10 #ifndef EIGEN_COHERENT_PAD_OP_H
11 #define EIGEN_COHERENT_PAD_OP_H
20 template <
typename XprType,
int SizeAtCompileTime_>
23 template <
typename XprType,
int SizeAtCompileTime_>
27 typedef typename std::remove_reference_t<XprNested>
XprNested_;
30 SizeAtCompileTime = SizeAtCompileTime_,
31 RowsAtCompileTime = IsRowMajor ? 1 : SizeAtCompileTime,
32 ColsAtCompileTime = IsRowMajor ? SizeAtCompileTime : 1,
33 MaxRowsAtCompileTime = RowsAtCompileTime,
34 MaxColsAtCompileTime = ColsAtCompileTime,
40 template <
typename XprType,
int SizeAtCompileTime_>
54 static_assert(XprNested_::IsVectorAtCompileTime,
"input type must be a vector");
75 template <
typename ArgType,
int SizeAtCompileTime>
91 : m_arg(
pad.nestedExpression()), m_argImpl(m_arg), m_size(
pad.nestedExpression().
size()) {}
95 if (
col < m_size.value()) {
96 return m_argImpl.coeff(1,
col);
100 if (
row < m_size.value()) {
101 return m_argImpl.coeff(
row, 1);
108 if (index < m_size.value()) {
109 return m_argImpl.coeff(index);
114 template <
int LoadMode,
typename PacketType>
122 template <
int LoadMode,
typename PacketType>
125 if (index + kPacketSize <= m_size.value()) {
126 return m_argImpl.template packet<LoadMode, PacketType>(index);
127 }
else if (index < m_size.value()) {
129 EIGEN_ALIGN_MAX std::remove_const_t<CoeffReturnType> values[kPacketSize];
130 const int partial = m_size.value() - index;
131 for (
int i = 0;
i < partial &&
i < kPacketSize; ++
i) {
132 values[
i] = m_argImpl.coeff(index +
i);
134 for (
int i = partial;
i < kPacketSize; ++
i) {
137 return pload<PacketType>(values);
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:1149
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define EIGEN_IF_CONSTEXPR(X)
Definition: Macros.h:1306
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value()
Definition: XprHelper.h:161
const unsigned int LinearAccessBit
Definition: Constants.h:133
const unsigned int RowMajorBit
Definition: Constants.h:70
typename remove_all< T >::type remove_all_t
Definition: Meta.h:142
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
const unsigned int HereditaryBits
Definition: Constants.h:198
const unsigned int NestByRefBit
Definition: Constants.h:173
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
Extend namespace for flags.
Definition: fsi_chan_precond_driver.cc:56
default
Definition: calibrate.py:45
type
Definition: compute_granudrum_aor.py:141
Definition: Eigen_Colamd.h:49
CwiseBinaryOp< internal::scalar_sum_op< double, double >, const CpyMatrixXd, const CpyMatrixXd > XprType
Definition: nestbyvalue.cpp:15
Definition: TensorMeta.h:47
Definition: CoherentPadOp.h:41
const internal::variable_if_dynamic< Index, SizeAtCompileTime > size_
Definition: CoherentPadOp.h:71
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
Definition: CoherentPadOp.h:61
XprNested xpr_
Definition: CoherentPadOp.h:70
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const XprNested_ & nestedExpression() const
Definition: CoherentPadOp.h:57
typename traits< CoherentPadOp >::XprNested_ XprNested_
Definition: CoherentPadOp.h:46
typename traits< CoherentPadOp >::XprNested XprNested
Definition: CoherentPadOp.h:45
internal::generic_xpr_base< CoherentPadOp< XprType, SizeAtCompileTime_ > >::type Base
Definition: CoherentPadOp.h:42
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const
Definition: CoherentPadOp.h:65
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index size() const
Definition: CoherentPadOp.h:59
XprNested_ NestedExpression
Definition: CoherentPadOp.h:47
Definition: XprHelper.h:558
Definition: CoreEvaluators.h:118
Definition: CoreEvaluators.h:104
Definition: XprHelper.h:575
std::conditional_t< Evaluate, PlainObject, typename ref_selector< T >::type > type
Definition: XprHelper.h:549
std::conditional_t< bool(traits< T >::Flags &NestByRefBit), T const &, const T > type
Definition: XprHelper.h:507
T type
Definition: Meta.h:118
internal::remove_all< XprType >::type PlainXprType
Definition: CoherentPadOp.h:25
internal::ref_selector< XprType >::type XprNested
Definition: CoherentPadOp.h:26
std::remove_reference_t< XprNested > XprNested_
Definition: CoherentPadOp.h:27
Definition: ForwardDeclarations.h:21
const variable_if_dynamic< Index, ArgTypeNestedCleaned::SizeAtCompileTime > m_size
Definition: CoherentPadOp.h:145
EIGEN_STRONG_INLINE PacketType packet(Index index) const
Definition: CoherentPadOp.h:123
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE unary_evaluator(const XprType &pad)
Definition: CoherentPadOp.h:90
const ArgTypeNested m_arg
Definition: CoherentPadOp.h:143
internal::remove_all_t< ArgTypeNested > ArgTypeNestedCleaned
Definition: CoherentPadOp.h:81
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
Definition: CoherentPadOp.h:93
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: CoherentPadOp.h:107
evaluator< ArgTypeNestedCleaned > m_argImpl
Definition: CoherentPadOp.h:144
internal::nested_eval< ArgType, 1 >::type ArgTypeNested
Definition: CoherentPadOp.h:80
EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const
Definition: CoherentPadOp.h:115
internal::remove_all_t< typename XprType::CoeffReturnType > CoeffReturnType
Definition: CoherentPadOp.h:79
CoherentPadOp< ArgType, SizeAtCompileTime > XprType
Definition: CoherentPadOp.h:78
Definition: CoreEvaluators.h:82
Definition: GenericPacketMath.h:134
Definition: Slicing_custom_padding_cxx11.cpp:1