예제 #1
0
 public void WideNorms()
 {
   DoubleMatrix a = new DoubleMatrix(2,3);
   a[0,0] = 2;
   a[0,1] = 4;
   a[0,2] = 5;
   a[1,0] = 3;
   a[1,1] = 1;
   a[1,2] = 6;
   Assert.AreEqual(a.GetL1Norm(),11.000,TOLERENCE);
   Assert.AreEqual(a.GetL2Norm(),9.247,TOLERENCE);
   Assert.AreEqual(a.GetInfinityNorm(),11.000,TOLERENCE);
   Assert.AreEqual(a.GetFrobeniusNorm(),9.539,TOLERENCE);
 }
예제 #2
0
 public void LongNorms()
 {
   DoubleMatrix a = new DoubleMatrix(3,2);
   a[0,0] = 2;
   a[0,1] = 4;
   a[1,0] = 3;
   a[1,1] = 1;
   a[2,0] = 5;
   a[2,1] = 6;
   Assert.AreEqual(a.GetL1Norm(),11.000,TOLERENCE);
   Assert.AreEqual(a.GetL2Norm(),9.337,TOLERENCE);
   Assert.AreEqual(a.GetInfinityNorm(),11.000,TOLERENCE);
   Assert.AreEqual(a.GetFrobeniusNorm(),9.539,TOLERENCE);
 } 
예제 #3
0
 public void Norms()
 {
   DoubleMatrix a = new DoubleMatrix(2);
   a[0,0] = 2;
   a[0,1] = 4;
   a[1,0] = 3;
   a[1,1] = 1;
   Assert.AreEqual(a.GetL1Norm(),5.000,TOLERENCE);
   Assert.AreEqual(a.GetL2Norm(),5.117,TOLERENCE);
   Assert.AreEqual(a.GetInfinityNorm(),6.000,TOLERENCE);
   Assert.AreEqual(a.GetFrobeniusNorm(),5.477,TOLERENCE);
 }