Accord.Tests.Math.ComplexMatrixTest.AbsTest C# (CSharp) Method

AbsTest() private method

private AbsTest ( ) : void
return void
        public void AbsTest()
        {
            Complex[] x = { new Complex(1, 5), new Complex(2, -1), new Complex(-5, 1) };
            Complex[] expected = { new Complex(Math.Sqrt(26), 0), new Complex(Math.Sqrt(5), 0), new Complex(Math.Sqrt(26), 0) };
            Complex[] actual = ComplexMatrix.Abs(x);
            Assert.IsTrue(expected.IsEqual(actual, 1e-5));
        }