Exemplo n.º 1
0
 public void NullParameterTestforConstructor4()
 {
   FloatLevinson fl = new FloatLevinson(LC5.ToArray(), null as ROFloatVector);
 }
Exemplo n.º 2
0
 public void ZeroLengthVectorTestsforConstructor1()
 {
   FloatVector fv = new FloatVector(1, 0.0f);
   fv.RemoveAt(0);
   FloatLevinson fl = new FloatLevinson(fv, fv);
 }
Exemplo n.º 3
0
 public void OrderPropertyTest()
 {
   FloatLevinson fl = new FloatLevinson(LC5, TR5);
   Assert.IsTrue(fl.Order == 5);
 }
Exemplo n.º 4
0
    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);
    }
Exemplo n.º 5
0
 public void FirstElementTestforConstructor2()
 {
   FloatVector fv = new FloatVector(3, 1.0f);
   FloatLevinson fl = new FloatLevinson(LC3.ToArray(), fv.ToArray());
 }
Exemplo n.º 6
0
 public void GetTopRowTest()
 {
   FloatLevinson fl = new FloatLevinson(LC5, TR5);
   FloatVector TR = fl.GetTopRow();
   Assert.IsTrue(TR5.Equals(TR));
 }
Exemplo n.º 7
0
 public void MismatchRowsTestforSolveMatrix()
 {
   FloatLevinson fl = new FloatLevinson(LC10, TR10);
   FloatMatrix X = fl.Solve(I5);
 }
Exemplo n.º 8
0
 public void MismatchVectorLengthTestsforConstructor2()
 {
   FloatLevinson fl = new FloatLevinson(LC2.ToArray(), TR3.ToArray());
 }
Exemplo n.º 9
0
 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());
 }
Exemplo n.º 10
0
 public void NullParameterTestforSolveMatrix()
 {
   FloatLevinson fl = new FloatLevinson(LC10, TR10);
   FloatMatrix X = fl.Solve(null as FloatMatrix);
 }
Exemplo n.º 11
0
 public void MismatchRowsTestforSolveVector()
 {
   FloatLevinson fl = new FloatLevinson(LC10, TR10);
   FloatVector X = fl.Solve(X5);
 }
Exemplo n.º 12
0
 public void NullParameterTestforSolveVector()
 {
   FloatLevinson fl = new FloatLevinson(LC10, TR10);
   FloatVector X = fl.Solve(null as FloatVector);
 }
Exemplo n.º 13
0
    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);
    }
Exemplo n.º 14
0
 public void ZeroLengthVectorTestsforConstructor2()
 {
   float[] fv = new float[0];
   FloatLevinson fl = new FloatLevinson(fv, fv);
 }
Exemplo n.º 15
0
    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());
    }
Exemplo n.º 16
0
 public void MismatchVectorLengthTestsforConstructor1()
 {
   FloatLevinson fl = new FloatLevinson(LC2, TR3);
 }
Exemplo n.º 17
0
    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());
    }
Exemplo n.º 18
0
 public void FirstElementTestforConstructor1()
 {
   FloatVector fv = new FloatVector(3, 1.0f);
   FloatLevinson fl = new FloatLevinson(LC3, fv);
 }
Exemplo n.º 19
0
 public void NullParameterTestforConstructor1()
 {
   FloatLevinson fl = new FloatLevinson(null as FloatVector, TR5);
 }
Exemplo n.º 20
0
 public void GetLeftColumnTest()
 {
   FloatLevinson fl = new FloatLevinson(LC5, TR5);
   FloatVector LC = fl.GetLeftColumn();
   Assert.IsTrue(LC5.Equals(LC));
 }
Exemplo n.º 21
0
 public void NullParameterTestforConstructor2()
 {
   FloatLevinson fl = new FloatLevinson(LC5, null as FloatVector);
 }
Exemplo n.º 22
0
 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]);
       }
     }
   }
 }
Exemplo n.º 23
0
 public void NullParameterTestforConstructor3()
 {
   FloatLevinson fl = new FloatLevinson(null as ROFloatVector, TR5.ToArray());
 }
Exemplo n.º 24
0
    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());
    }
Exemplo n.º 25
0
 public void SingularityPropertyTest1()
 {
   FloatLevinson fl = new FloatLevinson(LC4,TR4);
   Assert.IsFalse(fl.IsSingular);
 }