Jed Brown avatar Jed Brown committed 713ccfa

Make MatInvertBlockDiagonal return const because the user is not intended to modify this copy

Hg-commit: a86c8fe2e1845e1ac77307240b83c5ed8b8aca08

Comments (0)

Files changed (9)


   PetscErrorCode (*findnonzerorows)(Mat,IS*);
   PetscErrorCode (*getcolumnnorms)(Mat,NormType,PetscReal*);
-  PetscErrorCode (*invertblockdiagonal)(Mat,PetscScalar**);
+  PetscErrorCode (*invertblockdiagonal)(Mat,const PetscScalar**);
   PetscErrorCode (*dummy4)(Mat,Vec,Vec,Vec);
   PetscErrorCode (*getsubmatricesparallel)(Mat,PetscInt,const IS[], const IS[], MatReuse, Mat**);


 PETSC_EXTERN PetscErrorCode MatImaginaryPart(Mat);
 PETSC_EXTERN PetscErrorCode MatGetDiagonalBlock(Mat,Mat*);
 PETSC_EXTERN PetscErrorCode MatGetTrace(Mat,PetscScalar*);
-PETSC_EXTERN PetscErrorCode MatInvertBlockDiagonal(Mat,PetscScalar **);
+PETSC_EXTERN PetscErrorCode MatInvertBlockDiagonal(Mat,const PetscScalar **);
 /* ------------------------------------------------------------*/
 PETSC_EXTERN PetscErrorCode MatSetValues(Mat,PetscInt,const PetscInt[],PetscInt,const PetscInt[],const PetscScalar[],InsertMode);


         <li>Renamed MatMerge_SeqsToMPI() to MatCreateMPIAIJSumSeqAIJ()</li>
         <li>Renamed MatMerge() to MatCreateMPIAIJConcatenateSeqAIJ()</li>
         <li>Added block size in call to MatCreateIS()</li>
+        <li>MatInvertBlockDiagonal() now returns a const pointer</li>


    Private context (data structure) for the PBJacobi preconditioner.  
 typedef struct {
-  MatScalar   *diag;
+  const MatScalar *diag;
   PetscInt    bs,mbs;
 } PC_PBJacobi;


 #undef __FUNCT__  
 #define __FUNCT__ "MatInvertBlockDiagonal_MPIAIJ"
-PetscErrorCode  MatInvertBlockDiagonal_MPIAIJ(Mat A,PetscScalar **values)
+PetscErrorCode  MatInvertBlockDiagonal_MPIAIJ(Mat A,const PetscScalar **values)
   Mat_MPIAIJ    *a = (Mat_MPIAIJ*) A->data;
   PetscErrorCode ierr;


 #undef __FUNCT__  
 #define __FUNCT__ "MatInvertBlockDiagonal_SeqAIJ"
-PetscErrorCode  MatInvertBlockDiagonal_SeqAIJ(Mat A,PetscScalar **values)
+PetscErrorCode  MatInvertBlockDiagonal_SeqAIJ(Mat A,const PetscScalar **values)
   Mat_SeqAIJ    *a = (Mat_SeqAIJ*) A->data;
   PetscErrorCode ierr;


 #undef __FUNCT__  
 #define __FUNCT__ "MatInvertBlockDiagonal_MPIBAIJ"
-PetscErrorCode  MatInvertBlockDiagonal_MPIBAIJ(Mat A,PetscScalar **values)
+PetscErrorCode  MatInvertBlockDiagonal_MPIBAIJ(Mat A,const PetscScalar **values)
   Mat_MPIBAIJ    *a = (Mat_MPIBAIJ*) A->data;
   PetscErrorCode ierr;


 #undef __FUNCT__  
 #define __FUNCT__ "MatInvertBlockDiagonal_SeqBAIJ"
-PetscErrorCode  MatInvertBlockDiagonal_SeqBAIJ(Mat A,PetscScalar **values)
+PetscErrorCode  MatInvertBlockDiagonal_SeqBAIJ(Mat A,const PetscScalar **values)
   Mat_SeqBAIJ    *a = (Mat_SeqBAIJ*) A->data;
   PetscErrorCode ierr;


 #undef __FUNCT__
 #define __FUNCT__ "MatInvertBlockDiagonal"
   MatInvertBlockDiagonal - Inverts the block diagonal entries.
   Collective on Mat
   Output Parameters:
 . values - the block inverses in column major order (FORTRAN-like)
+   Note:
+   This routine is not available from Fortran.
   Level: advanced
-PetscErrorCode  MatInvertBlockDiagonal(Mat mat,PetscScalar **values)
+PetscErrorCode MatInvertBlockDiagonal(Mat mat,const PetscScalar **values)
   PetscErrorCode ierr;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.