MakeComplex
Create a complex vector from two real vectors.
int MakeComplex( vectorbase & vbReal, vectorbase & vbImag )
Returns 0 on success or -1 on failure.
EX1
void vectorbase_MakeComplex_ex1() { vector vec1 = {1, 3, -5, 7}; vector vec2 = {2.5, -4, 6, 8}; vector<complex> vecC; vecC.MakeComplex(vec1, vec2); for(int ii = 0; ii < vecC.GetSize(); ii++) out_complex("", vecC[ii]); // Result: // vecC = { 1.000000+2.500000i // 3.000000-4.000000i // -5.000000+6.000000i // 7.000000+8.000000i}; }
Create a complex vector from two real vectors. The real vectors must have the same dimension.
vectorbase::GetReal, vectorbase::GetImaginary, vectorbase::GetPhase, vectorbase::GetAmplitude, vectorbase::Conjugate
origin.h