Beispiel #1
0
        public void GetNorm()
        {
            ComplexDoubleVector a = new ComplexDoubleVector(new double[4] {
                0, 1, 2, 3
            });
            ComplexDoubleVector b = new ComplexDoubleVector(new double[4] {
                4, 5, 6, 7
            });

            Assert.AreEqual(a.GetNorm(), System.Math.Sqrt(14));
            Assert.AreEqual(a.GetNorm(), a.GetNorm(2));
            Assert.AreEqual(a.GetNorm(0), 3);

            Assert.AreEqual(b.GetNorm(), 3 * System.Math.Sqrt(14));
            Assert.AreEqual(b.GetNorm(), b.GetNorm(2));
            Assert.AreEqual(b.GetNorm(0), 7);
        }