Rosetta  2020.46
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions
numeric::linear_algebra Namespace Reference

Classes

class  EllipseParameters
 Container class for ellipse parameters. More...
 
class  GeneralizedEigenSolver
 Solves generalized eigenvalue problems. More...
 

Typedefs

typedef
utility::pointer::shared_ptr
< EllipseParameters
EllipseParametersOP
 
typedef
utility::pointer::shared_ptr
< EllipseParameters const > 
EllipseParametersCOP
 

Functions

EllipseParametersOP minimum_bounding_ellipse (utility::vector1< xyzVector< Real > > points, Real tolerance, Size max_iterations)
 Use the Khachiyan Algorithm to compute the minimum volume enclosing ellipsoid given a set of (x,y) data points. More...
 
Real sum_of_square_differences (MathMatrix< Real > old_u, MathMatrix< Real > new_u)
 Calculate the sum-of-square differences between values stored in two vector1 objects. More...
 
MathMatrix< Realnon_square_transpose (MathMatrix< Real > matrix_in)
 Calculate the transpose of a non-square MathMatrix and return the result as a new MathMatrix. More...
 
bool point_in_ellipse (xyzVector< Real > p, Real const h, Real const k, Real const a, Real const b, MathMatrix< Real > rotation)
 Check whether a given test point lies within an ellipse. More...
 
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 $ Ax = \lambda Bx $. More...
 
void qzhes (int const &nm, int const &n, fem::major_types::arr_ref< double, 2 > a, fem::major_types::arr_ref< double, 2 > b, bool const &matz, fem::major_types::arr_ref< double, 2 > z)
 
void qzit (int const &nm, int const &n, fem::major_types::arr_ref< double, 2 > a, fem::major_types::arr_ref< double, 2 > b, double const &eps1, bool const &matz, fem::major_types::arr_ref< double, 2 > z, int &ierr)
 
void qzval (int const &nm, int const &n, fem::major_types::arr_ref< double, 2 > a, fem::major_types::arr_ref< double, 2 > b, fem::major_types::arr_ref< double > alfr, fem::major_types::arr_ref< double > alfi, fem::major_types::arr_ref< double > beta, bool const &matz, fem::major_types::arr_ref< double, 2 > z)
 
void qzvec (int const &nm, int const &n, fem::major_types::arr_cref< double, 2 > a, fem::major_types::arr_ref< double, 2 > b, fem::major_types::arr_cref< double > alfr, fem::major_types::arr_cref< double > alfi, fem::major_types::arr_cref< double > beta, fem::major_types::arr_ref< double, 2 > z)
 
void rgg (int const &nm, int const &n, fem::major_types::arr_ref< double, 2 > a, fem::major_types::arr_ref< double, 2 > b, fem::major_types::arr_ref< double > alfr, fem::major_types::arr_ref< double > alfi, fem::major_types::arr_ref< double > beta, int const &matz, fem::major_types::arr_ref< double, 2 > z, int &ierr)
 
Real pythag (Real a, Real b)
 
Real sign (Real a, Real b)
 
void svdcmp (utility::vector1< utility::vector1< Real > > &a, Size const m, Size const n, utility::vector1< Real > &w, utility::vector1< utility::vector1< Real > > &v)
 

Typedef Documentation

Function Documentation

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:

  1. The base used in representing floating point numbers is not a power of three.
  2. The quantity a in statement 10 is represented to the accuracy used in floating point variables that are stored in memory.

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 four-thirds.
  • 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++.

References a, and basic::options::OptionKeys::score::fiber_diffraction::b.

Referenced by qzit().

EllipseParametersOP numeric::linear_algebra::minimum_bounding_ellipse ( utility::vector1< xyzVector< Real > >  points,
Real  tolerance,
Size  max_iterations 
)
MathMatrix< Real > numeric::linear_algebra::non_square_transpose ( MathMatrix< Real >  matrix_in)

Calculate the transpose of a non-square MathMatrix and return the result as a new MathMatrix.

References numeric::MathMatrix< T >::get_number_cols(), numeric::MathMatrix< T >::get_number_rows(), and test.T200_Scoring::ii.

Referenced by minimum_bounding_ellipse().

bool numeric::linear_algebra::point_in_ellipse ( xyzVector< Real >  p,
Real const  h,
Real const  k,
Real const  a,
Real const  b,
MathMatrix< Real >  rotation 
)
Real numeric::linear_algebra::pythag ( Real  a,
Real  b 
)
void numeric::linear_algebra::qzhes ( int const &  nm,
int const &  n,
fem::major_types::arr_ref< double, 2 >  a,
fem::major_types::arr_ref< double, 2 >  b,
bool const &  matz,
fem::major_types::arr_ref< double, 2 >  z 
)
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.

