Commit de106234 authored by berenger-bramas's avatar berenger-bramas
Browse files

Improve FComplexe operator.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@233 2616d619-271b-44dc-8df4-d4a8f33a7222
parent d6d40eee
......@@ -27,7 +27,7 @@ public:
* @param inImag the imaginary
* @param inReal the real
*/
FComplexe(const FReal inImag, const FReal inReal)
explicit FComplexe(const FReal inImag, const FReal inReal)
: real(inReal),imag(inImag){
}
......@@ -140,12 +140,11 @@ public:
};
/** Global operator Mul a complexe by another "c=c1*c2" */
FComplexe operator*=(const FComplexe& first, const FComplexe& second){
const FComplexe result(
inline FComplexe operator*=(const FComplexe& first, const FComplexe& second){
return FComplexe(
(first.getReal() * second.getImag()) + (first.getImag() * second.getReal()),
(first.getReal() * second.getReal()) - (first.getImag() * second.getImag())
);
return result;
}
#endif //FCOMPLEXE_HPP
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment