public void WideNorms() { ComplexDoubleMatrix a = new ComplexDoubleMatrix(2, 3); a[0, 0] = new Complex(1.1, 1.1); a[0, 1] = new Complex(2.2, -2.2); a[0, 2] = new Complex(3.3, 3.3); a[1, 0] = new Complex(4.4, -4.4); a[1, 1] = new Complex(5.5, 5.5); a[1, 2] = new Complex(6.6, -6.6); Assert.AreEqual(a.GetL1Norm(), 14.001, TOLERENCE); Assert.AreEqual(a.GetL2Norm(), 13.845, TOLERENCE); Assert.AreEqual(a.GetInfinityNorm(), 23.335, TOLERENCE); Assert.AreEqual(a.GetFrobeniusNorm(), 14.840, TOLERENCE); }
public void LongNorms() { ComplexDoubleMatrix a = new ComplexDoubleMatrix(3, 2); a[0, 0] = new Complex(1.1, 1.1); a[0, 1] = new Complex(2.2, -2.2); a[1, 0] = new Complex(3.3, 3.3); a[1, 1] = new Complex(4.4, -4.4); a[2, 0] = new Complex(5.5, 5.5); a[2, 1] = new Complex(6.6, -6.6); Assert.AreEqual(a.GetL1Norm(), 18.668, TOLERENCE); Assert.AreEqual(a.GetL2Norm(), 14.818, TOLERENCE); Assert.AreEqual(a.GetInfinityNorm(), 17.112, TOLERENCE); Assert.AreEqual(a.GetFrobeniusNorm(), 14.840, TOLERENCE); }
public void Norms() { ComplexDoubleMatrix a = new ComplexDoubleMatrix(2); a[0, 0] = new Complex(1.1, 1.1); a[0, 1] = new Complex(2.2, -2.2); a[1, 0] = new Complex(3.3, 3.3); a[1, 1] = new Complex(4.4, -4.4); Assert.AreEqual(a.GetL1Norm(), 9.334, TOLERENCE); Assert.AreEqual(a.GetL2Norm(), 8.502, TOLERENCE); Assert.AreEqual(a.GetInfinityNorm(), 10.889, TOLERENCE); Assert.AreEqual(a.GetFrobeniusNorm(), 8.521, TOLERENCE); }