mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-01 18:26:24 +08:00
move ei_conj_if to a more appropriate file
This commit is contained in:
parent
642cc27eb1
commit
b2effa2b2c
@ -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)); }
|
{ 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.
|
// Lightweight helper class to access matrix coefficients.
|
||||||
// Yes, this is somehow redundant with Map<>, but this version is much much lighter,
|
// 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).
|
// and so I hope better compilation performance (time and code quality).
|
||||||
|
@ -222,16 +222,4 @@ template<typename T> struct ei_is_diagonal<DiagonalWrapper<T> >
|
|||||||
template<typename T, int S> struct ei_is_diagonal<DiagonalMatrix<T,S> >
|
template<typename T, int S> struct ei_is_diagonal<DiagonalMatrix<T,S> >
|
||||||
{ enum { ret = true }; };
|
{ enum { ret = true }; };
|
||||||
|
|
||||||
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; }
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // EIGEN_META_H
|
#endif // EIGEN_META_H
|
||||||
|
Loading…
Reference in New Issue
Block a user