Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Seldon::SparseDistributedSolver< T > Class Template Reference

general class for direct solver More...

#include <DistributedSolver.hxx>

Inheritance diagram for Seldon::SparseDistributedSolver< T >:
Seldon::SparseDirectSolver< T >

Public Types

enum  {
  SELDON_SOLVER, UMFPACK, SUPERLU, MUMPS,
  PASTIX, ILUT, PARDISO, WSMP
}
 
enum  {
  FACTO_OK, STRUCTURALLY_SINGULAR_MATRIX, NUMERICALLY_SINGULAR_MATRIX, OUT_OF_MEMORY,
  INVALID_ARGUMENT, INCORRECT_NUMBER_OF_ROWS, MATRIX_INDICES_INCORRECT, INVALID_PERMUTATION,
  ORDERING_FAILED, INTERNAL_ERROR, OVERFLOW_32BIT
}
 

Public Member Functions

 SparseDistributedSolver ()
 Default constructor.
 
void SetPrintLevel (int print)
 Changes the level of displayed messages.
 
void Clear ()
 Clears LU matrices.
 
template<class Prop0 , class Storage0 , class Allocator0 >
void Factorize (Matrix< T, Prop0, Storage0, Allocator0 > &A, bool keep_matrix=false, bool scale_matrix=false)
 
template<class Prop0 , class Storage0 , class Allocator0 >
void PerformAnalysis (Matrix< T, Prop0, Storage0, Allocator0 > &A)
 
template<class Prop0 , class Storage0 , class Allocator0 >
void PerformFactorization (Matrix< T, Prop0, Storage0, Allocator0 > &A, bool scale_matrix=false)
 
template<class T1 >
void Solve (Vector< T1 > &x_solution, const Vector< T1 > &b_rhs)
 solution of linear system Ax = b by using LU factorization (with scaling) More...
 
template<class T1 >
void Solve (Vector< T1 > &x_solution)
 solution of linear system Ax = b by using LU factorization (with scaling) More...
 
template<class T1 >
void TransSolve (Vector< T1 > &x_solution)
 solution of linear system A^T x = b by using LU factorization (with scaling) More...
 
template<class T1 >
void Solve (const SeldonTranspose &, Vector< T1 > &x_solution, bool assemble=true)
 
template<class T1 >
void Solve (Matrix< T1, General, ColMajor > &x_solution)
 solution of linear system Ax = b by using LU factorization (with scaling) More...
 
template<class T1 >
void TransSolve (Matrix< T1, General, ColMajor > &x_solution)
 solution of linear system A^T x = b by using LU factorization (with scaling) More...
 
template<class T1 >
void Solve (const SeldonTranspose &, Matrix< T1, General, ColMajor > &x_solution)
 
template<class MatrixSparse , class MatrixFull >
void GetSchurComplement (MatrixSparse &mat_direct, const IVect &num, MatrixFull &mat_schur)
 Computation of a Schur Complement. More...
 
size_t GetMemorySize () const
 returns in bytes the memory used by the direct solver
 
template<class Prop , class Storage , class Allocator >
void Factorize (Matrix< T, Prop, Storage, Allocator > &A, bool keep_matrix, bool scale_matrix)
 factorization of matrix in sequential
 
template<class Prop , class Storage , class Allocator >
void PerformAnalysis (Matrix< T, Prop, Storage, Allocator > &A)
 Performs the analysis of the matrix A before numerical factorization.
 
template<class Prop , class Storage , class Allocator >
void PerformFactorization (Matrix< T, Prop, Storage, Allocator > &A, bool scale_matrix)
 Performs the numerical factorization.
 
int GetM () const
 returns the number of rows of the factorised matrix
 
int GetN () const
 returns the number of rows of the factorised matrix
 
int GetTypeOrdering () const
 returns the ordering algorithm to use
 
void SetPermutation (const IVect &)
 sets directly the new ordering (by giving a permutation vector)
 
