ParGeMSLR
Public Member Functions | Static Public Member Functions | List of all members
pargemslr::IluClass< MatrixType, VectorType, DataType > Class Template Reference

The local ilu preconditioner, only work for sequential CSR matrix. More...

#include <ilu.hpp>

Inheritance diagram for pargemslr::IluClass< MatrixType, VectorType, DataType >:
pargemslr::SolverClass< MatrixType, VectorType, DataType >

Public Member Functions

 IluClass ()
 The constructor of precondioner class. More...
 
 IluClass (const IluClass< MatrixType, VectorType, DataType > &precond)
 The copy constructor of precondioner class. More...
 
 IluClass (IluClass< MatrixType, VectorType, DataType > &&precond)
 The move constructor of precondioner class. More...
 
IluClass< MatrixType, VectorType, DataType > & operator= (const IluClass< MatrixType, VectorType, DataType > &precond)
 The operator = of precondioner class. More...
 
IluClass< MatrixType, VectorType, DataType > & operator= (IluClass< MatrixType, VectorType, DataType > &&precond)
 The operator = of precondioner class. More...
 
virtual int Clear ()
 Free the current precondioner. More...
 
virtual ~IluClass ()
 The destructor of precondioner class. More...
 
virtual int Setup (VectorType &x, VectorType &rhs)
 Setup the precondioner phase. Will be called by the solver if not called directly. More...
 
int Setup (MatrixType &L_mat, VectorType &D_vec, MatrixType &U_mat, int *pperm, int *qperm)
 Setup ILU with exist factorization L, D, and U. The lower triangular part of L, inverse of diagonal of U, and the upper triangular part of U. More...
 
int SetupPermutation (VectorType &x, VectorType &rhs)
 Build the permutation vector. More...
 
int SetupILUT (VectorType &x, VectorType &rhs)
 Setup ILUT, ingore the ilu option. More...
 
int SetupILUK (VectorType &x, VectorType &rhs)
 Setup ILU(K). More...
 
int SetupPartialILUT (VectorType &x, VectorType &rhs)
 Setup Partial ILUT, form approximate Schur Complement. More...
 
virtual int Solve (VectorType &x, VectorType &rhs)
 Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is used. More...
 
int SolveL (VectorType &x, VectorType &rhs)
 Solve with L only. Call this function after Setup. Solve with cusparse if unified memory/device memory is used. More...
 
int SolveU (VectorType &x, VectorType &rhs)
 Solve with U only. Call this function after Setup. Solve with cusparse if unified memory/device memory is used. More...
 
virtual int SetSolveLocation (const int &location)
 Set the data location that the preconditioner apply to. More...
 
virtual int MoveData (const int &location)
 Move the preconditioner to another location. Only can be called after Setup. More...
 
virtual int SetWithParameterArray (double *params)
 Setup with parameter array. More...
 
int SetLevelOfFill (int lfil)
 Set the level of fill for ILU(K). More...
 
int SetIluComplexShift (bool complex_shift)
 Set if we turn on the complex shift or not (complex version only). More...
 
template<typename T >
int SetDropTolerance (T droptol)
 Set the drop tols for ILUT. More...
 
template<typename T >
int SetDropToleranceEF (T droptol_ef)
 Set the drop tols in E, F part for Partial ILUT. More...
 
template<typename T >
int SetDropToleranceS (T droptol_s)
 Set the drop tols in S part for Partial ILUT. More...
 
int SetMaxNnzPerRow (int max_row_nnz)
 Set the max fill allowed for each row/col of L and U. More...
 
int SetMaxNnzPerRowSPart (int max_row_nnz_s)
 Set the max fill allowed for each row/col of S in partial ILU. More...
 
int SetNB (int nB)
 Set the size of the B block. More...
 
int SetOption (int option)
 Set the ILU option. See IluOptionEnum. More...
 
int SetOpenMPOption (int omp_option)
 Set the OpenMP option. See IluOpenMPOptionEnum. More...
 
int SetPolyOrder (int order)
 Set the polynomia order in some OpenMP option. See IluOpenMPOptionEnum. More...
 
int SetPermutationOption (int perm_option)
 Set the ILU permutation option. See IluReorderingOptionEnum. More...
 
int SetModified (bool modified)
 Enable/Disable modified ILU. More...
 
template<typename T >
int SetModifiedShift (T milu_shift)
 Set the shift for the modified ILU. More...
 
int GetSize ()
 Get the size of the problem. More...
 
virtual long int GetNumNonzeros ()
 Get the total number of nonzeros the ILU. More...
 
