GetImaginary
Get the imaginary part of a complex vector.
int GetImaginary( vector & vImag )
Returns 0 on success or -1 on failure.
EX1
void vectorbase_GetImaginary_ex1() { vector<complex> vecC = {1+2i, 3+4i, 5+6i, 7+8i}; vector vecR; vecC.GetImaginary(vecR); for (int ii = 0; ii < vecR.GetSize(); ii++) printf("%.0f ",vecR[ii]); // Result: // vecR = {2, 4, 6, 8}; }
Get the imaginary part of a complex vector. Causes a runtime error if the underlying base type of the vector is not complex.
vectorbase::GetReal, vectorbase::GetPhase, vectorbase::GetAmplitude, vectorbase::Conjugate, vectorbase::MakeComplex
origin.h