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

Class grouping different direct solvers. More...

#include <SparseDirectSolver.hxx>

Inheritance diagram for Seldon::SparseDirectSolver< T >:
Seldon::SparseDistributedSolver< 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

 SparseDirectSolver ()
 Default constructor.
 
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)
 
 ~SparseDirectSolver ()
 Destructor.
 
void Clear ()
 clearing factorisation
 
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 PerformAnalysis (Matrix< T, Prop, Storage, Allocator > &A)
 Performs the analysis of the matrix before numerical factorization.
 
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 Member Functions

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

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::SparseDirectSolver< T >

Class grouping different direct solvers.

Definition at line 26 of file SparseDirectSolver.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 
)

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.

◆ Solve() [1/3]

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

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/3]

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

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/3]

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

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.


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