20 #ifndef SELDON_FILE_SUPERLU_HXX
22 #ifdef SUPERLU_INTSIZE64
26 #include "superlu_interface.h"
32 #ifdef SUPERLU_INTSIZE64
33 #define superlu_int_t int64_t
36 #define superlu_int_t int
39 #if defined(SELDON_WITH_SUPERLU_DIST) || defined(SELDON_WITH_SUPERLU_MT)
41 #define SELDON_WITH_SUPERLU_SEQ
47 #ifndef SELDON_WITH_SUPERLU_DIST
48 void SetComplexOne(superlu::doublecomplex& one);
56 #ifndef SELDON_WITH_SUPERLU_DIST
57 superlu::SuperMatrix
L, U, B;
59 superlu::GlobalLU_t
Glu;
61 #ifdef SELDON_WITH_SUPERLU_MT
62 superlu::superlumt_options_t
options;
63 superlu::Gstat_t
stat;
66 double diag_pivot_thresh, drop_tol;
67 superlu::yes_no_t usepr, refact;
70 superlu::SCPformat *
Lstore;
71 superlu::NCPformat *
Ustore;
77 superlu::SuperLUStat_t
stat;
83 superlu::gridinfo_t grid;
84 superlu::superlu_dist_options_t
options;
85 superlu::SuperLUStat_t
stat;
87 superlu::SuperMatrix A;
108 void Init(
int size, int_t& panel_size, int_t& relax);
112 void SetPermutation(
const IVect&);
114 bool UseInteger8()
const;
134 #ifdef SELDON_WITH_SUPERLU_DIST
135 superlu::dScalePermstruct_t ScalePermstruct;
136 superlu::dLUstruct_t LUstruct;
137 superlu::dSOLVEstruct_t SOLVEstruct;
143 size_t GetMemorySize()
const;
146 #ifndef SELDON_WITH_SUPERLU_DIST
147 template<
class Prop,
class Allocator>
150 bool permuted =
true);
152 template<
class Prop,
class Allocator>
155 bool permuted =
true);
161 template<
class T0,
class Prop,
class Storage,
class Allocator>
163 bool keep_matrix =
false);
165 template<
class Allocator2>
168 template<
class Allocator2>
173 double* x_ptr,
int nrhs_);
175 template<
class Allocator2>
178 template<
class Allocator2>
182 #ifdef SELDON_WITH_SUPERLU_DIST
186 void FactorizeDistributedMatrix(MPI_Comm& comm_facto,
Vector<long>& Ptr,
189 bool sym,
bool keep_matrix =
false);
191 void FactorizeDistributedMatrix(MPI_Comm& comm_facto,
Vector<int64_t>& Ptr,
194 bool sym,
bool keep_matrix =
false);
197 void FactorizeParallel(MPI_Comm& comm_facto,
201 bool sym,
bool keep_matrix =
false);
203 void FactorizeParallel(MPI_Comm& comm_facto,
207 bool sym,
bool keep_matrix =
false);
209 template<
class Allocator2>
210 void SolveDistributed(MPI_Comm& comm_facto,
215 template<
class Allocator2>
216 void SolveDistributed(MPI_Comm& comm_facto,
221 void SolveDistributed(MPI_Comm& comm_facto,
223 double* x_ptr,
int nrhs_,
224 const IVect& glob_num);
236 #ifdef SELDON_WITH_SUPERLU_DIST
237 superlu::zScalePermstruct_t ScalePermstruct;
238 superlu::zLUstruct_t LUstruct;
239 superlu::zSOLVEstruct_t SOLVEstruct;
246 size_t GetMemorySize()
const;
248 #ifndef SELDON_WITH_SUPERLU_DIST
249 template<
class Prop,
class Allocator>
252 bool permuted =
true);
254 template<
class Prop,
class Allocator>
257 bool permuted =
true);
260 Vector<complex<double> >& Val,
bool sym);
264 template<
class T0,
class Prop,
class Storage,
class Allocator>
265 void FactorizeMatrix(
Matrix<T0, Prop,
266 Storage, Allocator> & mat,
267 bool keep_matrix =
false);
269 template<
class Allocator2>
272 template<
class Allocator2>
277 complex<double>* x_ptr,
int nrhs_);
279 template<
class Allocator2>
282 template<
class Allocator2>
286 #ifdef SELDON_WITH_SUPERLU_DIST
288 Vector<complex<double> >& Val,
bool sym);
290 void FactorizeDistributedMatrix(MPI_Comm& comm_facto,
Vector<long>& Ptr,
293 bool sym,
bool keep_matrix =
false);
295 void FactorizeDistributedMatrix(MPI_Comm& comm_facto,
Vector<int64_t>& Ptr,
298 bool sym,
bool keep_matrix =
false);
301 void FactorizeParallel(MPI_Comm& comm_facto,
303 Vector<complex<double> >&,
305 bool sym,
bool keep_matrix =
false);
307 void FactorizeParallel(MPI_Comm& comm_facto,
309 Vector<complex<double> >&,
311 bool sym,
bool keep_matrix =
false);
313 template<
class Allocator2>
314 void SolveDistributed(MPI_Comm& comm_facto,
319 template<
class Allocator2>
320 void SolveDistributed(MPI_Comm& comm_facto,
325 void SolveDistributed(MPI_Comm& comm_facto,
327 complex<double>* x_ptr,
int nrhs_,
328 const IVect& glob_num);
333 template<
class T0,
class Prop,
class Storage,
class Allocator,
class T>
335 bool keep_matrix =
false);
337 template<
class T,
class Allocator>
340 template<
class T,
class Allocator>
343 template<
class T,
class Prop,
class Allocator>
347 template<
class T,
class Prop,
class Allocator>
351 template<
class Allocator>
355 template<
class Allocator>
360 template<
class Allocator>
364 template<
class Allocator>
371 #define SELDON_FILE_SUPERLU_HXX