9 #ifndef __INTEL_COMPILER
11 std::cerr <<
"dgsmatrix::pardiso is only for intel c++ compiler (icpc)." << std::endl;
12 std::cerr <<
"Recompile your code with icpc to use pardiso." << std::endl;
15 #else //__INTEL_COMPILER
21 std::cerr <<
"These matrix and vector cannot be solved." << std::endl
22 <<
"Your input was (" <<
m <<
"x" <<
n <<
") and (" << b.
l <<
")." << std::endl;
29 std::vector<double> a(
data.size());
30 std::vector<MKL_INT> ja(
data.size());
31 std::vector<MKL_INT> ia(
m+1);
34 for(CPPL_INT
i=0;
i<
m;
i++){
36 const std::vector<CPPL_INT>::const_iterator rows_i_end =
rows[
i].end();
37 std::map<CPPL_INT,CPPL_INT> jc;
38 for(std::vector<CPPL_INT>::const_iterator rit=
rows[
i].begin(); rit!=rows_i_end; rit++){
39 jc.insert( std::make_pair(
data[*rit].j, *rit) );
42 const std::map<CPPL_INT,CPPL_INT>::const_iterator jc_end =jc.end();
43 for(std::map<CPPL_INT,CPPL_INT>::const_iterator jcit=jc.begin(); jcit!=jc_end; jcit++){
44 a[k] =
data[(*jcit).second].v;
45 ja[k] =MKL_INT((*jcit).first);
53 _MKL_DSS_HANDLE_t pt[64];
56 PARDISOINIT(pt, &mtype, iparm);
67 MKL_INT MKL_INT_n =MKL_INT(
n);
68 std::vector<MKL_INT> perm(
n);
73 PARDISO(pt, &maxfct, &mnum, &mtype, &phase, &MKL_INT_n, &a[0], &ia[0], &ja[0], &perm[0], &nrhs, iparm, &msglvl, b.
array, x.
array, &error);
77 std::cerr <<
"Serious trouble happend. error = " << error <<
"." << std::endl;
83 PARDISO(pt, &maxfct, &mnum, &mtype, &phase, &MKL_INT_n, &a[0], &ia[0], &ja[0], &perm[0], &nrhs, iparm, &msglvl, b.
array, x.
array, &error2);
86 #endif //__INTEL_COMPILER
CPPL_INT pardiso(dcovector &) const
std::vector< dcomponent > data
matrix data
CPPL_INT n
matrix column size
_dgematrix i(const _dgbmatrix &mat)
double * array
1D array to store vector data
friend void swap(dgsmatrix &, dgsmatrix &)
Real Double-precision Column Vector Class.
std::vector< std::vector< CPPL_INT > > rows
array of vector to store the entry information of component for each row
CPPL_INT m
matrix row size