10 #ifndef EIGEN_FORCEALIGNEDACCESS_H
11 #define EIGEN_FORCEALIGNEDACCESS_H
13 #include "./InternalHeaderCheck.h"
31 template<
typename ExpressionType>
32 struct traits<ForceAlignedAccess<ExpressionType> > :
public traits<ExpressionType>
37 :
public internal::dense_xpr_base< ForceAlignedAccess<ExpressionType> >::type
41 typedef typename internal::dense_xpr_base<ForceAlignedAccess>::type Base;
44 EIGEN_DEVICE_FUNC
explicit inline ForceAlignedAccess(
const ExpressionType& matrix) : m_expression(matrix) {}
46 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
47 inline Index rows()
const EIGEN_NOEXCEPT {
return m_expression.rows(); }
48 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
49 inline Index cols()
const EIGEN_NOEXCEPT {
return m_expression.cols(); }
50 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
51 inline Index outerStride()
const EIGEN_NOEXCEPT {
return m_expression.outerStride(); }
52 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
53 inline Index innerStride()
const EIGEN_NOEXCEPT {
return m_expression.innerStride(); }
55 EIGEN_DEVICE_FUNC
inline const CoeffReturnType coeff(
Index row,
Index col)
const
57 return m_expression.coeff(row, col);
60 EIGEN_DEVICE_FUNC
inline Scalar& coeffRef(
Index row,
Index col)
62 return m_expression.const_cast_derived().coeffRef(row, col);
65 EIGEN_DEVICE_FUNC
inline const CoeffReturnType coeff(
Index index)
const
67 return m_expression.coeff(index);
70 EIGEN_DEVICE_FUNC
inline Scalar& coeffRef(
Index index)
72 return m_expression.const_cast_derived().coeffRef(index);
75 template<
int LoadMode>
76 inline const PacketScalar packet(
Index row,
Index col)
const
78 return m_expression.template packet<Aligned>(row, col);
81 template<
int LoadMode>
82 inline void writePacket(
Index row,
Index col,
const PacketScalar& x)
84 m_expression.const_cast_derived().template writePacket<Aligned>(row, col, x);
87 template<
int LoadMode>
88 inline const PacketScalar packet(
Index index)
const
90 return m_expression.template packet<Aligned>(index);
93 template<
int LoadMode>
94 inline void writePacket(
Index index,
const PacketScalar& x)
96 m_expression.const_cast_derived().template writePacket<Aligned>(index, x);
99 EIGEN_DEVICE_FUNC
operator const ExpressionType&()
const {
return m_expression; }
102 const ExpressionType& m_expression;
111 template<
typename Derived>
121 template<
typename Derived>
122 inline ForceAlignedAccess<Derived>
125 return ForceAlignedAccess<Derived>(derived());
131 template<
typename Derived>
132 template<
bool Enable>
133 inline add_const_on_value_type_t<std::conditional_t<Enable,ForceAlignedAccess<Derived>,Derived&>>
142 template<
typename Derived>
143 template<
bool Enable>
144 inline std::conditional_t<Enable,ForceAlignedAccess<Derived>,Derived&>
Enforce aligned packet loads and stores regardless of what is requested.
Definition: ForceAlignedAccess.h:38
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
const Derived & forceAlignedAccess() const
Definition: MatrixBase.h:301
Namespace containing all symbols from the Eigen library.
Definition: Core:139
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:59