Based on a cursory perusal of the error diagnostic:
You are directly or indirectly including both the headers
<tr1/complex> and
<complex>
And you appear to have both these using directives at global namespace scope:
1 2
|
using namespace std;
using namespace tr1;
|
There is an ambiguity between
std::complex<double> std::conj( const std::complex<double>& )
and
std::complex<double> std::tr1::conj( const std::complex<double>& )
The situation with the call to unqualified
pow() is the same.
Using a qualified name would make this particular error go away:
sum += u * std::conj(v);.
Another option would to get rid of the using directives and let ADL resolve the call to unqualified
conj.
The very idea of trying to simultaneously use identical names from both the namespaces
std and
std::tr1 is fundamentally unsound.
Strongly consider switching to a version of the compiler/library that is not thoroughly obsolete; in addition to the other obvious benefits, you wouldn't have to use the
tr1 namespace at all.