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 #ifndef EIGEN_FLAGGED_H
00026 #define EIGEN_FLAGGED_H
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 namespace internal {
00045 template<typename ExpressionType, unsigned int Added, unsigned int Removed>
00046 struct traits<Flagged<ExpressionType, Added, Removed> > : traits<ExpressionType>
00047 {
00048 enum { Flags = (ExpressionType::Flags | Added) & ~Removed };
00049 };
00050 }
00051
00052 template<typename ExpressionType, unsigned int Added, unsigned int Removed> class Flagged
00053 : public MatrixBase<Flagged<ExpressionType, Added, Removed> >
00054 {
00055 public:
00056
00057 typedef MatrixBase<Flagged> Base;
00058 EIGEN_DENSE_PUBLIC_INTERFACE(Flagged)
00059 typedef typename internal::conditional<internal::must_nest_by_value<ExpressionType>::ret,
00060 ExpressionType, const ExpressionType&>::type ExpressionTypeNested;
00061 typedef typename ExpressionType::InnerIterator InnerIterator;
00062
00063 inline Flagged(const ExpressionType& matrix) : m_matrix(matrix) {}
00064
00065 inline Index rows() const { return m_matrix.rows(); }
00066 inline Index cols() const { return m_matrix.cols(); }
00067 inline Index outerStride() const { return m_matrix.outerStride(); }
00068 inline Index innerStride() const { return m_matrix.innerStride(); }
00069
00070 inline const Scalar coeff(Index row, Index col) const
00071 {
00072 return m_matrix.coeff(row, col);
00073 }
00074
00075 inline Scalar& coeffRef(Index row, Index col)
00076 {
00077 return m_matrix.const_cast_derived().coeffRef(row, col);
00078 }
00079
00080 inline const Scalar coeff(Index index) const
00081 {
00082 return m_matrix.coeff(index);
00083 }
00084
00085 inline Scalar& coeffRef(Index index)
00086 {
00087 return m_matrix.const_cast_derived().coeffRef(index);
00088 }
00089
00090 template<int LoadMode>
00091 inline const PacketScalar packet(Index row, Index col) const
00092 {
00093 return m_matrix.template packet<LoadMode>(row, col);
00094 }
00095
00096 template<int LoadMode>
00097 inline void writePacket(Index row, Index col, const PacketScalar& x)
00098 {
00099 m_matrix.const_cast_derived().template writePacket<LoadMode>(row, col, x);
00100 }
00101
00102 template<int LoadMode>
00103 inline const PacketScalar packet(Index index) const
00104 {
00105 return m_matrix.template packet<LoadMode>(index);
00106 }
00107
00108 template<int LoadMode>
00109 inline void writePacket(Index index, const PacketScalar& x)
00110 {
00111 m_matrix.const_cast_derived().template writePacket<LoadMode>(index, x);
00112 }
00113
00114 const ExpressionType& _expression() const { return m_matrix; }
00115
00116 template<typename OtherDerived>
00117 typename ExpressionType::PlainObject solveTriangular(const MatrixBase<OtherDerived>& other) const;
00118
00119 template<typename OtherDerived>
00120 void solveTriangularInPlace(const MatrixBase<OtherDerived>& other) const;
00121
00122 protected:
00123 ExpressionTypeNested m_matrix;
00124 };
00125
00126
00127
00128
00129
00130
00131
00132 template<typename Derived>
00133 template<unsigned int Added,unsigned int Removed>
00134 inline const Flagged<Derived, Added, Removed>
00135 DenseBase<Derived>::flagged() const
00136 {
00137 return derived();
00138 }
00139
00140 #endif // EIGEN_FLAGGED_H