Accord.Math.ComplexMatrix.Abs C# (CSharp) Method

Abs() public static method

Computes the absolute value of an array of complex numbers.
public static Abs ( this x ) : Complex[]
x this
return Complex[]
        public static Complex[] Abs(this Complex[] x)
        {
            if (x == null)
                throw new ArgumentNullException("x");

            Complex[] r = new Complex[x.Length];
            for (int i = 0; i < x.Length; i++)
                r[i] = new Complex(x[i].Magnitude, 0);
            return r;
        }