CsrMatrixClass< DataType > & GetL ()
 Get the L matrix of the ILU factorizaiton without diagonal. More...
 
SequentialVectorClass< DataType > & GetD ()
 Get the inverse of diagonal of the U matrix. More...
 
CsrMatrixClass< DataType > & GetU ()
 Get the U matrix of the ILU factorizaiton without diagonal. More...
 
CsrMatrixClass< DataType > & GetE ()
 Get the U matrix of the ILU factorizaiton without diagonal. More...
 
CsrMatrixClass< DataType > & GetF ()
 Get the U matrix of the ILU factorizaiton without diagonal. More...
 
CsrMatrixClass< DataType > & GetS ()
 Get the U matrix of the ILU factorizaiton without diagonal. More...
 
int GetNB ()
 Get the U matrix of the ILU factorizaiton without diagonal. More...
 
IntVectorClass< int > & GetRowPermutationVector ()
 Get the row permutation vector. More...
 
IntVectorClass< int > & GetColPermutationVector ()
 Get the column permutation vector. More...
 
- Public Member Functions inherited from pargemslr::SolverClass< MatrixType, VectorType, DataType >
 SolverClass ()
 The constructor of solver class. More...
 
 SolverClass (const SolverClass< MatrixType, VectorType, DataType > &solver)
 The copy constructor of solver class. More...
 
 SolverClass (SolverClass< MatrixType, VectorType, DataType > &&solver)
 The move constructor of solver class. More...
 
SolverClass< MatrixType, VectorType, DataType > & operator= (const SolverClass< MatrixType, VectorType, DataType > &solver)
 The = operator of solver class. More...
 
SolverClass< MatrixType, VectorType, DataType > & operator= (SolverClass< MatrixType, VectorType, DataType > &&solver)
 The = operator of solver class. More...
 
virtual ~SolverClass ()
 The destructor of solver class. More...
 
virtual int Solve (DenseMatrixClass< DataType > &x, DenseMatrixClass< DataType > &rhs)
 Solve phase with multiple right-hand-sides. Call this function after Setup. More...
 
MatrixType * GetMatrix ()
 Get pointer to the matrix. More...
 
SolverClass< MatrixType, VectorType, DataType > * GetPreconditioner ()
 Get pointer to the preconditioner. More...
 
int SetMatrix (MatrixType &matrix)
 Set the target matrix for the current solver. More...
 
int SetMatrixP (MatrixType *matrix)
 Set the target matrix for the current solver. More...
 
int SetPreconditioner (SolverClass< MatrixType, VectorType, DataType > &precond)
 Set the preconditioner for the current solver. More...
 
int SetPreconditionerP (SolverClass< MatrixType, VectorType, DataType > *precond)
 Set the preconditioner for the current solver. More...
 
bool IsReady () const
 Check if the solver is ready to be used. More...
 
int SetOwnMatrix (bool own_matrix)
 Set if the matrix is owned by this solver, if so, matrix is freed when free the solver. More...
 
int SetOwnPreconditioner (bool own_preconditioner)
 Set if the preconditioner is owned by this solver, if so, preconditioner is freed when free the solver. More...
 
int SetPrintOption (int print_option)
 Set the print option. More...
 
PrecisionEnum GerPrecision () const
 Get the precision. More...
 
SolverTypeEnum GetSolverType () const
 Get the solver type. More...
 

Static Public Member Functions

template<typename T >
static void Swap (T *v, int i, int j)
 Swap v[i] and v[j]. More...
 
template<typename T1 , typename T2 >
static void Swap (T1 *v, T2 *w, int i, int j)
 Swap v[i] and v[j], w[i] and w[j]. More...
 
template<typename T1 , typename T2 >
static void AbsMinHeapAdd_RN (T1 *heap, T2 *v, int len)
 Add value to a min heap based on the absolute value. RN stands for reverse (heap from right to left), normal (v1 based on normal order). More...
 
template<typename T1 , typename T2 >
static void AbsMinHeapRemove_RN (T1 *heap, T2 *v, int len)
 Remove value from a min heap based on the absolute value. RN stands for reverse (heap from right to left), normal (v1 based on normal order). More...
 
template<typename T1 , typename T2 >
static void MinHeapAdd_NNR (int *heap, T1 *v1, T2 *v2, int len)
 Add value to a min heap. NNR stands for normal (heap from left to right), normal (v1 based on normal order), reverse (v2 based on index order). More...
 
