28 SquareMatrix::SquareMatrix() :
63 m_factored(y.m_factored),
111 ct_dgetrs(ctlapack::NoTranspose, static_cast<int>(
nRows()),
116 writelogf(
"SquareMatrix::solve(): DGETRS returned INFO = %d\n", info);
138 (void) memset((
void*) sm, 0, nn *
sizeof(double));
177 integer n =
static_cast<int>(
nRows());
183 writelogf(
"SquareMatrix::factor(): DGETRS returned INFO = %d\n", info);
217 size_t lwork =
work.size();
221 writelogf(
"SquareMatrix::factorQR(): DGEQRF returned INFO = %d\n", info);
227 size_t lworkOpt =
static_cast<size_t>(
work[0]);
228 if (lworkOpt > lwork) {
229 work.resize(lworkOpt);
252 size_t lwork =
work.size();
261 ct_dormqr(ctlapack::Left, ctlapack::Transpose,
m_nrows, 1,
m_nrows, &(*(
begin())),
m_nrows,
DATA_PTR(
tau), b,
m_nrows,
265 writelogf(
"SquareMatrix::solveQR(): DORMQR returned INFO = %d\n", info);
271 size_t lworkOpt =
static_cast<size_t>(
work[0]);
272 if (lworkOpt > lwork) {
273 work.resize(lworkOpt);
278 ct_dtrtrs(ctlapack::UpperTriangular, ctlapack::NoTranspose, &dd,
m_nrows, 1, &(*(
begin())),
m_nrows, b,
282 writelogf(
"SquareMatrix::solveQR(): DTRTRS returned INFO = %d\n", info);
301 doublereal
rcond = 0.0;
303 throw CELapackError(
"SquareMatrix::rcond()",
"matrix isn't factored correctly");
314 writelogf(
"SquareMatrix::rcond(): DGECON returned INFO = %d\n", rinfo);
337 doublereal
rcond = 0.0;
339 throw CELapackError(
"SquareMatrix::rcondQR()",
"matrix isn't factored correctly");
347 writelogf(
"SquareMatrix::rcondQR(): DTRCON returned INFO = %d\n", rinfo);
437 valueSmall = 1.0E300;
438 size_t iSmall =
npos;
439 for (
size_t i = 0; i <
m_nrows; i++) {
441 for (
size_t j = 0; j <
m_nrows; j++) {
442 if (fabs(
value(i,j)) > valueS) {
443 valueS = fabs(
value(i,j));
446 if (valueS < valueSmall) {
456 valueSmall = 1.0E300;
457 size_t jSmall =
npos;
458 for (
size_t j = 0; j <
m_nrows; j++) {
460 for (
size_t i = 0; i <
m_nrows; i++) {
461 if (fabs(
value(i,j)) > valueS) {
462 valueS = fabs(
value(i,j));
465 if (valueS < valueSmall) {