Lines Matching refs:M
13 Mat M; member
117 PetscCall(MatDestroy(&pch2opus->M)); in PCDestroy_H2OPUS()
158 Mat M; member
178 PetscInt M, m; in PCH2OpusSetUpInit() local
185 aat.M = pch2opus->M; /* unused so far */ in PCH2OpusSetUpInit()
187 PetscCall(MatGetSize(A, &M, NULL)); in PCH2OpusSetUpInit()
189 PetscCall(MatCreateShell(PetscObjectComm((PetscObject)A), m, m, M, M, &aat, &AAt)); in PCH2OpusSetUpInit()
208 if (t) PetscCall(MatMultTranspose(pch2opus->M, x, y)); in PCApplyKernel_H2OPUS()
209 else PetscCall(MatMult(pch2opus->M, x, y)); in PCApplyKernel_H2OPUS()
218 if (t) PetscCall(MatTransposeMatMult(pch2opus->M, X, MAT_REUSE_MATRIX, PETSC_DETERMINE, &Y)); in PCApplyMatKernel_H2OPUS()
219 else PetscCall(MatMatMult(pch2opus->M, X, MAT_REUSE_MATRIX, PETSC_CURRENT, &Y)); in PCApplyMatKernel_H2OPUS()
252 static PetscErrorCode MatMultKernel_MAmI(Mat M, Vec x, Vec y, PetscBool t) in MatMultKernel_MAmI() argument
260 PetscCall(MatShellGetContext(M, &pc)); in MatMultKernel_MAmI()
262 if (!pch2opus->w) PetscCall(MatCreateVecs(pch2opus->M, &pch2opus->w, NULL)); in MatMultKernel_MAmI()
307 static PetscErrorCode MatMultKernel_Hyper(Mat M, Vec x, Vec y, PetscBool t) in MatMultKernel_Hyper() argument
314 PetscCall(MatShellGetContext(M, &pc)); in MatMultKernel_Hyper()
317 …PetscCall(MatCreateVecs(pch2opus->M, pch2opus->wns[0] ? NULL : &pch2opus->wns[0], pch2opus->wns[1]… in MatMultKernel_Hyper()
318 …PetscCall(MatCreateVecs(pch2opus->M, pch2opus->wns[2] ? NULL : &pch2opus->wns[2], pch2opus->wns[3]… in MatMultKernel_Hyper()
345 static PetscErrorCode MatMult_Hyper(Mat M, Vec x, Vec y) in MatMult_Hyper() argument
348 PetscCall(MatMultKernel_Hyper(M, x, y, PETSC_FALSE)); in MatMult_Hyper()
352 static PetscErrorCode MatMultTranspose_Hyper(Mat M, Vec x, Vec y) in MatMultTranspose_Hyper() argument
355 PetscCall(MatMultKernel_Hyper(M, x, y, PETSC_TRUE)); in MatMultTranspose_Hyper()
360 static PetscErrorCode MatMatMultKernel_Hyper(Mat M, Mat X, Mat Y, PetscBool t) in MatMatMultKernel_Hyper() argument
368 PetscCall(MatShellGetContext(M, &pc)); in MatMatMultKernel_Hyper()
409 static PetscErrorCode MatMatMultNumeric_Hyper(Mat M, Mat X, Mat Y, PetscCtx ctx) in MatMatMultNumeric_Hyper() argument
412 PetscCall(MatMatMultKernel_Hyper(M, X, Y, PETSC_FALSE)); in MatMatMultNumeric_Hyper()
417 static PetscErrorCode MatMultKernel_NS(Mat M, Vec x, Vec y, PetscBool t) in MatMultKernel_NS() argument
424 PetscCall(MatShellGetContext(M, &pc)); in MatMultKernel_NS()
427 …PetscCall(MatCreateVecs(pch2opus->M, pch2opus->wns[0] ? NULL : &pch2opus->wns[0], pch2opus->wns[1]… in MatMultKernel_NS()
444 static PetscErrorCode MatMult_NS(Mat M, Vec x, Vec y) in MatMult_NS() argument
447 PetscCall(MatMultKernel_NS(M, x, y, PETSC_FALSE)); in MatMult_NS()
451 static PetscErrorCode MatMultTranspose_NS(Mat M, Vec x, Vec y) in MatMultTranspose_NS() argument
454 PetscCall(MatMultKernel_NS(M, x, y, PETSC_TRUE)); in MatMultTranspose_NS()
459 static PetscErrorCode MatMatMultKernel_NS(Mat M, Mat X, Mat Y, PetscBool t) in MatMatMultKernel_NS() argument
466 PetscCall(MatShellGetContext(M, &pc)); in MatMatMultKernel_NS()
493 static PetscErrorCode MatMatMultNumeric_NS(Mat M, Mat X, Mat Y, PetscCtx ctx) in MatMatMultNumeric_NS() argument
496 PetscCall(MatMatMultKernel_NS(M, X, Y, PETSC_FALSE)); in MatMatMultNumeric_NS()
507 PetscInt M, N, m, n; in PCH2OpusSetUpSampler_Private() local
509 PetscCall(MatGetSize(A, &M, &N)); in PCH2OpusSetUpSampler_Private()
511 PetscCall(MatCreateShell(PetscObjectComm((PetscObject)A), m, n, M, N, pc, &pch2opus->S)); in PCH2OpusSetUpSampler_Private()
545 PetscInt M, N, m, n; in PCSetUp_H2OPUS() local
549 PetscCall(MatGetSize(A, &M, &N)); in PCSetUp_H2OPUS()
551 PetscCall(MatCreateShell(PetscObjectComm((PetscObject)pc->pmat), m, n, M, N, pc, &pch2opus->T)); in PCSetUp_H2OPUS()
591 if (pch2opus->M) { /* see if we can reuse M as initial guess */ in PCSetUp_H2OPUS()
594 PetscCall(MatBindToCPU(pch2opus->M, pch2opus->boundtocpu)); in PCSetUp_H2OPUS()
596 if (reuse >= 1.0) PetscCall(MatDestroy(&pch2opus->M)); in PCSetUp_H2OPUS()
598 if (!pch2opus->M) { in PCSetUp_H2OPUS()
600 PetscCall(MatDuplicate(pch2opus->A, MAT_COPY_VALUES, &pch2opus->M)); in PCSetUp_H2OPUS()
602 PetscCall(MatSetOptionsPrefix(pch2opus->M, prefix)); in PCSetUp_H2OPUS()
603 PetscCall(MatAppendOptionsPrefix(pch2opus->M, "pc_h2opus_inv_")); in PCSetUp_H2OPUS()
604 PetscCall(MatSetFromOptions(pch2opus->M)); in PCSetUp_H2OPUS()
606 PetscCall(MatScale(pch2opus->M, pch2opus->s0)); in PCSetUp_H2OPUS()
610 PetscCall(MatH2OpusSetNativeMult(pch2opus->M, PETSC_TRUE)); in PCSetUp_H2OPUS()
620 Mat M; in PCSetUp_H2OPUS() local
623 PetscCall(MatDuplicate(pch2opus->M, MAT_SHARE_NONZERO_PATTERN, &M)); in PCSetUp_H2OPUS()
624 PetscCall(MatGetOptionsPrefix(pch2opus->M, &prefix)); in PCSetUp_H2OPUS()
625 PetscCall(MatSetOptionsPrefix(M, prefix)); in PCSetUp_H2OPUS()
626 PetscCall(MatH2OpusSetSamplingMat(M, pch2opus->S, PETSC_DECIDE, PETSC_DECIDE)); in PCSetUp_H2OPUS()
627 PetscCall(MatSetFromOptions(M)); in PCSetUp_H2OPUS()
628 PetscCall(MatH2OpusSetNativeMult(M, PETSC_TRUE)); in PCSetUp_H2OPUS()
629 PetscCall(MatAssemblyBegin(M, MAT_FINAL_ASSEMBLY)); in PCSetUp_H2OPUS()
630 PetscCall(MatAssemblyEnd(M, MAT_FINAL_ASSEMBLY)); in PCSetUp_H2OPUS()
631 PetscCall(MatDestroy(&pch2opus->M)); in PCSetUp_H2OPUS()
632 pch2opus->M = M; in PCSetUp_H2OPUS()
641 PetscCall(MatH2OpusSetNativeMult(pch2opus->M, PETSC_FALSE)); in PCSetUp_H2OPUS()
669 if (pch2opus->M) { in PCView_H2OPUS()
673 PetscCall(MatView(pch2opus->M, viewer)); in PCView_H2OPUS()