Skip to content
Snippets Groups Projects
Commit 52d36ddd authored by Oliver Sander's avatar Oliver Sander
Browse files

[cleanup] Move complex conjugation et al to math.hh

parent 8d811aff
Branches
Tags
No related merge requests found
......@@ -96,7 +96,29 @@ namespace Dune
enum { factorial = 1 };
};
//! compute conjugate complex of x
// conjugate complex does nothing for non-complex types
template<class K>
inline K conjugateComplex (const K& x)
{
return x;
}
#ifndef DOXYGEN
// specialization for complex
template<class K>
inline std::complex<K> conjugateComplex (const std::complex<K>& c)
{
return std::complex<K>(c.real(),-c.imag());
}
#endif
//! Return the sign of the value
template <class T>
int sign(const T& val)
{
return (val < 0 ? -1 : 1);
}
}
......
......@@ -31,30 +31,6 @@ namespace Dune {
@{
*/
//! compute conjugate complex of x
// conjugate complex does nothing for non-complex types
template<class K>
inline K conjugateComplex (const K& x)
{
return x;
}
#ifndef DOXYGEN
// specialization for complex
template<class K>
inline std::complex<K> conjugateComplex (const std::complex<K>& c)
{
return std::complex<K>(c.real(),-c.imag());
}
#endif
//! Return the sign of the value
template <class T>
int sign(const T& val)
{
return (val < 0 ? -1 : 1);
}
/** \brief Compute the square of T */
/**
* \code
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment