MFEM
v3.2
Finite element discretization library
|
#include <densemat.hpp>
Public Member Functions | |
LUFactors () | |
LUFactors (double *data_, int *ipiv_) | |
void | Factor (int m) |
void | Mult (int m, int n, double *X) const |
void | LSolve (int m, int n, double *X) const |
void | USolve (int m, int n, double *X) const |
void | Solve (int m, int n, double *X) const |
void | GetInverseMatrix (int m, double *X) const |
Assuming L.U = P.A factored data of size (m x m), compute X <- A^{-1}. More... | |
void | BlockFactor (int m, int n, double *A12, double *A21, double *A22) const |
void | BlockForwSolve (int m, int n, int r, const double *L21, double *B1, double *B2) const |
void | BlockBackSolve (int m, int n, int r, const double *U12, const double *X2, double *Y1) const |
Static Public Member Functions | |
static void | SubMult (int m, int n, int r, const double *A21, const double *X1, double *X2) |
Public Attributes | |
double * | data |
int * | ipiv |
Static Public Attributes | |
static const int | ipiv_base = 1 |
Class that can compute LU factorization of external data and perform various operations with the factored data.
Definition at line 376 of file densemat.hpp.
|
inline |
With this constructor, the (public) data and ipiv members should be set explicitly before calling class methods.
Definition at line 389 of file densemat.hpp.
|
inline |
Definition at line 391 of file densemat.hpp.
void mfem::LUFactors::BlockBackSolve | ( | int | m, |
int | n, | ||
int | r, | ||
const double * | U12, | ||
const double * | X2, | ||
double * | Y1 | ||
) | const |
Given BlockFactor()'d data, perform the backward block solve in | U U12 | | X1 | = | Y1 | | 0 S22 | | X2 | | Y2 |. The input is the solution block X2 and the block Y1 resulting from BlockForwSolve(). The result block X1 overwrites input block Y1: Y1 <- X1 = U^{-1} (Y1 - U12 X2).
Definition at line 3857 of file densemat.cpp.
void mfem::LUFactors::BlockFactor | ( | int | m, |
int | n, | ||
double * | A12, | ||
double * | A21, | ||
double * | A22 | ||
) | const |
Assuming P.A = L.U factored data of size (m x m), compute the 2x2 block decomposition: | P 0 | | A A12 | = | L 0 | | U U12 | | 0 I | | A21 A22 | | L21 I | | 0 S22 | where A12, A21, and A22 are matrices of size (m x n), (n x m), and (n x n), respectively. The blocks are overwritten as follows: A12 <- U12 = L^{-1} P A12 A21 <- L21 = A21 U^{-1} A22 <- S22 = A22 - L21 U12. The block S22 is the Schur complement.
Definition at line 3821 of file densemat.cpp.
void mfem::LUFactors::BlockForwSolve | ( | int | m, |
int | n, | ||
int | r, | ||
const double * | L21, | ||
double * | B1, | ||
double * | B2 | ||
) | const |
Given BlockFactor()'d data, perform the forward block solve for the linear system: | A A12 | | X1 | = | B1 | | A21 A22 | | X2 | | B2 | written in the factored form: | L 0 | | U U12 | | X1 | = | P 0 | | B1 | | L21 I | | 0 S22 | | X2 | | 0 I | | B2 |. The resulting blocks Y1, Y2 solve the system: | L 0 | | Y1 | = | P 0 | | B1 | | L21 I | | Y2 | | 0 I | | B2 | The blocks are overwritten as follows: B1 <- Y1 = L^{-1} P B1 B2 <- Y2 = B2 - L21 Y1 = B2 - A21 A^{-1} B1 The blocks B1/Y1 and B2/Y2 are of size (m x r) and (n x r), respectively. The Schur complement system is given by: S22 X2 = Y2.
Definition at line 3848 of file densemat.cpp.
void mfem::LUFactors::Factor | ( | int | m | ) |
Factorize the current data of size (m x m) overwriting it with the LU factors. The factorization is such that L.U = P.A, where A is the original matrix and P is a permutation matrix represented by ipiv.
Definition at line 3593 of file densemat.cpp.
void mfem::LUFactors::GetInverseMatrix | ( | int | m, |
double * | X | ||
) | const |
Assuming L.U = P.A factored data of size (m x m), compute X <- A^{-1}.
Definition at line 3739 of file densemat.cpp.
void mfem::LUFactors::LSolve | ( | int | m, |
int | n, | ||
double * | X | ||
) | const |
Assuming L.U = P.A factored data of size (m x m), compute X <- L^{-1} P X, for a matrix X of size (m x n).
Definition at line 3681 of file densemat.cpp.
void mfem::LUFactors::Mult | ( | int | m, |
int | n, | ||
double * | X | ||
) | const |
Assuming L.U = P.A factored data of size (m x m), compute X <- A X, for a matrix X of size (m x n).
Definition at line 3645 of file densemat.cpp.
void mfem::LUFactors::Solve | ( | int | m, |
int | n, | ||
double * | X | ||
) | const |
Assuming L.U = P.A factored data of size (m x m), compute X <- A^{-1} X, for a matrix X of size (m x n).
Definition at line 3725 of file densemat.cpp.
|
static |
Given an (n x m) matrix A21, compute X2 <- X2 - A21 X1, for matrices X1, and X2 of size (m x r) and (n x r), respectively.
Definition at line 3804 of file densemat.cpp.
void mfem::LUFactors::USolve | ( | int | m, |
int | n, | ||
double * | X | ||
) | const |
Assuming L.U = P.A factored data of size (m x m), compute X <- U^{-1} X, for a matrix X of size (m x n).
Definition at line 3706 of file densemat.cpp.
double* mfem::LUFactors::data |
Definition at line 379 of file densemat.hpp.
int* mfem::LUFactors::ipiv |
Definition at line 380 of file densemat.hpp.
|
static |
Definition at line 382 of file densemat.hpp.