aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/ReturnByValue.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-03-05 10:25:22 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-03-05 10:25:22 +0000
commit0be89a4796543a7e7b8c244d3f1aabcf672cf114 (patch)
tree71333c6903892087dfd7f7a9343e390f0a4a6866 /Eigen/src/Core/ReturnByValue.h
parentd710ccd41e0819024ee168dafe7e7e5b8a7f0e45 (diff)
big addons:
* add Homogeneous expression for vector and set of vectors (aka matrix) => the next step will be to overload operator* * add homogeneous normalization (again for vector and set of vectors) * add a Replicate expression (with uni-directional replication facilities) => for all of them I'll add examples once we agree on the API * fix gcc-4.4 warnings * rename reverse.cpp array_reverse.cpp
Diffstat (limited to 'Eigen/src/Core/ReturnByValue.h')
-rw-r--r--Eigen/src/Core/ReturnByValue.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/Eigen/src/Core/ReturnByValue.h b/Eigen/src/Core/ReturnByValue.h
index e6d2b0d01..3613782ac 100644
--- a/Eigen/src/Core/ReturnByValue.h
+++ b/Eigen/src/Core/ReturnByValue.h
@@ -28,30 +28,40 @@
/** \class ReturnByValue
*
*/
-template<typename Functor,typename EvalType>
-struct ei_traits<ReturnByValue<Functor,EvalType> > : public ei_traits<EvalType>
+template<typename Functor, typename _Scalar,int _Rows,int _Cols,int _Options,int _MaxRows,int _MaxCols>
+struct ei_traits<ReturnByValue<Functor,Matrix<_Scalar,_Rows,_Cols,_Options,_MaxRows,_MaxCols> > >
+ : public ei_traits<Matrix<_Scalar,_Rows,_Cols,_Options,_MaxRows,_MaxCols> >
{
enum {
- Flags = ei_traits<EvalType>::Flags | EvalBeforeNestingBit
+ Flags = ei_traits<Matrix<_Scalar,_Rows,_Cols,_Options,_MaxRows,_MaxCols> >::Flags | EvalBeforeNestingBit
};
};
-template<typename Functor,typename EvalType,int n>
-struct ei_nested<ReturnByValue<Functor,EvalType>, n, EvalType>
+template<typename Functor,typename EvalTypeDerived,int n>
+struct ei_nested<ReturnByValue<Functor,MatrixBase<EvalTypeDerived> >, n, EvalTypeDerived>
{
- typedef EvalType type;
+ typedef EvalTypeDerived type;
};
template<typename Functor, typename EvalType> class ReturnByValue
- : public MatrixBase<ReturnByValue<Functor,EvalType> >
{
public:
- EIGEN_GENERIC_PUBLIC_INTERFACE(ReturnByValue)
template<typename Dest>
inline void evalTo(Dest& dst) const
{ static_cast<const Functor*>(this)->evalTo(dst); }
};
+template<typename Functor, typename _Scalar,int _Rows,int _Cols,int _Options,int _MaxRows,int _MaxCols>
+ class ReturnByValue<Functor,Matrix<_Scalar,_Rows,_Cols,_Options,_MaxRows,_MaxCols> >
+ : public MatrixBase<ReturnByValue<Functor,Matrix<_Scalar,_Rows,_Cols,_Options,_MaxRows,_MaxCols> > >
+{
+ public:
+ EIGEN_GENERIC_PUBLIC_INTERFACE(ReturnByValue)
+ template<typename Dest>
+ inline void evalTo(Dest& dst) const
+ { static_cast<const Functor* const>(this)->evalTo(dst); }
+};
+
template<typename Derived>
template<typename OtherDerived,typename OtherEvalType>
Derived& MatrixBase<Derived>::operator=(const ReturnByValue<OtherDerived,OtherEvalType>& other)