NestByValue.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 Gael Guennebaud <gael.guennebaud@inria.fr>
5 // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_NESTBYVALUE_H
12 #define EIGEN_NESTBYVALUE_H
13 
14 namespace Eigen {
15 
29 namespace internal {
30 template<typename ExpressionType>
31 struct traits<NestByValue<ExpressionType> > : public traits<ExpressionType>
32 {};
33 }
34 
35 template<typename ExpressionType> class NestByValue
36  : public internal::dense_xpr_base< NestByValue<ExpressionType> >::type
37 {
38  public:
39 
42 
43  inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {}
44 
45  inline Index rows() const { return m_expression.rows(); }
46  inline Index cols() const { return m_expression.cols(); }
47  inline Index outerStride() const { return m_expression.outerStride(); }
48  inline Index innerStride() const { return m_expression.innerStride(); }
49 
50  inline const CoeffReturnType coeff(Index row, Index col) const
51  {
52  return m_expression.coeff(row, col);
53  }
54 
55  inline Scalar& coeffRef(Index row, Index col)
56  {
57  return m_expression.const_cast_derived().coeffRef(row, col);
58  }
59 
60  inline const CoeffReturnType coeff(Index index) const
61  {
62  return m_expression.coeff(index);
63  }
64 
65  inline Scalar& coeffRef(Index index)
66  {
67  return m_expression.const_cast_derived().coeffRef(index);
68  }
69 
70  template<int LoadMode>
71  inline const PacketScalar packet(Index row, Index col) const
72  {
73  return m_expression.template packet<LoadMode>(row, col);
74  }
75 
76  template<int LoadMode>
77  inline void writePacket(Index row, Index col, const PacketScalar& x)
78  {
79  m_expression.const_cast_derived().template writePacket<LoadMode>(row, col, x);
80  }
81 
82  template<int LoadMode>
83  inline const PacketScalar packet(Index index) const
84  {
85  return m_expression.template packet<LoadMode>(index);
86  }
87 
88  template<int LoadMode>
89  inline void writePacket(Index index, const PacketScalar& x)
90  {
91  m_expression.const_cast_derived().template writePacket<LoadMode>(index, x);
92  }
93 
94  operator const ExpressionType&() const { return m_expression; }
95 
96  protected:
98 };
99 
102 template<typename Derived>
103 inline const NestByValue<Derived>
105 {
106  return NestByValue<Derived>(derived());
107 }
108 
109 } // end namespace Eigen
110 
111 #endif // EIGEN_NESTBYVALUE_H
const CoeffReturnType coeff(Index row, Index col) const
Definition: NestByValue.h:50
internal::dense_xpr_base< NestByValue >::type Base
Definition: NestByValue.h:40
#define inline
Definition: Types.h:109
Scalar & coeffRef(Index index)
Definition: NestByValue.h:65
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: matrix.hpp:471
Index innerStride() const
Definition: NestByValue.h:48
const PacketScalar packet(Index row, Index col) const
Definition: NestByValue.h:71
const ExpressionType m_expression
Definition: NestByValue.h:97
Index cols() const
Definition: NestByValue.h:46
void writePacket(Index index, const PacketScalar &x)
Definition: NestByValue.h:89
Index rows() const
Definition: NestByValue.h:45
Expression which must be nested by value.
Definition: NestByValue.h:35
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
RowXpr row(Index i)
Definition: BlockMethods.h:725
const NestByValue< Derived > nestByValue() const
Definition: NestByValue.h:104
Scalar & coeffRef(Index row, Index col)
Definition: NestByValue.h:55
const CoeffReturnType coeff(Index index) const
Definition: NestByValue.h:60
ColXpr col(Index i)
Definition: BlockMethods.h:708
void writePacket(Index row, Index col, const PacketScalar &x)
Definition: NestByValue.h:77
Index outerStride() const
Definition: NestByValue.h:47
const PacketScalar packet(Index index) const
Definition: NestByValue.h:83


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:54