Lines Matching refs:ctx

31   MatSubMatFreeCtx ctx;  in MatCreateSubMatrixFree()  local
35 PetscCall(PetscNew(&ctx)); in MatCreateSubMatrixFree()
36 ctx->A = mat; in MatCreateSubMatrixFree()
39 PetscCall(MatCreateVecs(mat, NULL, &ctx->VC)); in MatCreateSubMatrixFree()
40 ctx->VR = ctx->VC; in MatCreateSubMatrixFree()
43 ctx->Rows = Rows; in MatCreateSubMatrixFree()
44 ctx->Cols = Cols; in MatCreateSubMatrixFree()
47 PetscCall(MatCreateShell(comm, mloc, nloc, m, n, ctx, J)); in MatCreateSubMatrixFree()
69 MatSubMatFreeCtx ctx; in MatSMFResetRowColumn() local
72 PetscCall(MatShellGetContext(mat, &ctx)); in MatSMFResetRowColumn()
73 PetscCall(ISDestroy(&ctx->Rows)); in MatSMFResetRowColumn()
74 PetscCall(ISDestroy(&ctx->Cols)); in MatSMFResetRowColumn()
77 ctx->Cols = Cols; in MatSMFResetRowColumn()
78 ctx->Rows = Rows; in MatSMFResetRowColumn()
84 MatSubMatFreeCtx ctx; in MatMult_SMF() local
87 PetscCall(MatShellGetContext(mat, &ctx)); in MatMult_SMF()
88 PetscCall(VecCopy(a, ctx->VR)); in MatMult_SMF()
89 PetscCall(VecISSet(ctx->VR, ctx->Cols, 0.0)); in MatMult_SMF()
90 PetscCall(MatMult(ctx->A, ctx->VR, y)); in MatMult_SMF()
91 PetscCall(VecISSet(y, ctx->Rows, 0.0)); in MatMult_SMF()
97 MatSubMatFreeCtx ctx; in MatMultTranspose_SMF() local
100 PetscCall(MatShellGetContext(mat, &ctx)); in MatMultTranspose_SMF()
101 PetscCall(VecCopy(a, ctx->VC)); in MatMultTranspose_SMF()
102 PetscCall(VecISSet(ctx->VC, ctx->Rows, 0.0)); in MatMultTranspose_SMF()
103 PetscCall(MatMultTranspose(ctx->A, ctx->VC, y)); in MatMultTranspose_SMF()
104 PetscCall(VecISSet(y, ctx->Cols, 0.0)); in MatMultTranspose_SMF()
110 MatSubMatFreeCtx ctx; in MatDiagonalSet_SMF() local
113 PetscCall(MatShellGetContext(M, &ctx)); in MatDiagonalSet_SMF()
114 PetscCall(MatDiagonalSet(ctx->A, D, is)); in MatDiagonalSet_SMF()
120 MatSubMatFreeCtx ctx; in MatDestroy_SMF() local
123 PetscCall(MatShellGetContext(mat, &ctx)); in MatDestroy_SMF()
124 PetscCall(MatDestroy(&ctx->A)); in MatDestroy_SMF()
125 PetscCall(ISDestroy(&ctx->Rows)); in MatDestroy_SMF()
126 PetscCall(ISDestroy(&ctx->Cols)); in MatDestroy_SMF()
127 PetscCall(VecDestroy(&ctx->VC)); in MatDestroy_SMF()
128 PetscCall(PetscFree(ctx)); in MatDestroy_SMF()
134 MatSubMatFreeCtx ctx; in MatView_SMF() local
137 PetscCall(MatShellGetContext(mat, &ctx)); in MatView_SMF()
138 PetscCall(MatView(ctx->A, viewer)); in MatView_SMF()
144 MatSubMatFreeCtx ctx; in MatShift_SMF() local
147 PetscCall(MatShellGetContext(Y, &ctx)); in MatShift_SMF()
148 PetscCall(MatShift(ctx->A, a)); in MatShift_SMF()
154 MatSubMatFreeCtx ctx; in MatDuplicate_SMF() local
157 PetscCall(MatShellGetContext(mat, &ctx)); in MatDuplicate_SMF()
158 PetscCall(MatCreateSubMatrixFree(ctx->A, ctx->Rows, ctx->Cols, M)); in MatDuplicate_SMF()
187 MatSubMatFreeCtx ctx; in MatScale_SMF() local
190 PetscCall(MatShellGetContext(mat, &ctx)); in MatScale_SMF()
191 PetscCall(MatScale(ctx->A, a)); in MatScale_SMF()
204 MatSubMatFreeCtx ctx; in MatGetDiagonal_SMF() local
207 PetscCall(MatShellGetContext(mat, &ctx)); in MatGetDiagonal_SMF()
208 PetscCall(MatGetDiagonal(ctx->A, v)); in MatGetDiagonal_SMF()
214 MatSubMatFreeCtx ctx; in MatGetRowMax_SMF() local
217 PetscCall(MatShellGetContext(M, &ctx)); in MatGetRowMax_SMF()
218 PetscCall(MatGetRowMax(ctx->A, D, NULL)); in MatGetRowMax_SMF()
235 MatSubMatFreeCtx ctx; in MatCreateSubMatrix_SMF() local
238 PetscCall(MatShellGetContext(mat, &ctx)); in MatCreateSubMatrix_SMF()
240 PetscCall(MatCreateSubMatrixFree(ctx->A, isrow, iscol, newmat)); in MatCreateSubMatrix_SMF()
246 MatSubMatFreeCtx ctx; in MatGetRow_SMF() local
249 PetscCall(MatShellGetContext(mat, &ctx)); in MatGetRow_SMF()
250 PetscCall(MatGetRow(ctx->A, row, ncols, cols, vals)); in MatGetRow_SMF()
256 MatSubMatFreeCtx ctx; in MatRestoreRow_SMF() local
259 PetscCall(MatShellGetContext(mat, &ctx)); in MatRestoreRow_SMF()
260 PetscCall(MatRestoreRow(ctx->A, row, ncols, cols, vals)); in MatRestoreRow_SMF()
266 MatSubMatFreeCtx ctx; in MatGetColumnVector_SMF() local
269 PetscCall(MatShellGetContext(mat, &ctx)); in MatGetColumnVector_SMF()
270 PetscCall(MatGetColumnVector(ctx->A, Y, col)); in MatGetColumnVector_SMF()
276 MatSubMatFreeCtx ctx; in MatNorm_SMF() local
279 PetscCall(MatShellGetContext(mat, &ctx)); in MatNorm_SMF()