Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef EIGEN_NESTBYVALUE_H
00027 #define EIGEN_NESTBYVALUE_H
00028
00042 namespace internal {
00043 template<typename ExpressionType>
00044 struct traits<NestByValue<ExpressionType> > : public traits<ExpressionType>
00045 {};
00046 }
00047
00048 template<typename ExpressionType> class NestByValue
00049 : public internal::dense_xpr_base< NestByValue<ExpressionType> >::type
00050 {
00051 public:
00052
00053 typedef typename internal::dense_xpr_base<NestByValue>::type Base;
00054 EIGEN_DENSE_PUBLIC_INTERFACE(NestByValue)
00055
00056 inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {}
00057
00058 inline Index rows() const { return m_expression.rows(); }
00059 inline Index cols() const { return m_expression.cols(); }
00060 inline Index outerStride() const { return m_expression.outerStride(); }
00061 inline Index innerStride() const { return m_expression.innerStride(); }
00062
00063 inline const CoeffReturnType coeff(Index row, Index col) const
00064 {
00065 return m_expression.coeff(row, col);
00066 }
00067
00068 inline Scalar& coeffRef(Index row, Index col)
00069 {
00070 return m_expression.const_cast_derived().coeffRef(row, col);
00071 }
00072
00073 inline const CoeffReturnType coeff(Index index) const
00074 {
00075 return m_expression.coeff(index);
00076 }
00077
00078 inline Scalar& coeffRef(Index index)
00079 {
00080 return m_expression.const_cast_derived().coeffRef(index);
00081 }
00082
00083 template<int LoadMode>
00084 inline const PacketScalar packet(Index row, Index col) const
00085 {
00086 return m_expression.template packet<LoadMode>(row, col);
00087 }
00088
00089 template<int LoadMode>
00090 inline void writePacket(Index row, Index col, const PacketScalar& x)
00091 {
00092 m_expression.const_cast_derived().template writePacket<LoadMode>(row, col, x);
00093 }
00094
00095 template<int LoadMode>
00096 inline const PacketScalar packet(Index index) const
00097 {
00098 return m_expression.template packet<LoadMode>(index);
00099 }
00100
00101 template<int LoadMode>
00102 inline void writePacket(Index index, const PacketScalar& x)
00103 {
00104 m_expression.const_cast_derived().template writePacket<LoadMode>(index, x);
00105 }
00106
00107 operator const ExpressionType&() const { return m_expression; }
00108
00109 protected:
00110 const ExpressionType m_expression;
00111 };
00112
00115 template<typename Derived>
00116 inline const NestByValue<Derived>
00117 DenseBase<Derived>::nestByValue() const
00118 {
00119 return NestByValue<Derived>(derived());
00120 }
00121
00122 #endif // EIGEN_NESTBYVALUE_H