#include <Rsymdiag.hh>
Public Methods | |
Rsymdiag_ () | |
Inits to an empty object. | |
Rsymdiag_ (const Smatdbl_ &Mat) | |
Inits to diagonalise Mat. | |
size_t | re_init (const Smatdbl_ &Mat) |
re_init(Mat): reinitialises the calling object with the real symmetric matrix Mat. More... | |
size_t | size () const |
Returns the size of the matrix being diagonalised. | |
int | all_evalevec (Vecdbl_ &Eval, Rmatdbl_ &Evec, bool Sortevals=true) |
all_evalevec(Eval, Evec, Sortevals): Produces all eigenvalues in Eval and the eigenvectors in Evec (columns). More... | |
int | all_eval (Vecdbl_ &Eval, bool Sortevals=true) |
all_eval(Eval, Sortevals): Produces all eigenvalues in Eval (size adjusted silently). More... | |
int | range_evalevec (double Low, double Up, Vecdbl_ &Eval, Rmatdbl_ &Evec, bool Descend=false) |
range_evalevec(Low, Up, Eval, Evec): Finds all eigenvalues within the range [Low, Up], and puts them into Eval in ascending order by default, or in descending order if Descend==true. More... | |
int | range_eval (double Low, double Up, Vecdbl_ &Eval, bool Descend=false) |
range_eval(Low, Up, Eval, Descent): Finds all eigenvalues within the range [Low, Up], and puts them into Eval in ascending order by default or in descending order if Descend==true. More... | |
int | largest_evalevec (size_t N, Vecdbl_ &Eval, Rmatdbl_ &Evec, bool Descend=false) |
largest_evalevec(N, Eval, Evec, Descend): calculates the N largest eigenvalues and the corresponding eigenvectors. More... | |
int | largest_eval (size_t N, Vecdbl_ &Eval, bool Descend=false) |
largest_eval(N, Eval, Descend): calculates the N largest eigenvalues. More... | |
int | evalevec_above (double Thr, Vecdbl_ &Eval, Rmatdbl_ &Evec, bool Descend=false) |
evalevec_above(Thr, Eval, Evec, Descend): calculates the largest eigenvalues and the corresponding eigenvectors above the threshold Thr. More... | |
int | eval_above (double Thr, Vecdbl_ &Eval, bool Descend=false) |
eval_above(Thr, Eval, Descend): calculates the largest eigenvalues above the threshold Thr. More... | |
void | gershgorin_limits (double &Low, double &Up) |
gershgorin_limits(Low, Up): calculates the limits of the range [Low,Up] that contains all eigenvalues of the input matrix. More... | |
Protected Methods | |
void | housholder_tridiag (bool Wantevec) |
int | implicit_ql (int Itno, bool Wantevec) |
void | largest_range (size_t N, double &Low, double &Up) |
size_t | sturm_seq (double X) const |
double | sturm_newton (double X) const |
void | bisect_evals (list< Evaloc_ > &Evalist, list< Evaloc_ >::iterator Iv) |
int | inverse_iter (double Eval, Vecdbl_ &Evec, double &Tol) |
void | inverse_iter (double Eval, size_t Multiple, Rmatdbl_ &Evecs) |
int | tridiag_decomp (const Vecdbl_ &Diagshift) |
void | tridiag_solve (const Vecdbl_ &Rhs, Vecdbl_ &X) const |
Static Protected Methods | |
void | gram_schmidt (Rmatdbl_ &Mat) |
double | subspace_diff (const Rmatdbl_ &V, const Rmatdbl_ &W) |
void | random_vector (Vecdbl_ &Vec) |
void | random_matrix (Rmatdbl_ &Mat) |
double | round_tozero (double X) |
Private Attributes | |
size_t | Size |
size of the matrices (problem dimension). | |
Rmatdbl_ | Q |
Householder transformation matrix. | |
Vecdbl_ | Diag |
Vecdbl_ | Subdiag |
tridiagonalised matrix. | |
Vecdbl_ | Beta |
Vecdbl_ | Gamma |
decomposition vectors for inverse iteration. | |
bool | Tridiagdone |
flag to indicate if tridiagonalisation is done. | |
bool | Qdone |
transformation matrix for eigenvectors is done. | |
bool | QLdone |
QL done (destructive!). | |
Static Private Attributes | |
const Fparch_<double> | Fpdbl |
double-prec arithmetics mach constants. | |
const Fparch_<float> | Fpflo |
single-prec arithmetics mach constants. | |
const double | EPSILON |
error tolerance. | |
Friends | |
struct | Evaloc_ |
Definition at line 46 of file Rsymdiag.hh.
|
Inits to an empty object.
Definition at line 114 of file Rsymdiag.hh. |
|
Inits to diagonalise Mat.
Definition at line 117 of file Rsymdiag.hh. |
|
re_init(Mat): reinitialises the calling object with the real symmetric matrix Mat. Returns the size. Referenced by Rsymdiag_(). |
|
Returns the size of the matrix being diagonalised.
Definition at line 127 of file Rsymdiag.hh. |
|
all_evalevec(Eval, Evec, Sortevals): Produces all eigenvalues in Eval and the eigenvectors in Evec (columns). The sizes of these are adjusted silently if necessary. if Sortevals is true (the default) then eigenvalues (and the corresponding eigenvectors) are sorted in decreasing order. Return value: no. of dimensions. Throws Rsymdiagexc_ if the calling object was not re-initialised or if the iteration no. was exceeded in the implicit QL step. |
|
all_eval(Eval, Sortevals): Produces all eigenvalues in Eval (size adjusted silently). if Sortevals is true (the default) then the eigenvalues are sorted in decreasing order. Return value: no. of dimensions. Throws Rsymdiagexc_ if the calling object was not re-initialised or if the iteration no. was exceeded in the implicit QL step. |
|
range_evalevec(Low, Up, Eval, Evec): Finds all eigenvalues within the range [Low, Up], and puts them into Eval in ascending order by default, or in descending order if Descend==true. The corresponding eigenvectors are put into the columns of Evec. Return value: the number of eigenvalues found. Throws Rsymdiagexc_ if a reinit is needed. |
|
range_eval(Low, Up, Eval, Descent): Finds all eigenvalues within the range [Low, Up], and puts them into Eval in ascending order by default or in descending order if Descend==true. Return value: the number of eigenvalues found, or -1 if reinit is needed. |
|
largest_evalevec(N, Eval, Evec, Descend): calculates the N largest eigenvalues and the corresponding eigenvectors. Returns the number of eigenvalues found. Throws Argexc_ if N is not in the range [1..size()]. Throws Rsymdiagexc_ if a reinit is needed. See range_evalevec(..) for a description of the other variables. |
|
largest_eval(N, Eval, Descend): calculates the N largest eigenvalues. Returns the number of eigenvalues found. Throws Argexc_ if N is not in the range [1..size()]. Throws Rsymdiagexc_ if a reinit is needed. See range_eval(..) for a description of the other variables. |
|
evalevec_above(Thr, Eval, Evec, Descend): calculates the largest eigenvalues and the corresponding eigenvectors above the threshold Thr. Use for getting all positive eigenvalues for example. Returns the number of eigenvalues found. This can be 0 if Thr is set too high. Throws Rsymdiagexc_ if a reinit is needed. See range_evalevec(..) for a description of the other variables. |
|
eval_above(Thr, Eval, Descend): calculates the largest eigenvalues above the threshold Thr. Use for getting all positive eigenvalues for example. Returns the number of eigenvalues found. This can be 0 if Thr is set too high. Throws Rsymdiagexc_ if a reinit is needed. See range_eval(..) for a description of the other variables. |
|
gershgorin_limits(Low, Up): calculates the limits of the range [Low,Up] that contains all eigenvalues of the input matrix. Note that this method performs a Housholder tridiagonalisation but the transform matrix is not accumulated, you would not get eigenvectors without calling re_init(..) after calling this. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 258 of file Rsymdiag.hh. |
|
Definition at line 72 of file Rsymdiag.hh. |
|
double-prec arithmetics mach constants.
Definition at line 51 of file Rsymdiag.hh. |
|
single-prec arithmetics mach constants.
Definition at line 52 of file Rsymdiag.hh. |
|
error tolerance.
Definition at line 53 of file Rsymdiag.hh. |
|
size of the matrices (problem dimension).
Definition at line 102 of file Rsymdiag.hh. |
|
Householder transformation matrix.
Definition at line 103 of file Rsymdiag.hh. |
|
Definition at line 104 of file Rsymdiag.hh. |
|
tridiagonalised matrix.
Definition at line 104 of file Rsymdiag.hh. |
|
Definition at line 105 of file Rsymdiag.hh. |
|
decomposition vectors for inverse iteration.
Definition at line 105 of file Rsymdiag.hh. |
|
flag to indicate if tridiagonalisation is done.
Definition at line 107 of file Rsymdiag.hh. |
|
transformation matrix for eigenvectors is done.
Definition at line 107 of file Rsymdiag.hh. |
|
QL done (destructive!).
Definition at line 107 of file Rsymdiag.hh. |