20 #include <tensor/tensor.h>
21 #include <tensor/tensor_lapack.h>
22 #include <tensor/linalg.h>
26 using namespace lapack;
47 assert(A.
rank() == 2);
52 std::cerr <<
"Routine eig_sym() can only compute eigenvalues of square matrices, and you\n"
53 <<
"have passed a matrix that is " << A.
rows() <<
" by " << A.
columns();
58 double *a = tensor_pointer(aux);
59 integer lda = n, info[1];
60 char jobz[2] = { (V == 0)?
'N' :
'V', 0 };
61 char uplo[2] = {
'U', 0 };
63 double *w = tensor_pointer(output);
65 #ifdef TENSOR_USE_ACML
66 dsyev(*jobz, *uplo, n, a, lda, w, info);
70 F77NAME(dsyev)(jobz, uplo, &n, a, &lda, w, work0, &lwork, info);
71 lwork = (int)work0[0];
74 F77NAME(dsyev)(jobz, uplo, &n, a, &lda, w, tensor_pointer(work),
int rank() const
Number of Tensor indices.
index columns() const
Query the size of 2nd index.
index rows() const
Query then size of 1st index.
Real Tensor with elements of type "double".
RTensor eig_sym(const RTensor &A, RTensor *pR=0)
Eigenvalue decomposition of a real matrix.