static DoubleCholeskyDecompTest() { DoubleMatrix a = new DoubleMatrix(3); a[0,0] = 2; a[0,1] = 1; a[0,2] = 0; a[1,0] = 1; a[1,1] = 2; a[1,2] = 0; a[2,0] = 0; a[2,1] = 0; a[2,2] = 3; cd = new DoubleCholeskyDecomp(a); }
public void NonSymmFactorTest() { DoubleMatrix b = new DoubleMatrix(3); b[0,0] = 2; b[0,1] = 1; b[0,2] = 1; b[1,0] = 1; b[1,1] = 2; b[1,2] = 0; b[2,0] = 0; b[2,1] = 0; b[2,2] = 3; DoubleCholeskyDecomp dcd = new DoubleCholeskyDecomp(b); Assert.AreEqual(dcd.Factor[0,0],1.414,TOLERENCE); Assert.AreEqual(dcd.Factor[0,1],0.000,TOLERENCE); Assert.AreEqual(dcd.Factor[0,2],0.000,TOLERENCE); Assert.AreEqual(dcd.Factor[1,0],0.707,TOLERENCE); Assert.AreEqual(dcd.Factor[1,1],1.225,TOLERENCE); Assert.AreEqual(dcd.Factor[1,2],0.000,TOLERENCE); Assert.AreEqual(dcd.Factor[2,0],0.000,TOLERENCE); Assert.AreEqual(dcd.Factor[2,1],0.000,TOLERENCE); Assert.AreEqual(dcd.Factor[2,2],1.732,TOLERENCE); }
public void CDLong() { DoubleMatrix lm = new DoubleMatrix(3,2); DoubleCholeskyDecomp lcd = new DoubleCholeskyDecomp(lm); }
public void CDWide() { DoubleMatrix wm = new DoubleMatrix(2,3); DoubleCholeskyDecomp cd = new DoubleCholeskyDecomp(wm); }
public void GetInverseNotPositiveDefiniteTest() { DoubleMatrix a = new DoubleMatrix(3,3); DoubleCholeskyDecomp dcd = new DoubleCholeskyDecomp(a); dcd.GetInverse(); }
public void IsPositiveDefiniteTest() { Assert.IsTrue(cd.IsPositiveDefinite); DoubleMatrix b = new DoubleMatrix(3); b[0,0] = -2; b[0,1] = 1; b[0,2] = 0; b[1,0] = 1; b[1,1] = 2; b[1,2] = 0; b[2,0] = 0; b[2,1] = 0; b[2,2] = 3; DoubleCholeskyDecomp dcd = new DoubleCholeskyDecomp(b); Assert.IsFalse(dcd.IsPositiveDefinite); }