static FloatCholeskyDecompTest() { FloatMatrix a = new FloatMatrix(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 FloatCholeskyDecomp(a); }
public void NonSymmFactorTest() { FloatMatrix b = new FloatMatrix(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; FloatCholeskyDecomp dcd = new FloatCholeskyDecomp(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() { FloatMatrix lm = new FloatMatrix(3,2); FloatCholeskyDecomp lcd = new FloatCholeskyDecomp(lm); }
public void CDWide() { FloatMatrix wm = new FloatMatrix(2,3); FloatCholeskyDecomp wcd = new FloatCholeskyDecomp(wm); }
public void GetInverseNotPositiveDefiniteTest() { FloatMatrix a = new FloatMatrix(3,3); FloatCholeskyDecomp dcd = new FloatCholeskyDecomp(a); dcd.GetInverse(); }
public void IsPositiveDefiniteTest() { Assert.IsTrue(cd.IsPositiveDefinite); FloatMatrix b = new FloatMatrix(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; FloatCholeskyDecomp dcd = new FloatCholeskyDecomp(b); Assert.IsFalse(dcd.IsPositiveDefinite); }