11 std::cerr <<
"These two matrices cannot be solved." << std::endl
12 <<
"Your input was (" <<
n <<
"x" <<
n <<
") and (" << mat.
n <<
"x" << mat.
n <<
")." << std::endl;
18 CPPL_INT NRHS(mat.
n), LDA(
n), *IPIV(
new CPPL_INT[
n]), LDB(mat.
n), LWORK(-1), INFO(1);
19 comple *WORK(
new comple[1]);
20 zhesv_(&UPLO, &n, &NRHS,
array, &LDA, IPIV, mat.
array, &LDB, WORK, &LWORK, &INFO);
23 LWORK = CPPL_INT(std::real(WORK[0]));
25 WORK =
new comple[LWORK];
26 zhesv_(&UPLO, &n, &NRHS,
array, &LDA, IPIV, mat.
array, &LDB, WORK, &LWORK, &INFO);
33 std::cerr <<
"Serious trouble happend. INFO = " << INFO <<
"." << std::endl;
48 std::cerr <<
"These matrix and vector cannot be solved." << std::endl
49 <<
"Your input was (" <<
n <<
"x" <<
n <<
") and (" << vec.
l <<
")." << std::endl;
55 CPPL_INT NRHS(1), LDA(
n), *IPIV(
new CPPL_INT[
n]), LDB(vec.
l), LWORK(-1), INFO(1);
56 comple *WORK(
new comple[1] );
57 zhesv_(&UPLO, &n, &NRHS,
array, &LDA, IPIV, vec.
array, &LDB, WORK, &LWORK, &INFO);
60 LWORK = CPPL_INT(std::real(WORK[0]));
62 WORK =
new comple[LWORK];
63 zhesv_(&UPLO, &n, &NRHS,
array, &LDA, IPIV, vec.
array, &LDB, WORK, &LWORK, &INFO);
70 std::cerr <<
"Serious trouble happend. INFO = " << INFO <<
"." << std::endl;
92 if(jobz==0){ JOBZ=
'n'; }
else{ JOBZ=
'V'; }
93 CPPL_INT LDA(
n), INFO(1), LWORK(-1);
94 double *RWORK(
new double[std::max(CPPL_INT(1), 3*
n-2)]);
95 comple *WORK(
new comple[1]);
96 zheev_(&JOBZ, &UPLO, &
n,
array, &LDA, &w[0], WORK, &LWORK, RWORK, &INFO);
99 LWORK = CPPL_INT(std::real(WORK[0]));
101 WORK =
new comple[LWORK];
102 zheev_(&JOBZ, &UPLO, &
n,
array, &LDA, &w[0], WORK, &LWORK, RWORK, &INFO);
109 std::cerr <<
"Serious trouble happend. INFO = " << INFO <<
"." << std::endl;
122 std::vector<zcovector>& v)
123 {CPPL_VERBOSE_REPORT;
126 for(CPPL_INT
i=0;
i<
n;
i++){
130 char JOBZ(
'V'), UPLO(
'l');
131 CPPL_INT LDA(n), INFO(1), LWORK(-1);
132 double *RWORK(
new double[std::max(CPPL_INT(1), 3*n-2)]);
133 comple *WORK(
new comple[1]);
134 zheev_(&JOBZ, &UPLO, &n,
array, &LDA, &w[0], WORK, &LWORK, RWORK, &INFO);
137 LWORK = CPPL_INT(std::real(WORK[0]));
139 WORK =
new comple[LWORK];
140 zheev_(&JOBZ, &UPLO, &n,
array, &LDA, &w[0], WORK, &LWORK, RWORK, &INFO);
146 for(CPPL_INT
i=0;
i<
n;
i++){
147 for(CPPL_INT j=0; j<
n; j++){
154 std::cerr <<
"Serious trouble happend. INFO = " << INFO <<
"." << std::endl;
167 std::vector<zrovector>& v)
168 {CPPL_VERBOSE_REPORT;
171 for(CPPL_INT
i=0;
i<
n;
i++){
175 char JOBZ(
'V'), UPLO(
'l');
176 CPPL_INT LDA(n), INFO(1), LWORK(-1);
177 double *RWORK(
new double[std::max(CPPL_INT(1), 3*n-2)]);
178 comple *WORK(
new comple[1]);
179 zheev_(&JOBZ, &UPLO, &n,
array, &LDA, &w[0], WORK, &LWORK, RWORK, &INFO);
182 LWORK = CPPL_INT(std::real(WORK[0]));
184 WORK =
new comple[LWORK];
185 zheev_(&JOBZ, &UPLO, &n,
array, &LDA, &w[0], WORK, &LWORK, RWORK, &INFO);
191 for(CPPL_INT
i=0;
i<
n;
i++){
192 for(CPPL_INT j=0; j<
n; j++){
199 std::cerr <<
"Serious trouble happend. INFO = " << INFO <<
"." << std::endl;
comple * array
1D array to store vector data
CPPL_INT zhesv(zgematrix &)
CPPL_INT n
matrix column size
Complex Double-precision General Dence Matrix Class.
CPPL_INT n
matrix column size
comple * array
1D array to store matrix data
friend _zgematrix i(const zhematrix &)
comple * array
1D array to store matrix data
CPPL_INT zheev(std::vector< double > &, const bool &)
Complex Double-precision Column Vector Class.