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 
47 template<int _OuterStrideAtCompileTime, int _InnerStrideAtCompileTime>
48 class Stride
49 {
50  public:
51  typedef Eigen::Index Index;
52  enum {
53  InnerStrideAtCompileTime = _InnerStrideAtCompileTime,
54  OuterStrideAtCompileTime = _OuterStrideAtCompileTime
55  };
56 
61  {
62  // FIXME: for Eigen 4 we should use DynamicIndex instead of Dynamic.
63  // FIXME: for Eigen 4 we should also unify this API with fix<>
65  }
66 
69  Stride(Index outerStride, Index innerStride)
70  : m_outer(outerStride), m_inner(innerStride)
71  {
72  }
73 
77  : m_outer(other.outer()), m_inner(other.inner())
78  {}
79 
82  inline Index outer() const { return m_outer.value(); }
85  inline Index inner() const { return m_inner.value(); }
86 
87  protected:
90 };
91 
94 template<int Value>
95 class InnerStride : public Stride<0, Value>
96 {
98  public:
100  EIGEN_DEVICE_FUNC InnerStride(Index v) : Base(0, v) {} // FIXME making this explicit could break valid code
101 };
102 
105 template<int Value>
106 class OuterStride : public Stride<Value, 0>
107 {
109  public:
111  EIGEN_DEVICE_FUNC OuterStride(Index v) : Base(v,0) {} // FIXME making this explicit could break valid code
112 };
113 
114 } // end namespace Eigen
115 
116 #endif // EIGEN_STRIDE_H
internal::variable_if_dynamic< Index, InnerStrideAtCompileTime > m_inner
Definition: Stride.h:89
internal::variable_if_dynamic< Index, OuterStrideAtCompileTime > m_outer
Definition: Stride.h:88
EIGEN_DEVICE_FUNC Stride(const Stride &other)
Definition: Stride.h:76
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Holds strides information for Map.
Definition: Stride.h:48
EIGEN_DEVICE_FUNC InnerStride()
Definition: Stride.h:99
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outer() const
Definition: Stride.h:82
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index inner() const
Definition: Stride.h:85
Convenience specialization of Stride to specify only an inner stride See class Map for some examples...
Definition: Stride.h:95
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Eigen::Index Index
Definition: Stride.h:51
#define eigen_assert(x)
Definition: Macros.h:1037
Array< int, Dynamic, 1 > v
#define EIGEN_CONSTEXPR
Definition: Macros.h:787
EIGEN_DEVICE_FUNC OuterStride()
Definition: Stride.h:110
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value()
Definition: XprHelper.h:135
EIGEN_DEVICE_FUNC OuterStride(Index v)
Definition: Stride.h:111
EIGEN_DEVICE_FUNC Stride()
Definition: Stride.h:59
Stride< Value, 0 > Base
Definition: Stride.h:108
Stride< 0, Value > Base
Definition: Stride.h:97
const int Dynamic
Definition: Constants.h:22
Convenience specialization of Stride to specify only an outer stride See class Map for some examples...
Definition: Stride.h:106
EIGEN_DEVICE_FUNC Stride(Index outerStride, Index innerStride)
Definition: Stride.h:69
EIGEN_DEVICE_FUNC InnerStride(Index v)
Definition: Stride.h:100


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:36:21