20 n(A.rows()), V(n,n), D(n)
31 long want_eigenvectors = 1;
39 work2.
begin(), &ierr);
43 const double THRESH = 1e-8;
45 if (eig.
D(0,0) < -THRESH) {
46 std::cerr <<
"**** vnl_generalized_eigensystem: ERROR\n" 47 <<
"Matrix B is not nonneg-definite\n";
49 std::cerr <<
"**** eigenvalues(B) = " << eig.
D << std::endl;
57 double *vptr = &V1[0];
58 for (
int c = 0; c <
n; ++c)
59 for (
int r = 0; r <
n; ++r)
66 std::cerr <<
"vnl_generalized_eigensystem: N is greater than NM. Bug in interface to rsg.f\n";
68 std::cerr <<
"vnl_generalized_eigensystem: The " 69 << ierr <<
"-th eigenvalue has not been determined after 30 iterations.\n" 70 <<
"The eigenvalues should be correct for indices 1.." << ierr-1
71 <<
", but no eigenvectors are computed.\n" Print matrices and vectors in nice MATLAB format.
vnl_diag_matrix< T > D
Public eigenvalues.
vnl_matrix< double > V
Public eigenvectors.
Computes and stores the eigensystem decomposition of a symmetric matrix.
vnl_diag_matrix< double > D
Public eigenvalues.
Convert row-stored matrix to column-stored.
iterator begin()
Iterator pointing to start of data.
VNL_EXPORT std::ostream & vnl_matlab_print(std::ostream &, T const *array, unsigned length, vnl_matlab_print_format=vnl_matlab_print_format_default)
print a 1D array.
Declare in a central place the list of symbols from netlib.
Convert row-stored matrix to column-stored.
Find eigenvalues of a symmetric matrix.
vnl_generalized_eigensystem(const vnl_matrix< double > &A, const vnl_matrix< double > &B)
Solves the generalized eigenproblem Ax=Bx.
Holds the singular value decomposition of a vnl_matrix.
Solves the generalized eigenproblem Ax=La.
Holds the singular value decomposition of a vnl_matrix.
vnl_diag_matrix< singval_t > & W()
Get at DiagMatrix (q.v.) of singular values, sorted from largest to smallest.
T * data_block()
Return pointer to the diagonal elements as a contiguous 1D C array;.