ForceAlignedAccess.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) 2009-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
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_FORCEALIGNEDACCESS_H
11 #define EIGEN_FORCEALIGNEDACCESS_H
12 
13 namespace Eigen {
14 
28 namespace internal {
29 template<typename ExpressionType>
30 struct traits<ForceAlignedAccess<ExpressionType> > : public traits<ExpressionType>
31 {};
32 }
33 
34 template<typename ExpressionType> class ForceAlignedAccess
35  : public internal::dense_xpr_base< ForceAlignedAccess<ExpressionType> >::type
36 {
37  public:
38 
41 
42  EIGEN_DEVICE_FUNC explicit inline ForceAlignedAccess(const ExpressionType& matrix) : m_expression(matrix) {}
43 
45  inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); }
47  inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); }
49  inline Index outerStride() const EIGEN_NOEXCEPT { return m_expression.outerStride(); }
51  inline Index innerStride() const EIGEN_NOEXCEPT { return m_expression.innerStride(); }
52 
53  EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index row, Index col) const
54  {
55  return m_expression.coeff(row, col);
56  }
57 
59  {
60  return m_expression.const_cast_derived().coeffRef(row, col);
61  }
62 
63  EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index index) const
64  {
65  return m_expression.coeff(index);
66  }
67 
69  {
70  return m_expression.const_cast_derived().coeffRef(index);
71  }
72 
73  template<int LoadMode>
74  inline const PacketScalar packet(Index row, Index col) const
75  {
76  return m_expression.template packet<Aligned>(row, col);
77  }
78 
79  template<int LoadMode>
80  inline void writePacket(Index row, Index col, const PacketScalar& x)
81  {
82  m_expression.const_cast_derived().template writePacket<Aligned>(row, col, x);
83  }
84 
85  template<int LoadMode>
86  inline const PacketScalar packet(Index index) const
87  {
88  return m_expression.template packet<Aligned>(index);
89  }
90 
91  template<int LoadMode>
92  inline void writePacket(Index index, const PacketScalar& x)
93  {
94  m_expression.const_cast_derived().template writePacket<Aligned>(index, x);
95  }
96 
97  EIGEN_DEVICE_FUNC operator const ExpressionType&() const { return m_expression; }
98 
99  protected:
100  const ExpressionType& m_expression;
101 
102  private:
104 };
105 
109 template<typename Derived>
110 inline const ForceAlignedAccess<Derived>
112 {
113  return ForceAlignedAccess<Derived>(derived());
114 }
115 
119 template<typename Derived>
120 inline ForceAlignedAccess<Derived>
122 {
123  return ForceAlignedAccess<Derived>(derived());
124 }
125 
129 template<typename Derived>
130 template<bool Enable>
131 inline typename internal::add_const_on_value_type<typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type>::type
133 {
134  return derived(); // FIXME This should not work but apparently is never used
135 }
136 
140 template<typename Derived>
141 template<bool Enable>
144 {
145  return derived(); // FIXME This should not work but apparently is never used
146 }
147 
148 } // end namespace Eigen
149 
150 #endif // EIGEN_FORCEALIGNEDACCESS_H
Eigen::ForceAlignedAccess::outerStride
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT
Definition: ForceAlignedAccess.h:49
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
col
m col(1)
Eigen::MatrixBase::forceAlignedAccess
const Derived & forceAlignedAccess() const
Definition: MatrixBase.h:305
Eigen::ForceAlignedAccess
Enforce aligned packet loads and stores regardless of what is requested.
Definition: ForceAlignedAccess.h:34
Eigen::internal::dense_xpr_base
Definition: XprHelper.h:483
Eigen::ForceAlignedAccess::innerStride
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerStride() const EIGEN_NOEXCEPT
Definition: ForceAlignedAccess.h:51
Eigen::ForceAlignedAccess::coeffRef
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index index)
Definition: ForceAlignedAccess.h:68
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
Eigen::ForceAlignedAccess::writePacket
void writePacket(Index row, Index col, const PacketScalar &x)
Definition: ForceAlignedAccess.h:80
EIGEN_CONSTEXPR
#define EIGEN_CONSTEXPR
Definition: Macros.h:787
type
Definition: pytypes.h:1525
Eigen::ForceAlignedAccess::Base
internal::dense_xpr_base< ForceAlignedAccess >::type Base
Definition: ForceAlignedAccess.h:39
Eigen::ForceAlignedAccess::rows
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: ForceAlignedAccess.h:45
Eigen::ForceAlignedAccess::cols
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: ForceAlignedAccess.h:47
EIGEN_DENSE_PUBLIC_INTERFACE
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:1283
Eigen::ForceAlignedAccess::coeffRef
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index row, Index col)
Definition: ForceAlignedAccess.h:58
Eigen::MatrixBase::forceAlignedAccessIf
const Derived & forceAlignedAccessIf() const
Definition: MatrixBase.h:307
Eigen::ForceAlignedAccess::packet
const PacketScalar packet(Index row, Index col) const
Definition: ForceAlignedAccess.h:74
Eigen::ForceAlignedAccess::coeff
const EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index row, Index col) const
Definition: ForceAlignedAccess.h:53
Eigen::ForceAlignedAccess::coeff
const EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index index) const
Definition: ForceAlignedAccess.h:63
matrix
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: gtsam/3rdparty/Eigen/blas/common.h:110
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::ForceAlignedAccess::m_expression
const ExpressionType & m_expression
Definition: ForceAlignedAccess.h:100
row
m row(1)
Eigen::internal::conditional
Definition: Meta.h:109
Eigen::ForceAlignedAccess::operator=
ForceAlignedAccess & operator=(const ForceAlignedAccess &)
EIGEN_NOEXCEPT
#define EIGEN_NOEXCEPT
Definition: Macros.h:1418
internal
Definition: BandTriangularSolver.h:13
Eigen::ForceAlignedAccess::writePacket
void writePacket(Index index, const PacketScalar &x)
Definition: ForceAlignedAccess.h:92
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::ForceAlignedAccess::packet
const PacketScalar packet(Index index) const
Definition: ForceAlignedAccess.h:86
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 Fri Nov 1 2024 03:32:32