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

ToComplex() public static method

Converts a vector of real numbers to complex numbers.
public static ToComplex ( this real ) : Complex[]
real this The real numbers to be converted.
return Complex[]
        public static Complex[] ToComplex(this double[] real)
        {
            if (real == null)
                throw new ArgumentNullException("real");

            Complex[] arr = new Complex[real.Length];
            for (int i = 0; i < arr.Length; i++)
                arr[i] = new Complex(real[i], 0);

            return arr;
        }

Same methods

ComplexMatrix::ToComplex ( this real, double imag ) : Complex[]