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 Eigen::Index Index;
48  enum {
49  InnerStrideAtCompileTime = _InnerStrideAtCompileTime,
50  OuterStrideAtCompileTime = _OuterStrideAtCompileTime
51  };
52 
54  EIGEN_DEVICE_FUNC
57  {
59  }
60 
62  EIGEN_DEVICE_FUNC
63  Stride(Index outerStride, Index innerStride)
64  : m_outer(outerStride), m_inner(innerStride)
65  {
66  eigen_assert(innerStride>=0 && outerStride>=0);
67  }
68 
70  EIGEN_DEVICE_FUNC
71  Stride(const Stride& other)
72  : m_outer(other.outer()), m_inner(other.inner())
73  {}
74 
76  EIGEN_DEVICE_FUNC
77  inline Index outer() const { return m_outer.value(); }
79  EIGEN_DEVICE_FUNC
80  inline Index inner() const { return m_inner.value(); }
81 
82  protected:
85 };
86 
89 template<int Value>
90 class InnerStride : public Stride<0, Value>
91 {
93  public:
94  EIGEN_DEVICE_FUNC InnerStride() : Base() {}
95  EIGEN_DEVICE_FUNC InnerStride(Index v) : Base(0, v) {} // FIXME making this explicit could break valid code
96 };
97 
100 template<int Value>
101 class OuterStride : public Stride<Value, 0>
102 {
104  public:
105  EIGEN_DEVICE_FUNC OuterStride() : Base() {}
106  EIGEN_DEVICE_FUNC OuterStride(Index v) : Base(v,0) {} // FIXME making this explicit could break valid code
107 };
108 
109 } // end namespace Eigen
110 
111 #endif // EIGEN_STRIDE_H
internal::variable_if_dynamic< Index, InnerStrideAtCompileTime > m_inner
Definition: Stride.h:84
internal::variable_if_dynamic< Index, OuterStrideAtCompileTime > m_outer
Definition: Stride.h:83
EIGEN_DEVICE_FUNC Stride(const Stride &other)
Definition: Stride.h:71
Definition: LDLT.h:16
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T value()
Definition: XprHelper.h:111
Holds strides information for Map.
Definition: Stride.h:44
EIGEN_DEVICE_FUNC InnerStride()
Definition: Stride.h:94
EIGEN_DEVICE_FUNC Index outer() const
Definition: Stride.h:77
Convenience specialization of Stride to specify only an inner stride See class Map for some examples...
Definition: Stride.h:90
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Eigen::Index Index
Definition: Stride.h:47
#define eigen_assert(x)
Definition: Macros.h:577
EIGEN_DEVICE_FUNC OuterStride()
Definition: Stride.h:105
EIGEN_DEVICE_FUNC OuterStride(Index v)
Definition: Stride.h:106
EIGEN_DEVICE_FUNC Stride()
Definition: Stride.h:55
Stride< Value, 0 > Base
Definition: Stride.h:103
Stride< 0, Value > Base
Definition: Stride.h:92
const int Dynamic
Definition: Constants.h:21
Convenience specialization of Stride to specify only an outer stride See class Map for some examples...
Definition: Stride.h:101
EIGEN_DEVICE_FUNC Stride(Index outerStride, Index innerStride)
Definition: Stride.h:63
EIGEN_DEVICE_FUNC Index inner() const
Definition: Stride.h:80
EIGEN_DEVICE_FUNC InnerStride(Index v)
Definition: Stride.h:95


hebiros
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:09:03