public void NullParameterTestforConstructor4() { FloatLevinson fl = new FloatLevinson(LC5.ToArray(), null as ROFloatVector); }
public void ZeroLengthVectorTestsforConstructor1() { FloatVector fv = new FloatVector(1, 0.0f); fv.RemoveAt(0); FloatLevinson fl = new FloatLevinson(fv, fv); }
public void OrderPropertyTest() { FloatLevinson fl = new FloatLevinson(LC5, TR5); Assert.IsTrue(fl.Order == 5); }
public void SingularityPropertyTest2() { FloatVector LC = new FloatVector(new float[]{4.0f, 2.0f, 1.0f, 0.0f}); FloatVector TR = new FloatVector(new float[]{4.0f, 8.0f, 2.0f, 1.0f}); FloatLevinson fl = new FloatLevinson(LC,TR); Assert.IsTrue(fl.IsSingular); }
public void FirstElementTestforConstructor2() { FloatVector fv = new FloatVector(3, 1.0f); FloatLevinson fl = new FloatLevinson(LC3.ToArray(), fv.ToArray()); }
public void GetTopRowTest() { FloatLevinson fl = new FloatLevinson(LC5, TR5); FloatVector TR = fl.GetTopRow(); Assert.IsTrue(TR5.Equals(TR)); }
public void MismatchRowsTestforSolveMatrix() { FloatLevinson fl = new FloatLevinson(LC10, TR10); FloatMatrix X = fl.Solve(I5); }
public void MismatchVectorLengthTestsforConstructor2() { FloatLevinson fl = new FloatLevinson(LC2.ToArray(), TR3.ToArray()); }
public void SolveVector10() { int i; float e, me; FloatLevinson fl = new FloatLevinson(LC10, TR10); FloatVector X = fl.Solve(Y10); // determine the maximum error me = 0.0f; for (i = 0; i < fl.Order; i++) { e = System.Math.Abs((X10[i] - X[i]) / X10[i]); if (e > me) { me = e; } } Assert.IsTrue(me < Tolerance10, "Maximum Error = " + me.ToString()); }
public void NullParameterTestforSolveMatrix() { FloatLevinson fl = new FloatLevinson(LC10, TR10); FloatMatrix X = fl.Solve(null as FloatMatrix); }
public void MismatchRowsTestforSolveVector() { FloatLevinson fl = new FloatLevinson(LC10, TR10); FloatVector X = fl.Solve(X5); }
public void NullParameterTestforSolveVector() { FloatLevinson fl = new FloatLevinson(LC10, TR10); FloatVector X = fl.Solve(null as FloatVector); }
public void GetDeterminantMethodTest10() { // calculate determinant from diagonal FloatLevinson fl = new FloatLevinson(LC10, TR10); // check results match float e = System.Math.Abs( (fl.GetDeterminant() - Det10)/Det10 ); Assert.IsTrue(e < Tolerance10); }
public void ZeroLengthVectorTestsforConstructor2() { float[] fv = new float[0]; FloatLevinson fl = new FloatLevinson(fv, fv); }
public void SolveMatrix5() { int i, j; float e, me; FloatLevinson fl = new FloatLevinson(LC5, TR5); // check inverse FloatMatrix I = fl.Solve(FloatMatrix.CreateIdentity(5)); me = 0.0f; for (i = 0; i < fl.Order; i++) { for (j = 0; j < fl.Order; j++) { e = System.Math.Abs((I5[i, j] - I[i, j]) / I5[i, j]); if (e > me) { me = e; } } } Assert.IsTrue(me < Tolerance5, "Maximum Error = " + me.ToString()); }
public void MismatchVectorLengthTestsforConstructor1() { FloatLevinson fl = new FloatLevinson(LC2, TR3); }
public void GetInverse10() { int i, j; float e, me; FloatLevinson fl = new FloatLevinson(LC10, TR10); // check inverse FloatMatrix I = fl.GetInverse(); me = 0.0f; for (i = 0; i < fl.Order; i++) { for (j = 0; j < fl.Order; j++) { e = System.Math.Abs((I10[i, j] - I[i, j]) / I10[i, j]); if (e > me) { me = e; } } } Assert.IsTrue(me < Tolerance10, "Maximum Error = " + me.ToString()); }
public void FirstElementTestforConstructor1() { FloatVector fv = new FloatVector(3, 1.0f); FloatLevinson fl = new FloatLevinson(LC3, fv); }
public void NullParameterTestforConstructor1() { FloatLevinson fl = new FloatLevinson(null as FloatVector, TR5); }
public void GetLeftColumnTest() { FloatLevinson fl = new FloatLevinson(LC5, TR5); FloatVector LC = fl.GetLeftColumn(); Assert.IsTrue(LC5.Equals(LC)); }
public void NullParameterTestforConstructor2() { FloatLevinson fl = new FloatLevinson(LC5, null as FloatVector); }
public void GetMatrixMemberTest() { FloatLevinson fl = new FloatLevinson(LC5, TR5); FloatMatrix flfm = fl.GetMatrix(); for (int row = 0; row < TR5.Length; row++) { for (int column = 0; column < TR5.Length; column++) { if (column < row) { Assert.IsTrue(flfm[row, column] == LC5[row - column]); } else { Assert.IsTrue(flfm[row, column] == TR5[column - row]); } } } }
public void NullParameterTestforConstructor3() { FloatLevinson fl = new FloatLevinson(null as ROFloatVector, TR5.ToArray()); }
public void DecompositionTest2() { int i, j; float e, me; FloatLevinson fl = new FloatLevinson(LC2, TR2); FloatMatrix U = fl.U; FloatMatrix D = fl.D; FloatMatrix L = fl.L; // check the upper triangle me = 0.0f; for (i = 0; i < fl.Order; i++) { for (j = 0; j < fl.Order; j++) { if (B2[i, j] != U[i, j]) { e = System.Math.Abs((B2[i, j] - U[i, j]) / B2[i, j]); if (e > me) { me = e; } } } } Assert.IsTrue(me < Tolerance2, "Maximum Error = " + me.ToString()); // check the lower triangle me = 0.0f; for (i = 0; i < fl.Order; i++) { for (j = 0; j < fl.Order; j++) { if (A2[i, j] != L[i, j]) { e = System.Math.Abs((A2[i, j] - L[i, j]) / A2[i, j]); if (e > me) { me = e; } } } } Assert.IsTrue(me < Tolerance2, "Maximum Error = " + me.ToString()); // check the diagonal me = 0.0f; for (i = 0; i < fl.Order; i++) { e = System.Math.Abs((D2[i] - D[i, i]) / D2[i]); if (e > me) { me = e; } } Assert.IsTrue(me < Tolerance2, "Maximum Error = " + me.ToString()); }
public void SingularityPropertyTest1() { FloatLevinson fl = new FloatLevinson(LC4,TR4); Assert.IsFalse(fl.IsSingular); }