Rosetta Utilities
2014.35

Classes  
class  GeneralizedEigenSolver 
Solves generalized eigenvalue problems. More...  
Functions  
double  epslon (double const &x) 
Estimate unit roundoff in quantities of size x. More...  
void  qzhes (int const &nm, int const &n, arr_ref< double, 2 > a, arr_ref< double, 2 > b, bool const &matz, arr_ref< double, 2 > z) 
This subroutine is the first step of the QZ algorithm for solving generalized matrix eigenvalue problems. More...  
void  qzit (int const &nm, int const &n, arr_ref< double, 2 > a, arr_ref< double, 2 > b, double const &eps1, bool const &matz, arr_ref< double, 2 > z, int &ierr) 
This subroutine is the second step of the QZ algorithm for solving generalized matrix eigenvalue problems. More...  
void  qzval (int const &nm, int const &n, arr_ref< double, 2 > a, arr_ref< double, 2 > b, arr_ref< double > alfr, arr_ref< double > alfi, arr_ref< double > beta, bool const &matz, arr_ref< double, 2 > z) 
This subroutine is the third step of the QZ algorithm for solving generalized matrix eigenvalue problems,. More...  
void  qzvec (int const &nm, int const &n, arr_cref< double, 2 > a, arr_ref< double, 2 > b, arr_cref< double > alfr, arr_cref< double > alfi, arr_cref< double > beta, arr_ref< double, 2 > z) 
This subroutine is the optional fourth step of the QZ algorithm for solving generalized matrix eigenvalue problems. More...  
void  rgg (int const &nm, int const &n, arr_ref< double, 2 > a, arr_ref< double, 2 > b, arr_ref< double > alfr, arr_ref< double > alfi, arr_ref< double > beta, int const &matz, arr_ref< double, 2 > z, int &ierr) 
This subroutine calls the recommended sequence of subroutines from the eigensystem subroutine package (EISPACK) to find the eigenvalues and eigenvectors (if desired) for the real general generalized eigenproblem . More...  
double numeric::linear_algebra::epslon  (  double const &  x  ) 
Estimate unit roundoff in quantities of size x.
This program should function properly on all systems satisfying the following two assumptions:
The statement number 10 and the goto 10 are intended to force optimizing compilers to generate code satisfying assumption 2. Under these assumptions, it should be true that:
a
is not exactly equal to fourthirds.b
has a zero for its last bit or digit.c
is not exactly equal to one.eps
measures the separation of 1.0 from the next larger floating point number.The developers of EISPACK would appreciate being informed about any systems where these assumptions do not hold. This version dated 4/6/83. Fable was used to convert the original source to C++.
Referenced by qzit().
void numeric::linear_algebra::qzhes  (  int const &  nm, 
int const &  n,  
arr_ref< double, 2 >  a,  
arr_ref< double, 2 >  b,  
bool const &  matz,  
arr_ref< double, 2 >  z  
) 
This subroutine is the first step of the QZ algorithm for solving generalized matrix eigenvalue problems.
This subroutine accepts a pair of real general matrices and reduces one of them to upper Hessenberg form and the other to upper triangular form using orthogonal transformations. it is usually followed by qzit
, qzval
and, possibly, qzvec
.
[in]  nm  Must be set to the row dimension of twodimensional array parameters as declared in the calling program dimension statement. 
[in]  n  The order of the matrices. 
[in]  a  Contains a real general matrix. 
[in]  b  Contains a real general matrix. 
[in]  matz  Should be set to true if the right hand transformations are to be accumulated for later use in computing eigenvectors, and to false otherwise. 
[out]  a  Reduced to upper Hessenberg form. The elements below the first subdiagonal have been set to zero. 
[out]  b  Reduced to upper triangular form. The elements below the main diagonal have been set to zero. 
[out]  z  Contains the product of the right hand transformations if matz has been set to true . Otherwise, z is not referenced. 
Reference: Siam J. Numer. Anal. 10, 241256(1973) by Moler and Stewart.
Questions and comments should be directed to Burton S. Garbow, Mathematics and Computer Science Division, Argonne National Laboratory. This version dated August 1983. Fable was used to convert the original Fortran source into C++.
References basic::options::OptionKeys::in::file::l, basic::options::OptionKeys::in::file::s, and basic::options::OptionKeys::in::file::t.
Referenced by rgg().
void numeric::linear_algebra::qzit  (  int const &  nm, 
int const &  n,  
arr_ref< double, 2 >  a,  
arr_ref< double, 2 >  b,  
double const &  eps1,  
bool const &  matz,  
arr_ref< double, 2 >  z,  
int &  ierr  
) 
This subroutine is the second step of the QZ algorithm for solving generalized matrix eigenvalue problems.
This subroutine accepts a pair of real matrices, one of them in upper Hessenberg form and the other in upper triangular form. it reduces the Hessenberg matrix to quasitriangular form using orthogonal transformations while maintaining the triangular form of the other matrix. It is usually preceded by qzhes
and followed by qzval
and, possibly, qzvec
.
[in]  nm  Must be set to the row dimension of twodimensional array parameters as declared in the calling program dimension statement. 
[in]  n  The order of the matrices. 
[in]  a  Contains a real upper Hessenberg matrix. 
[in]  b  Contains a real upper triangular matrix. 
[in]  eps1  A tolerance used to determine negligible elements. Zero or negative values may be given, in which case an element will be neglected only if it is less than roundoff error times the norm of its matrix. If the input eps1 is positive, then an element will be considered negligible if it is less than eps1 times the norm of its matrix. A positive value of eps1 may result in faster execution, but less accurate results. 
[in]  matz  Should be set to true if the right hand transformations are to be accumulated for later use in computing eigenvectors, and to false otherwise. 
[in]  z  Contains, if matz has been set to true , the transformation matrix produced in the reduction by qzhes , if performed, or else the identity matrix. if matz has been set to false , z is not referenced. 
[out]  a  Reduced to quasitriangular form. The elements below the first subdiagonal are still zero and no two consecutive subdiagonal elements are nonzero. 
[out]  b  Still in upper triangular form, although its elements have been altered. The location b(n,1) is used to store eps1 times the norm of b for later use by qzval and qzvec . 
[out]  z  Contains the product of the right hand transformations (for both steps) if matz has been set to true . 
[out]  ierr  Set to zero for normal return, j if the limit of 30*n iterations is exhausted while the jth eigenvalue is being sought. 
Reference: Siam J. Numer. Anal. 10, 241256(1973) by Moler and Stewart, as modified in technical note NASA tn D7305(1973) by Ward.
Questions and comments should be directed to Burton S. Garbow, Mathematics and Computer Science Division, Argonne National Laboratory. This version dated August 1983. Fable was used to convert the original Fortran source into C++.
References epslon(), basic::options::OptionKeys::in::file::l, basic::options::OptionKeys::in::file::s, and basic::options::OptionKeys::in::file::t.
Referenced by rgg().
void numeric::linear_algebra::qzval  (  int const &  nm, 
int const &  n,  
arr_ref< double, 2 >  a,  
arr_ref< double, 2 >  b,  
arr_ref< double >  alfr,  
arr_ref< double >  alfi,  
arr_ref< double >  beta,  
bool const &  matz,  
arr_ref< double, 2 >  z  
) 
This subroutine is the third step of the QZ algorithm for solving generalized matrix eigenvalue problems,.
This subroutine accepts a pair of real matrices, one of them in quasitriangular form and the other in upper triangular form. It reduces the quasitriangular matrix further, so that any remaining 2by2 blocks correspond to pairs of complex eigenvalues, and returns quantities whose ratios give the generalized eigenvalues. It is usually preceded by qzhes
and qzit
and may be followed by qzvec
.
[in]  nm  Must be set to the row dimension of twodimensional array parameters as declared in the calling program dimension statement. 
[in]  n  The order of the matrices. 
[in]  a  Contains a real upper quasitriangular matrix. 
[in]  b  Contains a real upper triangular matrix. In addition, location b(n,1) contains the tolerance quantity epsb computed and saved in qzit . 
[in]  matz  Should be set to true if the right hand transformations are to be accumulated for later use in computing eigenvectors, and to false otherwise. 
[in]  z  Contains, if matz has been set to true , the transformation matrix produced in the reductions by qzhes and qzit , if performed, or else the identity matrix. If matz has been set to false , z is not referenced. 
[out]  a  Reduced further to a quasitriangular matrix in which all nonzero subdiagonal elements correspond to pairs of complex eigenvalues. 
[out]  b  Still in upper triangular form, although its elements have been altered. b(n,1) is unaltered. 
[out]  alfr,alfi  Contain the real and imaginary parts of the diagonal elements of the triangular matrix that would be obtained if a were reduced completely to triangular form by unitary transformations. Nonzero values of alfi occur in pairs, the first member positive and the second negative. 
[out]  beta  Contains the diagonal elements of the corresponding b , normalized to be real and nonnegative. The generalized eigenvalues are then the ratios . 
[out]  z  Contains the product of the right hand transformations (for all three steps) if matz has been set to true . 
Reference: Siam J. Numer. Anal. 10, 241256(1973) by Moler and Stewart.
Questions and comments should be directed to Burton S. Garbow, Mathematics and Computer Science Division, Argonne National Laboratory. This version dated August 1983. Fable was used to convert the original Fortran source into C++.
References basic::options::OptionKeys::corrections::beta, basic::options::OptionKeys::cm::nn, basic::options::OptionKeys::in::file::s, numeric::interpolation::spline::sqr(), basic::options::OptionKeys::in::file::t, and basic::datacache::tr.
Referenced by rgg().
void numeric::linear_algebra::qzvec  (  int const &  nm, 
int const &  n,  
arr_cref< double, 2 >  a,  
arr_ref< double, 2 >  b,  
arr_cref< double >  alfr,  
arr_cref< double >  alfi,  
arr_cref< double >  beta,  
arr_ref< double, 2 >  z  
) 
This subroutine is the optional fourth step of the QZ algorithm for solving generalized matrix eigenvalue problems.
This subroutine accepts a pair of real matrices, one of them in quasitriangular form (in which each 2by2 block corresponds to a pair of complex eigenvalues) and the other in upper triangular form. It computes the eigenvectors of the triangular problem and transforms the results back to the original coordinate system. It is usually preceded by qzhes
, qzit
, and qzval
.
[in]  nm  Must be set to the row dimension of twodimensional array parameters as declared in the calling program dimension statement. 
[in]  n  The order of the matrices. 
[in]  a  Contains a real upper quasitriangular matrix. Not altered by this subroutine. Its subdiagonal elements provide information about the storage of the complex eigenvectors. 
[in]  b  Contains a real upper triangular matrix. In addition, location b(n,1) contains the tolerance quantity epsb computed and saved in qzit . 
[in]  alfr,alfi,beta  Vectors with components whose ratios are the generalized eigenvalues. They are usually obtained from qzval . 
[in]  z  Contains the transformation matrix produced in the reductions by qzhes , qzit , and qzval , if performed. If the eigenvectors of the triangular problem are desired, z must contain the identity matrix. 
[out]  b  Destroyed. 
[out]  z  Contains the real and imaginary parts of the eigenvectors. Each eigenvector is normalized so that the modulus of its largest component is 1.0.

