28 eigs(
const Sparse<ELT_T> &A,
int eig_type,
size_t neig,
29 Tensor<ELT_T> *eigenvectors,
30 const Tensor::elt_t *initial_guess)
32 Arpack::EigType t = (Arpack::EigType)eig_type;
33 size_t n = A.columns();
36 return eigs(full(A), t, neig, eigenvectors, initial_guess);
40 std::cerr <<
"In eigs(): Can only compute eigenvalues of square matrices.";
44 Arpack data(A.columns(), t, neig);
47 data.set_start_vector(initial_guess);
49 while (data.update() < Arpack::Finished) {
50 data.set_y(mmult(A, data.get_x()));
52 if (data.get_status() == Arpack::Finished) {
53 return data.get_data(eigenvectors);
55 std::cerr << data.error_message() <<
'\n';
58 return Tensor<ELT_T>();
CTensor eigs(const CTensor &A, int eig_type, size_t neig, CTensor *vectors=NULL, const tensor::cdouble *initial_guess=NULL)
Find out a few eigenvalues and eigenvectors of a complex nonsymmetric matrix.