M
Matthias Pospiech
I have a Class for complex operations:
class CComplex
{
public:
inline CComplex() { re=im=0.0; }
inline CComplex operator*(CComplex c) { return
CComplex(re*c.re-im*c.im,re*c.im+im*c.re);}
inline CComplex operator*(double &d) { return CComplex(re*d,im*d);}
double re,im;
};
However when multiplying double * CComplex the operation fails
double m_Phase[8192][8192]; // Phase of Field
double m_Amplitude[8192][8192]; // Amplitude of Field
CComplex m_Field[8192][8192]; // Full electric Field
CComplex Expi(double wt) {return CComplex(cos(wt),sin(wt));}
CComplex Expi(CComplex x) {return
m_Field[x][y]= (m_Amplitude[x][y]) * (Expi(m_Phase[x][y]));
with
error C2677: Binärer Operator '*': Es konnte kein globaler Operator
gefunden werden, der den Typ 'CComplex' akzeptiert (oder keine geeignete
Konvertierung möglich)
(no Operator found that accepts CComplex)
What is going wrong ??
Matthias
class CComplex
{
public:
inline CComplex() { re=im=0.0; }
inline CComplex operator*(CComplex c) { return
CComplex(re*c.re-im*c.im,re*c.im+im*c.re);}
inline CComplex operator*(double &d) { return CComplex(re*d,im*d);}
double re,im;
};
However when multiplying double * CComplex the operation fails
double m_Phase[8192][8192]; // Phase of Field
double m_Amplitude[8192][8192]; // Amplitude of Field
CComplex m_Field[8192][8192]; // Full electric Field
CComplex Expi(double wt) {return CComplex(cos(wt),sin(wt));}
CComplex Expi(CComplex x) {return
m_Field[x][y]= (m_Amplitude[x][y]) * (Expi(m_Phase[x][y]));
with
error C2677: Binärer Operator '*': Es konnte kein globaler Operator
gefunden werden, der den Typ 'CComplex' akzeptiert (oder keine geeignete
Konvertierung möglich)
(no Operator found that accepts CComplex)
What is going wrong ??
Matthias