Hello. Tell me, please, I am trying to convert a double array into a complex array, as I was told earlier, in the real part we write the values of the double array, and assign the imaginary part to zero. I created the Complex structure in the project, declared a constructor, which takes re (an array of double) as a parameter, assigns the imaginary part to zero, then when I try to convert the double array to a complex using the method and return the result to the signal variable, the result is not returned yet tell me, please, what is my problem?
public struct Complex { // переменная, хранящая реальную часть комплексного числа private double[] m_real; // переменная, хранящая мнимую часть комплексного числа private double m_imag; public Complex(double[] re) { m_real = re; m_imag = 0.0; } // Свойства устанавливающие значения public double[] Re { get { return m_real; } set { m_real = value; } } public double Im { get { return m_imag; } set {m_imag = value; } } //Метод преобразующий массив double в complex public Complex[] ConvertToComplex(Double[] data) { Complex[] signal; Complex c1 = new Complex(data); signal = c1; return signal; } }`
double[] m_realinstead ofdouble m_realstored inComplex? - Regent