Reference: Siam J. Numer. Anal. 10, 241256(1973) by Moler and Stewart.
Questions and comments should be directed to Burton S. Garbow, Mathematics and Computer Science Division, Argonne National Laboratory. This version dated August 1983. Fable was used to convert the original Fortran source into C++.
References basic::options::OptionKeys::corrections::beta, basic::options::OptionKeys::cm::nn, basic::options::OptionKeys::in::file::s, basic::options::OptionKeys::in::file::t, basic::datacache::tr, numeric::statistics::w(), and basic::options::OptionKeys::motifs::z1.
Referenced by rgg().
void numeric::linear_algebra::rgg  (  int const &  nm, 
int const &  n,  
arr_ref< double, 2 >  a,  
arr_ref< double, 2 >  b,  
arr_ref< double >  alfr,  
arr_ref< double >  alfi,  
arr_ref< double >  beta,  
int const &  matz,  
arr_ref< double, 2 >  z,  
int &  ierr  
) 
This subroutine calls the recommended sequence of subroutines from the eigensystem subroutine package (EISPACK) to find the eigenvalues and eigenvectors (if desired) for the real general generalized eigenproblem .
[in]  nm  Must be set to the row dimension of the twodimensional array parameters as declared in the calling program dimension statement. 
[in]  n  The order of the matrices and . 
[in]  a  A real general matrix. 
[in]  b  A real general matrix. 
[in]  matz  An integer variable set equal to zero if only eigenvalues are desired. otherwise it is set to any nonzero integer for both eigenvalues and eigenvectors. 
[out]  alfr  The real parts of the numerators of the eigenvalues. 
[out]  alfi  The imaginary parts of the numerators of the eigenvalues. 
[out]  beta  The denominators of the eigenvalues, which are thus given by the ratios . Complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having the positive imaginary part first. 
[out]  z  The real and imaginary parts of the eigenvectors if matz is not zero. If the jth eigenvalue is real, the jth column of z contains its eigenvector. If the jth eigenvalue is complex with positive imaginary part, the jth and (j+1)th columns of z contain the real and imaginary parts of its eigenvector. The conjugate of this vector is the eigenvector for the conjugate eigenvalue. 
[out]  ierr  An integer output variable set equal to an error completion code described in the documentation for qzit. The normal completion code is zero. 
Questions and comments should be directed to Burton S. Garbow, Mathematics and Computer Science Division, Argonne National Laboratory. This version dated August 1983. Fable was used to convert the original Fortran source into C++.
References basic::options::OptionKeys::corrections::beta, qzhes(), qzit(), qzval(), and qzvec().
Referenced by numeric::linear_algebra::GeneralizedEigenSolver< _MatrixType >::compute_in_place().