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;
}