00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SELDON_FILE_ILUT_PRECONDITIONING_HXX
00021
00022 namespace Seldon
00023 {
00024
00025 template<class real, class cplx,
00026 class Allocator = SELDON_DEFAULT_ALLOCATOR<cplx> >
00027 class IlutPreconditioning
00028 {
00029 protected :
00031 int print_level;
00033 bool symmetric_algorithm;
00035 int type_ilu;
00039 int fill_level;
00043 int additional_fill;
00045 int mbloc;
00047 real alpha;
00049 real droptol;
00051 real permtol;
00053 IVect permutation_row, permutation_col;
00055 Matrix<cplx, Symmetric, ArrayRowSymSparse, Allocator> mat_sym;
00057 Matrix<cplx, General, ArrayRowSparse, Allocator> mat_unsym;
00059 Vector<cplx, VectFull, Allocator> xtmp;
00060
00061 public :
00062
00064 enum {ILUT, ILU_D, ILUT_K, ILU_0, MILU_0, ILU_K};
00065
00066 IlutPreconditioning();
00067
00068 void Clear();
00069
00070 int GetFactorisationType() const;
00071 int GetFillLevel() const;
00072 int GetAdditionalFillNumber() const;
00073 int GetPrintLevel() const;
00074 int GetPivotBlockInteger() const;
00075
00076 void SetFactorisationType(int);
00077 void SetFillLevel(int);
00078 void SetAdditionalFillNumber(int);
00079 void SetPrintLevel(int);
00080 void SetPivotBlockInteger(int);
00081 void SetSymmetricAlgorithm();
00082 void SetUnsymmetricAlgorithm();
00083
00084 real GetDroppingThreshold() const;
00085 real GetDiagonalCoefficient() const;
00086 real GetPivotThreshold() const;
00087
00088 void SetDroppingThreshold(real);
00089 void SetDiagonalCoefficient(real);
00090 void SetPivotThreshold(real);
00091
00092 template<class MatrixSparse>
00093 void FactorizeSymMatrix(const IVect& perm,
00094 MatrixSparse& mat, bool keep_matrix = false);
00095
00096 template<class MatrixSparse>
00097 void FactorizeUnsymMatrix(const IVect& perm,
00098 MatrixSparse& mat, bool keep_matrix = false);
00099
00100 template<class T0, class Storage0, class Allocator0>
00101 void FactorizeMatrix(const IVect& perm,
00102 Matrix<T0, General, Storage0, Allocator0>& mat,
00103 bool keep_matrix = false);
00104
00105 template<class T0, class Storage0, class Allocator0>
00106 void FactorizeMatrix(const IVect& perm,
00107 Matrix<T0, Symmetric, Storage0, Allocator0>& mat,
00108 bool keep_matrix = false);
00109
00110 template<class Matrix1, class Vector1>
00111 void TransSolve(const Matrix1& A, const Vector1& r, Vector1& z);
00112
00113 template<class Matrix1, class Vector1>
00114 void Solve(const Matrix1& A, const Vector1& r, Vector1& z);
00115
00116 template<class Vector1>
00117 void TransSolve(Vector1& z);
00118
00119 template<class Vector1>
00120 void Solve(Vector1& z);
00121
00122 template<class TransStatus, class Vector1>
00123 void Solve(const TransStatus& transA, Vector1& z);
00124
00125 };
00126
00127 }
00128
00129 #define SELDON_FILE_ILUT_PRECONDITIONING_HXX
00130 #endif