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 
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
Eigen::internal::variable_if_dynamic< Index, OuterStrideAtCompileTime >
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::Stride
Holds strides information for Map.
Definition: Stride.h:48
Eigen::Stride::inner
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index inner() const
Definition: Stride.h:85
Eigen::InnerStride
Convenience specialization of Stride to specify only an inner stride See class Map for some examples.
Definition: Stride.h:95
Eigen::Stride::Stride
EIGEN_DEVICE_FUNC Stride(Index outerStride, Index innerStride)
Definition: Stride.h:69
eigen_assert
#define eigen_assert(x)
Definition: Macros.h:1037
EIGEN_CONSTEXPR
#define EIGEN_CONSTEXPR
Definition: Macros.h:787
Eigen::InnerStride::InnerStride
EIGEN_DEVICE_FUNC InnerStride()
Definition: Stride.h:99
Eigen::Stride::Index
Eigen::Index Index
Definition: Stride.h:51
Eigen::Stride::Stride
EIGEN_DEVICE_FUNC Stride(const Stride &other)
Definition: Stride.h:76
Eigen::Stride::InnerStrideAtCompileTime
@ InnerStrideAtCompileTime
Definition: Stride.h:53
Eigen::Dynamic
const int Dynamic
Definition: Constants.h:22
Eigen::internal::variable_if_dynamic::value
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value()
Definition: XprHelper.h:135
Eigen::Stride::outer
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outer() const
Definition: Stride.h:82
Eigen::OuterStride
Convenience specialization of Stride to specify only an outer stride See class Map for some examples.
Definition: Stride.h:106
Eigen::OuterStride::OuterStride
EIGEN_DEVICE_FUNC OuterStride()
Definition: Stride.h:110
Eigen::Stride::m_inner
internal::variable_if_dynamic< Index, InnerStrideAtCompileTime > m_inner
Definition: Stride.h:89
Eigen::OuterStride::OuterStride
EIGEN_DEVICE_FUNC OuterStride(Index v)
Definition: Stride.h:111
Eigen::Stride::Stride
EIGEN_DEVICE_FUNC Stride()
Definition: Stride.h:59
Eigen::Stride::m_outer
internal::variable_if_dynamic< Index, OuterStrideAtCompileTime > m_outer
Definition: Stride.h:88
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
Eigen::Stride::OuterStrideAtCompileTime
@ OuterStrideAtCompileTime
Definition: Stride.h:54
Eigen::InnerStride::Base
Stride< 0, Value > Base
Definition: Stride.h:97
Eigen::OuterStride::Base
Stride< Value, 0 > Base
Definition: Stride.h:108
pybind_wrapper_test_script.other
other
Definition: pybind_wrapper_test_script.py:42
Eigen::InnerStride::InnerStride
EIGEN_DEVICE_FUNC InnerStride(Index v)
Definition: Stride.h:100
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74


gtsam
Author(s):
autogenerated on Thu Dec 19 2024 04:03:51