# 2.2.3.19.4 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( )

## 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.