Package mikera.matrixx.decompose

Examples of mikera.matrixx.decompose.ICholeskyResult


        double [][] dataL = {{1,0,0},
                  {2,3,0},
                  {4,5,7}};
        Matrix L = Matrix.create(dataL);

        ICholeskyResult ans = Cholesky.decompose(A);
        assertNotNull(ans);

        Matrix foundL = ans.getL().toMatrix();

//        EjmlUnitTests.assertEquals(L,foundL,1e-8);
        assertArrayEquals(L.getElements(),foundL.getElements(), 1e-8);
    }
View Full Code Here


         {4, 23, 90}};
     
        Matrix A = Matrix.create(data);
        Matrix B=A.clone();
       
        ICholeskyResult ans = Cholesky.decompose(B);
        assertNotNull(ans);
        assertEquals(A,B);
    }
View Full Code Here

        double [][] dataR = {{1,2,4},
                  {0,3,5},
                  {0,0,7}};
        Matrix R = Matrix.create(dataR);

        ICholeskyResult ans = Cholesky.decompose(A);
        assertNotNull(ans);
        Matrix foundR = ans.getU().toMatrix();

        assertArrayEquals(R.getElements(),foundR.getElements(),1e-8);
    }
View Full Code Here

        double [][] dataL = {{1,0,0},
                  {2,3,0},
                  {4,5,7}};
        Matrix L = Matrix.create(dataL);

        ICholeskyResult ans = CholeskyInner.decompose(A);
        assertNotNull(ans);

        Matrix foundL = ans.getL().toMatrix();

//        EjmlUnitTests.assertEquals(L,foundL,1e-8);
        assertArrayEquals(L.getElements(),foundL.getElements(), 1e-8);
    }
View Full Code Here

        double [][] dataR = {{1,2,4},
                  {0,3,5},
                  {0,0,7}};
        Matrix R = Matrix.create(dataR);

        ICholeskyResult ans = CholeskyInner.decompose(A);
        assertNotNull(ans);
        Matrix foundR = ans.getU().toMatrix();

        assertArrayEquals(R.getElements(),foundR.getElements(),1e-8);
    }
View Full Code Here

  @Test
  public void testCholeskyRegression() {
    Matrix original = Matrix.create(new double[][] {{4,12,-16},{12,37,-43},{-16,-43,98}})
    Matrix a=Matrix.create(original);
    ICholeskyResult r=Cholesky.decompose(a);
    validateCholesky(a,r);
   
    assertEquals(original,a);
  }
View Full Code Here

  @Test
  public void testCholesky() {
    AMatrix z = Matrixx.createRandomMatrix(3, 3);
    AMatrix a = z.innerProduct(z.getTranspose()); // should get a symmetric positive definite matrix!
   
    ICholeskyResult r=Cholesky.decompose(a);
    validateCholesky(a,r);
  }
View Full Code Here

  }
 
  @Test
  public void testZero() {
    AMatrix a = ZeroMatrix.create(4, 4);
    ICholeskyResult r=Cholesky.decompose(a);
    assertNull(r);
  }
View Full Code Here

  }
 
  @Test
  public void testIdentity() {
    AMatrix a = IdentityMatrix.create(5);
    ICholeskyResult r=Cholesky.decompose(a);
    validateCholesky(a,r);   
  }
View Full Code Here

  }
 
  @Test
  public void testSpecial() {
    AMatrix a = Matrix.create(new double[][] {{0,1},{0,0}});
    ICholeskyResult r=Cholesky.decompose(a);
    assertNull(r)
  }
View Full Code Here

TOP

Related Classes of mikera.matrixx.decompose.ICholeskyResult

Copyright © 2018 www.massapicom. 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.