Lines Matching refs:B
30 PetscErrorCode MatLMVMUpdate(Mat B, Vec X, Vec F) in MatLMVMUpdate() argument
36 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMUpdate()
39 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMUpdate()
49 PetscCall(MatLMVMUseVecLayoutsIfCompatible(B, X, F)); in MatLMVMUpdate()
50 MatCheckPreallocated(B, 1); in MatLMVMUpdate()
52 lmvm = (Mat_LMVM *)B->data; in MatLMVMUpdate()
54 PetscCall((*lmvm->ops->update)(B, X, F)); in MatLMVMUpdate()
59 static PetscErrorCode MatLMVMCreateJ0(Mat B, Mat *J0) in MatLMVMCreateJ0() argument
66 PetscCall(MatCreate(PetscObjectComm((PetscObject)B), J0)); in MatLMVMCreateJ0()
67 PetscCall(MatGetLayouts(B, &rmap, &cmap)); in MatLMVMCreateJ0()
69 PetscCall(MatGetVecType(B, &vec_type)); in MatLMVMCreateJ0()
71 PetscCall(MatGetOptionsPrefix(B, &prefix)); in MatLMVMCreateJ0()
77 static PetscErrorCode MatLMVMCreateJ0KSP(Mat B, KSP *ksp) in MatLMVMCreateJ0KSP() argument
79 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMCreateJ0KSP()
83 PetscCall(KSPCreate(PetscObjectComm((PetscObject)B), ksp)); in MatLMVMCreateJ0KSP()
85 PetscCall(PetscObjectIncrementTabLevel((PetscObject)B, (PetscObject)*ksp, 1)); in MatLMVMCreateJ0KSP()
86 PetscCall(MatGetOptionsPrefix(B, &prefix)); in MatLMVMCreateJ0KSP()
92 static PetscErrorCode MatLMVMCreateJ0KSP_ExactInverse(Mat B, KSP *ksp) in MatLMVMCreateJ0KSP_ExactInverse() argument
94 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMCreateJ0KSP_ExactInverse()
98 PetscCall(MatLMVMCreateJ0KSP(B, ksp)); in MatLMVMCreateJ0KSP_ExactInverse()
118 PetscErrorCode MatLMVMClearJ0(Mat B) in MatLMVMClearJ0() argument
124 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMClearJ0()
125 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMClearJ0()
127 lmvm = (Mat_LMVM *)B->data; in MatLMVMClearJ0()
130 PetscCall(MatLMVMCreateJ0(B, &lmvm->J0)); in MatLMVMClearJ0()
134 PetscCall(MatLMVMCreateJ0KSP_ExactInverse(B, &lmvm->J0ksp)); in MatLMVMClearJ0()
152 PetscErrorCode MatLMVMSetJ0Scale(Mat B, PetscReal scale) in MatLMVMSetJ0Scale() argument
159 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMSetJ0Scale()
160 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMSetJ0Scale()
162 lmvm = (Mat_LMVM *)B->data; in MatLMVMSetJ0Scale()
164 if (!isconstant) PetscCall(MatLMVMClearJ0(B)); in MatLMVMSetJ0Scale()
224 static PetscErrorCode MatLMVMUseJ0LayoutsIfCompatible(Mat B, Mat J0) in MatLMVMUseJ0LayoutsIfCompatible() argument
227 PetscCall(MatLMVMCheckArgumentLayout(B->rmap, J0->rmap)); in MatLMVMUseJ0LayoutsIfCompatible()
228 PetscCall(MatLMVMCheckArgumentLayout(B->cmap, J0->cmap)); in MatLMVMUseJ0LayoutsIfCompatible()
231 PetscCall(PetscLayoutReference(J0->rmap, &B->rmap)); in MatLMVMUseJ0LayoutsIfCompatible()
232 PetscCall(PetscLayoutReference(J0->cmap, &B->cmap)); in MatLMVMUseJ0LayoutsIfCompatible()
236 static PetscErrorCode MatLMVMUseJ0DiagLayoutsIfCompatible(Mat B, Vec J0_diag) in MatLMVMUseJ0DiagLayoutsIfCompatible() argument
239 PetscCall(MatLMVMCheckArgumentLayout(B->rmap, J0_diag->map)); in MatLMVMUseJ0DiagLayoutsIfCompatible()
240 PetscCall(MatLMVMCheckArgumentLayout(B->cmap, J0_diag->map)); in MatLMVMUseJ0DiagLayoutsIfCompatible()
242 PetscCall(PetscLayoutReference(J0_diag->map, &B->rmap)); in MatLMVMUseJ0DiagLayoutsIfCompatible()
243 PetscCall(PetscLayoutReference(J0_diag->map, &B->cmap)); in MatLMVMUseJ0DiagLayoutsIfCompatible()
247 PETSC_INTERN PetscErrorCode MatLMVMUseVecLayoutsIfCompatible(Mat B, Vec X, Vec F) in MatLMVMUseVecLayoutsIfCompatible() argument
249 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMUseVecLayoutsIfCompatible()
252 PetscCall(MatLMVMCheckArgumentLayout(B->rmap, F->map)); in MatLMVMUseVecLayoutsIfCompatible()
253 PetscCall(MatLMVMCheckArgumentLayout(B->cmap, X->map)); in MatLMVMUseVecLayoutsIfCompatible()
256 PetscCall(PetscLayoutReference(F->map, &B->rmap)); in MatLMVMUseVecLayoutsIfCompatible()
257 PetscCall(PetscLayoutReference(X->map, &B->cmap)); in MatLMVMUseVecLayoutsIfCompatible()
259 PetscCall(PetscLayoutReference(B->rmap, &lmvm->J0->rmap)); in MatLMVMUseVecLayoutsIfCompatible()
260 PetscCall(PetscLayoutReference(B->cmap, &lmvm->J0->cmap)); in MatLMVMUseVecLayoutsIfCompatible()
281 PetscErrorCode MatLMVMSetJ0Diag(Mat B, Vec V) in MatLMVMSetJ0Diag() argument
288 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMSetJ0Diag()
290 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMSetJ0Diag()
292 PetscCheckSameComm(B, 1, V, 2); in MatLMVMSetJ0Diag()
293 PetscCall(MatLMVMUseJ0DiagLayoutsIfCompatible(B, V)); in MatLMVMSetJ0Diag()
294 PetscCall(MatCreate(PetscObjectComm((PetscObject)B), &J0diag)); in MatLMVMSetJ0Diag()
300 PetscCall(MatLMVMSetJ0(B, J0diag)); in MatLMVMSetJ0Diag()
305 PETSC_INTERN PetscErrorCode MatLMVMGetJ0InvDiag(Mat B, Vec *V) in MatLMVMGetJ0InvDiag() argument
307 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMGetJ0InvDiag()
313 PetscCall(MatLMVMClearJ0(B)); in MatLMVMGetJ0InvDiag()
322 PETSC_INTERN PetscErrorCode MatLMVMRestoreJ0InvDiag(Mat B, Vec *V) in MatLMVMRestoreJ0InvDiag() argument
324 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMRestoreJ0InvDiag()
331 PETSC_INTERN PetscErrorCode MatLMVMJ0KSPIsExact(Mat B, PetscBool *is_exact) in MatLMVMJ0KSPIsExact() argument
334 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMJ0KSPIsExact()
374 PetscErrorCode MatLMVMSetJ0(Mat B, Mat J0) in MatLMVMSetJ0() argument
381 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMSetJ0()
383 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMSetJ0()
385 lmvm = (Mat_LMVM *)B->data; in MatLMVMSetJ0()
387 PetscCheckSameComm(B, 1, J0, 2); in MatLMVMSetJ0()
388 PetscCall(MatLMVMUseJ0LayoutsIfCompatible(B, J0)); in MatLMVMSetJ0()
396 PetscCall(MatLMVMCreateJ0KSP_ExactInverse(B, &lmvm->J0ksp)); in MatLMVMSetJ0()
418 PetscCall(MatLMVMCreateJ0KSP(B, &lmvm->J0ksp)); in MatLMVMSetJ0()
444 PetscErrorCode MatLMVMSetJ0PC(Mat B, PC J0pc) in MatLMVMSetJ0PC() argument
452 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMSetJ0PC()
454 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMSetJ0PC()
456 lmvm = (Mat_LMVM *)B->data; in MatLMVMSetJ0PC()
458 …PetscCheck(mat_set || pmat_set, PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRONGSTATE, "PC has… in MatLMVMSetJ0PC()
463 PetscCall(MatLMVMSetJ0(B, J0)); in MatLMVMSetJ0PC()
487 PetscErrorCode MatLMVMSetJ0KSP(Mat B, KSP J0ksp) in MatLMVMSetJ0KSP() argument
494 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMSetJ0KSP()
496 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMSetJ0KSP()
498 lmvm = (Mat_LMVM *)B->data; in MatLMVMSetJ0KSP()
500 …PetscCheck(mat_set || pmat_set, PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRONGSTATE, "PC has… in MatLMVMSetJ0KSP()
504 PetscCall(MatLMVMSetJ0(B, J0)); in MatLMVMSetJ0KSP()
532 PetscErrorCode MatLMVMGetJ0(Mat B, Mat *J0) in MatLMVMGetJ0() argument
538 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMGetJ0()
539 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMGetJ0()
540 …PetscCheck(same, PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRONG, "Matrix must be an LMVM-typ… in MatLMVMGetJ0()
541 lmvm = (Mat_LMVM *)B->data; in MatLMVMGetJ0()
560 PetscErrorCode MatLMVMGetJ0PC(Mat B, PC *J0pc) in MatLMVMGetJ0PC() argument
566 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMGetJ0PC()
567 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMGetJ0PC()
568 …PetscCheck(same, PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRONG, "Matrix must be an LMVM-typ… in MatLMVMGetJ0PC()
569 lmvm = (Mat_LMVM *)B->data; in MatLMVMGetJ0PC()
588 PetscErrorCode MatLMVMGetJ0KSP(Mat B, KSP *J0ksp) in MatLMVMGetJ0KSP() argument
594 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMGetJ0KSP()
595 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMGetJ0KSP()
596 …PetscCheck(same, PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRONG, "Matrix must be an LMVM-typ… in MatLMVMGetJ0KSP()
597 lmvm = (Mat_LMVM *)B->data; in MatLMVMGetJ0KSP()
618 PetscErrorCode MatLMVMApplyJ0Fwd(Mat B, Vec X, Vec Y) in MatLMVMApplyJ0Fwd() argument
620 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMApplyJ0Fwd()
627 PETSC_INTERN PetscErrorCode MatLMVMApplyJ0HermitianTranspose(Mat B, Vec X, Vec Y) in MatLMVMApplyJ0HermitianTranspose() argument
629 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMApplyJ0HermitianTranspose()
659 PetscErrorCode MatLMVMApplyJ0Inv(Mat B, Vec X, Vec Y) in MatLMVMApplyJ0Inv() argument
661 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMApplyJ0Inv()
670 PETSC_INTERN PetscErrorCode MatLMVMApplyJ0InvTranspose(Mat B, Vec X, Vec Y) in MatLMVMApplyJ0InvTranspose() argument
672 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMApplyJ0InvTranspose()
681 PETSC_INTERN PetscErrorCode MatLMVMApplyJ0InvHermitianTranspose(Mat B, Vec X, Vec Y) in MatLMVMApplyJ0InvHermitianTranspose() argument
685 PetscCall(MatLMVMApplyJ0InvTranspose(B, X, Y)); in MatLMVMApplyJ0InvHermitianTranspose()
692 PetscCall(MatLMVMApplyJ0InvTranspose(B, X_conj, Y)); in MatLMVMApplyJ0InvHermitianTranspose()
713 PetscErrorCode MatLMVMIsAllocated(Mat B, PetscBool *flg) in MatLMVMIsAllocated() argument
718 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMIsAllocated()
719 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMIsAllocated()
720 …PetscCheck(same, PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRONG, "Matrix must be an LMVM-typ… in MatLMVMIsAllocated()
721 *flg = B->preallocated; in MatLMVMIsAllocated()
744 PetscErrorCode MatLMVMAllocate(Mat B, Vec X, Vec F) in MatLMVMAllocate() argument
750 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMAllocate()
753 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMAllocate()
755 lmvm = (Mat_LMVM *)B->data; in MatLMVMAllocate()
756 PetscCall(MatAllocate_LMVM(B, X, F)); in MatLMVMAllocate()
771 PetscErrorCode MatLMVMResetShift(Mat B) in MatLMVMResetShift() argument
777 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMResetShift()
778 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMResetShift()
780 lmvm = (Mat_LMVM *)B->data; in MatLMVMResetShift()
785 PETSC_INTERN PetscErrorCode MatLMVMReset_Internal(Mat B, MatLMVMResetMode mode) in MatLMVMReset_Internal() argument
791 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMReset_Internal()
792 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMReset_Internal()
794 lmvm = (Mat_LMVM *)B->data; in MatLMVMReset_Internal()
796 if (lmvm->ops->reset) PetscCall((*lmvm->ops->reset)(B, mode)); in MatLMVMReset_Internal()
797 PetscCall(MatReset_LMVM(B, mode)); in MatLMVMReset_Internal()
823 PetscErrorCode MatLMVMReset(Mat B, PetscBool destructive) in MatLMVMReset() argument
829 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMReset()
830 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMReset()
832 lmvm = (Mat_LMVM *)B->data; in MatLMVMReset()
833 …PetscCall(PetscInfo(B, "Resetting %s after %" PetscInt_FMT " iterations\n", ((PetscObject)B)->type… in MatLMVMReset()
834 PetscCall(MatLMVMReset_Internal(B, destructive ? MAT_LMVM_RESET_ALL : MAT_LMVM_RESET_HISTORY)); in MatLMVMReset()
854 PetscErrorCode MatLMVMSetHistorySize(Mat B, PetscInt hist_size) in MatLMVMSetHistorySize() argument
856 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMSetHistorySize()
860 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMSetHistorySize()
861 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMSetHistorySize()
863 …PetscCheck(hist_size >= 0, PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRONG, "QN history size … in MatLMVMSetHistorySize()
864 if (lmvm->m != hist_size) PetscCall(MatLMVMReset_Internal(B, MAT_LMVM_RESET_BASES)); in MatLMVMSetHistorySize()
869 PetscErrorCode MatLMVMGetHistorySize(Mat B, PetscInt *hist_size) in MatLMVMGetHistorySize() argument
871 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMGetHistorySize()
875 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMGetHistorySize()
876 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMGetHistorySize()
900 PetscErrorCode MatLMVMGetUpdateCount(Mat B, PetscInt *nupdates) in MatLMVMGetUpdateCount() argument
906 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMGetUpdateCount()
907 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMGetUpdateCount()
908 …PetscCheck(same, PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRONG, "Matrix must be an LMVM-typ… in MatLMVMGetUpdateCount()
909 lmvm = (Mat_LMVM *)B->data; in MatLMVMGetUpdateCount()
928 PetscErrorCode MatLMVMGetRejectCount(Mat B, PetscInt *nrejects) in MatLMVMGetRejectCount() argument
934 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMGetRejectCount()
935 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMGetRejectCount()
936 …PetscCheck(same, PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRONG, "Matrix must be an LMVM-typ… in MatLMVMGetRejectCount()
937 lmvm = (Mat_LMVM *)B->data; in MatLMVMGetRejectCount()
942 PETSC_INTERN PetscErrorCode MatLMVMGetJ0Scalar(Mat B, PetscBool *is_scalar, PetscScalar *scale) in MatLMVMGetJ0Scalar() argument
944 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMGetJ0Scalar()
952 static PetscErrorCode MatLMVMUpdateOpVecs(Mat B, LMBasis X, LMBasis OpX, PetscErrorCode (*op)(Mat, … in MatLMVMUpdateOpVecs() argument
954 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMUpdateOpVecs()
976 PetscCall(op(B, x_i, op_x_i)); in MatLMVMUpdateOpVecs()
980 …d == J0_id && OpX->operator_state == J0_state, PetscObjectComm((PetscObject)B), PETSC_ERR_PLIB, "I… in MatLMVMUpdateOpVecs()
984 static PetscErrorCode MatLMVMUpdateOpDiffVecs(Mat B, LMBasis Y, PetscScalar alpha, LMBasis OpX, LMB… in MatLMVMUpdateOpDiffVecs() argument
986 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMUpdateOpDiffVecs()
995 …PetscAssert(Y->m == OpX->m, PetscObjectComm((PetscObject)B), PETSC_ERR_PLIB, "Incompatible Y and O… in MatLMVMUpdateOpDiffVecs()
996 …PetscAssert(Y->k == OpX->k, PetscObjectComm((PetscObject)B), PETSC_ERR_PLIB, "Stale OpX in MatLMVM… in MatLMVMUpdateOpDiffVecs()
1024 …_id && YmalphaOpX->operator_state == J0_state, PetscObjectComm((PetscObject)B), PETSC_ERR_PLIB, "I… in MatLMVMUpdateOpDiffVecs()
1028 PETSC_INTERN PetscErrorCode MatLMVMGetUpdatedBasis(Mat B, MatLMVMBasisType type, LMBasis *basis_p, … in MatLMVMGetUpdatedBasis() argument
1030 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMGetUpdatedBasis()
1048 PetscCall(MatLMVMGetJ0Scalar(B, &is_scalar, &scale_)); in MatLMVMGetUpdatedBasis()
1060 …PetscCall(MatLMVMUpdateOpVecs(B, orig_basis, basis, (type == LMBASIS_B0S) ? MatLMVMApplyJ0Fwd : Ma… in MatLMVMGetUpdatedBasis()
1073 PetscCall(MatLMVMGetUpdatedBasis(B, op_basis_t, &op_basis, &op_basis_t, &scale_)); in MatLMVMGetUpdatedBasis()
1074 …PetscCall(MatLMVMUpdateOpDiffVecs(B, lmvm->basis[MatLMVMBasisSizeOf(type)], scale_, op_basis, basi… in MatLMVMGetUpdatedBasis()
1084 PETSC_INTERN PetscErrorCode MatLMVMBasisGetVecRead(Mat B, MatLMVMBasisType type, PetscInt i, Vec *y… in MatLMVMBasisGetVecRead() argument
1086 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMBasisGetVecRead()
1095 PetscCall(MatLMVMGetJ0Scalar(B, &is_scalar, &scale_)); in MatLMVMBasisGetVecRead()
1108 PetscCall(MatLMVMApplyJ0Fwd(B, w, tmp)); in MatLMVMBasisGetVecRead()
1110 PetscCall(MatLMVMApplyJ0Inv(B, w, tmp)); in MatLMVMBasisGetVecRead()
1119 PetscCall(MatLMVMGetUpdatedBasis(B, type, &basis, &type, &dummy)); in MatLMVMBasisGetVecRead()
1125 …SETERRQ(PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRONG, "MatLMVMBasisGetVecRead() is only fo… in MatLMVMBasisGetVecRead()
1130 PETSC_INTERN PetscErrorCode MatLMVMBasisRestoreVecRead(Mat B, MatLMVMBasisType type, PetscInt i, Ve… in MatLMVMBasisRestoreVecRead() argument
1132 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMBasisRestoreVecRead()
1141 PetscCall(MatLMVMGetJ0Scalar(B, &is_scalar, &scale_)); in MatLMVMBasisRestoreVecRead()
1153 …SETERRQ(PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRONG, "MatLMVMBasisRestoreVecRead() is onl… in MatLMVMBasisRestoreVecRead()
1158 PETSC_INTERN PetscErrorCode MatLMVMGetRange(Mat B, PetscInt *oldest, PetscInt *next) in MatLMVMGetRange() argument
1160 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMGetRange()
1167 PETSC_INTERN PetscErrorCode MatLMVMGetWorkRow(Mat B, Vec *array_p) in MatLMVMGetWorkRow() argument
1172 PetscCall(MatLMVMGetUpdatedBasis(B, LMBASIS_Y, &basis, NULL, NULL)); in MatLMVMGetWorkRow()
1177 PETSC_INTERN PetscErrorCode MatLMVMRestoreWorkRow(Mat B, Vec *array_p) in MatLMVMRestoreWorkRow() argument
1182 PetscCall(MatLMVMGetUpdatedBasis(B, LMBASIS_Y, &basis, NULL, NULL)); in MatLMVMRestoreWorkRow()
1187 static PetscErrorCode MatLMVMApplyOpThenVecs(PetscScalar alpha, Mat B, PetscInt oldest, PetscInt ne… in MatLMVMApplyOpThenVecs() argument
1193 PetscCall(MatLMVMGetUpdatedBasis(B, type_S, &S, NULL, NULL)); in MatLMVMApplyOpThenVecs()
1195 PetscCall(op(B, x, B0x)); in MatLMVMApplyOpThenVecs()
1201 static PetscErrorCode MatLMVMApplyVecsThenOp(PetscScalar alpha, Mat B, PetscInt oldest, PetscInt ne… in MatLMVMApplyVecsThenOp() argument
1208 PetscCall(MatLMVMGetUpdatedBasis(B, type_S, &S, NULL, NULL)); in MatLMVMApplyVecsThenOp()
1209 PetscCall(MatLMVMGetUpdatedBasis(B, type_Y, &Y, NULL, NULL)); in MatLMVMApplyVecsThenOp()
1213 PetscCall(op(B, S_x, B0S_x)); in MatLMVMApplyVecsThenOp()
1220 PETSC_INTERN PetscErrorCode MatLMVMBasisGEMVH(Mat B, MatLMVMBasisType type, PetscInt oldest, PetscI… in MatLMVMBasisGEMVH() argument
1222 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMBasisGEMVH()
1230 PetscCall(MatLMVMGetUpdatedBasis(B, type, &basis, &basis_t, &gamma)); in MatLMVMBasisGEMVH()
1235 …PetscCall(MatLMVMApplyOpThenVecs(alpha, B, oldest, next, LMBASIS_S, MatLMVMApplyJ0HermitianTranspo… in MatLMVMBasisGEMVH()
1238 …PetscCall(MatLMVMApplyOpThenVecs(alpha, B, oldest, next, LMBASIS_Y, MatLMVMApplyJ0InvHermitianTran… in MatLMVMBasisGEMVH()
1242 PetscCall(MatLMVMBasisGEMVH(B, LMBASIS_B0S, oldest, next, -alpha, v, 1.0, array)); in MatLMVMBasisGEMVH()
1246 PetscCall(MatLMVMBasisGEMVH(B, LMBASIS_H0Y, oldest, next, -alpha, v, 1.0, array)); in MatLMVMBasisGEMVH()
1256 PETSC_INTERN PetscErrorCode MatLMVMBasisGEMV(Mat B, MatLMVMBasisType type, PetscInt oldest, PetscIn… in MatLMVMBasisGEMV() argument
1258 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMBasisGEMV()
1267 PetscCall(MatLMVMGetUpdatedBasis(B, type, &basis, &base_type, &gamma)); in MatLMVMBasisGEMV()
1272 …PetscCall(MatLMVMApplyVecsThenOp(alpha, B, oldest, next, LMBASIS_S, LMBASIS_Y, MatLMVMApplyJ0Fwd, … in MatLMVMBasisGEMV()
1275 …PetscCall(MatLMVMApplyVecsThenOp(alpha, B, oldest, next, LMBASIS_Y, LMBASIS_S, MatLMVMApplyJ0Inv, … in MatLMVMBasisGEMV()
1279 PetscCall(MatLMVMBasisGEMV(B, LMBASIS_B0S, oldest, next, -alpha, x, 1.0, y)); in MatLMVMBasisGEMV()
1283 PetscCall(MatLMVMBasisGEMV(B, LMBASIS_H0Y, oldest, next, -alpha, x, 1.0, y)); in MatLMVMBasisGEMV()
1292 PETSC_INTERN PetscErrorCode MatLMVMCreateProducts(Mat B, LMBlockType block_type, LMProducts *produc… in MatLMVMCreateProducts() argument
1294 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMCreateProducts()
1302 static PetscErrorCode MatLMVMProductsUpdate(Mat B, MatLMVMBasisType type_X, MatLMVMBasisType type_Y… in MatLMVMProductsUpdate() argument
1304 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMProductsUpdate()
1312 PetscCall(MatLMVMGetUpdatedBasis(B, type_X, &X, &true_type_X, &alpha_X)); in MatLMVMProductsUpdate()
1313 PetscCall(MatLMVMGetUpdatedBasis(B, type_Y, &Y, &true_type_Y, &alpha_Y)); in MatLMVMProductsUpdate()
1314 …if (!lmvm->products[block_type][true_type_X][true_type_Y]) PetscCall(MatLMVMCreateProducts(B, bloc… in MatLMVMProductsUpdate()
1317 …if (!lmvm->products[block_type][type_X][type_Y]) PetscCall(MatLMVMCreateProducts(B, block_type, &l… in MatLMVMProductsUpdate()
1319 PetscCall(MatLMVMGetRange(B, &oldest, &next)); in MatLMVMProductsUpdate()
1328 PETSC_INTERN PetscErrorCode MatLMVMGetUpdatedProducts(Mat B, MatLMVMBasisType type_X, MatLMVMBasisT… in MatLMVMGetUpdatedProducts() argument
1330 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMGetUpdatedProducts()
1333 PetscCall(MatLMVMProductsUpdate(B, type_X, type_Y, block_type)); in MatLMVMGetUpdatedProducts()
1338 PETSC_INTERN PetscErrorCode MatLMVMProductsInsertDiagonalValue(Mat B, MatLMVMBasisType type_X, MatL… in MatLMVMProductsInsertDiagonalValue() argument
1340 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMProductsInsertDiagonalValue()
1344 …if (!lmvm->products[LMBLOCK_DIAGONAL][type_X][type_Y]) PetscCall(MatLMVMCreateProducts(B, LMBLOCK_… in MatLMVMProductsInsertDiagonalValue()
1350 PETSC_INTERN PetscErrorCode MatLMVMProductsGetDiagonalValue(Mat B, MatLMVMBasisType type_X, MatLMVM… in MatLMVMProductsGetDiagonalValue() argument
1355 PetscCall(MatLMVMGetUpdatedProducts(B, type_X, type_Y, LMBLOCK_DIAGONAL, &products)); in MatLMVMProductsGetDiagonalValue()