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

Magnitude() public static method

Gets the magnitude of every complex number in a matrix.
public static Magnitude ( this c ) : ].double[
c this
return ].double[
        public static double[,] Magnitude(this Complex[,] c)
        {
            if (c == null) throw new ArgumentNullException("c");

            int rows = c.GetLength(0);
            int cols = c.GetLength(1);

            double[,] magnitudes = new double[rows, cols];
            for (int i = 0; i < rows; i++)
                for (int j = 0; j < cols; j++)
                    magnitudes[i, j] = c[i, j].Magnitude;

            return magnitudes;
        }

Same methods

ComplexMatrix::Magnitude ( this c ) : double[]