Parameters
[in]nmMust be set to the row dimension of two-dimensional array parameters as declared in the calling program dimension statement.
[in]nThe order of the matrices.
[in]aContains a real general matrix.
[in]bContains a real general matrix.
[in]matzShould be set to true if the right hand transformations are to be accumulated for later use in computing eigenvectors, and to false otherwise.
[out]aReduced to upper Hessenberg form. The elements below the first subdiagonal have been set to zero.
[out]bReduced to upper triangular form. The elements below the main diagonal have been set to zero.
[out]zContains 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, 241-256(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 a, basic::options::OptionKeys::score::fiber_diffraction::b, basic::options::OptionKeys::frags::j, basic::options::OptionKeys::in::file::l, test.G201_Module_Structure::l1, basic::options::OptionKeys::in::file::s, basic::options::OptionKeys::in::file::t, and numeric::crick_equations::z().

Referenced by rgg().

void numeric::linear_algebra::qzit ( int const &  nm,
int const &  n,
fem::major_types::arr_ref< double, 2 >  a,
fem::major_types::arr_ref< double, 2 >  b,
double const &  eps1,
bool const &  matz,
fem::major_types::arr_ref< double, 2 >  z,
int ierr 
)
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 quasi-triangular 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.

Parameters
[in]nmMust be set to the row dimension of two-dimensional array parameters as declared in the calling program dimension statement.
[in]nThe order of the matrices.
[in]aContains a real upper Hessenberg matrix.
[in]bContains a real upper triangular matrix.
[in]eps1A 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]matzShould be set to true if the right hand transformations are to be accumulated for later use in computing eigenvectors, and to false otherwise.
[in]zContains, 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]aReduced to quasi-triangular form. The elements below the first subdiagonal are still zero and no two consecutive subdiagonal elements are nonzero.
[out]bStill 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]zContains the product of the right hand transformations (for both steps) if matz has been set to true.
[out]ierrSet to zero for normal return, j if the limit of 30*n iterations is exhausted while the j-th eigenvalue is being sought.

Reference: Siam J. Numer. Anal. 10, 241-256(1973) by Moler and Stewart, as modified in technical note NASA tn D-7305(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 a, test.Workshop3test::a1, test.Workshop3test::a2, basic::options::OptionKeys::score::fiber_diffraction::b, epslon(), basic::options::OptionKeys::frags::j, basic::options::OptionKeys::in::file::l, test.G201_Module_Structure::l1, basic::options::OptionKeys::in::file::s, basic::options::OptionKeys::in::file::t, and numeric::crick_equations::z().

Referenced by rgg().

void numeric::linear_algebra::qzval ( int const &  nm,
int const &  n,
fem::major_types::arr_ref< double, 2 >  a,
fem::major_types::arr_ref< double, 2 >  b,
fem::major_types::arr_ref< double alfr,
fem::major_types::arr_ref< double alfi,
fem::major_types::arr_ref< double beta,
bool const &  matz,
fem::major_types::arr_ref< double, 2 >  z 
)
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 quasi-triangular form and the other in upper triangular form. It reduces the quasi-triangular matrix further, so that any remaining 2-by-2 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.

Parameters
[in]nmMust be set to the row dimension of two-dimensional array parameters as declared in the calling program dimension statement.
[in]nThe order of the matrices.
[in]aContains a real upper quasi-triangular matrix.
[in]bContains a real upper triangular matrix. In addition, location b(n,1) contains the tolerance quantity epsb computed and saved in qzit.
[in]matzShould be set to true if the right hand transformations are to be accumulated for later use in computing eigenvectors, and to false otherwise.
[in]zContains, 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]aReduced further to a quasi-triangular matrix in which all nonzero subdiagonal elements correspond to pairs of complex eigenvalues.
[out]bStill in upper triangular form, although its elements have been altered. b(n,1) is unaltered.
[out]alfr,alfiContain 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. Non-zero values of alfi occur in pairs, the first member positive and the second negative.
[out]betaContains the diagonal elements of the corresponding b, normalized to be real and non-negative. The generalized eigenvalues are then the ratios $\frac{\mathrm{alfr} + i \times \mathrm{alfi}} {\mathrm{beta}}$.
[out]zContains the product of the right hand transformations (for all three steps) if matz has been set to true.

