MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::LUFactors Class Reference

#include <densemat.hpp>

Inheritance diagram for mfem::LUFactors:
[legend]
Collaboration diagram for mfem::LUFactors:
[legend]

Public Member Functions

 LUFactors ()
 
 LUFactors (real_t *data_, int *ipiv_)
 
virtual bool Factor (int m, real_t TOL=0.0)
 Compute the LU factorization of the current matrix.
 
virtual real_t Det (int m) const
 
void Mult (int m, int n, real_t *X) const
 
void LSolve (int m, int n, real_t *X) const
 
void USolve (int m, int n, real_t *X) const
 
virtual void Solve (int m, int n, real_t *X) const
 
void RightSolve (int m, int n, real_t *X) const
 
virtual void GetInverseMatrix (int m, real_t *X) const
 Assuming L.U = P.A factored data of size (m x m), compute X <- A^{-1}.
 
void BlockFactor (int m, int n, real_t *A12, real_t *A21, real_t *A22) const
 
void BlockForwSolve (int m, int n, int r, const real_t *L21, real_t *B1, real_t *B2) const
 
void BlockBackSolve (int m, int n, int r, const real_t *U12, const real_t *X2, real_t *Y1) const
 
- Public Member Functions inherited from mfem::Factors
 Factors ()
 
 Factors (real_t *data_)
 
virtual ~Factors ()
 

Static Public Member Functions

static void SubMult (int m, int n, int r, const real_t *A21, const real_t *X1, real_t *X2)
 

Public Attributes

int * ipiv
 
- Public Attributes inherited from mfem::Factors
real_tdata
 

Static Public Attributes

static const int ipiv_base = 1
 

Detailed Description

Class that can compute LU factorization of external data and perform various operations with the factored data.

Definition at line 663 of file densemat.hpp.

Constructor & Destructor Documentation

◆ LUFactors() [1/2]

mfem::LUFactors::LUFactors ( )
inline

With this constructor, the (public) data and ipiv members should be set explicitly before calling class methods.

Definition at line 675 of file densemat.hpp.

◆ LUFactors() [2/2]

mfem::LUFactors::LUFactors ( real_t * data_,
int * ipiv_ )
inline

Definition at line 677 of file densemat.hpp.

Member Function Documentation

◆ BlockBackSolve()

void mfem::LUFactors::BlockBackSolve ( int m,
int n,
int r,
const real_t * U12,
const real_t * X2,
real_t * 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 3835 of file densemat.cpp.

◆ BlockFactor()

void mfem::LUFactors::BlockFactor ( int m,
int n,
real_t * A12,
real_t * A21,
real_t * 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 3800 of file densemat.cpp.

◆ BlockForwSolve()

void mfem::LUFactors::BlockForwSolve ( int m,
int n,
int r,
const real_t * L21,
real_t * B1,
real_t * 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 3826 of file densemat.cpp.

◆ Det()

real_t mfem::LUFactors::Det ( int m) const
virtual

Assuming L.U = P.A factored data of size (m x m), compute |A| from the diagonal values of U and the permutation information.

Reimplemented from mfem::Factors.

Definition at line 3546 of file densemat.cpp.

◆ Factor()

bool mfem::LUFactors::Factor ( int m,
real_t TOL = 0.0 )
virtual

Compute the LU factorization of the current matrix.

Factorize the current matrix 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.

Parameters
[in]msize of the square matrix
[in]TOLoptional fuzzy comparison tolerance. Defaults to 0.0.
Returns
status set to true if successful, otherwise, false.

Reimplemented from mfem::Factors.

Definition at line 3481 of file densemat.cpp.

◆ GetInverseMatrix()

void mfem::LUFactors::GetInverseMatrix ( int m,
real_t * X ) const
virtual

Assuming L.U = P.A factored data of size (m x m), compute X <- A^{-1}.

Reimplemented from mfem::Factors.

Definition at line 3720 of file densemat.cpp.

◆ LSolve()

void mfem::LUFactors::LSolve ( int m,
int n,
real_t * 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 3597 of file densemat.cpp.

◆ Mult()

void mfem::LUFactors::Mult ( int m,
int n,
real_t * 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 3563 of file densemat.cpp.

◆ RightSolve()

void mfem::LUFactors::RightSolve ( int m,
int n,
real_t * X ) const

Assuming L.U = P.A factored data of size (m x m), compute X <- X A^{-1}, for a matrix X of size (n x m).

Definition at line 3658 of file densemat.cpp.

◆ Solve()

void mfem::LUFactors::Solve ( int m,
int n,
real_t * X ) const
virtual

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).

Reimplemented from mfem::Factors.

Definition at line 3638 of file densemat.cpp.

◆ SubMult()

void mfem::LUFactors::SubMult ( int m,
int n,
int r,
const real_t * A21,
const real_t * X1,
real_t * X2 )
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 3783 of file densemat.cpp.

◆ USolve()

void mfem::LUFactors::USolve ( int m,
int n,
real_t * 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 3620 of file densemat.cpp.

Member Data Documentation

◆ ipiv

int* mfem::LUFactors::ipiv

Definition at line 666 of file densemat.hpp.

◆ ipiv_base

static const int mfem::LUFactors::ipiv_base = 1
static

Definition at line 668 of file densemat.hpp.


The documentation for this class was generated from the following files: