Flagged.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008 Benoit Jacob <jacob.benoit.1@gmail.com>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_FLAGGED_H
11 #define EIGEN_FLAGGED_H
12 
13 namespace Eigen {
14 
31 namespace internal {
32 template<typename ExpressionType, unsigned int Added, unsigned int Removed>
33 struct traits<Flagged<ExpressionType, Added, Removed> > : traits<ExpressionType>
34 {
35  enum { Flags = (ExpressionType::Flags | Added) & ~Removed };
36 };
37 }
38 
39 template<typename ExpressionType, unsigned int Added, unsigned int Removed> class Flagged
40  : public MatrixBase<Flagged<ExpressionType, Added, Removed> >
41 {
42  public:
43 
45 
47  typedef typename internal::conditional<internal::must_nest_by_value<ExpressionType>::ret,
48  ExpressionType, const ExpressionType&>::type ExpressionTypeNested;
49  typedef typename ExpressionType::InnerIterator InnerIterator;
50 
51  inline Flagged(const ExpressionType& matrix) : m_matrix(matrix) {}
52 
53  inline Index rows() const { return m_matrix.rows(); }
54  inline Index cols() const { return m_matrix.cols(); }
55  inline Index outerStride() const { return m_matrix.outerStride(); }
56  inline Index innerStride() const { return m_matrix.innerStride(); }
57 
59  {
60  return m_matrix.coeff(row, col);
61  }
62 
63  inline CoeffReturnType coeff(Index index) const
64  {
65  return m_matrix.coeff(index);
66  }
67 
68  inline const Scalar& coeffRef(Index row, Index col) const
69  {
70  return m_matrix.const_cast_derived().coeffRef(row, col);
71  }
72 
73  inline const Scalar& coeffRef(Index index) const
74  {
75  return m_matrix.const_cast_derived().coeffRef(index);
76  }
77 
79  {
80  return m_matrix.const_cast_derived().coeffRef(row, col);
81  }
82 
83  inline Scalar& coeffRef(Index index)
84  {
85  return m_matrix.const_cast_derived().coeffRef(index);
86  }
87 
88  template<int LoadMode>
89  inline const PacketScalar packet(Index row, Index col) const
90  {
91  return m_matrix.template packet<LoadMode>(row, col);
92  }
93 
94  template<int LoadMode>
95  inline void writePacket(Index row, Index col, const PacketScalar& x)
96  {
97  m_matrix.const_cast_derived().template writePacket<LoadMode>(row, col, x);
98  }
99 
100  template<int LoadMode>
101  inline const PacketScalar packet(Index index) const
102  {
103  return m_matrix.template packet<LoadMode>(index);
104  }
105 
106  template<int LoadMode>
107  inline void writePacket(Index index, const PacketScalar& x)
108  {
109  m_matrix.const_cast_derived().template writePacket<LoadMode>(index, x);
110  }
111 
112  const ExpressionType& _expression() const { return m_matrix; }
113 
114  template<typename OtherDerived>
115  typename ExpressionType::PlainObject solveTriangular(const MatrixBase<OtherDerived>& other) const;
116 
117  template<typename OtherDerived>
118  void solveTriangularInPlace(const MatrixBase<OtherDerived>& other) const;
119 
120  protected:
122 };
123 
130 template<typename Derived>
131 template<unsigned int Added,unsigned int Removed>
134 {
135  return derived();
136 }
137 
138 } // end namespace Eigen
139 
140 #endif // EIGEN_FLAGGED_H
const PacketScalar packet(Index row, Index col) const
Definition: Flagged.h:89
internal::packet_traits< Scalar >::type PacketScalar
Definition: DenseBase.h:64
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:63
CoeffReturnType coeff(Index index) const
Definition: Flagged.h:63
Index cols() const
Definition: Flagged.h:54
Base::CoeffReturnType CoeffReturnType
Definition: DenseBase.h:98
Expression with modified flags.
Definition: Flagged.h:39
Index rows() const
Definition: Flagged.h:53
internal::traits< Derived >::Index Index
The type of indices.
Definition: DenseBase.h:61
Index innerStride() const
Definition: Flagged.h:56
const PacketScalar packet(Index index) const
Definition: Flagged.h:101
Scalar & coeffRef(Index row, Index col)
Definition: Flagged.h:78
Definition: LDLT.h:16
void writePacket(Index row, Index col, const PacketScalar &x)
Definition: Flagged.h:95
void writePacket(Index index, const PacketScalar &x)
Definition: Flagged.h:107
const Scalar & coeffRef(Index row, Index col) const
Definition: Flagged.h:68
const Scalar & coeffRef(Index index) const
Definition: Flagged.h:73
Scalar & coeffRef(Index index)
Definition: Flagged.h:83
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
CoeffReturnType coeff(Index row, Index col) const
Definition: Flagged.h:58
An InnerIterator allows to loop over the element of a sparse (or dense) matrix or expression...
RowXpr row(Index i)
Definition: BlockMethods.h:725
Index outerStride() const
Definition: Flagged.h:55
const ExpressionType & _expression() const
Definition: Flagged.h:112
ExpressionTypeNested m_matrix
Definition: Flagged.h:121
ColXpr col(Index i)
Definition: BlockMethods.h:708
MatrixBase< Flagged > Base
Definition: Flagged.h:44
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
const Flagged< Derived, Added, Removed > flagged() const
Definition: Flagged.h:133


tuw_aruco
Author(s): Lukas Pfeifhofer
autogenerated on Mon Jun 10 2019 15:40:48