46 #ifndef _PEXSI_SUPERLUMATRIX_IMPL_HPP_
47 #define _PEXSI_SUPERLUMATRIX_IMPL_HPP_
51 inline SuperLUMatrix<Real>::SuperLUMatrix ( )
54 PushCallStack(
"SuperLUMatrix<Real>::SuperLUMatrix");
63 inline SuperLUMatrix<Real>::SuperLUMatrix (
const SuperLUGrid<Real>& g,
const SuperLUOptions& opt )
66 PushCallStack(
"SuperLUMatrix<Real>::SuperLUMatrix");
68 ptrData =
new RealSuperLUData(g,opt);
74 inline SuperLUMatrix<Real>::~SuperLUMatrix ( )
77 PushCallStack(
"SuperLUMatrix<Real>::~SuperLUMatrix");
89 inline SuperLUMatrix<Real>::SuperLUMatrix(
const SuperLUMatrix<Real> & g){
91 PushCallStack(
"SuperLUMatrix<Real>::SuperLUMatrix");
97 ptrData =
new RealSuperLUData(*g.ptrData);
104 inline SuperLUMatrix<Real> & SuperLUMatrix<Real>::operator = (
const SuperLUMatrix<Real> & g){
115 ptrData =
new RealSuperLUData(*g.ptrData);
127 SuperLUMatrix<Real>::Setup (
const SuperLUGrid<Real>& g,
const SuperLUOptions& opt )
130 PushCallStack(
"SuperLUMatrix<Real>::Setup");
133 ptrData =
new RealSuperLUData(g,opt);
149 inline Int SuperLUMatrix<Real>::m ( )
const
156 inline Int SuperLUMatrix<Real>::n ( )
const
165 PushCallStack(
"SuperLUMatrix<Real>::DistSparseMatrixToSuperMatrixNRloc" );
167 ptrData->DistSparseMatrixToSuperMatrixNRloc(sparseA, opt );
179 PushCallStack(
"SuperLUMatrix<Real>::DestroyAOnly");
181 ptrData->DestroyAOnly();
193 PushCallStack(
"SuperLUMatrix<Real>::SymbolicFactorize");
195 ptrData->SymbolicFactorize();
208 PushCallStack(
"SuperLUMatrix<Real>::Distribute");
210 ptrData->Distribute();
223 PushCallStack(
"SuperLUMatrix<Real>::NumericalFactorize");
225 ptrData->NumericalFactorize();
238 PushCallStack(
"SuperLUMatrix<Real>::ConvertNRlocToNC");
240 ptrData->ConvertNRlocToNC(AGlobal.ptrData);
252 PushCallStack(
"SuperLUMatrix<Real>::MultiplyGlobalMultiVector");
254 ptrData->MultiplyGlobalMultiVector(xGlobal, bGlobal);
267 PushCallStack(
"SuperLUMatrix<Real>::DistributeGlobalMultiVector");
269 ptrData->DistributeGlobalMultiVector(xGlobal, xLocal );
281 PushCallStack(
"SuperLUMatrix<Real>::GatherDistributedMultiVector");
283 ptrData->GatherDistributedMultiVector(xGlobal, xLocal );
296 PushCallStack(
"SuperLUMatrix<Real>::SolveDistMultiVector");
298 ptrData->SolveDistMultiVector(bLocal, berr );
311 PushCallStack(
"SuperLUMatrix<Real>::CheckErrorDistMultiVector");
313 ptrData->CheckErrorDistMultiVector(xLocal, xTrueLocal );
326 PushCallStack(
"SuperLUMatrix<Real>::LUstructToPMatrix");
328 ptrData->LUstructToPMatrix(PMloc);
342 PushCallStack(
"SuperLUMatrix<Real>::SymbolicToSuperNode");
344 ptrData->SymbolicToSuperNode(super);
356 inline SuperLUMatrix<Complex>::SuperLUMatrix ( )
359 PushCallStack(
"SuperLUMatrix<Complex>::SuperLUMatrix");
368 inline SuperLUMatrix<Complex>::SuperLUMatrix (
const SuperLUGrid<Complex>& g,
const SuperLUOptions& opt )
371 PushCallStack(
"SuperLUMatrix<Complex>::SuperLUMatrix");
373 ptrData =
new ComplexSuperLUData(g,opt);
379 inline SuperLUMatrix<Complex>::~SuperLUMatrix ( )
382 PushCallStack(
"SuperLUMatrix<Complex>::~SuperLUMatrix");
384 if( ptrData != NULL ){
393 inline SuperLUMatrix<Complex>::SuperLUMatrix(
const SuperLUMatrix<Complex> & g){
395 PushCallStack(
"SuperLUMatrix<Complex>::SuperLUMatrix");
401 ptrData =
new ComplexSuperLUData(*g.ptrData);
408 inline SuperLUMatrix<Complex> & SuperLUMatrix<Complex>::operator = (
const SuperLUMatrix<Complex> & g){
419 ptrData =
new ComplexSuperLUData(*g.ptrData);
430 SuperLUMatrix<Complex>::Setup (
const SuperLUGrid<Complex>& g,
const SuperLUOptions& opt )
433 PushCallStack(
"SuperLUMatrix<Complex>::Setup");
436 ptrData =
new ComplexSuperLUData(g,opt);
450 inline Int SuperLUMatrix<Complex>::m ( )
const
455 inline Int SuperLUMatrix<Complex>::n ( )
const
464 PushCallStack(
"SuperLUMatrix<Complex>::DistSparseMatrixToSuperMatrixNRloc" );
466 ptrData->DistSparseMatrixToSuperMatrixNRloc(sparseA, opt);
477 PushCallStack(
"SuperLUMatrix<Complex>::DestroyAOnly");
479 ptrData->DestroyAOnly();
491 PushCallStack(
"SuperLUMatrix<Complex>::SymbolicFactorize");
493 ptrData->SymbolicFactorize();
505 PushCallStack(
"SuperLUMatrix<Complex>::Distribute");
507 ptrData->Distribute();
519 PushCallStack(
"SuperLUMatrix<Complex>::NumericalFactorize");
521 ptrData->NumericalFactorize();
533 PushCallStack(
"SuperLUMatrix<Complex>::ConvertNRlocToNC");
535 ptrData->ConvertNRlocToNC(AGlobal.ptrData);
547 PushCallStack(
"SuperLUMatrix<Complex>::MultiplyGlobalMultiVector");
549 ptrData->MultiplyGlobalMultiVector(xGlobal, bGlobal);
561 PushCallStack(
"SuperLUMatrix<Complex>::DistributeGlobalMultiVector");
563 ptrData->DistributeGlobalMultiVector(xGlobal, xLocal );
574 PushCallStack(
"SuperLUMatrix<Complex>::GatherDistributedMultiVector");
576 ptrData->GatherDistributedMultiVector(xGlobal, xLocal );
588 PushCallStack(
"SuperLUMatrix<Complex>::SolveDistMultiVector");
590 ptrData->SolveDistMultiVector(bLocal, berr );
602 PushCallStack(
"SuperLUMatrix<Complex>::CheckErrorDistMultiVector");
604 ptrData->CheckErrorDistMultiVector(xLocal, xTrueLocal );
616 PushCallStack(
"SuperLUMatrix<Complex>::LUstructToPMatrix");
618 ptrData->LUstructToPMatrix(PMloc);
630 PushCallStack(
"SuperLUMatrix<Complex>::SymbolicToSuperNode");
632 ptrData->SymbolicToSuperNode(super);
642 #endif //_PEXSI_SUPERLUMATRIX_IMPL_HPP_
void CheckErrorDistMultiVector(NumMat< T > &xLocal, NumMat< T > &xTrueLocal)
Prints out the error by direct comparison with the true solution in distributed format.
Definition: SuperLUMatrix.hpp:192
void SymbolicToSuperNode(SuperNodeType &super)
SymbolicToSuperNode converts the symbolic information to SuperNode structure in SelInv.
Definition: SuperLUMatrix.hpp:203
A thin interface for passing parameters to set the SuperLU options.
Definition: superlu_dist_internal.hpp:62
void DistSparseMatrixToSuperMatrixNRloc(DistSparseMatrix< T > &sparseA, const SuperLUOptions &options)
Convert a distributed sparse matrix in compressed sparse column format into the SuperLU compressed ro...
Definition: SuperLUMatrix.hpp:117
SuperNodeType describes mapping between supernode and column, the permutation information, and potentially the elimination tree (not implemented here).
Definition: pselinv.hpp:143
void DistributeGlobalMultiVector(NumMat< T > &xGlobal, NumMat< T > &xLocal)
DistributeGlobalMultiVector distributes a global multivector into a local multivector according to th...
Definition: SuperLUMatrix.hpp:175
void NumericalFactorize()
Performs LU factorization numerically.
Definition: SuperLUMatrix.hpp:154
void SymbolicFactorize()
Factorizes the superlu matrix symbolically.
Definition: SuperLUMatrix.hpp:139
void SolveDistMultiVector(NumMat< T > &bLocal, DblNumVec &berr)
Solve A x = b with b overwritten by x for distributed multivector.
Definition: SuperLUMatrix.hpp:184
An thin interface to keep the main code insulated from the source code of SuperLU.
Definition: SuperLUMatrix.hpp:75
void DestroyAOnly()
Releases the data in A but keeps other data, such as LUstruct.
Definition: SuperLUMatrix.hpp:128
void ConvertNRlocToNC(SuperLUMatrix< T > &AGlobal)
ConvertNRlocToNC converts a distributed compressed sparse row matrix to a global compressed sparse co...
Definition: SuperLUMatrix.hpp:160
Numerical matrix.
Definition: NumMat.hpp:61
void Distribute()
Distribute redistrbutes the SuperMatrix in parallel so that it is ready for the numerical factorizati...
Definition: SuperLUMatrix.hpp:146
void LUstructToPMatrix(PMatrix< T > &PMloc)
LUstructToPMatrix converts the data in LUstruct to PMatrix.
Definition: SuperLUMatrix.hpp:197
void MultiplyGlobalMultiVector(NumMat< T > &xGlobal, NumMat< T > &bGlobal)
MultiplyGlobalMultiVector computes b = A * x.
Definition: SuperLUMatrix.hpp:168