From e74fbfb2bc13dee268950361a957aea73bcefc21 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 31 Mar 2008 17:24:09 +0000 Subject: [PATCH] - remove Eval/EvalOMP (moving them to a disabled/ subdir in order to preserve SVN history). They are made useless by the new ei_eval_unless_lazy. - introduce a generic Eval member typedef so one can do e.g. T t; U u; Product::Eval m; m = t*u; --- Eigen/Core | 2 -- Eigen/src/Core/ForwardDeclarations.h | 8 +++++++- Eigen/src/Core/MatrixBase.h | 6 ++++-- Eigen/src/Core/Util.h | 8 +++++++- {Eigen/src/Core => disabled}/Eval.h | 0 {Eigen/src/Core => disabled}/EvalOMP.h | 0 {doc/snippets => disabled}/Eval_MatrixType.cpp | 0 {doc/examples => disabled}/class_Eval.cpp | 0 8 files changed, 18 insertions(+), 6 deletions(-) rename {Eigen/src/Core => disabled}/Eval.h (100%) rename {Eigen/src/Core => disabled}/EvalOMP.h (100%) rename {doc/snippets => disabled}/Eval_MatrixType.cpp (100%) rename {doc/examples => disabled}/class_Eval.cpp (100%) diff --git a/Eigen/Core b/Eigen/Core index c6185368d..bb4fc20c5 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -20,7 +20,6 @@ namespace Eigen { #include "src/Core/OperatorEquals.h" #include "src/Core/MatrixStorage.h" #include "src/Core/Matrix.h" -#include "src/Core/Eval.h" #include "src/Core/Lazy.h" #include "src/Core/CwiseBinaryOp.h" #include "src/Core/CwiseUnaryOp.h" @@ -43,7 +42,6 @@ namespace Eigen { #include "src/Core/Swap.h" #include "src/Core/CommaInitializer.h" #include "src/Core/AssociativeFunctors.h" -#include "src/Core/EvalOMP.h" } // namespace Eigen diff --git a/Eigen/src/Core/ForwardDeclarations.h b/Eigen/src/Core/ForwardDeclarations.h index 3c9d9db70..58e1bf353 100644 --- a/Eigen/src/Core/ForwardDeclarations.h +++ b/Eigen/src/Core/ForwardDeclarations.h @@ -86,11 +86,17 @@ template struct ei_conditional_eval template struct ei_conditional_eval { - typedef Eval Type; + typedef Matrix::Scalar, + ei_traits::RowsAtCompileTime, + ei_traits::ColsAtCompileTime, + ei_traits::Flags, + ei_traits::MaxRowsAtCompileTime, + ei_traits::MaxColsAtCompileTime> Type; }; template struct ei_eval_unless_lazy { typedef typename ei_conditional_eval::Flags & LazyBit)>::Type Type; }; + #endif // EIGEN_FORWARDDECLARATIONS_H diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index e1caa4c48..7f8283e9f 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -356,8 +356,10 @@ template class MatrixBase template const CwiseUnaryOp, Derived> cast() const; - const typename ei_eval_unless_lazy::Type eval() const EIGEN_ALWAYS_INLINE; - const EvalOMP evalOMP() const EIGEN_ALWAYS_INLINE; + const typename ei_eval_unless_lazy::Type eval() const EIGEN_ALWAYS_INLINE + { + return typename ei_eval_unless_lazy::Type(derived()); + } template void swap(const MatrixBase& other); diff --git a/Eigen/src/Core/Util.h b/Eigen/src/Core/Util.h index ae9624aa1..9aaac9ae2 100644 --- a/Eigen/src/Core/Util.h +++ b/Eigen/src/Core/Util.h @@ -117,7 +117,13 @@ enum { RowsAtCompileTime = Base::RowsAtCompileTime, \ SizeAtCompileTime = Base::SizeAtCompileTime, \ MaxSizeAtCompileTime = Base::MaxSizeAtCompileTime, \ IsVectorAtCompileTime = Base::IsVectorAtCompileTime, \ - Flags = Base::Flags }; + Flags = Base::Flags }; \ +typedef Matrix Eval; #define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \ _EIGEN_GENERIC_PUBLIC_INTERFACE(Derived, Eigen::MatrixBase) \ diff --git a/Eigen/src/Core/Eval.h b/disabled/Eval.h similarity index 100% rename from Eigen/src/Core/Eval.h rename to disabled/Eval.h diff --git a/Eigen/src/Core/EvalOMP.h b/disabled/EvalOMP.h similarity index 100% rename from Eigen/src/Core/EvalOMP.h rename to disabled/EvalOMP.h diff --git a/doc/snippets/Eval_MatrixType.cpp b/disabled/Eval_MatrixType.cpp similarity index 100% rename from doc/snippets/Eval_MatrixType.cpp rename to disabled/Eval_MatrixType.cpp diff --git a/doc/examples/class_Eval.cpp b/disabled/class_Eval.cpp similarity index 100% rename from doc/examples/class_Eval.cpp rename to disabled/class_Eval.cpp