v0.16.3
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
MoFEM::SchurDGESV Struct Reference

Static Public Member Functions

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

Detailed Description

Definition at line 1266 of file Schur.cpp.

Member Function Documentation

◆ invertMat()

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

Definition at line 1268 of file Schur.cpp.

1268 {
1270
1271 const auto nb = m.size1();
1272#ifndef NDEBUG
1273 if (nb != m.size2()) {
1274 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1275 "It should be square matrix %zu != %zu", nb, m.size2());
1276 }
1277#endif
1278
1279 inv.resize(nb, nb, false);
1280 inv.swap(m);
1281
1282 VectorInt ipiv(nb);
1283 int info;
1284
1285 info = lapack_dgetrf(nb, nb, &*inv.data().begin(), nb, &*ipiv.begin());
1286 if (info)
1287 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1288 "lapack error info = %d", info);
1289 info = lapack_dgetri(nb, &*inv.data().begin(), nb, &*ipiv.begin(),
1290 &*m.data().begin(), m.data().size());
1291 if (info)
1292 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1293 "lapack error info = %d", info);
1294
1296 }
#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)
UBlasVector< int > VectorInt
Definition Types.hpp:67
FTensor::Index< 'm', 3 > m

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