21 m_useReturnErrorCode(0),
33 m_useReturnErrorCode(0),
39 for (
size_t j = 0; j < m; j++) {
52 m_useReturnErrorCode(0),
58 for (
size_t j = 0; j <
m_ncols; j++) {
73 for (
size_t j = 0; j <
m_ncols; j++) {
92 for (
size_t j = 0; j <
m_ncols; j++) {
110 ct_dgemv(ctlapack::ColMajor, ctlapack::NoTranspose,
111 static_cast<int>(
nRows()),
113 static_cast<int>(
nRows()), b, 1, 0.0, prod, 1);
121 for (
size_t n = 0; n < nc; n++) {
123 for (
size_t i = 0; i < nr; i++) {
124 sum +=
value(i,n)*b[i];
140 writelogf(
"solve(DenseMatrix& A, double* b): Can only solve a square matrix\n");
142 throw CELapackError(
"solve(DenseMatrix& A, double* b)",
"Can only solve a square matrix");
148 writelogf(
"solve(DenseMatrix& A, double* b): DGETRF returned INFO = %d U(i,i) is exactly zero. The factorization has"
149 " been completed, but the factor U is exactly singular, and division by zero will occur if "
150 "it is used to solve a system of equations.\n", info);
154 "DGETRF returned INFO = "+
int2str(info) +
". U(i,i) is exactly zero. The factorization has"
155 " been completed, but the factor U is exactly singular, and division by zero will occur if "
156 "it is used to solve a system of equations.");
159 }
else if (info < 0) {
161 writelogf(
"solve(DenseMatrix& A, double* b): DGETRF returned INFO = %d. The argument i has an illegal value\n", info);
165 "DGETRF returned INFO = "+
int2str(info) +
". The argument i has an illegal value");
172 writelogf(
"solve(DenseMatrix& A, double* b): DGETRS returned INFO = %d\n", info);
175 throw CELapackError(
"solve(DenseMatrix& A, double* b)",
"DGETRS returned INFO = "+
int2str(info));
186 writelogf(
"solve(DenseMatrix& A, DenseMatrix& b): Can only solve a square matrix\n");
189 throw CELapackError(
"solve(DenseMatrix& A, DenseMatrix& b)",
"Can only solve a square matrix");
198 writelogf(
"solve(DenseMatrix& A, DenseMatrix& b): DGETRF returned INFO = %d U(i,i) is exactly zero. The factorization has"
199 " been completed, but the factor U is exactly singular, and division by zero will occur if "
200 "it is used to solve a system of equations.\n", info);
204 "DGETRF returned INFO = "+
int2str(info) +
". U(i,i) is exactly zero. The factorization has"
205 " been completed, but the factor U is exactly singular, and division by zero will occur if "
206 "it is used to solve a system of equations.");
210 writelogf(
"solve(DenseMatrix& A, DenseMatrix& b): DGETRF returned INFO = %d. The argument i has an illegal value\n", info);
214 "DGETRF returned INFO = "+
int2str(info) +
". The argument i has an illegal value");
224 writelogf(
"solve(DenseMatrix& A, DenseMatrix& b): DGETRS returned INFO = %d\n", info);
227 throw CELapackError(
"solve(DenseMatrix& A, DenseMatrix& b)",
"DGETRS returned INFO = "+
int2str(info));
236 ct_dgemv(ctlapack::ColMajor, ctlapack::NoTranspose,
237 static_cast<int>(A.
nRows()), static_cast<int>(A.
nColumns()), 1.0,
243 ct_dgemv(ctlapack::ColMajor, ctlapack::NoTranspose,
244 static_cast<int>(A.
nRows()), static_cast<int>(A.
nRows()), 1.0,
250 integer n =
static_cast<int>(nn !=
npos ? nn : A.
nRows());
256 writelogf(
"invert(DenseMatrix& A, int nn): DGETRS returned INFO = %d\n", info);
265 integer lwork =
static_cast<int>(work.size());
267 &A.
ipiv()[0], &work[0], lwork, info);
270 writelogf(
"invert(DenseMatrix& A, int nn): DGETRS returned INFO = %d\n", info);