vectorbase::Conjugate

Description

Replace vector with the conjugate of the vector. The method only available for complex or double data type vector.

Syntax

int Conjugate( )

Parameters

Return

Returns 0 on success and -1 on failure which occurs if the vector is empty.

Examples

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]);
}

Remark

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.

See Also

vectorbase::GetReal, vectorbase::GetImaginary, vectorbase::GetPhase, vectorbase::GetAmplitude, vectorbase::MakeComplex

Header to Include

origin.h