FILTLAN 1.0a
Loading...
Searching...
No Matches
symtrieig.h
Go to the documentation of this file.
1#ifndef SYMTRIEIG_H
2#define SYMTRIEIG_H
9// routines for symmetric eigenvalue problems, invoking LAPACK routine sstev_ (single precision) or dstev_ (double precision)
10
11#include <iostream> // for ostream
12#include "matkitdef.h"
13
14#ifdef USE_NAMESPACE
15using namespace MATKIT;
16namespace MATKIT {
17#endif
18
19class Vector;
20class Matrix;
21
22#ifdef USE_NAMESPACE
23} // end of namespace MATKIT
24#endif
25
26
27
34
47// compute all eigenvalues (but not eigenvectors) of a symmetric tridiagonal matrix
48// n is the dimension of the symmetric tridiagonal matrix
49// diag[],sdiag[] define the symmetric tridiagonal matrix:
50// the diagonal elements are diag[0,...,n-1] in order and the subdiagonal elements are sdiag[0,...,n-2] in order
51// eigVal is the output vector of length n containing all eigenvalues in ascending order
52// the return value is the flag returned by the LAPACK routine dstev_() (if Real is double) or stev_() (if Real is float)
53int SymmetricTridiagoanlEigenSolver(Vector &eigVal, mkIndex n, const Real *diag, const Real *sdiag);
54
56
70// compute all eigenvalues and eigenvectors of a symmetric tridiagonal matrix
71// n is the dimension of the symmatrix tridiagonal matrix
72// diag[],sdiag[] define the symmetric tridiagonal matrix:
73// the diagonal elements are diag[0,...,n-1] in order and the subdiagonal elements are sdiag[0,...,n-2] in order
74// eigVal is the output vector of length n containing all eigenvalues in ascending order
75// eigVec is the output n-by-n matrix with columns as eigenvectors, in the order as elements in eigVal
76// the return value is the flag returned by the LAPACK routine dstev_() (if Real is double) or stev_() (if Real is float)
77int SymmetricTridiagoanlEigenSolver(Vector &eigVal, Matrix &eigVec, mkIndex n, const Real *diag, const Real *sdiag);
78
80
92// print out an error message to std::ostream outerr if info!=0 which signifies an error that occurred in the LAPACK routine xSTEV
93// outerr is an std::ostream for printing out the error message when info!=0
94// info is the flag returned from the LAPACK routine dstev_() (if Real is double) or sstev_() (if Real is float)
95// = 0: successful exit (nothing will be printed)
96// < 0: if info = -i, the i-th argument had an illegal value
97// > 0: if info = i, the algorithm failed to converge; i off-diagonal elements did not converge to zero
98// n is the dimension of the symmetric tridiagonal matrix; this information will also be printed out if n is provided (i.e. n!=0)
99void reportTroubleIfAny(std::ostream &outerr, int info, mkIndex n=0);
100
101 // end of group_symtrieig
102
103
104#endif
int SymmetricTridiagoanlEigenSolver(Vector &eigVal, mkIndex n, const Real *diag, const Real *sdiag)
Compute all eigenvalues (but not eigenvectors) of a symmetric tridiagonal matrix T....
void reportTroubleIfAny(std::ostream &outerr, int info, mkIndex n=0)
Print out an error message to std::ostream outerr if info 0 which signifies an error that occurred i...