void SelectOrdering (int)
 modifies the ordering algorithm to use
 
void HideMessages ()
 hiding all messages
 
void ShowMessages ()
 displaying basic messages
 
void ShowFullHistory ()
 displaying all the messages
 
void SetPivotThreshold (const double &)
 sets the threshold used for pivoting
 
void SetNumberOfThreadPerNode (int m)
 modifies the number of threads per node (for Pastix only)
 
int GetNumberOfThreadPerNode () const
 modifies the number of threads per node (for Pastix only)
 
void SelectDirectSolver (int)
 modifies the direct solver to use
 
void SetNonSymmetricIlut ()
 enforces the use of unsymmetric algorithm for ilut solver
 
int GetDirectSolver ()
 returns the direct solver to use
 
void RefineSolution ()
 
void DoNotRefineSolution ()
 
void SetCoefficientEstimationNeededMemory (double)
 
void SetMaximumCoefficientEstimationNeededMemory (double)
 
void SetIncreaseCoefficientEstimationNeededMemory (double)
 
double GetThresholdMatrix () const
 returns threshold used for ilut (if this solver is selected)
 
void SetThresholdMatrix (const double &)
 modifies threshold used for ilut
 
template<class Prop , class Storage , class Allocator >
void Factorize (Matrix< T, Prop, Storage, Allocator > &A, bool keep_matrix=false)
 factorisation of matrix A More...
 
template<class Prop , class Storage , class Allocator >
void PerformFactorization (Matrix< T, Prop, Storage, Allocator > &A)
 Performs the numerical factorization.
 
int GetInfoFactorization (int &ierr) const
 Returns error code of the direct solver.
 
void Solve (Vector< T > &x)
 x_solution is overwritten by solution of A x = b More...
 
void Solve (const SeldonTranspose &TransA, Vector< T > &x, bool assemble=true)
 x_solution is overwritten with solution of A x = b or A^T x = b
 
void Solve (Matrix< T, General, ColMajor > &x)
 x_solution is overwritten by solution of A x = b More...
 
void Solve (const SeldonTranspose &, Matrix< T, General, ColMajor > &x)
 x_solution is overwritten by solution of A x = b More...
 

Static Public Member Functions

static bool IsAvailableSolver (int type)
 returns true if the solver type is available
 

Protected Types

typedef ClassComplexType< T >::Treal Treal
 

Protected Member Functions

template<class MatrixSparse >
void ScaleMatrixRowCol (MatrixSparse &A)
 scales matrix with 1 / \sum a_{i, j} (rows and columns)
 
bool AffectOrdering ()
 
template<class T0 , class Prop , class Storage , class Alloc >
void ComputeOrdering (Matrix< T0, Prop, Storage, Alloc > &A)
 computation of the permutation vector in order to reduce fill-in
 
void InitSolver ()
 initializes the solver (internal method)
 

Protected Attributes

bool diagonal_scaling_left
 left scaling ?
 
bool diagonal_scaling_right
 right scaling ?
 
Vector< Treal > diagonal_scale_left
 left scaling
 
Vector< Treal > diagonal_scale_right
 right scaling
 
int type_ordering
 ordering to use
 
int type_solver
 solver to use
 
int nb_threads_per_node
 number of threads (for Pastix)
 
IVect permut
 ordering (if supplied by the user)
 
int n
 size of factorized linear system
 
VirtualSparseDirectSolver< T > * solver
 pointer to the used solver
 
double threshold_matrix
 threshold for ilut solver
 
double pivot_threshold
 
bool refine_solution
 
int print_level
 
bool enforce_unsym_ilut
 use of non-symmetric ilut ?
 

Detailed Description

template<class T>
class Seldon::SparseDistributedSolver< T >

general class for direct solver

This class will call one of the direct solver interfaced in Seldon (in sequential for Matrix and in distributed for DistributedMatrix). The user can also provide left/right scaling to apply to the matrix before factorization.

Definition at line 15 of file DistributedSolver.hxx.

