9 #ifndef __INTEL_COMPILER
11 std::cerr <<
"dssmatrix::pardiso_definite 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 line_i_end =
line[
i].end();
37 std::map<CPPL_INT,CPPL_INT> jc;
38 for(std::vector<CPPL_INT>::const_iterator lit=
line[
i].begin(); lit!=line_i_end; lit++){
40 jc.insert( std::make_pair(
data[*lit].
i, *lit) );
44 const std::map<CPPL_INT,CPPL_INT>::const_iterator jc_end =jc.end();
45 for(std::map<CPPL_INT,CPPL_INT>::const_iterator jcit=jc.begin(); jcit!=jc_end; jcit++){
46 a[k] =
data[(*jcit).second].v;
47 ja[k] =MKL_INT((*jcit).first);
55 _MKL_DSS_HANDLE_t pt[64];
58 PARDISOINIT(pt, &mtype, iparm);
69 MKL_INT MKL_INT_n =MKL_INT(
n);
70 std::vector<MKL_INT> perm(
n);
75 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);
79 std::cerr <<
"Serious trouble happend. error = " << error <<
"." << std::endl;
85 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);
88 #endif //__INTEL_COMPILER
102 {CPPL_VERBOSE_REPORT;
103 #ifndef __INTEL_COMPILER
105 std::cerr <<
"dssmatrix::pardiso_indefinite is only for intel c++ compiler (icpc)." << std::endl;
106 std::cerr <<
"Recompile your code with icpc to use pardiso." << std::endl;
109 #else //__INTEL_COMPILER
115 std::cerr <<
"These matrix and vector cannot be solved." << std::endl
116 <<
"Your input was (" <<
m <<
"x" <<
n <<
") and (" << b.
l <<
")." << std::endl;
123 std::vector<double> a(
data.size());
124 std::vector<MKL_INT> ja(
data.size());
125 std::vector<MKL_INT> ia(
m+1);
128 for(CPPL_INT
i=0;
i<
m;
i++){
130 const std::vector<CPPL_INT>::const_iterator line_i_end =
line[
i].end();
131 std::map<CPPL_INT,CPPL_INT> jc;
132 for(std::vector<CPPL_INT>::const_iterator lit=
line[
i].begin(); lit!=line_i_end; lit++){
134 jc.insert( std::make_pair(
data[*lit].
i, *lit) );
138 const std::map<CPPL_INT,CPPL_INT>::const_iterator jc_end =jc.end();
139 for(std::map<CPPL_INT,CPPL_INT>::const_iterator jcit=jc.begin(); jcit!=jc_end; jcit++){
140 a[k] =
data[(*jcit).second].v;
141 ja[k] =MKL_INT((*jcit).first);
149 _MKL_DSS_HANDLE_t pt[64];
152 PARDISOINIT(pt, &mtype, iparm);
163 MKL_INT MKL_INT_n =MKL_INT(
n);
164 std::vector<MKL_INT> perm(
n);
169 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);
173 std::cerr <<
"Serious trouble happend. error = " << error <<
"." << std::endl;
179 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);
182 #endif //__INTEL_COMPILER
std::vector< dcomponent > data
matrix data
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
CPPL_INT pardiso_indefinite(dcovector &) const
friend void swap(dssmatrix &, dssmatrix &)
_dgematrix i(const _dgbmatrix &mat)
double * array
1D array to store vector data
CPPL_INT pardiso_definite(dcovector &) const
Real Double-precision Column Vector Class.
CPPL_INT n
matrix column size
CPPL_INT const & m
matrix row size