template<typename T1 , typename T2 >
static void MinHeapRemovd_NNR (int *heap, T1 *v1, T2 *v2, int len)
 Remove value from a min heap. NNR stands for normal (heap from left to right), normal (v1 based on normal order), reverse (v2 based on index order). More...
 
template<typename T >
static void Qsplit (T *a, int *ind, int left, int bound, int right)
 Does a quick-sort split of a real array. More...
 

Additional Inherited Members

- Protected Member Functions inherited from pargemslr::SolverClass< MatrixType, VectorType, DataType >
int CheckReadySetups (const char *str) const
 Return error is the preconditioner is ready. More...
 
- Protected Attributes inherited from pargemslr::SolverClass< MatrixType, VectorType, DataType >
PrecisionEnum _solver_precision
 The precision of the solver. More...
 
SolverTypeEnum _solver_type
 The type of the solver. More...
 
bool _is_mixed
 Is the preconditioner a mixed precision preconditioner? More...
 
MatrixType * _matrix
 The matrix. More...
 
bool _own_matrix
 If the matrix is owned by this solver, default is false. More...
 
SolverClass< MatrixType, VectorType, DataType > * _preconditioner
 The preconditioner. More...
 
bool _own_preconditioner
 If the preconditioner is owned by this solver, default is false. More...
 
VectorType * _solution
 Pointer to the solution, note that this vector is not going to be freed. More...
 
VectorType * _right_hand_side
 Pointer to the right-hand-size, note that this vector is not going to be freed. More...
 
bool _ready
 If the solver is ready. More...
 
int _print_option
 The print option. More...
 

Detailed Description

template<class MatrixType, class VectorType, typename DataType>
class pargemslr::IluClass< MatrixType, VectorType, DataType >

The local ilu preconditioner, only work for sequential CSR matrix.

Constructor & Destructor Documentation

◆ IluClass() [1/3]

template<class MatrixType , class VectorType , typename DataType >
template pargemslr::precond_ilu_csr_seq_complexd::IluClass ( )

The constructor of precondioner class.

◆ IluClass() [2/3]

template<class MatrixType , class VectorType , typename DataType >
pargemslr::IluClass< MatrixType, VectorType, DataType >::IluClass ( const IluClass< MatrixType, VectorType, DataType > &  precond)

The copy constructor of precondioner class.

◆ IluClass() [3/3]

template<class MatrixType , class VectorType , typename DataType >
pargemslr::IluClass< MatrixType, VectorType, DataType >::IluClass ( IluClass< MatrixType, VectorType, DataType > &&  precond)

The move constructor of precondioner class.

◆ ~IluClass()

template<class MatrixType , class VectorType , typename DataType >
template pargemslr::precond_ilu_csr_seq_complexd::~IluClass ( )
virtual

The destructor of precondioner class.

Member Function Documentation

◆ AbsMinHeapAdd_RN()

template<class MatrixType , class VectorType , typename DataType >
template<typename T1 , typename T2 >
static void pargemslr::IluClass< MatrixType, VectorType, DataType >::AbsMinHeapAdd_RN ( T1 *  heap,
T2 *  v,
int  len 
)
inlinestatic

Add value to a min heap based on the absolute value. RN stands for reverse (heap from right to left), normal (v1 based on normal order).
That is, the heap starts from heap[0], and goes to heap[-1], heap[-2] ...
When swaping elements in the heap, elements in v1 swap in the same way (swap heap[i]<->heap[j] and v1[i]<->v1[j]).

Parameters
[in]heapThe heap.
[in]v1The second array.
[in]v2The third array.
[in]lenThe length.

◆ AbsMinHeapRemove_RN()

template<class MatrixType , class VectorType , typename DataType >
template<typename T1 , typename T2 >
static void pargemslr::IluClass< MatrixType, VectorType, DataType >::AbsMinHeapRemove_RN ( T1 *  heap,
T2 *  v,
int  len 
)
inlinestatic

Remove value from a min heap based on the absolute value. RN stands for reverse (heap from right to left), normal (v1 based on normal order).
That is, the heap starts from heap[0], and goes to heap[-1], heap[-2] ...
When swaping elements in the heap, elements in v1 swap in the same way (swap heap[i]<->heap[j] and v1[i]<->v1[j]).

Parameters
[in]heapThe heap.
[in]v1The second array.
[in]v2The third array.
[in]lenThe length.

◆ Clear()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::Clear ( )
virtual

Free the current precondioner.

Returns
Return error message.

Reimplemented from pargemslr::SolverClass< MatrixType, VectorType, DataType >.

