aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-02-18 13:30:16 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-02-18 13:30:16 +0100
commit1b5de5a37b47ef2738e5bdf4135777f00ac5967d (patch)
tree7b3fe19f965122f02b1ddb1043650597497093e9 /Eigen
parenta08cba6b5f51db2338da58d54cda7e04cc24e372 (diff)
Add evaluator for Ref
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/CoreEvaluators.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/Eigen/src/Core/CoreEvaluators.h b/Eigen/src/Core/CoreEvaluators.h
index ef900e236..d02bac0a8 100644
--- a/Eigen/src/Core/CoreEvaluators.h
+++ b/Eigen/src/Core/CoreEvaluators.h
@@ -587,7 +587,7 @@ struct evaluator<MapBase<Derived, AccessorsType> >
CoeffReturnType coeff(Index index) const
{
return coeff(RowsAtCompileTime == 1 ? 0 : index,
- RowsAtCompileTime == 1 ? index : 0);
+ RowsAtCompileTime == 1 ? index : 0);
}
Scalar& coeffRef(Index row, Index col)
@@ -598,7 +598,7 @@ struct evaluator<MapBase<Derived, AccessorsType> >
Scalar& coeffRef(Index index)
{
return coeffRef(RowsAtCompileTime == 1 ? 0 : index,
- RowsAtCompileTime == 1 ? index : 0);
+ RowsAtCompileTime == 1 ? index : 0);
}
template<int LoadMode>
@@ -612,7 +612,7 @@ struct evaluator<MapBase<Derived, AccessorsType> >
PacketReturnType packet(Index index) const
{
return packet<LoadMode>(RowsAtCompileTime == 1 ? 0 : index,
- RowsAtCompileTime == 1 ? index : 0);
+ RowsAtCompileTime == 1 ? index : 0);
}
template<int StoreMode>
@@ -626,8 +626,8 @@ struct evaluator<MapBase<Derived, AccessorsType> >
void writePacket(Index index, const PacketScalar& x)
{
return writePacket<StoreMode>(RowsAtCompileTime == 1 ? 0 : index,
- RowsAtCompileTime == 1 ? index : 0,
- x);
+ RowsAtCompileTime == 1 ? index : 0,
+ x);
}
protected:
@@ -647,6 +647,19 @@ struct evaluator<Map<PlainObjectType, MapOptions, StrideType> >
{ }
};
+// -------------------- Ref --------------------
+
+template<typename PlainObjectType, int RefOptions, typename StrideType>
+struct evaluator<Ref<PlainObjectType, RefOptions, StrideType> >
+ : public evaluator<MapBase<Ref<PlainObjectType, RefOptions, StrideType> > >
+{
+ typedef Ref<PlainObjectType, RefOptions, StrideType> XprType;
+
+ evaluator(const XprType& map)
+ : evaluator<MapBase<XprType> >(map)
+ { }
+};
+
// -------------------- Block --------------------
template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel,