Conjugate
Replace vector with the conjugate of the vector. The method only available for complex or double data type vector.
int Conjugate( )
Returns 0 on success and -1 on failure which occurs if the vector is empty.
EX1
void vectorbase_Conjugate_ex1() { //Output Original vector vector<complex> vecC = {1+2i, 3-4i, 5+6i, 7-8i}; printf("Original vector:\n"); for( int ii = 0; ii < vecC.GetSize(); ii++) out_complex("", vecC[ii]); //Replace vector with the conjugate of the vector vecC.Conjugate(); //Output the result printf("Conjugate vector:\n"); for( ii = 0; ii < vecC.GetSize(); ii++) out_complex("", vecC[ii]); }
Replace this vector with the conjugate of the vector. A runtime error occurs if the underlying base type of this vector is not double or Complex.
vectorbase::GetReal, vectorbase::GetImaginary, vectorbase::GetPhase, vectorbase::GetAmplitude, vectorbase::MakeComplex
origin.h