Member Function Documentation

◆ Factorize()

template<class T >
template<class Prop , class Storage , class Allocator >
SELDON_EXTERN template void Seldon::SparseDirectSolver< T >::Factorize ( Matrix< T, Prop, Storage, Allocator > &  A,
bool  keep_matrix = false 
)
inherited

factorisation of matrix A

LU factorisation is stored in the current object. You can ask to clear the matrix given on input (to spare memory)

Definition at line 503 of file SparseDirectSolver.cxx.

◆ GetSchurComplement()

template<class T >
template<class MatrixSparse , class MatrixFull >
void Seldon::SparseDistributedSolver< T >::GetSchurComplement ( MatrixSparse &  mat_direct,
const IVect num,
MatrixFull &  mat_schur 
)

Computation of a Schur Complement.

Parameters
[in]mat_directinitial matrix
[in]numrow numbers of the Schur Complement
[out]mat_schurSchur Complement

Definition at line 640 of file DistributedSolver.cxx.

◆ Solve() [1/6]

template<class T >
void Seldon::SparseDirectSolver< T >::Solve ( const SeldonTranspose trans,
Matrix< T, General, ColMajor > &  x_sol 
)
inherited

x_solution is overwritten by solution of A x = b

Multiple right hand sides We assume that Factorize has been called previously

Definition at line 827 of file SparseDirectSolver.cxx.

◆ Solve() [2/6]

template<class T >
void Seldon::SparseDirectSolver< T >::Solve ( Matrix< T, General, ColMajor > &  x_solution)
inherited

x_solution is overwritten by solution of A x = b

Multiple right hand sides We assume that Factorize has been called previously

Definition at line 814 of file SparseDirectSolver.cxx.

◆ Solve() [3/6]

template<class T >
template<class T1 >
void Seldon::SparseDistributedSolver< T >::Solve ( Matrix< T1, General, ColMajor > &  x_solution)

solution of linear system Ax = b by using LU factorization (with scaling)

Parameters
[in,out]x_solutionon input right hand side, on output solution

Definition at line 565 of file DistributedSolver.cxx.

◆ Solve() [4/6]

template<class T >
void Seldon::SparseDirectSolver< T >::Solve ( Vector< T > &  x_solution)
inherited

x_solution is overwritten by solution of A x = b

We assume that Factorize has been called previously

Definition at line 783 of file SparseDirectSolver.cxx.

◆ Solve() [5/6]

template<class T >
template<class T1 >
void Seldon::SparseDistributedSolver< T >::Solve ( Vector< T1 > &  x_solution)

solution of linear system Ax = b by using LU factorization (with scaling)

Parameters
[in,out]x_solutionon input right hand side, on output solution

Definition at line 490 of file DistributedSolver.cxx.

◆ Solve() [6/6]

template<class T >
template<class T1 >
void Seldon::SparseDistributedSolver< T >::Solve ( Vector< T1 > &  x_solution,
const Vector< T1 > &  b_rhs 
)

solution of linear system Ax = b by using LU factorization (with scaling)

Parameters
[out]x_solutionsolution
[in]b_rhsright hand side

Definition at line 476 of file DistributedSolver.cxx.

◆ TransSolve() [1/2]

template<class T >
template<class T1 >
void Seldon::SparseDistributedSolver< T >::TransSolve ( Matrix< T1, General, ColMajor > &  x_solution)

solution of linear system A^T x = b by using LU factorization (with scaling)

Parameters
[in,out]x_solutionon input right hand sides, on output solution

Definition at line 576 of file DistributedSolver.cxx.

◆ TransSolve() [2/2]

template<class T >
template<class T1 >
void Seldon::SparseDistributedSolver< T >::TransSolve ( Vector< T1 > &  x_solution)

solution of linear system A^T x = b by using LU factorization (with scaling)

Parameters
[in,out]x_solutionon input right hand side, on output solution

Definition at line 502 of file DistributedSolver.cxx.


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