Reference: Siam J. Numer. Anal. 10, 241-256(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 a, test.Workshop3test::a1, test.Workshop3test::a2, basic::options::OptionKeys::score::fiber_diffraction::b, basic::options::OptionKeys::corrections::beta, test.T009_Exceptions::e, basic::options::OptionKeys::frags::j, basic::options::OptionKeys::cm::nn, basic::options::OptionKeys::in::file::s, sqr(), basic::options::OptionKeys::in::file::t, tr, and numeric::crick_equations::z().

Referenced by rgg().

void numeric::linear_algebra::qzvec ( int const &  nm,
int const &  n,
fem::major_types::arr_cref< double, 2 >  a,
fem::major_types::arr_ref< double, 2 >  b,
fem::major_types::arr_cref< double alfr,
fem::major_types::arr_cref< double alfi,
fem::major_types::arr_cref< double beta,
fem::major_types::arr_ref< double, 2 >  z 
)
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 quasi-triangular form (in which each 2-by-2 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.

Parameters
[in]nmMust be set to the row dimension of two-dimensional array parameters as declared in the calling program dimension statement.
[in]nThe order of the matrices.
[in]aContains a real upper quasi-triangular matrix. Not altered by this subroutine. Its subdiagonal elements provide information about the storage of the complex eigenvectors.
[in]bContains a real upper triangular matrix. In addition, location b(n,1) contains the tolerance quantity epsb computed and saved in qzit.
[in]alfr,alfi,betaVectors with components whose ratios $\frac{\mathrm{alfr} + i \times \mathrm{alfi} } {\mathrm{beta}}$ are the generalized eigenvalues. They are usually obtained from qzval.
[in]zContains 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]bDestroyed.
[out]zContains the real and imaginary parts of the eigenvectors. Each eigenvector is normalized so that the modulus of its largest component is 1.0.
  • if alfi(i) == 0.0, the i-th eigenvalue is real and the i-th column of z contains its eigenvector.
  • if alfi(i) != 0.0, the i-th eigenvalue is complex.
  • if alfi(i) > 0.0, the eigenvalue is the first of a complex pair and the i-th and (i+1)-th columns of z contain its eigenvector.
  • if alfi(i) < 0.0, the eigenvalue is the second of a complex pair and the (i-1)-th and i-th columns of z contain the conjugate of its eigenvector.

Reference: Siam J. Numer. Anal. 10, 241-256(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 a, basic::options::OptionKeys::score::fiber_diffraction::b, basic::options::OptionKeys::corrections::beta, test.T200_Scoring::ii, basic::options::OptionKeys::frags::j, test.T110_numeric::m, basic::options::OptionKeys::cm::nn, basic::options::OptionKeys::in::file::s, basic::options::OptionKeys::in::file::t, tr, numeric::statistics::w(), numeric::crick_equations::x(), numeric::crick_equations::y(), numeric::crick_equations::z(), and basic::options::OptionKeys::motifs::z1.

Referenced by rgg().

void numeric::linear_algebra::rgg ( int const &  nm,
int const &  n,
fem::major_types::arr_ref< double, 2 >  a,
fem::major_types::arr_ref< double, 2 >  b,
fem::major_types::arr_ref< double alfr,
fem::major_types::arr_ref< double alfi,
fem::major_types::arr_ref< double beta,
int const &  matz,
fem::major_types::arr_ref< double, 2 >  z,
int ierr 
)
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 $ Ax = \lambda Bx $.

Parameters
[in]nmMust be set to the row dimension of the two-dimensional array parameters as declared in the calling program dimension statement.
[in]nThe order of the matrices $A$ and $B$.
[in]aA real general matrix.
[in]bA real general matrix.
[in]matzAn integer variable set equal to zero if only eigenvalues are desired. otherwise it is set to any non-zero integer for both eigenvalues and eigenvectors.
[out]alfrThe real parts of the numerators of the eigenvalues.
[out]alfiThe imaginary parts of the numerators of the eigenvalues.
[out]betaThe denominators of the eigenvalues, which are thus given by the ratios $\frac{\mathrm{alfr} + i \times \mathrm{alfi}} {\mathrm{beta}}$. Complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having the positive imaginary part first.
[out]zThe real and imaginary parts of the eigenvectors if matz is not zero. If the j-th eigenvalue is real, the j-th column of z contains its eigenvector. If the j-th eigenvalue is complex with positive imaginary part, the j-th 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]ierrAn 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 a, basic::options::OptionKeys::score::fiber_diffraction::b, basic::options::OptionKeys::corrections::beta, qzhes(), qzit(), qzval(), qzvec(), test.G200_Module_Region::tf, and numeric::crick_equations::z().

Referenced by numeric::linear_algebra::GeneralizedEigenSolver< _MatrixType >::compute_in_place().

Real numeric::linear_algebra::sign ( Real  a,
Real  b 
)
Real numeric::linear_algebra::sum_of_square_differences ( MathMatrix< Real >  old_u,
MathMatrix< Real >  new_u 
)

Calculate the sum-of-square differences between values stored in two vector1 objects.

References a, ObjexxFCL::abs(), erraser_analysis::diff, numeric::MathMatrix< T >::get_number_rows(), test.T200_Scoring::ii, and ObjexxFCL::pow().

Referenced by minimum_bounding_ellipse().

void numeric::linear_algebra::svdcmp ( utility::vector1< utility::vector1< Real > > &  a,
Size const  m,
Size const  n,
utility::vector1< Real > &  w,
utility::vector1< utility::vector1< Real > > &  v 
)