QRDecomposition
cern.colt.matrix.linalg

Class QRDecomposition

  • All Implemented Interfaces:
    Serializable


    public class QRDecompositionextends Objectimplements Serializable
    For an m x n matrix A with m >= n, the QR decomposition is an m x northogonal matrix Q and an n x n upper triangular matrix R so thatA = Q*R.

    The QR decompostion always exists, even if the matrix does not havefull rank, so the constructor will never fail. The primary use of theQR decomposition is in the least squares solution of nonsquare systemsof simultaneous linear equations. This will fail if isFullRank()returns false.

    See Also:
    Serialized Form
    • Constructor Detail

      • QRDecomposition

        public QRDecomposition(DoubleMatrix2D A)
        Constructs and returns a new QR decomposition object; computed by Householder reflections;The decomposed matrices can be retrieved via instance methods of the returned decomposition object.
        Parameters:
        A - A rectangular matrix.
        Throws:
        IllegalArgumentException - if A.rows() < A.columns().
    • Method Detail

      • getH

        public DoubleMatrix2D getH()
        Returns the Householder vectors H.
        Returns:
        A lower trapezoidal matrix whose columns define the householder reflections.
      • getQ

        public DoubleMatrix2D getQ()
        Generates and returns the (economy-sized) orthogonal factor Q.
        Returns:
        Q
      • getR

        public DoubleMatrix2D getR()
        Returns the upper triangular factor, R.
        Returns:
        R
      • hasFullRank

        public boolean hasFullRank()
        Returns whether the matrix A has full rank.
        Returns:
        true if R, and hence A, has full rank.
      • toString

        public String toString()
        Returns a String with (propertyName, propertyValue) pairs.Useful for debugging or to quickly get the rough picture.For example,
        rank          : 3trace         : 0
        Overrides:
        toString in class Object

SCaVis 1.7 © jWork.org