00001
00008 #ifndef TBCI_SOLVER_SUPERLU_H
00009 #define TBCI_SOLVER_SUPERLU_H
00010
00011 #include "../vector.h"
00012 #include "../cscmatrix.h"
00013
00014 #if !defined(COLPERM_T_DECLARED) //and !defined(__SUPERLU_UTIL)
00015
00020 typedef enum {NATURAL, MMD_ATA, MMD_AT_PLUS_A, COLAMD, MY_PERMC} colperm_t;
00021 #define COLPERM_T_DECLARED
00022 #endif
00023
00024 NAMESPACE_TBCI
00025
00035 int lu_solve (CSCMatrix<double>& M, Vector<double>& x,
00036 const Vector<double>& rhs,
00037 colperm_t permc_spec = NATURAL,
00038 bool verbose = false, bool symm = false);
00039
00040 inline
00041 TVector<double> lu_solve(CSCMatrix<double>& M,
00042 const Vector<double>& rhs,
00043 colperm_t permc_spec = NATURAL,
00044 bool verbose = false, bool symm = false)
00045 {
00046 TVector<double> x(rhs.size());
00047 const int info = lu_solve(M, (Vector<double>&)x, rhs, permc_spec, verbose, symm);
00048 return x;
00049 }
00050
00051 #ifdef TBCI_CPLX_H
00053 int lu_solve (CSCMatrix< cplx<double> >& M, Vector< cplx<double> >& x,
00054 const Vector< cplx<double> >& rhs,
00055 colperm_t permc_spec = NATURAL,
00056 bool verbose = false, bool symm = false);
00057
00058 inline
00059 TVector< cplx<double> > lu_solve(CSCMatrix< cplx<double> >& M,
00060 const Vector< cplx<double> >& rhs,
00061 colperm_t permc_spec = NATURAL,
00062 bool verbose = false, bool symm = false)
00063 {
00064 TVector< cplx<double> > x(rhs.size());
00065 const int info = lu_solve(M, (Vector< cplx<double> >&)x,
00066 rhs, permc_spec, verbose, symm);
00067 return x;
00068 }
00069
00070 #endif
00071 NAMESPACE_END
00072
00073 #endif