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);
54 std::cerr <<
"Routine eig() can only compute eigenvalues of square matrices, and you\n"
55 <<
"have passed a matrix that is " << A.
rows() <<
" by " << A.
columns();
60 cdouble *a = tensor_pointer(aux);
61 integer lda = n, info[1];
62 char jobz[2] = { (V == 0)?
'N' :
'V', 0 };
63 char uplo[2] = {
'U', 0 };
65 double *w = tensor_pointer(output);
68 #ifdef TENSOR_USE_ACML
69 zheev(*jobz, *uplo, n, a, lda, w, info);
73 F77NAME(zheev)(jobz, uplo, &n, a, &lda, w, tensor_pointer(work),
74 &lwork, tensor_pointer(rwork), info);
75 lwork = (int)tensor::real(work[0]);
78 F77NAME(zheev)(jobz, uplo, &n, a, &lda, w, tensor_pointer(work),
79 &lwork, tensor_pointer(rwork), info);
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.
Complex Tensor with elements of type "cdouble".