diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-07-09 18:05:57 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-07-09 18:05:57 +0200 |
commit | b2effa2b2c464a2e8cb1c4d5b71843b6514a50ae (patch) | |
tree | 7a93345bdc5a782402a9cd4cfa0b44134f1fc1b0 /Eigen/src/Core/util/BlasUtil.h | |
parent | 642cc27eb1b8d8440ca35f5f08934cce22cd99dc (diff) |
move ei_conj_if to a more appropriate file
Diffstat (limited to 'Eigen/src/Core/util/BlasUtil.h')
-rw-r--r-- | Eigen/src/Core/util/BlasUtil.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/BlasUtil.h b/Eigen/src/Core/util/BlasUtil.h index 38c86511c..12ac6994f 100644 --- a/Eigen/src/Core/util/BlasUtil.h +++ b/Eigen/src/Core/util/BlasUtil.h @@ -89,6 +89,18 @@ template<typename RealScalar> struct ei_conj_helper<std::complex<RealScalar>, st { return Scalar(ei_real(x)*ei_real(y) - ei_imag(x)*ei_imag(y), - ei_real(x)*ei_imag(y) - ei_imag(x)*ei_real(y)); } }; +template<bool Conjugate> struct ei_conj_if; + +template<> struct ei_conj_if<true> { + template<typename T> + inline T operator()(const T& x) { return ei_conj(x); } +}; + +template<> struct ei_conj_if<false> { + template<typename T> + inline const T& operator()(const T& x) { return x; } +}; + // Lightweight helper class to access matrix coefficients. // Yes, this is somehow redundant with Map<>, but this version is much much lighter, // and so I hope better compilation performance (time and code quality). |