Stride.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) 2010 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_STRIDE_H
11 #define EIGEN_STRIDE_H
12 
13 namespace Eigen {
14 
43 template<int _OuterStrideAtCompileTime, int _InnerStrideAtCompileTime>
44 class Stride
45 {
46  public:
47  typedef DenseIndex Index;
48  enum {
49  InnerStrideAtCompileTime = _InnerStrideAtCompileTime,
50  OuterStrideAtCompileTime = _OuterStrideAtCompileTime
51  };
52 
56  {
58  }
59 
61  Stride(Index outerStride, Index innerStride)
62  : m_outer(outerStride), m_inner(innerStride)
63  {
64  eigen_assert(innerStride>=0 && outerStride>=0);
65  }
66 
68  Stride(const Stride& other)
69  : m_outer(other.outer()), m_inner(other.inner())
70  {}
71 
73  inline Index outer() const { return m_outer.value(); }
75  inline Index inner() const { return m_inner.value(); }
76 
77  protected:
80 };
81 
84 template<int Value = Dynamic>
85 class InnerStride : public Stride<0, Value>
86 {
88  public:
89  typedef DenseIndex Index;
90  InnerStride() : Base() {}
91  InnerStride(Index v) : Base(0, v) {}
92 };
93 
96 template<int Value = Dynamic>
97 class OuterStride : public Stride<Value, 0>
98 {
100  public:
101  typedef DenseIndex Index;
102  OuterStride() : Base() {}
103  OuterStride(Index v) : Base(v,0) {}
104 };
105 
106 } // end namespace Eigen
107 
108 #endif // EIGEN_STRIDE_H
internal::variable_if_dynamic< Index, InnerStrideAtCompileTime > m_inner
Definition: Stride.h:79
Stride(Index outerStride, Index innerStride)
Definition: Stride.h:61
internal::variable_if_dynamic< Index, OuterStrideAtCompileTime > m_outer
Definition: Stride.h:78
Definition: LDLT.h:16
Index inner() const
Definition: Stride.h:75
Holds strides information for Map.
Definition: Stride.h:44
OuterStride(Index v)
Definition: Stride.h:103
DenseIndex Index
Definition: Stride.h:101
DenseIndex Index
Definition: Stride.h:89
Convenience specialization of Stride to specify only an inner stride See class Map for some examples...
Definition: Stride.h:85
Index outer() const
Definition: Stride.h:73
InnerStride(Index v)
Definition: Stride.h:91
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
Definition: XprHelper.h:27
Stride(const Stride &other)
Definition: Stride.h:68
DenseIndex Index
Definition: Stride.h:47
Stride< Value, 0 > Base
Definition: Stride.h:99
Stride< 0, Value > Base
Definition: Stride.h:87
const int Dynamic
Definition: Constants.h:21
#define eigen_assert(x)
Convenience specialization of Stride to specify only an outer stride See class Map for some examples...
Definition: Stride.h:97


tuw_aruco
Author(s): Lukas Pfeifhofer
autogenerated on Mon Jun 10 2019 15:41:00