◆ GetColPermutationVector()

template<class MatrixType , class VectorType , typename DataType >
template IntVectorClass< int > & pargemslr::precond_ilu_csr_seq_complexd::GetColPermutationVector ( )

Get the column permutation vector.

◆ GetD()

template<class MatrixType , class VectorType , typename DataType >
template SequentialVectorClass< complexd > & pargemslr::precond_ilu_csr_seq_complexd::GetD ( )

Get the inverse of diagonal of the U matrix.

◆ GetE()

template<class MatrixType , class VectorType , typename DataType >
template CsrMatrixClass< complexd > & pargemslr::precond_ilu_csr_seq_complexd::GetE ( )

Get the U matrix of the ILU factorizaiton without diagonal.

◆ GetF()

template<class MatrixType , class VectorType , typename DataType >
template CsrMatrixClass< complexd > & pargemslr::precond_ilu_csr_seq_complexd::GetF ( )

Get the U matrix of the ILU factorizaiton without diagonal.

◆ GetL()

template<class MatrixType , class VectorType , typename DataType >
template CsrMatrixClass< complexd > & pargemslr::precond_ilu_csr_seq_complexd::GetL ( )

Get the L matrix of the ILU factorizaiton without diagonal.

◆ GetNB()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::GetNB ( )

Get the U matrix of the ILU factorizaiton without diagonal.

◆ GetNumNonzeros()

template<class MatrixType , class VectorType , typename DataType >
template long int pargemslr::precond_ilu_csr_seq_complexd::GetNumNonzeros ( )
virtual

Get the total number of nonzeros the ILU.

Returns
Return the total number of nonzeros the ILU.

Reimplemented from pargemslr::SolverClass< MatrixType, VectorType, DataType >.

◆ GetRowPermutationVector()

template<class MatrixType , class VectorType , typename DataType >
template IntVectorClass< int > & pargemslr::precond_ilu_csr_seq_complexd::GetRowPermutationVector ( )

Get the row permutation vector.

◆ GetS()

template<class MatrixType , class VectorType , typename DataType >
template CsrMatrixClass< complexd > & pargemslr::precond_ilu_csr_seq_complexd::GetS ( )

Get the U matrix of the ILU factorizaiton without diagonal.

◆ GetSize()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::GetSize ( )

Get the size of the problem.

Returns
Return the problem size.

◆ GetU()

template<class MatrixType , class VectorType , typename DataType >
template CsrMatrixClass< complexd > & pargemslr::precond_ilu_csr_seq_complexd::GetU ( )

Get the U matrix of the ILU factorizaiton without diagonal.

◆ MinHeapAdd_NNR()

template<class MatrixType , class VectorType , typename DataType >
template<typename T1 , typename T2 >
static void pargemslr::IluClass< MatrixType, VectorType, DataType >::MinHeapAdd_NNR ( int *  heap,
T1 *  v1,
T2 *  v2,
int  len 
)
inlinestatic

Add value to a min heap. NNR stands for normal (heap from left to right), normal (v1 based on normal order), reverse (v2 based on index order).
That is, the heap starts from heap[0], and goes to heap[1] ...
When swaping elements in the heap, elements in v1 swap in the same way (swap heap[i]<->heap[j] and v1[i]<->v1[j]). When swaping elements in the heap, elements in v2 swap in based on the heap value (swap heap[i]<->heap[j] and v1[heal[i]]<->v1[heap[j]]).

Parameters
[in]heapThe heap.
[in]v1The second array.
[in]v2The third array.
[in]lenThe length.

◆ MinHeapRemovd_NNR()

template<class MatrixType , class VectorType , typename DataType >
template<typename T1 , typename T2 >
static void pargemslr::IluClass< MatrixType, VectorType, DataType >::MinHeapRemovd_NNR ( int *  heap,
T1 *  v1,
T2 *  v2,
int  len 
)
inlinestatic

Remove value from a min heap. NNR stands for normal (heap from left to right), normal (v1 based on normal order), reverse (v2 based on index order).
That is, the heap starts from heap[0], and goes to heap[1] ...
When swaping elements in the heap, elements in v1 swap in the same way (swap heap[i]<->heap[j] and v1[i]<->v1[j]). When swaping elements in the heap, elements in v2 swap in based on the heap value (swap heap[i]<->heap[j] and v1[heal[i]]<->v1[heap[j]]).

Parameters
[in]heapThe heap.
[in]v1The second array.
[in]v2The third array.
[in]lenThe length.

