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

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

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