Package mikera.matrixx.decompose.impl.qr

Examples of mikera.matrixx.decompose.impl.qr.HouseholderQR.decompose()


  @Test
  public void testDecompose() {
    double[][] dataA = { { 0, 3, 1 }, { 0, 4, -2 }, { 2, 1, 1 } };
    Matrix A = Matrix.create(dataA);
    HouseholderQR alg = new HouseholderQR(false);
    IQRResult result = alg.decompose(A);
   
    AMatrix Q = result.getQ();
    AMatrix R = result.getR();

    Matrix expectQ = Matrix.create(new double[][] { { 0, -0.6, 0.8 },
View Full Code Here


    assertEquals(Q, expectQ);
    assertEquals(R, expectR);

    A = Matrix.create(dataA);
    alg = new HouseholderQR(true);
    result = alg.decompose(A);
    Q = result.getQ();
    R = result.getR();

    assertEquals(Q, expectQ);
    assertEquals(R, expectR);
View Full Code Here

  @Test
  public void testZeroDecompose() {
    AMatrix a = ZeroMatrix.create(4, 3);
    HouseholderQR alg = new HouseholderQR(false);
    IQRResult result = alg.decompose(a);
    AMatrix q = result.getQ();
    AMatrix r = result.getR();

    assertEquals(IdentityMatrix.create(3), q.subMatrix(0, 3, 0, 3));
    assertTrue(r.isZero());
View Full Code Here

  @Test
  public void testZeroDecomposeSquare() {
    AMatrix a = ZeroMatrix.create(3, 3);
    HouseholderQR alg = new HouseholderQR(false);
    IQRResult result = alg.decompose(a);
    AMatrix q = result.getQ();
    AMatrix r = result.getR();

    assertEquals(IdentityMatrix.create(3), q);
View Full Code Here

     * @param matrix
     * @return
     */
    public static IQRResult decompose(AMatrix matrix) {
        HouseholderQR alg = new HouseholderQR(false);
        return alg.decompose(matrix)
    }
    /**
     * Computes the QR factorisation of a matrix A such that:
     *
     *   A = Q.R
View Full Code Here

     * @param matrix
     * @return
     */
    public static IQRResult decompose(AMatrix matrix, boolean compact) {
        HouseholderQR alg = new HouseholderQR(compact);
        return alg.decompose(matrix)
    }
   
  /**
   * Computes the QR factorisation of a matrix A such that:
   *
 
View Full Code Here

   * @param matrix
   * @return
   */
  public static IQRResult decomposeCompact(AMatrix matrix) {
    HouseholderQR alg = new HouseholderQR(true);
    return alg.decompose(matrix)
  }
 
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.