◆ MoveData()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::MoveData ( const int &  location)
virtual

Move the preconditioner to another location. Only can be called after Setup.

Parameters
[in]locationThe target solver location.
Returns
Return error message.

◆ operator=() [1/2]

template<class MatrixType , class VectorType , typename DataType >
IluClass< MatrixType, VectorType, DataType > & pargemslr::IluClass< MatrixType, VectorType, DataType >::operator= ( const IluClass< MatrixType, VectorType, DataType > &  precond)

The operator = of precondioner class.

◆ operator=() [2/2]

template<class MatrixType , class VectorType , typename DataType >
IluClass< MatrixType, VectorType, DataType > & pargemslr::IluClass< MatrixType, VectorType, DataType >::operator= ( IluClass< MatrixType, VectorType, DataType > &&  precond)

The operator = of precondioner class.

◆ Qsplit()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
static void pargemslr::IluClass< MatrixType, VectorType, DataType >::Qsplit ( T *  a,
int *  ind,
int  left,
int  bound,
int  right 
)
inlinestatic

Does a quick-sort split of a real array.

Parameters
[in/out]athe array to sort.
[in]indpermuted indices.
[in]nlength of the array.
[in]leftthe start location.
[in]splitfrom here.
[in]rightthe end location.
Returns
Return error message.

◆ SetDropTolerance()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::SetDropTolerance ( droptol)
inline

Set the drop tols for ILUT.

Parameters
[in]droptolThe new drop tol for ILUT.
Returns
Return error message.

◆ SetDropToleranceEF()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::SetDropToleranceEF ( droptol_ef)
inline

Set the drop tols in E, F part for Partial ILUT.

Parameters
[in]droptol_efThe new drop tol in E, F part for Partial ILUT.
Returns
Return error message.

◆ SetDropToleranceS()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::SetDropToleranceS ( droptol_s)
inline

Set the drop tols in S part for Partial ILUT.

Parameters
[in]droptol_efThe new drop tol in S part for Partial ILUT.
Returns
Return error message.

◆ SetIluComplexShift()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::SetIluComplexShift ( bool  complex_shift)
inline

Set if we turn on the complex shift or not (complex version only).

Parameters
[in]complex_shiftThe new drop tol for ILUT.
Returns
Return error message.

◆ SetLevelOfFill()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::SetLevelOfFill ( int  lfil)
inline

Set the level of fill for ILU(K).

Parameters
[in]lfilThe new level of fill for ILU(K).
Returns
Return error message.

◆ SetMaxNnzPerRow()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::SetMaxNnzPerRow ( int  max_row_nnz)

Set the max fill allowed for each row/col of L and U.

Parameters
[in]max_row_nnzThe new max fill allowed for each row/col of L and U.
Returns
Return error message.

◆ SetMaxNnzPerRowSPart()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::SetMaxNnzPerRowSPart ( int  max_row_nnz_s)

Set the max fill allowed for each row/col of S in partial ILU.

Parameters
[in]max_row_nnz_sThe new max fill allowed for each row/col of S in partial ILU.
Returns
Return error message.

◆ SetModified()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::SetModified ( bool  modified)

Enable/Disable modified ILU.

Parameters
[in]modifiedThe new ILUT option.
Returns
Return error message.

◆ SetModifiedShift()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::SetModifiedShift ( milu_shift)
inline

Set the shift for the modified ILU.

Parameters
[in]milu_shiftThe shift for the modified ILU.
Returns
Return error message.

◆ SetNB()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::SetNB ( int  nB)

Set the size of the B block.

Parameters
[in]nBThe number of nodes in the B block.
Returns
Return error message.

◆ SetOpenMPOption()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::SetOpenMPOption ( int  omp_option)

Set the OpenMP option. See IluOpenMPOptionEnum.

Parameters
[in]omp_optionThe new OpenMP option.
Returns
Return error message.

◆ SetOption()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::SetOption ( int  option)

Set the ILU option. See IluOptionEnum.

Parameters
[in]optionThe new ILUT option.
Returns
Return error message.

◆ SetPermutationOption()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::SetPermutationOption ( int  perm_option)

Set the ILU permutation option. See IluReorderingOptionEnum.

Parameters
[in]perm_optionThe new ILU permutation option.
Returns
Return error message.

◆ SetPolyOrder()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::SetPolyOrder ( int  order)

Set the polynomia order in some OpenMP option. See IluOpenMPOptionEnum.

Parameters
[in]orderThe new order.
Returns
Return error message.

