[eigen] ei_conj not yet declared for ei_conj_if |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Hello
In Eigen/src/Core/util/Meta.h, there's the definition of ei_conj_if. Unfortunately, at this stage, ei_conj is not yet defined (in Eigen/Core, Meta.h is included before MathFunctions.h which defines ei_conj.
I guess the right fix is to define ei_conj in util/ForwardDeclarations.h but i dont know how to do it (because there, EIGEN_MATHFUNC_RETVAL does not exist yet)
Well.. this situation is the last blocker so that clang can compile all tests... I can fix it locally with the included patch, but i'm sure it's not the right way.
Thomas
--
Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
http://www.freehackers.org/thomas
diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h
--- a/Eigen/src/Core/MathFunctions.h
+++ b/Eigen/src/Core/MathFunctions.h
@@ -258,6 +258,20 @@
return EIGEN_MATHFUNC_IMPL(conj, Scalar)::run(x);
}
+
+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; }
+};
+
+
/****************************************************************************
* Implementation of ei_abs *
****************************************************************************/
diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h
--- a/Eigen/src/Core/util/Meta.h
+++ b/Eigen/src/Core/util/Meta.h
@@ -222,16 +222,4 @@
template<typename T, int S> struct ei_is_diagonal<DiagonalMatrix<T,S> >
{ 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