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