xref: /petsc/src/tao/matrix/submatfree.h (revision 9dd11ecf0918283bb567d8b33a92f53ac4ea7840)
1 #pragma once
2 
3 #include <petscmat.h>
4 
5 typedef struct {
6   Mat A;
7   Vec VC; /* Work vector in the column space */
8   Vec VR; /* Work vector in the row space */
9   IS  Rows, Cols;
10 
11 } _p_MatSubMatFreeCtx;
12 
13 typedef _p_MatSubMatFreeCtx *MatSubMatFreeCtx;
14 
15 PetscErrorCode MatCreateSubMatrixFree(Mat, IS, IS, Mat *);
16 PetscErrorCode MatSMFResetRowColumn(Mat, IS, IS);
17 PetscErrorCode MatMult_SMF(Mat, Vec, Vec);
18 PetscErrorCode MatMultTranspose_SMF(Mat, Vec, Vec);
19 PetscErrorCode MatDiagonalSet_SMF(Mat, Vec, InsertMode);
20 PetscErrorCode MatDestroy_SMF(Mat);
21 PetscErrorCode MatView_SMF(Mat, PetscViewer);
22 PetscErrorCode MatShift_SMF(Mat, PetscReal);
23 PetscErrorCode MatDuplicate_SMF(Mat, MatDuplicateOption, Mat *);
24 PetscErrorCode MatEqual_SMF(Mat, Mat, PetscBool *);
25 PetscErrorCode MatScale_SMF(Mat, PetscReal);
26 PetscErrorCode MatCreateSubMatrix_SMF(Mat, IS, IS, MatReuse, Mat *);
27 PetscErrorCode MatCreateSubMatrices_SMF(Mat, PetscInt, IS *, IS *, MatReuse, Mat **);
28 PetscErrorCode MatTranspose_SMF(Mat, Mat *);
29 PetscErrorCode MatGetDiagonal_SMF(Mat, Vec);
30 PetscErrorCode MatGetColumnVector_SMF(Mat, Vec, PetscInt);
31 PetscErrorCode MatNorm_SMF(Mat, NormType, PetscReal *);
32 PetscErrorCode MatGetRowMax_SMF(Mat, Vec);
33 PetscErrorCode MatGetRow_SMF(Mat, PetscInt, PetscInt *, const PetscInt **, const PetscScalar **);
34 PetscErrorCode MatRestoreRow_SMF(Mat, PetscInt, PetscInt *, const PetscInt **, const PetscScalar **);
35