88 template <
typename DataType>
91 DataType* subdiagonals,
92 DataType* eigenvectors,
99 DataType* work =
new DataType[2*matrix_size - 2];
102 int ldz = matrix_size;
105 int n =
static_cast<int>(matrix_size);
111 lapack_xstev(&jobz, &n, diagonals, subdiagonals, eigenvectors, &ldz, work,
115 assert((info == 0,
"?stev subroutine returned non-zero status."));
189 template <
typename DataType>
192 DataType* supdiagonals,
204 int n =
static_cast<int>(matrix_size);
207 int LDU = matrix_size;
208 int LDVT = matrix_size;
215 DataType* work =
new DataType[3*matrix_size*matrix_size + 4*matrix_size];
216 int* iwork =
new int[8 * matrix_size];
222 lapack_xbdsdc(&UPLO, &COMPQ, &n, diagonals, supdiagonals, U, &LDU, Vt,
223 &LDVT, Q, IQ, work, iwork, &info);
228 assert((info == 0,
"?stev subroutine returned non-zero status."));
A static class to find eigenvalues and eigenvectors (diagonalize) tridiagonal and bidiagonal matrices...
static int eigh_tridiagonal(DataType *diagonals, DataType *subdiagonals, DataType *eigenvectors, IndexType matrix_size)
Computes all eigenvalues and eigenvectors of a real and symmetric tridiagonal matrix.
static int svd_bidiagonal(DataType *diagonals, DataType *subdiagonals, DataType *U, DataType *Vt, IndexType matrix_size)
Computes all singular-values and left and right eigenvectors of a real and symmetric upper bi-diagona...
void lapack_xbdsdc(char *uplo, char *compq, int *n, DataType *d, DataType *e, DataType *u, int *ldu, DataType *vt, int *ldvt, DataType *q, int *iq, DataType *work, int *iwork, int *info)
void lapack_xstev(char *jobz, int *n, DataType *d, DataType *e, DataType *z, int *ldz, DataType *work, int *info)