v0.15.0
Loading...
Searching...
No Matches
MoFEM::SchurDGESV Struct Reference

Static Public Member Functions

static auto invertMat (MatrixDouble &m, MatrixDouble &inv)
 

Detailed Description

Definition at line 1037 of file Schur.cpp.

Member Function Documentation

◆ invertMat()

static auto MoFEM::SchurDGESV::invertMat ( MatrixDouble & m,
MatrixDouble & inv )
inlinestatic

Definition at line 1039 of file Schur.cpp.

1039 {
1041
1042 const auto nb = m.size1();
1043#ifndef NDEBUG
1044 if (nb != m.size2()) {
1045 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1046 "It should be square matrix %ld != %ld", nb, m.size2());
1047 }
1048#endif
1049
1050 inv.resize(nb, nb, false);
1051 inv.swap(m);
1052
1053 VectorInt ipiv(nb);
1054 int info;
1055
1056 info = lapack_dgetrf(nb, nb, &*inv.data().begin(), nb, &*ipiv.begin());
1057 if (info)
1058 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1059 "lapack error info = %d", info);
1060 info = lapack_dgetri(nb, &*inv.data().begin(), nb, &*ipiv.begin(),
1061 &*m.data().begin(), m.data().size());
1062 if (info)
1063 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1064 "lapack error info = %d", info);
1065
1067 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
static __CLPK_integer lapack_dgetrf(__CLPK_integer m, __CLPK_integer n, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_integer *ipiv)
static __CLPK_integer lapack_dgetri(__CLPK_integer n, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_integer *ipiv, __CLPK_doublereal *work, __CLPK_integer lwork)
FTensor::Index< 'm', 3 > m

The documentation for this struct was generated from the following file: