20 #include <tensor/tensor.h>
21 #include <tensor/tensor_lapack.h>
22 #include <tensor/linalg.h>
28 using namespace lapack;
50 assert(A.
rank() == 2);
55 integer lda, ldvl, ldvr, lwork, info;
59 cdouble *a = tensor_pointer(aux);
63 std::cerr <<
"Routine eig() can only compute eigenvalues of square matrices, and you\n"
64 <<
"have passed a matrix that is " << A.
rows() <<
" by " << A.
columns();
70 vl = tensor_pointer(*L);
77 vr = tensor_pointer(*R);
86 w = tensor_pointer(output);
87 #ifdef TENSOR_USE_ACML
88 zgeev(*jobvl, *jobvr, n, a, lda, w, vl, ldvl, vr, ldvr, &info);
92 rwork =
new double[2*n];
93 F77NAME(zgeev)(jobvl, jobvr, &n, a, &lda, w, vl, &ldvl, vr, &ldvr, work0, &lwork,
95 lwork = lapack::real(work0[0]);
97 cdouble *work =
new cdouble[lwork];
98 F77NAME(zgeev)(jobvl, jobvr, &n, a, &lda, w, vl, &ldvl, vr, &ldvr, work, &lwork,
int rank() const
Number of Tensor indices.
const CTensor eig(const RTensor &A, CTensor *R=0, CTensor *L=0)
Eigenvalue decomposition of a real matrix.
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".
Complex Tensor with elements of type "cdouble".