◆ SetSolveLocation()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_ilu_csr_seq_complexd::SetSolveLocation ( const int &  location)
virtual

Set the data location that the preconditioner apply to.

Parameters
[in]locationThe target solver location.
Returns
Return error message.

Implements pargemslr::SolverClass< MatrixType, VectorType, DataType >.

◆ Setup() [1/2]

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::Setup ( MatrixType &  L_mat,
VectorType &  D_vec,
MatrixType &  U_mat,
int *  pperm,
int *  qperm 
)

Setup ILU with exist factorization L, D, and U. The lower triangular part of L, inverse of diagonal of U, and the upper triangular part of U.

Parameters
[in]L_matthe lower triangular part of L.
[in]D_vecthe inverse of diagonal of U.
[in]U_matthe upper triangular part of U.
[in]ppermthe row permutation vector, set to NULL to use the nature ordering.
[in]qpermthe col permutation vector, set to NULL to use the nature ordering.
Returns
Return error message.

◆ Setup() [2/2]

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::Setup ( VectorType &  x,
VectorType &  rhs 
)
virtual

Setup the precondioner phase. Will be called by the solver if not called directly.

Parameters
[in]xThe initial guess.
[in]rhsThe right-hand-side.
Returns
Return error message.

Implements pargemslr::SolverClass< MatrixType, VectorType, DataType >.

◆ SetupILUK()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::SetupILUK ( VectorType &  x,
VectorType &  rhs 
)

Setup ILU(K).

Parameters
[in]xThe initial guess.
[in]rhsThe right-hand-side.
Returns
Return error message.

◆ SetupILUT()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::SetupILUT ( VectorType &  x,
VectorType &  rhs 
)

Setup ILUT, ingore the ilu option.

Parameters
[in]xThe initial guess.
[in]rhsThe right-hand-side.
Returns
Return error message.

◆ SetupPartialILUT()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::SetupPartialILUT ( VectorType &  x,
VectorType &  rhs 
)

Setup Partial ILUT, form approximate Schur Complement.

Parameters
[in]xThe initial guess.
[in]rhsThe right-hand-side.
Returns
Return error message.

◆ SetupPermutation()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::SetupPermutation ( VectorType &  x,
VectorType &  rhs 
)

Build the permutation vector.

Parameters
[in]xThe initial guess.
[in]rhsThe right-hand-side.
Returns
Return error message.

◆ SetWithParameterArray()

template<class MatrixType , class VectorType , typename DataType >
virtual int pargemslr::IluClass< MatrixType, VectorType, DataType >::SetWithParameterArray ( double *  params)
inlinevirtual

Setup with parameter array.

Parameters
[in]paramsThe parameter array.
Returns
Return error message.

Reimplemented from pargemslr::SolverClass< MatrixType, VectorType, DataType >.

◆ Solve()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::Solve ( VectorType &  x,
VectorType &  rhs 
)
virtual

Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is used.

Parameters
[in,out]xThe initial guess.
[in]rhsThe right-hand-side.
Returns
Return error message.

Implements pargemslr::SolverClass< MatrixType, VectorType, DataType >.

◆ SolveL()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::SolveL ( VectorType &  x,
VectorType &  rhs 
)

Solve with L only. Call this function after Setup. Solve with cusparse if unified memory/device memory is used.

Parameters
[in,out]xThe initial guess.
[in]rhsThe right-hand-side.
Returns
Return error message.

◆ SolveU()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::IluClass< MatrixType, VectorType, DataType >::SolveU ( VectorType &  x,
VectorType &  rhs 
)

Solve with U only. Call this function after Setup. Solve with cusparse if unified memory/device memory is used.

Parameters
[in,out]xThe initial guess.
[in]rhsThe right-hand-side.
Returns
Return error message.

◆ Swap() [1/2]

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
static void pargemslr::IluClass< MatrixType, VectorType, DataType >::Swap ( T *  v,
int  i,
int  j 
)
inlinestatic

Swap v[i] and v[j].

Parameters
[in]vThe array.
[in]iThe first index.
[in]jThe second index.

◆ Swap() [2/2]

template<class MatrixType , class VectorType , typename DataType >
template<typename T1 , typename T2 >
static void pargemslr::IluClass< MatrixType, VectorType, DataType >::Swap ( T1 *  v,
T2 *  w,
int  i,
int  j 
)
inlinestatic

Swap v[i] and v[j], w[i] and w[j].

Parameters
[in]vThe first array.
[in]wThe second array.
[in]iThe first index.
[in]jThe second index.

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