10 #ifndef EIGEN_BLASUTIL_H 11 #define EIGEN_BLASUTIL_H 21 template<
typename LhsScalar,
typename RhsScalar,
typename Index,
typename DataMapper,
int mr,
int nr,
bool ConjugateLhs=false,
bool ConjugateRhs=false>
24 template<
typename Scalar,
typename Index,
typename DataMapper,
int nr,
int StorageOrder,
bool Conjugate = false,
bool PanelMode=false>
27 template<
typename Scalar,
typename Index,
typename DataMapper,
int Pack1,
int Pack2,
typename Packet,
int StorageOrder,
bool Conjugate = false,
bool PanelMode = false>
32 typename LhsScalar,
int LhsStorageOrder,
bool ConjugateLhs,
33 typename RhsScalar,
int RhsStorageOrder,
bool ConjugateRhs,
34 int ResStorageOrder,
int ResInnerStride>
37 template<
typename Index,
38 typename LhsScalar,
typename LhsMapper,
int LhsStorageOrder,
bool ConjugateLhs,
39 typename RhsScalar,
typename RhsMapper,
bool ConjugateRhs,
int Version=
Specialized>
52 template<
typename Scalar,
typename Index>
60 template <
typename Packet,
int AlignmentType>
62 return ploadt<Packet, AlignmentType>(m_data +
i);
65 template <
typename Packet>
74 template<
typename Scalar,
typename Index,
int AlignmentType,
int Incr=1>
77 template<
typename Scalar,
typename Index,
int AlignmentType>
96 template<
typename PacketType>
98 return ploadt<PacketType, AlignmentType>(m_data +
i);
101 template<
typename PacketType>
103 pstoret<Scalar, PacketType, AlignmentType>(m_data +
i,
p);
111 template<
typename Scalar,
typename Index,
int StorageOrder,
int AlignmentType = Unaligned,
int Incr = 1>
118 template<
typename Index,
typename Scalar,
typename Packet,
int n,
int idx,
int StorageOrder>
123 pbm.store(to, stride, i, j, block);
124 pstoreu<Scalar>(to + i + (j + idx)*stride, block.
packet[idx]);
129 template<
typename Index,
typename Scalar,
typename Packet,
int n,
int idx>
134 pbm.store(to, stride, i, j, block);
135 pstoreu<Scalar>(to + j + (i + idx)*stride, block.
packet[idx]);
139 template<
typename Index,
typename Scalar,
typename Packet,
int n,
int StorageOrder>
151 template<
typename Index,
typename Scalar,
typename Packet,
int n>
163 template<
typename Scalar,
typename Index,
int StorageOrder,
int AlignmentType>
171 : m_data(data), m_stride(stride)
183 return LinearMapper(&
operator()(i, j));
187 return VectorMapper(&
operator()(i, j));
193 return m_data[StorageOrder==
RowMajor ? j + i*m_stride : i + j*m_stride];
196 template<
typename PacketType>
198 return ploadt<PacketType, AlignmentType>(&
operator()(i, j));
201 template <
typename PacketT,
int AlignmentT>
203 return ploadt<PacketT, AlignmentT>(&
operator()(i, j));
206 template<
typename SubPacket>
208 pscatter<Scalar, SubPacket>(&
operator()(i, j),
p, m_stride);
211 template<
typename SubPacket>
213 return pgather<Scalar, SubPacket>(&
operator()(i, j), m_stride);
226 template<
typename SubPacket,
int n>
229 pbm.
store(m_data, m_stride, i, j, block);
239 template<
typename Scalar,
typename Index,
int AlignmentType,
int Incr>
250 return m_data[i*m_incr.value()];
253 template<
typename PacketType>
255 return pgather<Scalar,PacketType>(m_data + i*m_incr.value(), m_incr.value());
258 template<
typename PacketType>
260 pscatter<Scalar, PacketType>(m_data + i*m_incr.value(),
p, m_incr.value());
268 template<
typename Scalar,
typename Index,
int StorageOrder,
int AlignmentType,
int Incr>
282 return LinearMapper(&
operator()(i, j), m_incr.value());
287 return m_data[StorageOrder==
RowMajor ? j*m_incr.value() + i*m_stride : i*m_incr.value() + j*m_stride];
290 template<
typename PacketType>
292 return pgather<Scalar,PacketType>(&
operator()(i, j),m_incr.value());
295 template <
typename PacketT,
int AlignmentT>
297 return pgather<Scalar,PacketT>(&
operator()(i, j),m_incr.value());
300 template<
typename SubPacket>
302 pscatter<Scalar, SubPacket>(&
operator()(i, j),
p, m_stride);
305 template<
typename SubPacket>
307 return pgather<Scalar, SubPacket>(&
operator()(i, j), m_stride);
311 template<
typename SubPacket,
typename ScalarT,
int n,
int idx>
316 spbh.store(sup, i,j,block);
319 ScalarT *
v = &sup->operator()(i+
l, j+idx);
325 template<
typename SubPacket,
int n,
int idx>
330 spbh.
store(sup,i,j,block);
333 std::complex<float> *
v = &sup->operator()(i+
l, j+idx);
334 v->real(block.
packet[idx].v[2*l+0]);
335 v->imag(block.
packet[idx].v[2*l+1]);
340 template<
typename SubPacket,
int n,
int idx>
345 spbh.
store(sup,i,j,block);
348 std::complex<double> *
v = &sup->operator()(i+
l, j+idx);
349 v->real(block.
packet[idx].v[2*l+0]);
350 v->imag(block.
packet[idx].v[2*l+1]);
355 template<
typename SubPacket,
typename ScalarT,
int n>
362 template<
typename SubPacket,
int n>
369 template<
typename SubPacket,
int n>
376 template<
typename SubPacket,
int n>
378 storePacketBlock_helper<SubPacket,
Scalar,
n, n-1> spb;
379 spb.store(
this, i,j,block);
388 template<
typename Scalar,
typename Index,
int StorageOrder>
409 IsTransposed =
false,
410 NeedToConjugate =
false,
412 && (
bool(XprType::IsVectorAtCompileTime)
415 HasScalarFactor =
false 417 typedef typename conditional<bool(HasUsableDirectAccess),
419 typename _ExtractType::PlainObject
426 template<
typename Scalar,
typename NestedXpr>
443 template<
typename Scalar,
typename NestedXpr,
typename Plain>
448 HasScalarFactor =
true 455 {
return x.
lhs().functor().m_other * Base::extractScalarFactor(x.
rhs()); }
457 template<
typename Scalar,
typename NestedXpr,
typename Plain>
462 HasScalarFactor =
true 467 static inline ExtractType
extract(
const XprType&
x) {
return Base::extract(x.
lhs()); }
469 {
return Base::extractScalarFactor(x.
lhs()) * x.
rhs().functor().m_other; }
471 template<
typename Scalar,
typename Plain1,
typename Plain2>
474 :
blas_traits<CwiseNullaryOp<scalar_constant_op<Scalar>,Plain1> >
478 template<
typename Scalar,
typename NestedXpr>
483 HasScalarFactor =
true 494 template<
typename NestedXpr>
503 typedef typename conditional<bool(Base::HasUsableDirectAccess),
505 typename ExtractType::PlainObject
508 IsTransposed = Base::IsTransposed ? 0 : 1
519 template<typename T, bool HasUsableDirectAccess=blas_traits<T>::HasUsableDirectAccess>
542 template<
typename ResScalar,
typename Lhs,
typename Rhs>
554 template<
typename Lhs,
typename Rhs>
567 template<
typename ResScalar,
typename Lhs,
typename Rhs>
572 template<
typename ResScalar,
typename Lhs,
typename Rhs>
583 #endif // EIGEN_BLASUTIL_H EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar & operator()(Index i) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void storePacket(Index i, const PacketType &p) const
internal::packet_traits< Scalar >::type Packet
Generic expression of a matrix where all coefficients are defined by a functor.
#define EIGEN_ALWAYS_INLINE
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE BlasVectorMapper(Scalar *data)
#define EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE bool run(const Lhs &lhs, const Rhs &rhs)
Base::ExtractType ExtractType
CwiseUnaryOp< scalar_opposite_op< Scalar >, NestedXpr > XprType
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper< Scalar, Index, StorageOrder, AlignmentType, Incr > *, Index, Index, const PacketBlock< SubPacket, n > &) const
storePacketBlock_helper< SubPacket, std::complex< double >, n, idx-1 > spbh
blas_traits< NestedXpr > Base
m m block(1, 0, 2, 2)<< 4
blas_traits< NestedXpr > Base
static ExtractType extract(const XprType &x)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const _RhsNested & rhs() const
Base::ExtractType ExtractType
PacketBlockManagement< Index, Scalar, Packet, n, idx - 1, RowMajor > pbm
Expression of the transpose of a matrix.
const unsigned int DirectAccessBit
conditional< bool(HasUsableDirectAccess), ExtractType, typename _ExtractType::PlainObject >::type DirectLinearAccessType
static Scalar extractScalarFactor(const XprType &x)
EIGEN_ALWAYS_INLINE const_blas_data_mapper(const Scalar *data, Index stride)
EIGEN_DEVICE_FUNC Index firstAligned(Index size) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketType loadPacket(Index i, Index j) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void prefetch(int i) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketType loadPacket(Index i) const
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE To run(const From &x)
EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE ResScalar run(const Lhs &lhs, const Rhs &rhs)
blas_traits< NestedXpr > Base
Namespace containing all symbols from the Eigen library.
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const T::Scalar * extract_data(const T &m)
EIGEN_DEVICE_FUNC const Index stride() const
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
BlasLinearMapper< Scalar, Index, AlignmentType > LinearMapper
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE BlasLinearMapper(Scalar *data, Index incr=1)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE VectorMapper getVectorMapper(Index i, Index j) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketT load(Index i, Index j) const
static Scalar extractScalarFactor(const XprType &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(Scalar *to, const Index stride, Index i, Index j, const PacketBlock< Packet, n > &block) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void scatterPacket(Index i, Index j, const SubPacket &p) const
Scalar *EIGEN_RESTRICT m_data
blas_traits< NestedXpr > Base
const internal::variable_if_dynamic< Index, Incr > m_incr
static ExtractType extract(const XprType &x)
Transpose< const typename Base::_ExtractType > ExtractType
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE LinearMapper getLinearMapper(Index i, Index j) const
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE NumTraits< Scalar >::Real run(const Scalar &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper< Scalar, Index, StorageOrder, AlignmentType, Incr > *sup, Index i, Index j, const PacketBlock< SubPacket, n > &block) const
static Index first_default_aligned(const DenseBase< Derived > &m)
storePacketBlock_helper< SubPacket, std::complex< float >, n, idx-1 > spbh
EIGEN_ALWAYS_INLINE const_blas_data_mapper< Scalar, Index, StorageOrder > getSubMapper(Index i, Index j) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(Scalar *to, const Index stride, Index i, Index j, const PacketBlock< Packet, n > &block) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar & operator()(Index i) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper< Scalar, Index, StorageOrder, AlignmentType, Incr > *sup, Index i, Index j, const PacketBlock< SubPacket, n > &block) const
Generic expression where a coefficient-wise binary operator is applied to two expressions.
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE SubPacket gatherPacket(Index i, Index j) const
static const Line3 l(Rot3(), 1, 1)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(Scalar *to, const Index stride, Index i, Index j, const PacketBlock< Packet, n > &block) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::remove_all< MatrixTypeNested >::type & nestedExpression() const
Scalar *EIGEN_RESTRICT m_data
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar & operator()(Index i, Index j) const
CwiseBinaryOp< scalar_product_op< Scalar >, NestedXpr, const CwiseNullaryOp< scalar_constant_op< Scalar >, Plain > > XprType
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE blas_data_mapper getSubMapper(Index i, Index j) const
EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE bool run(const bool &alpha, const Lhs &lhs, const Rhs &rhs)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Base::ExtractType ExtractType
Array< int, Dynamic, 1 > v
static ExtractType extract(const XprType &x)
BlasVectorMapper< Scalar, Index > VectorMapper
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar & operator()(Index i, Index j) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE ResScalar combine_scalar_factors(const ResScalar &alpha, const Lhs &lhs, const Rhs &rhs)
static Scalar extractScalarFactor(const XprType &x)
CwiseUnaryOp< scalar_conjugate_op< Scalar >, NestedXpr > XprType
Transpose< NestedXpr > XprType
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketT load(Index i, Index j) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar operator()(Index i) const
static EIGEN_DEVICE_FUNC Scalar extractScalarFactor(const XprType &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE blas_data_mapper(Scalar *data, Index stride, Index incr=1)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper< Scalar, Index, StorageOrder, AlignmentType, Incr > *, Index, Index, const PacketBlock< SubPacket, n > &) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void scatterPacket(Index i, Index j, const SubPacket &p) const
const internal::variable_if_dynamic< Index, Incr > m_incr
static ExtractType extract(const XprType &x)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const _LhsNested & lhs() const
blas_traits< NestedXpr > Base
PacketBlockManagement< Index, Scalar, Packet, n, idx - 1, StorageOrder > pbm
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketType loadPacket(Index i) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void storePacketBlock(Index i, Index j, const PacketBlock< SubPacket, n > &block) const
EIGEN_CONSTEXPR Index size(const T &x)
#define EIGEN_DEVICE_FUNC
static EIGEN_DEVICE_FUNC const Scalar extractScalarFactor(const XprType &)
BlasLinearMapper< Scalar, Index, AlignmentType, Incr > LinearMapper
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(Scalar *to, const Index stride, Index i, Index j, const PacketBlock< Packet, n > &block) const
mp::number< mp::cpp_dec_float< 100 >, mp::et_on > Real
CwiseBinaryOp< scalar_product_op< Scalar >, const CwiseNullaryOp< scalar_constant_op< Scalar >, Plain >, NestedXpr > XprType
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet load(Index i) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper< Scalar, Index, StorageOrder, AlignmentType, Incr > *sup, Index i, Index j, const PacketBlock< SubPacket, n > &block) const
EIGEN_DEVICE_FUNC bool aligned(Index i) const
CwiseBinaryOp< internal::scalar_sum_op< double, double >, const CpyMatrixXd, const CpyMatrixXd > XprType
storePacketBlock_helper< SubPacket, ScalarT, n, idx-1 > spbh
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void storePacket(Index i, const PacketType &p) const
EIGEN_DEVICE_FUNC const Scalar * data() const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void prefetch(int i) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE LinearMapper getLinearMapper(Index i, Index j) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketType loadPacket(Index i, Index j) const
static EIGEN_DEVICE_FUNC ExtractType extract(const XprType &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE SubPacket gatherPacket(Index i, Index j) const
conditional< bool(Base::HasUsableDirectAccess), ExtractType, typename ExtractType::PlainObject >::type DirectLinearAccessType
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE blas_data_mapper(Scalar *data, Index stride, Index incr)
EIGEN_DEVICE_FUNC void prefetch(const Scalar *addr)
Generic expression where a coefficient-wise unary operator is applied to an expression.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::remove_all< XprTypeNested >::type & nestedExpression() const
traits< XprType >::Scalar Scalar
static EIGEN_DEVICE_FUNC ExtractType extract(const XprType &x)
EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE ResScalar run(const ResScalar &alpha, const Lhs &lhs, const Rhs &rhs)
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
internal::enable_if< internal::valid_indexed_view_overload< RowIndices, ColIndices >::value &&internal::traits< typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::ReturnAsIndexedView, typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::type operator()(const RowIndices &rowIndices, const ColIndices &colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST
static Scalar extractScalarFactor(const XprType &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE BlasLinearMapper(Scalar *data, Index incr)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void storePacketBlock(Index i, Index j, const PacketBlock< SubPacket, n > &block) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void store(const blas_data_mapper< Scalar, Index, StorageOrder, AlignmentType, Incr > *, Index, Index, const PacketBlock< SubPacket, n > &) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE blas_data_mapper< Scalar, Index, StorageOrder, AlignmentType > getSubMapper(Index i, Index j) const
#define EIGEN_UNUSED_VARIABLE(var)
Base::ExtractType ExtractType
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Transpose< const typename Base::_ExtractType > _ExtractType
const XprType & ExtractType