PEXSI
 All Classes Namespaces Files Functions Variables Typedefs Pages
Public Member Functions | List of all members
PEXSI::SuperLUMatrix< T > Class Template Reference

An thin interface to keep the main code insulated from the source code of SuperLU. More...

#include <SuperLUMatrix.hpp>

Public Member Functions

 SuperLUMatrix (const SuperLUGrid< T > &g, const SuperLUOptions &opt=SuperLUOptions())
 
Int m () const
 
Int n () const
 
void DistSparseMatrixToSuperMatrixNRloc (DistSparseMatrix< T > &sparseA)
 Convert a distributed sparse matrix in compressed sparse column format into the SuperLU compressed row format. More...
 
void DestroyAOnly ()
 Releases the data in A but keeps other data, such as LUstruct. More...
 
void SymbolicFactorize ()
 Factorizes the superlu matrix symbolically. More...
 
void Distribute ()
 Distribute redistrbutes the SuperMatrix in parallel so that it is ready for the numerical factorization. More...
 
void NumericalFactorize ()
 Performs LU factorization numerically. More...
 
void ConvertNRlocToNC (SuperLUMatrix< T > &AGlobal)
 ConvertNRlocToNC converts a distributed compressed sparse row matrix to a global compressed sparse column matrix. More...
 
void MultiplyGlobalMultiVector (NumMat< T > &xGlobal, NumMat< T > &bGlobal)
 MultiplyGlobalMultiVector computes b = A * x. More...
 
void DistributeGlobalMultiVector (NumMat< T > &xGlobal, NumMat< T > &xLocal)
 DistributeGlobalMultiVector distributes a global multivector into a local multivector according to the compressed row format of A. More...
 
void GatherDistributedMultiVector (NumMat< T > &xGlobal, NumMat< T > &xLocal)
 
void SolveDistMultiVector (NumMat< T > &bLocal, DblNumVec &berr)
 Solve A x = b with b overwritten by x for distributed multivector. More...
 
void CheckErrorDistMultiVector (NumMat< T > &xLocal, NumMat< T > &xTrueLocal)
 Prints out the error by direct comparison with the true solution in distributed format. More...
 
void LUstructToPMatrix (PMatrix< T > &PMloc)
 LUstructToPMatrix converts the data in LUstruct to PMatrix. More...
 
void SymbolicToSuperNode (SuperNodeType &super)
 SymbolicToSuperNode converts the symbolic information to SuperNode structure in SelInv. More...
 

Detailed Description

template<typename T>
class PEXSI::SuperLUMatrix< T >

An thin interface to keep the main code insulated from the source code of SuperLU.

Member Function Documentation

template<typename T>
void PEXSI::SuperLUMatrix< T >::CheckErrorDistMultiVector ( NumMat< T > &  xLocal,
NumMat< T > &  xTrueLocal 
)
inline

Prints out the error by direct comparison with the true solution in distributed format.

Parameters
[in]xLocalThe computed solution.
[in]xTrueLocalThe true solution.
template<typename T>
void PEXSI::SuperLUMatrix< T >::ConvertNRlocToNC ( SuperLUMatrix< T > &  AGlobal)
inline

ConvertNRlocToNC converts a distributed compressed sparse row matrix to a global compressed sparse column matrix.

Parameters
[out]AGlobal
template<typename T>
void PEXSI::SuperLUMatrix< T >::DestroyAOnly ( )
inline

Releases the data in A but keeps other data, such as LUstruct.

This allows one to perform factorization of matrices of the same pattern, such as the option

fact = SamePattern_SameRowPerm

in SuperLU_DIST.

template<typename T>
void PEXSI::SuperLUMatrix< T >::Distribute ( )
inline

Distribute redistrbutes the SuperMatrix in parallel so that it is ready for the numerical factorization.

Todo:
Better way to incorporate both real and complex arithmetic.
template<typename T>
void PEXSI::SuperLUMatrix< T >::DistributeGlobalMultiVector ( NumMat< T > &  xGlobal,
NumMat< T > &  xLocal 
)
inline

DistributeGlobalMultiVector distributes a global multivector into a local multivector according to the compressed row format of A.

Parameters
[in]xGlobal
[out]xLocal
template<typename T>
void PEXSI::SuperLUMatrix< T >::DistSparseMatrixToSuperMatrixNRloc ( DistSparseMatrix< T > &  sparseA)
inline

Convert a distributed sparse matrix in compressed sparse column format into the SuperLU compressed row format.

The output is saved in the current SuperLUMatrix.

Note
Although LU factorization is used, the routine assumes that the matrix is strictly symmetric, and therefore the compressed sparse row (CSR) format, used by SuperLU_DIST, gives exactly the same matrix as formed by the compresed sparse column format (CSC).
Parameters
[in]sparseAMatrix A saved in distributed compressed sparse column format.
Todo:
Better way to incorporate both real and complex arithmetic.
template<typename T>
void PEXSI::SuperLUMatrix< T >::LUstructToPMatrix ( PMatrix< T > &  PMloc)
inline

LUstructToPMatrix converts the data in LUstruct to PMatrix.

[out] PMloc

template<typename T>
void PEXSI::SuperLUMatrix< T >::MultiplyGlobalMultiVector ( NumMat< T > &  xGlobal,
NumMat< T > &  bGlobal 
)
inline

MultiplyGlobalMultiVector computes b = A * x.

Both xGlobal and bGlobal are saved globally.

Parameters
[in]xGlobal
[out]bGlobal
template<typename T>
void PEXSI::SuperLUMatrix< T >::NumericalFactorize ( )
inline

Performs LU factorization numerically.

The SuperLUMatrix should have been permuted and distributed.

Todo:
Better way to incorporate both real and complex arithmetic.
template<typename T>
void PEXSI::SuperLUMatrix< T >::SolveDistMultiVector ( NumMat< T > &  bLocal,
DblNumVec berr 
)
inline

Solve A x = b with b overwritten by x for distributed multivector.

Parameters
[in,out]bLocalRight hand side savd in the distributed format.
[out]berrThe componentwise relative backward error of each solution vector.
template<typename T>
void PEXSI::SuperLUMatrix< T >::SymbolicFactorize ( )
inline

Factorizes the superlu matrix symbolically.

Symbolic factorization contains three steps.

  • Permute the matrix to reduce fill-in.
  • Symbolic factorize the matrix.
  • Distribute the matrix into 2D block cyclic format.

This routine is controlled via SuperLUOptions.

template<typename T>
void PEXSI::SuperLUMatrix< T >::SymbolicToSuperNode ( SuperNodeType super)
inline

SymbolicToSuperNode converts the symbolic information to SuperNode structure in SelInv.

Parameters
[out]super

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