ParGeMSLR
ilu.hpp
Go to the documentation of this file.
1 #ifndef PARGEMSLR_ILU_H
2 #define PARGEMSLR_ILU_H
3 
8 #include <iostream>
9 
10 #include "../utils/utils.hpp"
11 #include "../vectors/int_vector.hpp"
12 #include "../vectors/sequential_vector.hpp"
13 #include "../matrices/csr_matrix.hpp"
14 #include "../solvers/solver.hpp"
15 
16 /* IMPORTANT NOTE:
17  * this file contains some functions from the package HYPRE
18  * parcsr_ls/par_ilu_setup.c
19  * parcsr_ls/par_ilu_solve.c
20  *
21  * Modifications are made to fit the ParGEMSLR data structure
22  * the following is the license statement of HYPRE
23  *
24  * Include the following functions:
25  *
26  * ----------------------------------------------------------------------------------------------------------------
27  *
28  * Intellectual Property Notice
29  * ----------------------------
30  * HYPRE is licensed under the Apache License, Version 2.0 (see LICENSE-APACHE or
31  * http://www.apache.org/licenses/LICENSE-2.0) or the MIT license (see LICENSE-MIT
32  * or http://opensource.org/licenses/MIT), at your option.
33  *
34  * Copyrights and patents in the HYPRE project are retained by contributors.
35  * No copyright assignment is required to contribute to HYPRE.
36  *
37  * HYPRE's original open source license was LGPL-2.1. Consent from contributors
38  * was received and documented before relicensing to Apache-2.0/MIT.
39  *
40  * SPDX usage
41  * ----------
42  *
43  * Individual files contain SPDX tags instead of the full license text.
44  * This enables machine processing of license information based on the SPDX
45  * License Identifiers that are available here: https://spdx.org/licenses/
46  *
47  * Files that are dual-licensed as Apache-2.0 OR MIT contain the following
48  * text in the license header:
49  *
50  * SPDX-License-Identifier: (Apache-2.0 OR MIT)
51  *
52  *
53  * External Software
54  * -----------------
55  *
56  * External software in hypre is covered by various permissive licenses. A summary
57  * listing follows. See the license included with the software for full details.
58  *
59  * Directory: src/blas
60  * License: University of Tennessee
61  *
62  * Directory: src/lapack
63  * License: University of Tennessee
64  *
65  * ----------------------------------------------------------------------------------------------------------------
66  *
67  */
68 
69 #ifdef PARGEMSLR_CUDA
70 #include "cusparse.h"
71 #endif
72 
73 namespace pargemslr
74 {
75 
81  {
82  kIluOptionILUT,
83  kIluOptionPartialILUT,
84  kIluOptionILUK
85  };
86 
93  {
94  kIluReorderingNo,
95  kIluReorderingRcm,
96  kIluReorderingAmd,
97  kIluReorderingNd,
98  kIluReorderingDdpq,
99  kIluReorderingInput
100  };
101 
108  {
109  kIluOpenMPNo,
110  kIluOpenMPLevelScheduling,
111  kIluOpenMPPoly
112  };
113 
118  template <class MatrixType, class VectorType, typename DataType>
119  class IluClass: public SolverClass<MatrixType, VectorType, DataType>
120  {
121  private:
122 
127  DataType _diag_shift_milu;
128 
133  VectorType _x_temp;
134 
135 #ifdef PARGEMSLR_CUDA
136 
142 
147  csrsv2Info_t _matL_info;
148 
153  csrsv2Info_t _matU_info;
154 
155 #endif
156 
161  int _n;
162 
167  int _nnz;
168 
173  bool _complex_shift;
174 
180 
186 
192 
197  int _nB;
198 
204 
210 
216 
217 #ifdef PARGEMSLR_OPENMP
218 
223  VectorType _y_temp;
224 
229  VectorType _z_temp;
230 
235  CsrMatrixClass<DataType> _L_poly;
236 
241  CsrMatrixClass<DataType> _D_poly;
242 
247  CsrMatrixClass<DataType> _U_poly;
248 
253  CsrMatrixClass<DataType> _L_level;
254 
260 
265  CsrMatrixClass<DataType> _U_level;
266 
271  vector_int _level_ptr_l;
272 
277  vector_int _levels_l;
278 
283  vector_int _level_ptr_u;
284 
289  vector_int _levels_u;
290 
295  int _levels_l_start;
296 
301  int _levels_l_end;
302 
307  int _levels_u_start;
308 
313  int _levels_u_end;
314 
315 #endif
316 
321  int _fill_level;
322 
327  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
328  double,
329  float>::type _droptol;
330 
335  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
336  double,
337  float>::type _droptol_ef;
338 
343  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
344  double,
345  float>::type _droptol_s;
346 
351  int _max_row_nnz;
352 
357  int _max_row_nnz_s;
358 
363  int _option;
364 
369  int _omp_option;
370 
375  int _poly_order;
376 
381  int _perm_option;
382 
387  bool _modified;
388 
393  IntVectorClass<int> _row_perm_vec;
394 
399  IntVectorClass<int> _col_perm_vec;
400 
405  int _location;
406 
411  int _matrix_location;
412 
417  int _cusparse_ready;
418 
427  template <typename T>
428  int ApplyShift( T &w, int nz, T norm);
429 
439  template <typename T>
440  int ApplyShift( ComplexValueClass<T> &w, int nz, T norm);
441 
451  template <typename T>
452  int Qsplit(T *a, int *ind, int n, int Ncut);
453 
471  int SetupILUKSymbolic( int n, int *A_i, int *A_j, int lfil, int *perm, int *qperm, int *rqperm, int *iw, int *L_i, int *U_i, int **L_jp, int **U_jp);
472 
480  virtual int SolveHost( VectorType &x, VectorType &rhs);
481 
489  virtual int SolveLHost( VectorType &x, VectorType &rhs);
490 
498  virtual int SolveUHost( VectorType &x, VectorType &rhs);
499 
500 #ifdef PARGEMSLR_CUDA
501 
509  virtual int SolveDevice( VectorType &x, VectorType &rhs);
510 
518  int SolveLDevice( VectorType &x, VectorType &rhs);
519 
527  int SolveUDevice( VectorType &x, VectorType &rhs);
528 
529 #endif
530 
531 #ifdef PARGEMSLR_OPENMP
532 
538  int BuildLevels();
539 
545  int BuildPoly();
546 
554  int SolveHostOmp( VectorType &x, VectorType &rhs);
555 
565  int SolveHostOmpPoly( VectorType &x, VectorType &rhs, int option);
566 
567 #endif
568 
569  public:
570 
575  IluClass();
576 
582 
588 
594 
600 
606  virtual int Clear();
607 
612  virtual ~IluClass();
613 
621  virtual int Setup( VectorType &x, VectorType &rhs);
622 
633  int Setup(MatrixType &L_mat, VectorType &D_vec, MatrixType &U_mat, int *pperm, int *qperm);
634 
642  int SetupPermutation( VectorType &x, VectorType &rhs);
643 
651  int SetupILUT( VectorType &x, VectorType &rhs);
652 
660  int SetupILUK( VectorType &x, VectorType &rhs);
661 
669  template <typename T>
670  static void Swap( T *v, int i, int j)
671  {
672  T temp;
673  temp = v[i];
674  v[i] = v[j];
675  v[j] = temp;
676  }
677 
686  template <typename T1, typename T2>
687  static void Swap(T1 *v, T2 *w, int i, int j)
688  {
689  T1 temp;
690  T2 temp2;
691 
692  temp = v[i];
693  v[i] = v[j];
694  v[j] = temp;
695  temp2 = w[i];
696  w[i] = w[j];
697  w[j] = temp2;
698  }
699 
710  template <typename T1, typename T2>
711  static void AbsMinHeapAdd_RN(T1 *heap, T2 *v, int len)
712  {
713  /* parent, left, right */
714  int p;
715  len--;/* now len is the current index */
716  while(len > 0)
717  {
718  /* get the parent index */
719  p = (len-1)/2;
720  if(PargemslrAbs(heap[-p]) < PargemslrAbs(heap[-len]))
721  {
722  /* this is smaller */
724  len = p;
725  }
726  else
727  {
728  break;
729  }
730  }
731  }
732 
743  template <typename T1, typename T2>
744  static void AbsMinHeapRemove_RN(T1 *heap, T2 *v, int len)
745  {
746  /* parent, left, right */
747  int p,l,r;
748  len--;/* now len is the max index */
749  /* swap the first element to last */
751  p = 0;
752  l = 1;
753  /* while I'm still in the heap */
754  while(l < len)
755  {
756  r = 2*p+2;
757  /* two childs, pick the smaller one */
758  l = r >= len || PargemslrAbs(heap[-l])>PargemslrAbs(heap[-r]) ? l : r;
759  if(PargemslrAbs(heap[-l])>PargemslrAbs(heap[-p]))
760  {
762  p = l;
763  l = 2*p+1;
764  }
765  else
766  {
767  break;
768  }
769  }
770  }
771 
783  template <typename T1, typename T2>
784  static void MinHeapAdd_NNR(int *heap, T1 *v1, T2 *v2, int len)
785  {
786  /* parent, left, right */
787  int p;
788  len--;/* now len is the current index */
789  while(len > 0)
790  {
791  /* get the parent index */
792  p = (len-1)/2;
793  if(heap[p] > heap[len])
794  {
795  /* this is smaller */
798  len = p;
799  }
800  else
801  {
802  break;
803  }
804  }
805  }
806 
818  template <typename T1, typename T2>
819  static void MinHeapRemovd_NNR(int *heap, T1 *v1, T2 *v2, int len)
820  {
821  /* parent, left, right */
822  int p,l,r;
823  len--;/* now len is the max index */
824  /* swap the first element to last */
827  p = 0;
828  l = 1;
829  /* while I'm still in the heap */
830  while(l < len)
831  {
832  r = 2*p+2;
833  /* two childs, pick the smaller one */
834  l = r >= len || heap[l]<heap[r] ? l : r;
835  if(heap[l]<heap[p])
836  {
839  p = l;
840  l = 2*p+1;
841  }
842  else
843  {
844  break;
845  }
846  }
847  }
848 
860  template <typename T>
861  static void Qsplit(T *a, int *ind, int left, int bound, int right)
862  {
863  int i, last;
864  if (left >= right)
865  {
866  return;
867  }
868  IluClass<MatrixType, VectorType, DataType>::Swap<int, T>( ind, a, left, (left+right)/2);
869  last = left;
870  for(i = left + 1 ; i <= right ; i ++)
871  {
872  if(PargemslrAbs(a[i]) > PargemslrAbs(a[left]))
873  {
875  }
876  }
878  IluClass<MatrixType, VectorType, DataType>::Qsplit<T>( a, ind, left, bound, last-1);
879  if(bound > last)
880  {
881  IluClass<MatrixType, VectorType, DataType>::Qsplit<T>( a, ind, last+1, bound, right);
882  }
883  }
884 
892  int SetupPartialILUT(VectorType &x, VectorType &rhs);
893 
901  virtual int Solve( VectorType &x, VectorType &rhs);
902 
910  int SolveL( VectorType &x, VectorType &rhs);
911 
919  int SolveU( VectorType &x, VectorType &rhs);
920 
927  virtual int SetSolveLocation( const int &location);
928 
935  virtual int MoveData( const int &location);
936 
937  /* --------- SETS and GETS ----------- */
938 
945  virtual int SetWithParameterArray(double *params)
946  {
947  if(this->_ready)
948  {
949  PARGEMSLR_ERROR("Change setup after preconditioner is built.");
950  return PARGEMSLR_ERROR_FUNCTION_CALL_ERR;
951  }
952 
953  this->_droptol = params[PARGEMSLR_IO_ILU_DROPTOL_B_LOCAL];
954  this->_droptol_ef = params[PARGEMSLR_IO_ILU_DROPTOL_EF_LOCAL];
955  this->_droptol_s = params[PARGEMSLR_IO_ILU_DROPTOL_S_LOCAL];
956  this->_max_row_nnz = params[PARGEMSLR_IO_ILU_ROWNNZ_B_LOCAL];
957  this->_max_row_nnz_s = params[PARGEMSLR_IO_ILU_ROWNNZ_S_LOCAL];
958  this->_perm_option = params[PARGEMSLR_IO_ILU_PERM_OPTION_LOCAL];
959  this->_omp_option = params[PARGEMSLR_IO_ILU_OMP_OPTION_LOCAL];
960  this->_poly_order = params[PARGEMSLR_IO_POLY_ORDER];
961  this->_print_option = params[PARGEMSLR_IO_GENERAL_PRINT_LEVEL];
962  this->_complex_shift = params[PARGEMSLR_IO_ADVANCED_USE_COMPLEX_SHIFT] != 0.0;
963  this->_diag_shift_milu = params[PARGEMSLR_IO_ADVANCED_DIAG_SHIFT_MODIFIED];
964 
965  return PARGEMSLR_SUCCESS;
966  }
967 
974  int SetLevelOfFill( int lfil)
975  {
976  this->_fill_level = lfil;
977  return PARGEMSLR_SUCCESS;
978  }
979 
986  int SetIluComplexShift( bool complex_shift)
987  {
988  this->_complex_shift = complex_shift;
989  return PARGEMSLR_SUCCESS;
990  }
991 
998  template <typename T>
999  int SetDropTolerance( T droptol)
1000  {
1001  this->_droptol = droptol;
1002  return PARGEMSLR_SUCCESS;
1003  }
1004 
1011  template <typename T>
1012  int SetDropToleranceEF( T droptol_ef)
1013  {
1014  if(this->_ready)
1015  {
1016  PARGEMSLR_WARNING("Change setting after Setup is not going to change the preconditioner.");
1017  }
1018  this->_droptol_ef = droptol_ef;
1019  return PARGEMSLR_SUCCESS;
1020  }
1021 
1028  template <typename T>
1029  int SetDropToleranceS( T droptol_s)
1030  {
1031  if(this->_ready)
1032  {
1033  PARGEMSLR_WARNING("Change setting after Setup is not going to change the preconditioner.");
1034  }
1035  this->_droptol_s = droptol_s;
1036  return PARGEMSLR_SUCCESS;
1037  }
1038 
1045  int SetMaxNnzPerRow( int max_row_nnz);
1046 
1053  int SetMaxNnzPerRowSPart( int max_row_nnz_s);
1054 
1061  int SetNB(int nB);
1062 
1069  int SetOption( int option);
1070 
1077  int SetOpenMPOption( int omp_option);
1078 
1085  int SetPolyOrder( int order);
1086 
1093  int SetPermutationOption( int perm_option);
1094 
1101  int SetModified( bool modified);
1102 
1109  template <typename T>
1110  int SetModifiedShift( T milu_shift)
1111  {
1112  if(this->_ready)
1113  {
1114  PARGEMSLR_WARNING("Change setting after Setup is not going to change the preconditioner.");
1115  }
1116  this->_diag_shift_milu = milu_shift;
1117  return PARGEMSLR_SUCCESS;
1118  }
1119 
1125  int GetSize();
1126 
1132  virtual long int GetNumNonzeros();
1133 
1139 
1145 
1151 
1157 
1163 
1169 
1174  int GetNB();
1175 
1181 
1187 
1188  };
1189 
1190  typedef IluClass<CsrMatrixClass<float>, SequentialVectorClass<float>, float> precond_ilu_csr_seq_float;
1191  typedef IluClass<CsrMatrixClass<double>, SequentialVectorClass<double>, double> precond_ilu_csr_seq_double;
1192  typedef IluClass<CsrMatrixClass<complexs>, SequentialVectorClass<complexs>, complexs> precond_ilu_csr_seq_complexs;
1193  typedef IluClass<CsrMatrixClass<complexd>, SequentialVectorClass<complexd>, complexd> precond_ilu_csr_seq_complexd;
1194 
1195 }
1196 
1197 #endif
pargemslr::IluClass::Clear
virtual int Clear()
Free the current precondioner.
Definition: ilu.cpp:329
pargemslr::IluClass::SetModified
int SetModified(bool modified)
Enable/Disable modified ILU.
Definition: ilu.cpp:3843
pargemslr::IluOpenMPOptionEnum
IluOpenMPOptionEnum
The ilu OpenMP solve option.
Definition: ilu.hpp:108
pargemslr::IluClass::~IluClass
virtual ~IluClass()
The destructor of precondioner class.
Definition: ilu.cpp:317
pargemslr::IluClass::Solve
virtual int Solve(VectorType &x, VectorType &rhs)
Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is u...
Definition: ilu.cpp:3417
pargemslr::IluClass::Swap
static void Swap(T *v, int i, int j)
Swap v[i] and v[j].
Definition: ilu.hpp:670
pargemslr::IluClass::GetD
SequentialVectorClass< DataType > & GetD()
Get the inverse of diagonal of the U matrix.
Definition: ilu.cpp:3885
pargemslr::IluClass::SetOpenMPOption
int SetOpenMPOption(int omp_option)
Set the OpenMP option. See IluOpenMPOptionEnum.
Definition: ilu.cpp:3778
pargemslr::IluClass::SolveU
int SolveU(VectorType &x, VectorType &rhs)
Solve with U only. Call this function after Setup. Solve with cusparse if unified memory/device memor...
Definition: ilu.cpp:3479
pargemslr::IluClass::GetU
CsrMatrixClass< DataType > & GetU()
Get the U matrix of the ILU factorizaiton without diagonal.
Definition: ilu.cpp:3895
pargemslr::IluClass::SetupPermutation
int SetupPermutation(VectorType &x, VectorType &rhs)
Build the permutation vector.
Definition: ilu.cpp:607
pargemslr::IluClass::SetDropToleranceEF
int SetDropToleranceEF(T droptol_ef)
Set the drop tols in E, F part for Partial ILUT.
Definition: ilu.hpp:1012
pargemslr::IluClass::SetPolyOrder
int SetPolyOrder(int order)
Set the polynomia order in some OpenMP option. See IluOpenMPOptionEnum.
Definition: ilu.cpp:3818
pargemslr::SequentialVectorClass< DataType >
pargemslr::IluClass::SetWithParameterArray
virtual int SetWithParameterArray(double *params)
Setup with parameter array.
Definition: ilu.hpp:945
pargemslr::IluClass::GetF
CsrMatrixClass< DataType > & GetF()
Get the U matrix of the ILU factorizaiton without diagonal.
Definition: ilu.cpp:3905
pargemslr::IluClass::GetE
CsrMatrixClass< DataType > & GetE()
Get the U matrix of the ILU factorizaiton without diagonal.
Definition: ilu.cpp:3915
pargemslr::IluClass::GetRowPermutationVector
IntVectorClass< int > & GetRowPermutationVector()
Get the row permutation vector.
Definition: ilu.cpp:3945
pargemslr::IluClass::SetNB
int SetNB(int nB)
Set the size of the B block.
Definition: ilu.cpp:3742
pargemslr::IluClass::SetIluComplexShift
int SetIluComplexShift(bool complex_shift)
Set if we turn on the complex shift or not (complex version only).
Definition: ilu.hpp:986
pargemslr::IluClass::GetNumNonzeros
virtual long int GetNumNonzeros()
Get the total number of nonzeros the ILU.
Definition: ilu.cpp:3865
pargemslr::IluClass::AbsMinHeapRemove_RN
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 l...
Definition: ilu.hpp:744
pargemslr::IluClass::SetPermutationOption
int SetPermutationOption(int perm_option)
Set the ILU permutation option. See IluReorderingOptionEnum.
Definition: ilu.cpp:3831
pargemslr::IluClass::SetLevelOfFill
int SetLevelOfFill(int lfil)
Set the level of fill for ILU(K).
Definition: ilu.hpp:974
pargemslr::IluClass::SetDropToleranceS
int SetDropToleranceS(T droptol_s)
Set the drop tols in S part for Partial ILUT.
Definition: ilu.hpp:1029
pargemslr::SolverClass::_ready
bool _ready
If the solver is ready.
Definition: solver.hpp:108
pargemslr::IluOptionEnum
IluOptionEnum
The ilu option.
Definition: ilu.hpp:81
pargemslr::SolverClass
The base solver class.
Definition: solver.hpp:47
pargemslr::ComplexValueClass
The template class complex.
Definition: complex.hpp:24
pargemslr::IntVectorClass< int >
pargemslr::IluClass::Setup
virtual int Setup(VectorType &x, VectorType &rhs)
Setup the precondioner phase. Will be called by the solver if not called directly.
Definition: ilu.cpp:381
pargemslr::IluClass::SetOption
int SetOption(int option)
Set the ILU option. See IluOptionEnum.
Definition: ilu.cpp:3760
pargemslr::IluClass::GetNB
int GetNB()
Get the U matrix of the ILU factorizaiton without diagonal.
Definition: ilu.cpp:3935
pargemslr::IluClass::Qsplit
static void Qsplit(T *a, int *ind, int left, int bound, int right)
Does a quick-sort split of a real array.
Definition: ilu.hpp:861
pargemslr::IluClass::MinHeapAdd_NNR
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 ...
Definition: ilu.hpp:784
pargemslr::IluClass::SolveL
int SolveL(VectorType &x, VectorType &rhs)
Solve with L only. Call this function after Setup. Solve with cusparse if unified memory/device memor...
Definition: ilu.cpp:3448
pargemslr::SolverClass::_print_option
int _print_option
The print option.
Definition: solver.hpp:114
pargemslr::IluClass::SetSolveLocation
virtual int SetSolveLocation(const int &location)
Set the data location that the preconditioner apply to.
Definition: ilu.cpp:3965
pargemslr::IluClass::SetMaxNnzPerRow
int SetMaxNnzPerRow(int max_row_nnz)
Set the max fill allowed for each row/col of L and U.
Definition: ilu.cpp:3718
pargemslr::IluClass
The local ilu preconditioner, only work for sequential CSR matrix.
Definition: ilu.hpp:120
pargemslr::IluClass::GetL
CsrMatrixClass< DataType > & GetL()
Get the L matrix of the ILU factorizaiton without diagonal.
Definition: ilu.cpp:3875
pargemslr::IluClass::SetDropTolerance
int SetDropTolerance(T droptol)
Set the drop tols for ILUT.
Definition: ilu.hpp:999
pargemslr::IluClass::GetS
CsrMatrixClass< DataType > & GetS()
Get the U matrix of the ILU factorizaiton without diagonal.
Definition: ilu.cpp:3925
pargemslr::IluClass::IluClass
IluClass()
The constructor of precondioner class.
Definition: ilu.cpp:18
pargemslr::IluClass::MinHeapRemovd_NNR
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 no...
Definition: ilu.hpp:819
pargemslr::IluClass::AbsMinHeapAdd_RN
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),...
Definition: ilu.hpp:711
pargemslr::IluClass::SetupPartialILUT
int SetupPartialILUT(VectorType &x, VectorType &rhs)
Setup Partial ILUT, form approximate Schur Complement.
Definition: ilu.cpp:2711
pargemslr::IluClass::operator=
IluClass< MatrixType, VectorType, DataType > & operator=(const IluClass< MatrixType, VectorType, DataType > &precond)
The operator = of precondioner class.
Definition: ilu.cpp:179
pargemslr::IluReorderingOptionEnum
IluReorderingOptionEnum
The ilu reordering option.
Definition: ilu.hpp:93
pargemslr::IluClass::GetSize
int GetSize()
Get the size of the problem.
Definition: ilu.cpp:3855
pargemslr::IluClass::SetMaxNnzPerRowSPart
int SetMaxNnzPerRowSPart(int max_row_nnz_s)
Set the max fill allowed for each row/col of S in partial ILU.
Definition: ilu.cpp:3730
pargemslr::IluClass::SetupILUT
int SetupILUT(VectorType &x, VectorType &rhs)
Setup ILUT, ingore the ilu option.
Definition: ilu.cpp:1632
pargemslr::CsrMatrixClass< DataType >
pargemslr::IluClass::SetupILUK
int SetupILUK(VectorType &x, VectorType &rhs)
Setup ILU(K).
Definition: ilu.cpp:2148
pargemslr::IluClass::SetModifiedShift
int SetModifiedShift(T milu_shift)
Set the shift for the modified ILU.
Definition: ilu.hpp:1110
pargemslr::IluClass::MoveData
virtual int MoveData(const int &location)
Move the preconditioner to another location. Only can be called after Setup.
Definition: ilu.cpp:3984
pargemslr::IluClass::Swap
static void Swap(T1 *v, T2 *w, int i, int j)
Swap v[i] and v[j], w[i] and w[j].
Definition: ilu.hpp:687
pargemslr::IluClass::GetColPermutationVector
IntVectorClass< int > & GetColPermutationVector()
Get the column permutation vector.
Definition: ilu.cpp:3955