23 std::vector<double>
doubles(len);
26 for (
size_t r = 0; r < mat.
numRows(); ++r)
34 std::vector<double>
doubles(len);
37 for (
size_t r = 0; r < mat.
numRows(); ++r)
50 throw exc::engine_error(
"Internal error: a size in lapack code was set too small");
54 for (
size_t r = 0; r < mat.
numRows(); ++r)
63 throw exc::engine_error(
"Internal error: a size in lapack CC code was set too small");
67 for (
size_t r = 0; r < mat.
numRows(); ++r)
87 assert(upper.
numRows() == std::min(numrows, numcols));
91 const double* U = lapack_numbers.data();
92 for (
size_t c = 0; c < upper.
numColumns(); c++, U += numrows)
93 for (
size_t r = 0; r <= c; ++r)
95 if (r >= upper.
numRows())
break;
96 upper.
entry(r, c) = U[r];
113 assert(upper.
numRows() == std::min(numrows, numcols));
117 const double* U = lapack_numbers.data();
118 for (
size_t c = 0; c < upper.
numColumns(); c++, U += 2*numrows)
119 for (
size_t r = 0; r <= c; ++r)
121 if (r >= upper.
numRows())
break;
134 int nrows =
static_cast<int>(lower.
numRows());
135 int ncols =
static_cast<int>(upper.
numColumns());
136 int min =
static_cast<int>(lower.
numColumns());
137 assert(min ==
static_cast<int>(upper.
numRows()));
143 const double* U = lapack_numbers.data();
144 for (
size_t c = 0; c < upper.
numColumns(); c++)
146 for (
size_t r = 0; r <= c and r <= min; r++)
147 upper.
entry(r, c) = *U++;
148 lower.
entry(c, c) = 1;
149 for (
size_t r = c+1 ; r <= lower.
numColumns(); ++r)
150 lower.
entry(r,c) = *U++;
162 auto& ring = lower.
ring();
163 int nrows =
static_cast<int>(lower.
numRows());
164 int ncols =
static_cast<int>(upper.
numColumns());
165 int min =
static_cast<int>(lower.
numColumns());
166 assert(min ==
static_cast<int>(upper.
numRows()));
172 const double* U = lapack_numbers.data();
173 for (
size_t c = 0; c < upper.
numColumns(); c++)
175 for (
size_t r = 0; r <= c and r <= min; r++)
179 ring.set_from_doubles(upper.
entry(r, c), re, im);
183 ring.set_from_long(lower.
entry(c, c), 1);
184 for (
size_t r = c+1 ; r <= lower.
numColumns(); ++r)
188 ring.set_from_doubles(lower.
entry(r, c), re, im);
197 int rows =
static_cast<int>(A->
numRows());
200 int min = (rows <= cols) ? rows : cols;
209 for (
int i = 0; i < rows; i++)
result->array[i] = i;
213 int* perm =
new int[min];
216 dgetrf_(&rows, &cols, copyA.data(), &rows, perm, &info);
220 for (
int i = 0; i < rows; i++)
result->array[i] = i;
221 for (
int i = 0; i < min; i++)
223 int thisloc = perm[i] - 1;
224 int tmp =
result->array[thisloc];
233 ERROR(
"argument passed to dgetrf had an illegal value");
244 int size =
static_cast<int>(A->
numRows());
245 int bsize =
static_cast<int>(b->
numColumns());
251 ERROR(
"expected a square matrix");
258 ERROR(
"expected matrices to have same number of rows");
265 x->resize(size, bsize);
269 int* perm =
new int[size];
285 x->resize(size, bsize);
290 ERROR(
"according to dgesv, matrix is singular");
295 ERROR(
"argument passed to dgesv had an illegal value");
304 int size =
static_cast<int>(A->
numRows());
305 if (size !=
static_cast<int>(A->
numColumns()))
307 ERROR(
"expected a square matrix");
319 int wsize = 3 * size;
320 double* workspace =
new double[2 * wsize];
324 double *real =
new double[size];
325 double *imag =
new double[size];
334 static_cast<double *
>(
nullptr),
336 static_cast<double *
>(
nullptr),
344 ERROR(
"argument passed to dgeev had an illegal value");
349 ERROR(
"the QR algorithm in dgeev failed to compute all eigvals");
355 for (
int i = 0; i < size; i++)
369 int size =
static_cast<int>(A->
numRows());
370 if (size !=
static_cast<int>(A->
numColumns()))
372 ERROR(
"expected a square matrix");
386 int wsize = 4 * size;
388 double *workspace =
new double[2*wsize];
392 double *real =
new double[size];
393 double *imag =
new double[size];
394 double *eigen =
new double[size * size];
403 static_cast<double *
>(
nullptr),
413 ERROR(
"argument passed to dgeev had an illegal value");
418 ERROR(
"the QR algorithm in dgeev failed to compute all eigvals");
425 eigvecs->
resize(size, size);
427 double* eigenLoc = eigen;
428 for (
int j = 0; j < size; j++, eigenLoc += size)
435 for (
int i = 0; i < size; ++i)
437 eigvecs->
entry(i,j).
re = eigenLoc[i];
441 else if (imag[j] > 0)
443 for (
int i = 0; i < size; ++i)
446 eigenLoc[i], eigenLoc[size + i]);
448 eigenLoc[i], - eigenLoc[size + i]);
464 int size =
static_cast<int>(A->
numRows());
465 if (size !=
static_cast<int>(A->
numColumns()))
467 ERROR(
"expected a square matrix");
482 int wsize = 3 * size - 1;
483 double * workspace =
new double[wsize];
486 std::vector<double> evals(size);
489 &dont, &triangle, &size, copyA.data(), &size, evals.data(), workspace, &wsize, &info);
493 ERROR(
"argument passed to dsyev had an illegal value");
498 ERROR(
"dsyev did not converge");
517 int size =
static_cast<int>(A->
numRows());
518 if (size !=
static_cast<int>(A->
numColumns()))
520 ERROR(
"expected a square matrix");
535 int wsize = 3 * size - 1;
536 double* workspace =
new double[wsize];
540 std::vector<double> evals(size);
543 &doit, &triangle, &size, evecs.data(), &size, evals.data(), workspace, &wsize, &info);
547 ERROR(
"argument passed to dsyev had an illegal value");
552 ERROR(
"dsyev did not converge");
558 eigvecs->
resize(size, size);
576 int rows =
static_cast<int>(A->
numRows());
579 int min = (rows <= cols) ? rows : cols;
583 ERROR(
"expected a matrix with positive dimensions");
587 int max = (rows >= cols) ? rows : cols;
588 int wsize = (3 * min +
max >= 5 * min) ? 3 * min +
max : 5 * min;
589 double *workspace =
new double[wsize];
592 std::vector<double> u(rows * rows);
593 std::vector<double> vt(cols * cols);
594 std::vector<double> sigma(min);
613 ERROR(
"argument passed to dgesvd had an illegal value");
618 ERROR(
"dgesvd did not converge");
643 int rows =
static_cast<int>(A->
numRows());
646 int min = (rows <= cols) ? rows : cols;
650 ERROR(
"expected a matrix with positive dimensions");
654 int max = (rows >= cols) ? rows : cols;
655 int wsize = 4 * min * min +
max + 9 * min;
657 double *workspace =
new double[wsize];
658 int* iworkspace =
new int[8 * min];
661 std::vector<double> u(rows * rows);
662 std::vector<double> vt(cols * cols);
663 std::vector<double> sigma(min);
682 ERROR(
"argument passed to dgesdd had an illegal value");
687 ERROR(
"dgesdd did not converge");
701 delete [] iworkspace;
712 int rows =
static_cast<int>(A->
numRows());
714 int brows =
static_cast<int>(b->
numRows());
715 int bcols =
static_cast<int>(b->
numColumns());
716 int min = (rows <= cols) ? rows : cols;
717 int max = (rows >= cols) ? rows : cols;
718 int wsize = min + ((bcols >=
max) ? bcols :
max);
722 ERROR(
"expected compatible right hand side");
726 if (min == 0 || bcols == 0)
728 x->resize(cols, bcols);
734 double* workspace =
new double[wsize];
740 std::vector<double> copyb2(cols * bcols);
741 for (
auto&a : copyb2) a = 0;
744 for (
int j = 0; j < bcols; j++)
747 for (
int i = 0; i < brows; i++)
749 copyb2[copyloc++] = copyb[bloc++];
769 ERROR(
"argument passed to dgels had an illegal value");
774 x->resize(cols, bcols);
779 for (
int j = 0; j < bcols; j++)
782 for (
int i = 0; i < cols; i++)
784 x->entry(i,j) = copyb[copyloc++];
804 int rows =
static_cast<int>(A->
numRows());
806 int brows =
static_cast<int>(b->
numRows());
807 int bcols =
static_cast<int>(b->
numColumns());
810 int min = (rows < cols) ? rows : cols;
811 int max = (rows > cols) ? rows : cols;
812 int tempmax = ((2 * min >
max) ? 2 * min :
max);
813 int wsize = 3 * min + ((tempmax > bcols) ? tempmax : bcols);
817 ERROR(
"expected compatible right hand side");
821 if (min == 0 || bcols == 0)
823 x->resize(cols, bcols);
829 double *workspace =
new double[wsize];
830 double *sing =
new double[min];
836 std::vector<double> copyb2(cols * bcols);
837 for (
auto&a : copyb2) a = 0;
840 for (
int j = 0; j < bcols; j++)
843 for (
int i = 0; i < brows; i++)
845 copyb2[copyloc++] = copyb[bloc++];
867 ERROR(
"argument passed to dgelss had an illegal value");
872 x->resize(cols, bcols);
877 for (
int j = 0; j < bcols; j++)
880 for (
int i = 0; i < cols; i++)
882 x->entry(i,j) = copyb[copyloc++];
908 int rows =
static_cast<int>(A->
numRows());
910 int info1 = 0, info2 = 0, info3 = 0, info4 = 0;
911 int min = (rows <= cols) ? rows : cols;
915 ERROR(
"expected a matrix with positive dimensions");
920 std::vector<double> tau (min);
921 double workspace_size[1];
924 dgeqrf_(&rows, &cols, copyA.data(), &rows, tau.data(), workspace_size, &work_size, &info1);
925 work_size =
static_cast<int>(workspace_size[0]);
927 double *workspace =
new double[work_size];
929 dgeqrf_(&rows, &cols, copyA.data(), &rows, tau.data(), workspace, &work_size, &info2);
931 if (info1 < 0 or info2 < 0)
933 ERROR(
"argument passed to dgeqrf had an illegal value");
936 if (info1 > 0 or info2 > 0)
938 ERROR(
"can this happen?");
951 int orgqr_work_size = -1;
961 orgqr_work_size =
static_cast<int>(workspace_size[0]);
962 if (orgqr_work_size > work_size)
965 work_size = orgqr_work_size;
966 workspace =
new double[work_size];
967 std::cout <<
"work size increased to: " << work_size << std::endl;
978 if (info3 < 0 or info4 < 0)
980 ERROR(
"argument passed to dorgqr or dorgqr had an illegal value");
983 else if (info3 > 0 or info4 > 0)
985 ERROR(
"can this happen?");
1019 int rows =
static_cast<int>(A->
numRows());
1020 int cols =
static_cast<int>(A->
numColumns());
1021 int info1 = 0, info2 = 0, info3 = 0, info4 = 0;
1022 int min = (rows <= cols) ? rows : cols;
1026 ERROR(
"expected a matrix with positive dimensions");
1031 std::vector<double> tau (10*min);
1032 double workspace_size[1];
1035 zgeqrf_(&rows, &cols, copyA.data(), &rows, tau.data(), workspace_size, &work_size, &info1);
1036 work_size =
static_cast<int>(workspace_size[0]);
1037 double *workspace =
new double[20 * work_size];
1039 zgeqrf_(&rows, &cols, copyA.data(), &rows, tau.data(), workspace, &work_size, &info2);
1041 if (info1 < 0 or info2 < 0)
1043 ERROR(
"argument passed to zgeqrf had an illegal value");
1046 if (info1 > 0 or info2 > 0)
1048 ERROR(
"can this happen?");
1061 int orgqr_work_size = -1;
1071 orgqr_work_size =
static_cast<int>(workspace_size[0]);
1072 if (orgqr_work_size > work_size)
1075 work_size = orgqr_work_size;
1076 workspace =
new double[2 * work_size];
1087 if (info3 < 0 or info4 < 0)
1089 ERROR(
"argument passed to dorgqr or dorgqr had an illegal value");
1092 else if (info3 > 0 or info4 > 0)
1094 ERROR(
"can this happen?");
1119 int rows =
static_cast<int>(A->
numRows());
1120 int cols =
static_cast<int>(A->
numColumns());
1122 int min = (rows <= cols) ? rows : cols;
1131 for (
int i = 0; i < rows; i++)
result->array[i] = i;
1135 int* perm =
new int[min];
1138 zgetrf_(&rows, &cols, copyA.data(), &rows, perm, &info);
1142 ERROR(
"argument passed to zgetrf had an illegal value");
1149 for (
int i = 0; i < rows; i++)
result->array[i] = i;
1150 for (
int i = 0; i < min; i++)
1152 int thisloc = perm[i] - 1;
1153 int tmp =
result->array[thisloc];
1161 for (
int row=1; row<=min; row++) {
1163 for (
int i=1; i<=min; i++) {
1166 else if (perm[i-1] == targ)
1169 result->array[row-1] = targ-1;
1171 for (
int i=min; i<rows; i++)
1183 int size =
static_cast<int>(A->
numRows());
1184 int bsize =
static_cast<int>(b->
numColumns());
1188 if (size !=
static_cast<int>(A->
numColumns()))
1190 ERROR(
"expected a square matrix");
1197 ERROR(
"expected matrices to have same number of rows");
1203 x->resize(size, bsize);
1207 int* permutation =
new int[size];
1211 zgesv_(&size, &bsize, copyA.data(), &size, permutation, copyb.data(), &size, &info);
1215 ERROR(
"according to zgesv, matrix is singular");
1220 ERROR(
"argument passed to zgesv had an illegal value");
1225 x->resize(size, bsize);
1229 delete [] permutation;
1235 int size =
static_cast<int>(A->
numRows());
1236 if (size !=
static_cast<int>(A->
numColumns()))
1238 ERROR(
"expected a square matrix");
1251 int wsize = 2 * size;
1252 int rsize = 2 * size;
1253 double *workspace =
new double[2*wsize];
1254 double *rwork =
new double[rsize];
1257 std::vector<double> evals(2 * size);
1265 static_cast<double *
>(
nullptr),
1267 static_cast<double *
>(
nullptr),
1276 ERROR(
"argument passed to zgeev had an illegal value");
1281 ERROR(
"the QR algorithm in zgeev failed to compute all eigvals");
1286 eigvals->
resize(size, 1);
1300 int size =
static_cast<int>(A->
numRows());
1301 if (size !=
static_cast<int>(A->
numColumns()))
1303 ERROR(
"expected a square matrix");
1317 int wsize = 2 * size;
1318 int rsize = 2 * size;
1319 double *workspace =
new double[2*wsize];
1320 double *rwork =
new double[rsize];
1324 std::vector<double> evals(2 * size);
1325 std::vector<double> evecs(2 * size * size);
1333 static_cast<double *
>(
nullptr),
1344 ERROR(
"argument passed to zgeev had an illegal value");
1349 ERROR(
"the QR algorithm in zgeev failed to compute all eigvals");
1354 eigvals->
resize(size, 1);
1356 eigvecs->
resize(size, size);
1368 int size =
static_cast<int>(A->
numRows());
1369 if (size !=
static_cast<int>(A->
numColumns()))
1371 ERROR(
"expected a square matrix");
1383 char triangle =
'U';
1385 int wsize = 2 * size - 1;
1386 double *workspace =
new double[2*wsize];
1387 double *rwork =
new double[3 * size - 2];
1391 std::vector<double> evals(size);
1406 ERROR(
"argument passed to zheev had an illegal value");
1411 ERROR(
"zheev did not converge");
1416 eigvals->
resize(size, 1);
1430 int size =
static_cast<int>(A->
numRows());
1431 if (size !=
static_cast<int>(A->
numColumns()))
1433 ERROR(
"expected a square matrix");
1446 char triangle =
'U';
1448 int wsize = 2 * size - 1;
1449 double *workspace =
new double[2*wsize];
1450 double *rwork =
new double[3 * size - 2];
1454 std::vector<double> evals(size);
1469 ERROR(
"argument passed to zheev had an illegal value");
1474 ERROR(
"zheev did not converge");
1479 eigvals->
resize(size, 1);
1481 eigvecs->
resize(size, size);
1498 int rows =
static_cast<int>(A->
numRows());
1499 int cols =
static_cast<int>(A->
numColumns());
1501 int min = (rows <= cols) ? rows : cols;
1505 ERROR(
"expected a matrix with positive dimensions");
1509 int max = (rows >= cols) ? rows : cols;
1510 int wsize = 2 * min +
max;
1511 double *workspace =
new double[2 * wsize];
1512 double *rwork =
new double[5 * min];
1515 std::vector<double> u(2 * rows * rows);
1516 std::vector<double> vt(2 * cols * cols);
1517 std::vector<double> sigma(2 * min);
1537 ERROR(
"argument passed to zgesvd had an illegal value");
1542 ERROR(
"zgesvd did not converge");
1568 int rows =
static_cast<int>(A->
numRows());
1569 int cols =
static_cast<int>(A->
numColumns());
1571 int min = (rows <= cols) ? rows : cols;
1575 ERROR(
"expected a matrix with positive dimensions");
1579 int max = (rows >= cols) ? rows : cols;
1580 int wsize = min * min + 2 * min +
max;
1582 double *workspace =
new double[2 * wsize];
1583 int *iworkspace =
new int[8 * min];
1584 double *rwork =
new double[5 * min * min + 7 * min];
1587 std::vector<double> u(2 * rows * rows);
1588 std::vector<double> vt(2 * cols * cols);
1589 std::vector<double> sigma(2 * min);
1609 ERROR(
"argument passed to zgesdd had an illegal value");
1614 ERROR(
"zgesdd did not converge");
1628 delete[] iworkspace;
1639 int rows =
static_cast<int>(A->
numRows());
1640 int cols =
static_cast<int>(A->
numColumns());
1641 int brows =
static_cast<int>(b->
numRows());
1642 int bcols =
static_cast<int>(b->
numColumns());
1643 int min = (rows <= cols) ? rows : cols;
1644 int max = (rows >= cols) ? rows : cols;
1645 int wsize = min + ((bcols >=
max) ? bcols :
max);
1649 ERROR(
"expected compatible right hand side");
1653 if (min == 0 || bcols == 0)
1655 x->resize(cols, bcols);
1661 double *workspace =
new double[2 * wsize];
1667 std::vector<double> copyb2(2 * cols * bcols);
1668 for (
auto& a : copyb2) a = 0;
1671 for (
int j = 0; j < bcols; j++)
1673 copyloc = 2 * j * cols;
1674 for (
int i = 0; i < 2 * brows; i++)
1676 copyb2[copyloc++] = copyb[bloc++];
1696 ERROR(
"argument passed to zgels had an illegal value");
1701 x->resize(cols, bcols);
1706 for (
int j = 0; j < bcols; j++)
1708 copyloc = 2 * j * rows;
1709 for (
int i = 0; i < cols; i++)
1711 double re = copyb[copyloc++];
1712 double im = copyb[copyloc++];
1713 x->ring().set_from_doubles(
x->entry(i,j), re, im);
1733 int rows =
static_cast<int>(A->
numRows());
1734 int cols =
static_cast<int>(A->
numColumns());
1735 int brows =
static_cast<int>(b->
numRows());
1736 int bcols =
static_cast<int>(b->
numColumns());
1737 double rcond = -1.0;
1739 int min = (rows < cols) ? rows : cols;
1740 int max = (rows > cols) ? rows : cols;
1741 int wsize = 2 * min + ((bcols >
max) ? bcols :
max);
1745 ERROR(
"expected compatible right hand side");
1749 if (min == 0 || bcols == 0)
1751 x->resize(cols, bcols);
1757 double *workspace =
new double[2 * wsize];
1758 double *sing =
new double[min];
1759 double *rwork =
new double[5 * min];
1765 std::vector<double> copyb2(2 * cols * bcols);
1766 for (
auto& a : copyb2) a = 0;
1769 for (
int j = 0; j < bcols; j++)
1771 copyloc = 2 * j * cols;
1772 for (
int i = 0; i < 2 * brows; i++)
1774 copyb2[copyloc++] = copyb[bloc++];
1797 ERROR(
"argument passed to zgelss had an illegal value");
1802 x->resize(cols, bcols);
1807 for (
int j = 0; j < bcols; j++)
1809 copyloc = 2 * j * rows;
1810 for (
int i = 0; i < cols; i++)
1812 double re = copyb[copyloc++];
1813 double im = copyb[copyloc++];
1814 x->ring().set_from_doubles(
x->entry(i,j), re, im);
ElementType & entry(size_t row, size_t column)
void resize(size_t new_nrows, size_t new_ncols)
const ACoeffRing & ring() const
size_t numColumns() const
static bool least_squares_deficient(const DMatRRR *A, const DMatRRR *b, DMatRRR *x)
DMat< M2::ARingRR > DMatRR
static bool SVD_divide_conquer(const DMatRRR *A, DMatRRR *Sigma, DMatRRR *U, DMatRRR *VT)
static bool eigenvectors_symmetric(const DMatRRR *A, DMatRRR *eigenvals, DMatRRR *eigenvecs)
static bool eigenvalues_hermitian(const DMatCCC *A, DMatRRR *eigenvals)
static bool SVD(const DMatRRR *A, DMatRRR *Sigma, DMatRRR *U, DMatRRR *VT)
static bool QR(const DMatRR *A, DMatRR *Q, DMatRR *R, bool return_QR)
static bool eigenvalues_symmetric(const DMatRRR *A, DMatRRR *eigenvals)
static bool solve(const DMatRRR *A, const DMatRRR *b, DMatRRR *x)
static M2_arrayintOrNull LU(const DMatRRR *A, DMatRRR *L, DMatRRR *U)
static bool eigenvectors_hermitian(const DMatCCC *A, DMatRRR *eigenvals, DMatCCC *eigenvecs)
static bool least_squares(const DMatRRR *A, const DMatRRR *b, DMatRRR *x)
static bool eigenvectors(const DMatRRR *A, DMatCCC *eigenvals, DMatCCC *eigenvecs)
DMat< M2::ARingCC > DMatCC
static bool eigenvalues(const DMatRRR *A, DMatCCC *eigenvals)
void set_from_doubles(ElementType &result, double re, double im) const
Two SimpleARing-style coefficient adapters: CoefficientRingZZp and CoefficientRingR.
std::vector< double > make_lapack_array(const DMatRR &mat)
void fill_from_lapack_array(const std::vector< double > &doubles, DMatRR &mat)
std::vector< double > make_lapack_array(const DMatRR &mat)
void fill_from_lapack_upper(const std::vector< double > &lapack_numbers, int numrows, int numcols, DMatRR &upper)
void fill_from_lapack_array(const std::vector< double > &doubles, DMatRR &mat)
void fill_lower_and_upper(const std::vector< double > &lapack_numbers, DMatRR &lower, DMatRR &upper)
int zgelss_(int *rows, int *cols, int *nhrs, double *A, int *ldA, double *b, int *ldb, double *Sigma, double *rcond, int *rank, double *work, int *lwork, double *rwork, int *info)
int dgesdd_(char *jobU, int *rows, int *cols, double *A, int *ldA, double *Sigma, double *U, int *ldU, double *VT, int *ldVT, double *work, int *lwork, int *iwork, int *info)
int zgeqrf_(int *m, int *n, double *A, int *lda, double *tau, double *work, int *lwork, int *info)
int zgesdd_(char *jobU, int *rows, int *cols, double *A, int *ldA, double *Sigma, double *U, int *ldU, double *VT, int *ldVT, double *w, int *lwork, double *rwork, int *iwork, int *info)
int zgesvd_(char *jobU, char *jobV, int *rows, int *cols, double *A, int *ldA, double *Sigma, double *U, int *ldU, double *VT, int *ldVT, double *w, int *lwork, double *rwork, int *info)
int zheev_(char *n, char *n2, int *size, double *M, int *lda, double *eig, double *w, int *wsize, double *rwork, int *info)
int zgetrf_(int *rows, int *cols, double *M, int *ld, int *ipiv, int *info)
int zgesv_(int *n, int *nrhs, double *a, int *lda, int *ipiv, double *b, int *ldb, int *info)
int zgels_(char *job, int *rows, int *cols, int *nhrs, double *A, int *ldA, double *b, int *ldb, double *work, int *lwork, int *info)
int dgeqrf_(int *m, int *n, double *A, int *lda, double *tau, double *work, int *lwork, int *info)
int zungqr_(int *m, int *n, int *k, double *A, int *lda, double *tau, double *work, int *lwork, int *info)
int dorgqr_(int *m, int *n, int *k, double *A, int *lda, double *tau, double *work, int *lwork, int *info)
int dsyev_(char *n, char *n2, int *size, double *M, int *lda, double *eig, double *work, int *wsize, int *info)
int dgeev_(char *n, char *n2, int *size, double *M, int *size1, double *E, double *E2, double *, int *, double *, int *, double *, int *, int *)
DMat< M2::ARingCC > DMatCC
int dgesvd_(char *jobU, char *jobV, int *rows, int *cols, double *A, int *ldA, double *Sigma, double *U, int *ldU, double *VT, int *ldVT, double *work, int *lwork, int *info)
int zgeev_(char *n, char *n2, int *size, double *M, int *size1, double *E, double *l, int *lsize, double *r, int *rsize, double *w, int *wsize, double *rwork, int *info)
int dgelss_(int *rows, int *cols, int *nhrs, double *A, int *ldA, double *b, int *ldb, double *Sigma, double *rcond, int *rank, double *work, int *lwork, int *info)
void dgetrf_(const int *rows, const int *cols, double *A, const int *ld, int *ipiv, int *info)
int dgesv_(int *n, int *nrhs, double *a, int *lda, int *ipiv, double *b, int *ldb, int *info)
int dgels_(char *job, int *rows, int *cols, int *nhrs, double *A, int *ldA, double *b, int *ldb, double *work, int *lwork, int *info)
DMat< M2::ARingRR > DMatRR
Engine bridge into LAPACK for RR / CC dense linear algebra.
VALGRIND_MAKE_MEM_DEFINED & result(result)
M2_arrayint M2_makearrayint(int n)
M2_arrayint M2_arrayintOrNull
Templated matrix arithmetic for DMat<R> / SMat<R> plus the MatrixWindow / SubMatrix view types.
bool isZero(const DMat< RT > &A)
void swap(mpfr::mpreal &x, mpfr::mpreal &y)