PEXSI
 All Classes Namespaces Files Functions Variables Friends Pages
Classes | Public Member Functions | List of all members
PEXSI::SuperLUMatrix Class Reference

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

#include <superlu_dist_interf.hpp>

Classes

struct  SuperLUData
 Data of a matrix in the SuperLU format. More...
 

Public Member Functions

 SuperLUMatrix (const SuperLUGrid &g, const SuperLUOptions &opt=SuperLUOptions())
 
Int m () const
 
Int n () const
 
void DistSparseMatrixToSuperMatrixNRloc (DistSparseMatrix< Scalar > &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 &AGlobal)
 ConvertNRlocToNC converts a distributed compressed sparse row matrix to a global compressed sparse column matrix. More...
 
void MultiplyGlobalMultiVector (NumMat< Scalar > &xGlobal, NumMat< Scalar > &bGlobal)
 MultiplyGlobalMultiVector computes b = A * x. More...
 
void DistributeGlobalMultiVector (NumMat< Scalar > &xGlobal, NumMat< Scalar > &xLocal)
 DistributeGlobalMultiVector distributes a global multivector into a local multivector according to the compressed row format of A. More...
 
void GatherDistributedMultiVector (NumMat< Scalar > &xGlobal, NumMat< Scalar > &xLocal)
 
void SolveDistMultiVector (NumMat< Scalar > &bLocal, DblNumVec &berr)
 Solve A x = b with b overwritten by x for distributed multivector. More...
 
void CheckErrorDistMultiVector (NumMat< Scalar > &xLocal, NumMat< Scalar > &xTrueLocal)
 Prints out the error by direct comparison with the true solution in distributed format. More...
 
void LUstructToPMatrix (PMatrix &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

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

Member Function Documentation

void PEXSI::SuperLUMatrix::CheckErrorDistMultiVector ( NumMat< Scalar > &  xLocal,
NumMat< Scalar > &  xTrueLocal 
)

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

Parameters
[in]xLocalThe computed solution.
[in]xTrueLocalThe true solution.
void PEXSI::SuperLUMatrix::ConvertNRlocToNC ( SuperLUMatrix AGlobal)

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

Parameters
[out]AGlobal
void PEXSI::SuperLUMatrix::DestroyAOnly ( )

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.

void PEXSI::SuperLUMatrix::Distribute ( )

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.
void PEXSI::SuperLUMatrix::DistributeGlobalMultiVector ( NumMat< Scalar > &  xGlobal,
NumMat< Scalar > &  xLocal 
)

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

Parameters
[in]xGlobal
[out]xLocal
void PEXSI::SuperLUMatrix::DistSparseMatrixToSuperMatrixNRloc ( DistSparseMatrix< Scalar > &  sparseA)

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.
void PEXSI::SuperLUMatrix::LUstructToPMatrix ( PMatrix PMloc)

LUstructToPMatrix converts the data in LUstruct to PMatrix.

[out] PMloc

void PEXSI::SuperLUMatrix::MultiplyGlobalMultiVector ( NumMat< Scalar > &  xGlobal,
NumMat< Scalar > &  bGlobal 
)

MultiplyGlobalMultiVector computes b = A * x.

Both xGlobal and bGlobal are saved globally.

Parameters
[in]xGlobal
[out]bGlobal
void PEXSI::SuperLUMatrix::NumericalFactorize ( )

Performs LU factorization numerically.

The SuperLUMatrix should have been permuted and distributed.

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

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.
void PEXSI::SuperLUMatrix::SymbolicFactorize ( )

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.

void PEXSI::SuperLUMatrix::SymbolicToSuperNode ( SuperNodeType super)

SymbolicToSuperNode converts the symbolic information to SuperNode structure in SelInv.

Parameters
[out]super

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