19 #ifndef SELDON_FILE_COMPUTATION_SPARSE_DIRECT_SOLVER_HXX
43 double pivot_threshold;
51 enum {SELDON_SOLVER, UMFPACK, SUPERLU, MUMPS, PASTIX, ILUT, PARDISO, WSMP};
54 enum {FACTO_OK, STRUCTURALLY_SINGULAR_MATRIX,
55 NUMERICALLY_SINGULAR_MATRIX, OUT_OF_MEMORY, INVALID_ARGUMENT,
56 INCORRECT_NUMBER_OF_ROWS, MATRIX_INDICES_INCORRECT,
57 INVALID_PERMUTATION, ORDERING_FAILED, INTERNAL_ERROR,
83 void RefineSolution();
84 void DoNotRefineSolution();
86 void SetCoefficientEstimationNeededMemory(
double);
87 void SetMaximumCoefficientEstimationNeededMemory(
double);
88 void SetIncreaseCoefficientEstimationNeededMemory(
double);
101 bool AffectOrdering();
103 template<
class T0,
class Prop,
class Storage,
class Alloc>
111 template<
class Prop,
class Storage,
class Allocator>
112 void Factorize(Matrix<T, Prop, Storage, Allocator>& A,
113 bool keep_matrix =
false);
115 template<
class Prop,
class Storage,
class Allocator>
118 template<
class Prop,
class Storage,
class Allocator>
123 void Solve(Vector<T>& x);
124 void Solve(
const SeldonTranspose& TransA, Vector<T>& x,
bool assemble =
true);
126 void Solve(Matrix<T, General, ColMajor>& x);
127 void Solve(
const SeldonTranspose&, Matrix<T, General, ColMajor>& x);
129 #ifdef SELDON_WITH_MPI
130 template<
class T
int0,
class T
int1>
131 void FactorizeDistributed(MPI_Comm& comm_facto,
132 Vector<Tint0>& Ptr, Vector<Tint1>& IndRow,
133 Vector<T>& Val,
const IVect& glob_num,
134 bool sym,
bool keep_matrix =
false);
136 template<
class T
int0,
class T
int1>
137 void PerformAnalysisDistributed(MPI_Comm& comm_facto,
138 Vector<Tint0>& Ptr, Vector<Tint1>& IndRow,
139 Vector<T>& Val,
const IVect& glob_num,
140 bool sym,
bool keep_matrix =
false);
142 template<
class T
int0,
class T
int1>
143 void PerformFactorizationDistributed(MPI_Comm& comm_facto,
144 Vector<Tint0>& Ptr, Vector<Tint1>& IndRow,
145 Vector<T>& Val,
const IVect& glob_num,
146 bool sym,
bool keep_matrix =
false);
148 void SolveDistributed(MPI_Comm& comm_facto, Vector<T>& x_solution,
149 const IVect& glob_number);
151 void SolveDistributed(MPI_Comm& comm_facto,
152 const SeldonTranspose& TransA, Vector<T>& x_solution,
153 const IVect& glob_number);
155 void SolveDistributed(MPI_Comm& comm_facto,
156 Matrix<T, General, ColMajor>& x_solution,
157 const IVect& glob_number);
159 void SolveDistributed(MPI_Comm& comm_facto,
160 const SeldonTranspose& TransA,
161 Matrix<T, General, ColMajor>& x_solution,
162 const IVect& glob_number);
167 #ifdef SELDON_WITH_MPI
169 void SolveLU_Distributed(MPI_Comm& comm,
const SeldonTranspose& transA,
170 SparseDirectSolver<T>& mat_lu,
171 Vector<T>& x, Vector<int>& global_col);
174 void SolveLU_Distributed(MPI_Comm& comm,
const SeldonTranspose& transA,
175 SparseDirectSolver<complex<T> >& mat_lu,
176 Vector<T>& x, Vector<int>& global_col);
179 void SolveLU_Distributed(MPI_Comm& comm,
const SeldonTranspose& transA,
180 SparseDirectSolver<T>& mat_lu,
181 Vector<complex<T> >& x, Vector<int>& global_col);
184 void SolveLU_Distributed(MPI_Comm& comm,
const SeldonTranspose& transA,
185 SparseDirectSolver<T>& mat_lu,
186 Matrix<T, General, ColMajor>& x, Vector<int>& global_col);
189 void SolveLU_Distributed(MPI_Comm& comm,
const SeldonTranspose& transA,
190 SparseDirectSolver<complex<T> >& mat_lu,
191 Matrix<T, General, ColMajor>& x, Vector<int>& global_col);
194 void SolveLU_Distributed(MPI_Comm& comm,
const SeldonTranspose& transA,
195 SparseDirectSolver<T>& mat_lu,
196 Matrix<complex<T>, General, ColMajor>& x,
197 Vector<int>& global_col);
200 template<
class T0,
class Prop,
class Storage,
class Allocator,
class T>
201 void GetLU(Matrix<T0, Prop, Storage, Allocator>& A, SparseDirectSolver<T>& mat_lu,
202 bool keep_matrix =
false);
205 void SolveLU(
const SeldonTranspose& transA,
206 SparseDirectSolver<T>& mat_lu, Vector<T>& x);
209 void SolveLU(
const SeldonTranspose& transA,
210 SparseDirectSolver<complex<T> >& mat_lu, Vector<T>& x);
213 void SolveLU(
const SeldonTranspose& transA,
214 SparseDirectSolver<T>& mat_lu, Vector<complex<T> >& x);
217 void SolveLU(
const SeldonTranspose& transA,
218 SparseDirectSolver<T>& mat_lu,
219 Matrix<T, General, ColMajor>& x);
222 void SolveLU(
const SeldonTranspose& transA,
223 SparseDirectSolver<complex<T> >& mat_lu,
224 Matrix<T, General, ColMajor>& x);
227 void SolveLU(
const SeldonTranspose& transA,
228 SparseDirectSolver<T>& mat_lu,
229 Matrix<complex<T>, General, ColMajor>& x);
232 template <
class T0,
class Prop0,
class Storage0,
class Allocator0,
233 class T1,
class Storage1,
class Allocator1>
234 void SparseSolve(Matrix<T0, Prop0, Storage0, Allocator0>& M,
235 Vector<T1, Storage1, Allocator1>& Y);
238 template <
class T,
class Prop0,
class Allocator0,
class Allocator1>
239 void GetAndSolveLU(Matrix<T, Prop0, ColSparse, Allocator0>& M,
240 Vector<T, VectFull, Allocator1>& Y);
242 template <
class T,
class Prop0,
class Allocator0,
class Allocator1>
243 void GetAndSolveLU(Matrix<T, Prop0, RowSparse, Allocator0>& M,
244 Vector<T, VectFull, Allocator1>& Y);
246 template <
class T,
class Prop0,
class Allocator0,
class Allocator1>
247 void GetAndSolveLU(Matrix<T, Prop0, ArrayRowSparse, Allocator0>& M,
248 Vector<T, VectFull, Allocator1>& Y);
250 template <
class T,
class Prop0,
class Allocator0,
class Allocator1>
251 void GetAndSolveLU(Matrix<T, Prop0, ColSymSparse, Allocator0>& M,
252 Vector<T, VectFull, Allocator1>& Y);
254 template <
class T,
class Prop0,
class Allocator0,
class Allocator1>
255 void GetAndSolveLU(Matrix<T, Prop0, RowSymSparse, Allocator0>& M,
256 Vector<T, VectFull, Allocator1>& Y);
258 template <
class T,
class Prop0,
class Allocator0,
class Allocator1>
259 void GetAndSolveLU(Matrix<T, Prop0, ArrayRowSymSparse, Allocator0>& M,
260 Vector<T, VectFull, Allocator1>& Y);
264 #define SELDON_FILE_COMPUTATION_SPARSE_DIRECT_SOLVER_HXX