mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-29 07:14:12 +08:00
Replace instances of EIGEN_CONSTEXPR macro
This commit is contained in:
parent
33f5f59614
commit
d6689a15d7
@ -230,8 +230,8 @@ class LDLT : public SolverBase<LDLT<MatrixType_, UpLo_> > {
|
|||||||
*/
|
*/
|
||||||
const LDLT& adjoint() const { return *this; }
|
const LDLT& adjoint() const { return *this; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC inline EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
||||||
EIGEN_DEVICE_FUNC inline EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
||||||
|
|
||||||
/** \brief Reports whether previous computation was successful.
|
/** \brief Reports whether previous computation was successful.
|
||||||
*
|
*
|
||||||
|
@ -184,8 +184,8 @@ class LLT : public SolverBase<LLT<MatrixType_, UpLo_> > {
|
|||||||
*/
|
*/
|
||||||
const LLT& adjoint() const EIGEN_NOEXCEPT { return *this; }
|
const LLT& adjoint() const EIGEN_NOEXCEPT { return *this; }
|
||||||
|
|
||||||
inline EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
||||||
inline EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
||||||
|
|
||||||
template <typename VectorType>
|
template <typename VectorType>
|
||||||
LLT& rankUpdate(const VectorType& vec, const RealScalar& sigma = 1);
|
LLT& rankUpdate(const VectorType& vec, const RealScalar& sigma = 1);
|
||||||
|
@ -253,8 +253,8 @@ class Array : public PlainObjectBase<Array<Scalar_, Rows_, Cols_, Options_, MaxR
|
|||||||
PrivateType())
|
PrivateType())
|
||||||
: Base(other.derived()) {}
|
: Base(other.derived()) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT { return 1; }
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return 1; }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { return this->innerSize(); }
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return this->innerSize(); }
|
||||||
|
|
||||||
#ifdef EIGEN_ARRAY_PLUGIN
|
#ifdef EIGEN_ARRAY_PLUGIN
|
||||||
#include EIGEN_ARRAY_PLUGIN
|
#include EIGEN_ARRAY_PLUGIN
|
||||||
|
@ -56,14 +56,10 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> > {
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC explicit EIGEN_STRONG_INLINE ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {}
|
EIGEN_DEVICE_FUNC explicit EIGEN_STRONG_INLINE ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return m_expression.outerStride(); }
|
||||||
return m_expression.outerStride();
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return m_expression.innerStride(); }
|
||||||
}
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT {
|
|
||||||
return m_expression.innerStride();
|
|
||||||
}
|
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC constexpr ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
EIGEN_DEVICE_FUNC constexpr ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
||||||
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_expression.data(); }
|
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_expression.data(); }
|
||||||
@ -135,14 +131,10 @@ class MatrixWrapper : public MatrixBase<MatrixWrapper<ExpressionType> > {
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC explicit inline MatrixWrapper(ExpressionType& matrix) : m_expression(matrix) {}
|
EIGEN_DEVICE_FUNC explicit inline MatrixWrapper(ExpressionType& matrix) : m_expression(matrix) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return m_expression.outerStride(); }
|
||||||
return m_expression.outerStride();
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return m_expression.innerStride(); }
|
||||||
}
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT {
|
|
||||||
return m_expression.innerStride();
|
|
||||||
}
|
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC constexpr ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
EIGEN_DEVICE_FUNC constexpr ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
||||||
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_expression.data(); }
|
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_expression.data(); }
|
||||||
|
@ -200,7 +200,7 @@ struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling {
|
|||||||
|
|
||||||
template <typename Kernel, int Stop>
|
template <typename Kernel, int Stop>
|
||||||
struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling<Kernel, Stop, Stop> {
|
struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling<Kernel, Stop, Stop> {
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) {}
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel&) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Kernel, int Index_, int Stop>
|
template <typename Kernel, int Index_, int Stop>
|
||||||
@ -254,7 +254,7 @@ struct copy_using_evaluator_innervec_CompleteUnrolling {
|
|||||||
|
|
||||||
template <typename Kernel, int Stop>
|
template <typename Kernel, int Stop>
|
||||||
struct copy_using_evaluator_innervec_CompleteUnrolling<Kernel, Stop, Stop> {
|
struct copy_using_evaluator_innervec_CompleteUnrolling<Kernel, Stop, Stop> {
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) {}
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel&) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Kernel, int Index_, int Stop, int SrcAlignment, int DstAlignment>
|
template <typename Kernel, int Index_, int Stop, int SrcAlignment, int DstAlignment>
|
||||||
@ -334,7 +334,7 @@ template <typename Kernel, int Unrolling>
|
|||||||
struct dense_assignment_loop_impl<Kernel, AllAtOnceTraversal, Unrolling> {
|
struct dense_assignment_loop_impl<Kernel, AllAtOnceTraversal, Unrolling> {
|
||||||
static constexpr int SizeAtCompileTime = Kernel::AssignmentTraits::SizeAtCompileTime;
|
static constexpr int SizeAtCompileTime = Kernel::AssignmentTraits::SizeAtCompileTime;
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC static void EIGEN_STRONG_INLINE EIGEN_CONSTEXPR run(Kernel& /*kernel*/) {
|
EIGEN_DEVICE_FUNC static void EIGEN_STRONG_INLINE constexpr run(Kernel& /*kernel*/) {
|
||||||
EIGEN_STATIC_ASSERT(SizeAtCompileTime == 0, EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT)
|
EIGEN_STATIC_ASSERT(SizeAtCompileTime == 0, EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -385,25 +385,23 @@ template <typename PacketType, int DstAlignment, int SrcAlignment, bool UsePacke
|
|||||||
struct unaligned_dense_assignment_loop {
|
struct unaligned_dense_assignment_loop {
|
||||||
// if Skip == true, then do nothing
|
// if Skip == true, then do nothing
|
||||||
template <typename Kernel>
|
template <typename Kernel>
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& /*kernel*/, Index /*start*/,
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& /*kernel*/, Index /*start*/, Index /*end*/) {}
|
||||||
Index /*end*/) {}
|
|
||||||
template <typename Kernel>
|
template <typename Kernel>
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& /*kernel*/, Index /*outer*/,
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& /*kernel*/, Index /*outer*/,
|
||||||
Index /*innerStart*/, Index /*innerEnd*/) {}
|
Index /*innerStart*/, Index /*innerEnd*/) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename PacketType, int DstAlignment, int SrcAlignment>
|
template <typename PacketType, int DstAlignment, int SrcAlignment>
|
||||||
struct unaligned_dense_assignment_loop<PacketType, DstAlignment, SrcAlignment, /*UsePacketSegment*/ true,
|
struct unaligned_dense_assignment_loop<PacketType, DstAlignment, SrcAlignment, /*UsePacketSegment*/ true,
|
||||||
/*Skip*/ false> {
|
/*Skip*/ false> {
|
||||||
template <typename Kernel>
|
template <typename Kernel>
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel, Index start, Index end) {
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel, Index start, Index end) {
|
||||||
Index count = end - start;
|
Index count = end - start;
|
||||||
eigen_assert(count <= unpacket_traits<PacketType>::size);
|
eigen_assert(count <= unpacket_traits<PacketType>::size);
|
||||||
if (count > 0) kernel.template assignPacketSegment<DstAlignment, SrcAlignment, PacketType>(start, 0, count);
|
if (count > 0) kernel.template assignPacketSegment<DstAlignment, SrcAlignment, PacketType>(start, 0, count);
|
||||||
}
|
}
|
||||||
template <typename Kernel>
|
template <typename Kernel>
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel, Index outer, Index start,
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel, Index outer, Index start, Index end) {
|
||||||
Index end) {
|
|
||||||
Index count = end - start;
|
Index count = end - start;
|
||||||
eigen_assert(count <= unpacket_traits<PacketType>::size);
|
eigen_assert(count <= unpacket_traits<PacketType>::size);
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
@ -415,12 +413,12 @@ template <typename PacketType, int DstAlignment, int SrcAlignment>
|
|||||||
struct unaligned_dense_assignment_loop<PacketType, DstAlignment, SrcAlignment, /*UsePacketSegment*/ false,
|
struct unaligned_dense_assignment_loop<PacketType, DstAlignment, SrcAlignment, /*UsePacketSegment*/ false,
|
||||||
/*Skip*/ false> {
|
/*Skip*/ false> {
|
||||||
template <typename Kernel>
|
template <typename Kernel>
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel, Index start, Index end) {
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel, Index start, Index end) {
|
||||||
for (Index index = start; index < end; ++index) kernel.assignCoeff(index);
|
for (Index index = start; index < end; ++index) kernel.assignCoeff(index);
|
||||||
}
|
}
|
||||||
template <typename Kernel>
|
template <typename Kernel>
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel, Index outer, Index innerStart,
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel, Index outer, Index innerStart,
|
||||||
Index innerEnd) {
|
Index innerEnd) {
|
||||||
for (Index inner = innerStart; inner < innerEnd; ++inner) kernel.assignCoeffByOuterInner(outer, inner);
|
for (Index inner = innerStart; inner < innerEnd; ++inner) kernel.assignCoeffByOuterInner(outer, inner);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -440,7 +438,7 @@ struct copy_using_evaluator_linearvec_CompleteUnrolling {
|
|||||||
|
|
||||||
template <typename Kernel, int Stop>
|
template <typename Kernel, int Stop>
|
||||||
struct copy_using_evaluator_linearvec_CompleteUnrolling<Kernel, Stop, Stop> {
|
struct copy_using_evaluator_linearvec_CompleteUnrolling<Kernel, Stop, Stop> {
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) {}
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel&) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Kernel, int Index_, int Stop, bool UsePacketSegment>
|
template <typename Kernel, int Index_, int Stop, bool UsePacketSegment>
|
||||||
@ -460,12 +458,12 @@ struct copy_using_evaluator_linearvec_segment<Kernel, Index_, Stop, /*UsePacketS
|
|||||||
|
|
||||||
template <typename Kernel, int Stop>
|
template <typename Kernel, int Stop>
|
||||||
struct copy_using_evaluator_linearvec_segment<Kernel, Stop, Stop, /*UsePacketSegment*/ true> {
|
struct copy_using_evaluator_linearvec_segment<Kernel, Stop, Stop, /*UsePacketSegment*/ true> {
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) {}
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel&) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Kernel, int Stop>
|
template <typename Kernel, int Stop>
|
||||||
struct copy_using_evaluator_linearvec_segment<Kernel, Stop, Stop, /*UsePacketSegment*/ false> {
|
struct copy_using_evaluator_linearvec_segment<Kernel, Stop, Stop, /*UsePacketSegment*/ false> {
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) {}
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel&) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Kernel>
|
template <typename Kernel>
|
||||||
@ -486,7 +484,7 @@ struct dense_assignment_loop_impl<Kernel, LinearVectorizedTraversal, NoUnrolling
|
|||||||
unaligned_dense_assignment_loop<PacketType, DstAlignment, SrcAlignment, UsePacketSegment, DstIsAligned>;
|
unaligned_dense_assignment_loop<PacketType, DstAlignment, SrcAlignment, UsePacketSegment, DstIsAligned>;
|
||||||
using tail_loop = unaligned_dense_assignment_loop<PacketType, Alignment, SrcAlignment, UsePacketSegment, false>;
|
using tail_loop = unaligned_dense_assignment_loop<PacketType, Alignment, SrcAlignment, UsePacketSegment, false>;
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) {
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) {
|
||||||
const Index size = kernel.size();
|
const Index size = kernel.size();
|
||||||
const Index alignedStart = DstIsAligned ? 0 : first_aligned<Alignment>(kernel.dstDataPtr(), size);
|
const Index alignedStart = DstIsAligned ? 0 : first_aligned<Alignment>(kernel.dstDataPtr(), size);
|
||||||
const Index alignedEnd = alignedStart + numext::round_down(size - alignedStart, PacketSize);
|
const Index alignedEnd = alignedStart + numext::round_down(size - alignedStart, PacketSize);
|
||||||
@ -508,7 +506,7 @@ struct dense_assignment_loop_impl<Kernel, LinearVectorizedTraversal, CompleteUnr
|
|||||||
static constexpr int AlignedSize = numext::round_down(Size, PacketSize);
|
static constexpr int AlignedSize = numext::round_down(Size, PacketSize);
|
||||||
static constexpr bool UsePacketSegment = Kernel::AssignmentTraits::UsePacketSegment;
|
static constexpr bool UsePacketSegment = Kernel::AssignmentTraits::UsePacketSegment;
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) {
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) {
|
||||||
copy_using_evaluator_linearvec_CompleteUnrolling<Kernel, 0, AlignedSize>::run(kernel);
|
copy_using_evaluator_linearvec_CompleteUnrolling<Kernel, 0, AlignedSize>::run(kernel);
|
||||||
copy_using_evaluator_linearvec_segment<Kernel, AlignedSize, Size, UsePacketSegment>::run(kernel);
|
copy_using_evaluator_linearvec_segment<Kernel, AlignedSize, Size, UsePacketSegment>::run(kernel);
|
||||||
}
|
}
|
||||||
@ -525,7 +523,7 @@ struct dense_assignment_loop_impl<Kernel, InnerVectorizedTraversal, NoUnrolling>
|
|||||||
static constexpr int SrcAlignment = Kernel::AssignmentTraits::JointAlignment;
|
static constexpr int SrcAlignment = Kernel::AssignmentTraits::JointAlignment;
|
||||||
static constexpr int DstAlignment = Kernel::AssignmentTraits::DstAlignment;
|
static constexpr int DstAlignment = Kernel::AssignmentTraits::DstAlignment;
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) {
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) {
|
||||||
const Index innerSize = kernel.innerSize();
|
const Index innerSize = kernel.innerSize();
|
||||||
const Index outerSize = kernel.outerSize();
|
const Index outerSize = kernel.outerSize();
|
||||||
for (Index outer = 0; outer < outerSize; ++outer)
|
for (Index outer = 0; outer < outerSize; ++outer)
|
||||||
@ -563,7 +561,7 @@ struct dense_assignment_loop_impl<Kernel, InnerVectorizedTraversal, InnerUnrolli
|
|||||||
|
|
||||||
template <typename Kernel>
|
template <typename Kernel>
|
||||||
struct dense_assignment_loop_impl<Kernel, LinearTraversal, NoUnrolling> {
|
struct dense_assignment_loop_impl<Kernel, LinearTraversal, NoUnrolling> {
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) {
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) {
|
||||||
const Index size = kernel.size();
|
const Index size = kernel.size();
|
||||||
for (Index i = 0; i < size; ++i) kernel.assignCoeff(i);
|
for (Index i = 0; i < size; ++i) kernel.assignCoeff(i);
|
||||||
}
|
}
|
||||||
@ -571,7 +569,7 @@ struct dense_assignment_loop_impl<Kernel, LinearTraversal, NoUnrolling> {
|
|||||||
|
|
||||||
template <typename Kernel>
|
template <typename Kernel>
|
||||||
struct dense_assignment_loop_impl<Kernel, LinearTraversal, CompleteUnrolling> {
|
struct dense_assignment_loop_impl<Kernel, LinearTraversal, CompleteUnrolling> {
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) {
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) {
|
||||||
copy_using_evaluator_LinearTraversal_CompleteUnrolling<Kernel, 0, Kernel::AssignmentTraits::SizeAtCompileTime>::run(
|
copy_using_evaluator_LinearTraversal_CompleteUnrolling<Kernel, 0, Kernel::AssignmentTraits::SizeAtCompileTime>::run(
|
||||||
kernel);
|
kernel);
|
||||||
}
|
}
|
||||||
@ -598,7 +596,7 @@ struct dense_assignment_loop_impl<Kernel, SliceVectorizedTraversal, NoUnrolling>
|
|||||||
using head_loop = unaligned_dense_assignment_loop<PacketType, DstAlignment, Unaligned, UsePacketSegment, !Alignable>;
|
using head_loop = unaligned_dense_assignment_loop<PacketType, DstAlignment, Unaligned, UsePacketSegment, !Alignable>;
|
||||||
using tail_loop = unaligned_dense_assignment_loop<PacketType, Alignment, Unaligned, UsePacketSegment, false>;
|
using tail_loop = unaligned_dense_assignment_loop<PacketType, Alignment, Unaligned, UsePacketSegment, false>;
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) {
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) {
|
||||||
const Scalar* dst_ptr = kernel.dstDataPtr();
|
const Scalar* dst_ptr = kernel.dstDataPtr();
|
||||||
const Index innerSize = kernel.innerSize();
|
const Index innerSize = kernel.innerSize();
|
||||||
const Index outerSize = kernel.outerSize();
|
const Index outerSize = kernel.outerSize();
|
||||||
@ -634,7 +632,7 @@ struct dense_assignment_loop_impl<Kernel, SliceVectorizedTraversal, InnerUnrolli
|
|||||||
using packet_segment_loop = copy_using_evaluator_innervec_segment<Kernel, VectorizableSize, InnerSize, Unaligned,
|
using packet_segment_loop = copy_using_evaluator_innervec_segment<Kernel, VectorizableSize, InnerSize, Unaligned,
|
||||||
Unaligned, UsePacketSegment>;
|
Unaligned, UsePacketSegment>;
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) {
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) {
|
||||||
for (Index outer = 0; outer < kernel.outerSize(); ++outer) {
|
for (Index outer = 0; outer < kernel.outerSize(); ++outer) {
|
||||||
packet_loop::run(kernel, outer);
|
packet_loop::run(kernel, outer);
|
||||||
packet_segment_loop::run(kernel, outer);
|
packet_segment_loop::run(kernel, outer);
|
||||||
@ -676,12 +674,12 @@ class generic_dense_assignment_kernel {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT { return m_dstExpr.size(); }
|
EIGEN_DEVICE_FUNC constexpr Index size() const EIGEN_NOEXCEPT { return m_dstExpr.size(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerSize() const EIGEN_NOEXCEPT { return m_dstExpr.innerSize(); }
|
EIGEN_DEVICE_FUNC constexpr Index innerSize() const EIGEN_NOEXCEPT { return m_dstExpr.innerSize(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerSize() const EIGEN_NOEXCEPT { return m_dstExpr.outerSize(); }
|
EIGEN_DEVICE_FUNC constexpr Index outerSize() const EIGEN_NOEXCEPT { return m_dstExpr.outerSize(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_dstExpr.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_dstExpr.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_dstExpr.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_dstExpr.cols(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT { return m_dstExpr.outerStride(); }
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return m_dstExpr.outerStride(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC DstEvaluatorType& dstEvaluator() EIGEN_NOEXCEPT { return m_dst; }
|
EIGEN_DEVICE_FUNC DstEvaluatorType& dstEvaluator() EIGEN_NOEXCEPT { return m_dst; }
|
||||||
EIGEN_DEVICE_FUNC const SrcEvaluatorType& srcEvaluator() const EIGEN_NOEXCEPT { return m_src; }
|
EIGEN_DEVICE_FUNC const SrcEvaluatorType& srcEvaluator() const EIGEN_NOEXCEPT { return m_src; }
|
||||||
@ -811,9 +809,8 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void resize_if_allowed(DstXprTyp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename DstXprType, typename SrcXprType, typename Functor>
|
template <typename DstXprType, typename SrcXprType, typename Functor>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_dense_assignment_loop(DstXprType& dst,
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_dense_assignment_loop(DstXprType& dst, const SrcXprType& src,
|
||||||
const SrcXprType& src,
|
const Functor& func) {
|
||||||
const Functor& func) {
|
|
||||||
typedef evaluator<DstXprType> DstEvaluatorType;
|
typedef evaluator<DstXprType> DstEvaluatorType;
|
||||||
typedef evaluator<SrcXprType> SrcEvaluatorType;
|
typedef evaluator<SrcXprType> SrcEvaluatorType;
|
||||||
|
|
||||||
@ -882,7 +879,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(const Dst& dst, const
|
|||||||
|
|
||||||
// Deal with "assume-aliasing"
|
// Deal with "assume-aliasing"
|
||||||
template <typename Dst, typename Src, typename Func>
|
template <typename Dst, typename Src, typename Func>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment(
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment(
|
||||||
Dst& dst, const Src& src, const Func& func, std::enable_if_t<evaluator_assume_aliasing<Src>::value, void*> = 0) {
|
Dst& dst, const Src& src, const Func& func, std::enable_if_t<evaluator_assume_aliasing<Src>::value, void*> = 0) {
|
||||||
typename plain_matrix_type<Src>::type tmp(src);
|
typename plain_matrix_type<Src>::type tmp(src);
|
||||||
call_assignment_no_alias(dst, tmp, func);
|
call_assignment_no_alias(dst, tmp, func);
|
||||||
@ -897,14 +894,14 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment(
|
|||||||
// by-pass "assume-aliasing"
|
// by-pass "assume-aliasing"
|
||||||
// When there is no aliasing, we require that 'dst' has been properly resized
|
// When there is no aliasing, we require that 'dst' has been properly resized
|
||||||
template <typename Dst, template <typename> class StorageBase, typename Src, typename Func>
|
template <typename Dst, template <typename> class StorageBase, typename Src, typename Func>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment(NoAlias<Dst, StorageBase>& dst,
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment(NoAlias<Dst, StorageBase>& dst, const Src& src,
|
||||||
const Src& src, const Func& func) {
|
const Func& func) {
|
||||||
call_assignment_no_alias(dst.expression(), src, func);
|
call_assignment_no_alias(dst.expression(), src, func);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Dst, typename Src, typename Func>
|
template <typename Dst, typename Src, typename Func>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias(Dst& dst, const Src& src,
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias(Dst& dst, const Src& src,
|
||||||
const Func& func) {
|
const Func& func) {
|
||||||
enum {
|
enum {
|
||||||
NeedToTranspose = ((int(Dst::RowsAtCompileTime) == 1 && int(Src::ColsAtCompileTime) == 1) ||
|
NeedToTranspose = ((int(Dst::RowsAtCompileTime) == 1 && int(Src::ColsAtCompileTime) == 1) ||
|
||||||
(int(Dst::ColsAtCompileTime) == 1 && int(Src::RowsAtCompileTime) == 1)) &&
|
(int(Dst::ColsAtCompileTime) == 1 && int(Src::RowsAtCompileTime) == 1)) &&
|
||||||
@ -943,14 +940,13 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_restricted_packet_assignment_no_
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Dst, typename Src>
|
template <typename Dst, typename Src>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias(Dst& dst, const Src& src) {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias(Dst& dst, const Src& src) {
|
||||||
call_assignment_no_alias(dst, src, internal::assign_op<typename Dst::Scalar, typename Src::Scalar>());
|
call_assignment_no_alias(dst, src, internal::assign_op<typename Dst::Scalar, typename Src::Scalar>());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Dst, typename Src, typename Func>
|
template <typename Dst, typename Src, typename Func>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias_no_transpose(Dst& dst,
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias_no_transpose(Dst& dst, const Src& src,
|
||||||
const Src& src,
|
const Func& func) {
|
||||||
const Func& func) {
|
|
||||||
// TODO check whether this is the right place to perform these checks:
|
// TODO check whether this is the right place to perform these checks:
|
||||||
EIGEN_STATIC_ASSERT_LVALUE(Dst)
|
EIGEN_STATIC_ASSERT_LVALUE(Dst)
|
||||||
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Dst, Src)
|
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Dst, Src)
|
||||||
@ -959,8 +955,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_al
|
|||||||
Assignment<Dst, Src, Func>::run(dst, src, func);
|
Assignment<Dst, Src, Func>::run(dst, src, func);
|
||||||
}
|
}
|
||||||
template <typename Dst, typename Src>
|
template <typename Dst, typename Src>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias_no_transpose(Dst& dst,
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias_no_transpose(Dst& dst, const Src& src) {
|
||||||
const Src& src) {
|
|
||||||
call_assignment_no_alias_no_transpose(dst, src, internal::assign_op<typename Dst::Scalar, typename Src::Scalar>());
|
call_assignment_no_alias_no_transpose(dst, src, internal::assign_op<typename Dst::Scalar, typename Src::Scalar>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,16 +200,16 @@ class BandMatrix : public BandMatrixBase<BandMatrix<Scalar_, Rows, Cols, Supers,
|
|||||||
: m_coeffs(1 + supers + subs, cols), m_rows(rows), m_supers(supers), m_subs(subs) {}
|
: m_coeffs(1 + supers + subs, cols), m_rows(rows), m_supers(supers), m_subs(subs) {}
|
||||||
|
|
||||||
/** \returns the number of columns */
|
/** \returns the number of columns */
|
||||||
inline EIGEN_CONSTEXPR Index rows() const { return m_rows.value(); }
|
constexpr Index rows() const { return m_rows.value(); }
|
||||||
|
|
||||||
/** \returns the number of rows */
|
/** \returns the number of rows */
|
||||||
inline EIGEN_CONSTEXPR Index cols() const { return m_coeffs.cols(); }
|
constexpr Index cols() const { return m_coeffs.cols(); }
|
||||||
|
|
||||||
/** \returns the number of super diagonals */
|
/** \returns the number of super diagonals */
|
||||||
inline EIGEN_CONSTEXPR Index supers() const { return m_supers.value(); }
|
constexpr Index supers() const { return m_supers.value(); }
|
||||||
|
|
||||||
/** \returns the number of sub diagonals */
|
/** \returns the number of sub diagonals */
|
||||||
inline EIGEN_CONSTEXPR Index subs() const { return m_subs.value(); }
|
constexpr Index subs() const { return m_subs.value(); }
|
||||||
|
|
||||||
inline const CoefficientsType& coeffs() const { return m_coeffs; }
|
inline const CoefficientsType& coeffs() const { return m_coeffs; }
|
||||||
inline CoefficientsType& coeffs() { return m_coeffs; }
|
inline CoefficientsType& coeffs() { return m_coeffs; }
|
||||||
@ -260,16 +260,16 @@ class BandMatrixWrapper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** \returns the number of columns */
|
/** \returns the number of columns */
|
||||||
inline EIGEN_CONSTEXPR Index rows() const { return m_rows.value(); }
|
constexpr Index rows() const { return m_rows.value(); }
|
||||||
|
|
||||||
/** \returns the number of rows */
|
/** \returns the number of rows */
|
||||||
inline EIGEN_CONSTEXPR Index cols() const { return m_coeffs.cols(); }
|
constexpr Index cols() const { return m_coeffs.cols(); }
|
||||||
|
|
||||||
/** \returns the number of super diagonals */
|
/** \returns the number of super diagonals */
|
||||||
inline EIGEN_CONSTEXPR Index supers() const { return m_supers.value(); }
|
constexpr Index supers() const { return m_supers.value(); }
|
||||||
|
|
||||||
/** \returns the number of sub diagonals */
|
/** \returns the number of sub diagonals */
|
||||||
inline EIGEN_CONSTEXPR Index subs() const { return m_subs.value(); }
|
constexpr Index subs() const { return m_subs.value(); }
|
||||||
|
|
||||||
inline const CoefficientsType& coeffs() const { return m_coeffs; }
|
inline const CoefficientsType& coeffs() const { return m_coeffs; }
|
||||||
|
|
||||||
|
@ -289,11 +289,11 @@ class BlockImpl_dense : public internal::dense_xpr_base<Block<XprType, BlockRows
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE XprType& nestedExpression() { return m_xpr; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE XprType& nestedExpression() { return m_xpr; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR StorageIndex startRow() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr StorageIndex startRow() const EIGEN_NOEXCEPT {
|
||||||
return m_startRow.value();
|
return m_startRow.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR StorageIndex startCol() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr StorageIndex startCol() const EIGEN_NOEXCEPT {
|
||||||
return m_startCol.value();
|
return m_startCol.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,8 +319,7 @@ class BlockImpl_dense<XprType, BlockRows, BlockCols, InnerPanel, true>
|
|||||||
* Adding an offset to nullptr is undefined behavior, so we must avoid it.
|
* Adding an offset to nullptr is undefined behavior, so we must avoid it.
|
||||||
*/
|
*/
|
||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE static Scalar* add_to_nullable_pointer(Scalar* base,
|
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE static Scalar* add_to_nullable_pointer(Scalar* base, Index offset) {
|
||||||
Index offset) {
|
|
||||||
return base != nullptr ? base + offset : nullptr;
|
return base != nullptr ? base + offset : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,20 +385,20 @@ class BlockImpl_dense<XprType, BlockRows, BlockCols, InnerPanel, true>
|
|||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE XprType& nestedExpression() { return m_xpr; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE XprType& nestedExpression() { return m_xpr; }
|
||||||
|
|
||||||
/** \sa MapBase::innerStride() */
|
/** \sa MapBase::innerStride() */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index innerStride() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index innerStride() const EIGEN_NOEXCEPT {
|
||||||
return internal::traits<BlockType>::HasSameStorageOrderAsXprType ? m_xpr.innerStride() : m_xpr.outerStride();
|
return internal::traits<BlockType>::HasSameStorageOrderAsXprType ? m_xpr.innerStride() : m_xpr.outerStride();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \sa MapBase::outerStride() */
|
/** \sa MapBase::outerStride() */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index outerStride() const EIGEN_NOEXCEPT {
|
||||||
return internal::traits<BlockType>::HasSameStorageOrderAsXprType ? m_xpr.outerStride() : m_xpr.innerStride();
|
return internal::traits<BlockType>::HasSameStorageOrderAsXprType ? m_xpr.outerStride() : m_xpr.innerStride();
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR StorageIndex startRow() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr StorageIndex startRow() const EIGEN_NOEXCEPT {
|
||||||
return m_startRow.value();
|
return m_startRow.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR StorageIndex startCol() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr StorageIndex startCol() const EIGEN_NOEXCEPT {
|
||||||
return m_startCol.value();
|
return m_startCol.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ class plainobjectbase_evaluator_data {
|
|||||||
#endif
|
#endif
|
||||||
eigen_internal_assert(outerStride == OuterStride);
|
eigen_internal_assert(outerStride == OuterStride);
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT { return OuterStride; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index outerStride() const EIGEN_NOEXCEPT { return OuterStride; }
|
||||||
const Scalar* data;
|
const Scalar* data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1296,10 +1296,10 @@ struct mapbase_evaluator : evaluator_base<Derived> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rowStride() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rowStride() const EIGEN_NOEXCEPT {
|
||||||
return XprType::IsRowMajor ? m_outerStride.value() : m_innerStride.value();
|
return XprType::IsRowMajor ? m_outerStride.value() : m_innerStride.value();
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index colStride() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index colStride() const EIGEN_NOEXCEPT {
|
||||||
return XprType::IsRowMajor ? m_innerStride.value() : m_outerStride.value();
|
return XprType::IsRowMajor ? m_innerStride.value() : m_outerStride.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1985,10 +1985,10 @@ struct evaluator<Diagonal<ArgType, DiagIndex>> : evaluator_base<Diagonal<ArgType
|
|||||||
const variable_if_dynamicindex<Index, XprType::DiagIndex> m_index;
|
const variable_if_dynamicindex<Index, XprType::DiagIndex> m_index;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rowOffset() const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rowOffset() const {
|
||||||
return m_index.value() > 0 ? 0 : -m_index.value();
|
return m_index.value() > 0 ? 0 : -m_index.value();
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index colOffset() const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index colOffset() const {
|
||||||
return m_index.value() > 0 ? m_index.value() : 0;
|
return m_index.value() > 0 ? m_index.value() : 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -2017,9 +2017,9 @@ class EvalToTemp : public dense_xpr_base<EvalToTemp<ArgType>>::type {
|
|||||||
|
|
||||||
const ArgType& arg() const { return m_arg; }
|
const ArgType& arg() const { return m_arg; }
|
||||||
|
|
||||||
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_arg.rows(); }
|
constexpr Index rows() const EIGEN_NOEXCEPT { return m_arg.rows(); }
|
||||||
|
|
||||||
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_arg.cols(); }
|
constexpr Index cols() const EIGEN_NOEXCEPT { return m_arg.cols(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const ArgType& m_arg;
|
const ArgType& m_arg;
|
||||||
|
@ -108,12 +108,12 @@ class CwiseBinaryOp : public CwiseBinaryOpImpl<BinaryOp, LhsType, RhsType,
|
|||||||
eigen_assert(aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols());
|
eigen_assert(aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols());
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const EIGEN_NOEXCEPT {
|
||||||
// return the fixed size type if available to enable compile time optimizations
|
// return the fixed size type if available to enable compile time optimizations
|
||||||
return internal::traits<internal::remove_all_t<LhsNested>>::RowsAtCompileTime == Dynamic ? m_rhs.rows()
|
return internal::traits<internal::remove_all_t<LhsNested>>::RowsAtCompileTime == Dynamic ? m_rhs.rows()
|
||||||
: m_lhs.rows();
|
: m_lhs.rows();
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const EIGEN_NOEXCEPT {
|
||||||
// return the fixed size type if available to enable compile time optimizations
|
// return the fixed size type if available to enable compile time optimizations
|
||||||
return internal::traits<internal::remove_all_t<LhsNested>>::ColsAtCompileTime == Dynamic ? m_rhs.cols()
|
return internal::traits<internal::remove_all_t<LhsNested>>::ColsAtCompileTime == Dynamic ? m_rhs.cols()
|
||||||
: m_lhs.cols();
|
: m_lhs.cols();
|
||||||
|
@ -76,8 +76,8 @@ class CwiseNullaryOp : public internal::dense_xpr_base<CwiseNullaryOp<NullaryOp,
|
|||||||
EIGEN_STATIC_ASSERT(CwiseNullaryOp::IsVectorAtCompileTime, YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
|
EIGEN_STATIC_ASSERT(CwiseNullaryOp::IsVectorAtCompileTime, YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const { return m_rows.value(); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return m_rows.value(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const { return m_cols.value(); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return m_cols.value(); }
|
||||||
|
|
||||||
/** \returns the functor representing the nullary operation */
|
/** \returns the functor representing the nullary operation */
|
||||||
EIGEN_DEVICE_FUNC const NullaryOp& functor() const { return m_functor; }
|
EIGEN_DEVICE_FUNC const NullaryOp& functor() const { return m_functor; }
|
||||||
|
@ -60,8 +60,8 @@ class CwiseUnaryOp : public CwiseUnaryOpImpl<UnaryOp, XprType, typename internal
|
|||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit CwiseUnaryOp(const XprType& xpr, const UnaryOp& func = UnaryOp())
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit CwiseUnaryOp(const XprType& xpr, const UnaryOp& func = UnaryOp())
|
||||||
: m_xpr(xpr), m_functor(func) {}
|
: m_xpr(xpr), m_functor(func) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_xpr.rows(); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const EIGEN_NOEXCEPT { return m_xpr.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_xpr.cols(); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const EIGEN_NOEXCEPT { return m_xpr.cols(); }
|
||||||
|
|
||||||
/** \returns the functor representing the unary operation */
|
/** \returns the functor representing the unary operation */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const UnaryOp& functor() const { return m_functor; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const UnaryOp& functor() const { return m_functor; }
|
||||||
|
@ -66,13 +66,13 @@ class CwiseUnaryViewImpl<ViewOp, MatrixType, StrideType, Dense, false>
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC inline const Scalar* data() const { return &(this->coeffRef(0)); }
|
EIGEN_DEVICE_FUNC inline const Scalar* data() const { return &(this->coeffRef(0)); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const {
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const {
|
||||||
return StrideType::InnerStrideAtCompileTime != 0 ? int(StrideType::InnerStrideAtCompileTime)
|
return StrideType::InnerStrideAtCompileTime != 0 ? int(StrideType::InnerStrideAtCompileTime)
|
||||||
: derived().nestedExpression().innerStride() *
|
: derived().nestedExpression().innerStride() *
|
||||||
sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar);
|
sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar);
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const {
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const {
|
||||||
return StrideType::OuterStrideAtCompileTime != 0 ? int(StrideType::OuterStrideAtCompileTime)
|
return StrideType::OuterStrideAtCompileTime != 0 ? int(StrideType::OuterStrideAtCompileTime)
|
||||||
: derived().nestedExpression().outerStride() *
|
: derived().nestedExpression().outerStride() *
|
||||||
sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar);
|
sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar);
|
||||||
@ -145,8 +145,8 @@ class CwiseUnaryView : public internal::CwiseUnaryViewImpl<ViewOp, MatrixType, S
|
|||||||
|
|
||||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(CwiseUnaryView)
|
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(CwiseUnaryView)
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
||||||
|
|
||||||
/** \returns the functor representing unary operation */
|
/** \returns the functor representing unary operation */
|
||||||
EIGEN_DEVICE_FUNC const ViewOp& functor() const { return m_functor; }
|
EIGEN_DEVICE_FUNC const ViewOp& functor() const { return m_functor; }
|
||||||
|
@ -208,7 +208,7 @@ class DenseBase
|
|||||||
* \note For a vector, this returns just 1. For a matrix (non-vector), this is the major dimension
|
* \note For a vector, this returns just 1. For a matrix (non-vector), this is the major dimension
|
||||||
* with respect to the \ref TopicStorageOrders "storage order", i.e., the number of columns for a
|
* with respect to the \ref TopicStorageOrders "storage order", i.e., the number of columns for a
|
||||||
* column-major matrix, and the number of rows for a row-major matrix. */
|
* column-major matrix, and the number of rows for a row-major matrix. */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerSize() const {
|
EIGEN_DEVICE_FUNC constexpr Index outerSize() const {
|
||||||
return IsVectorAtCompileTime ? 1 : int(IsRowMajor) ? this->rows() : this->cols();
|
return IsVectorAtCompileTime ? 1 : int(IsRowMajor) ? this->rows() : this->cols();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ class DenseBase
|
|||||||
* \note For a vector, this is just the size. For a matrix (non-vector), this is the minor dimension
|
* \note For a vector, this is just the size. For a matrix (non-vector), this is the minor dimension
|
||||||
* with respect to the \ref TopicStorageOrders "storage order", i.e., the number of rows for a
|
* with respect to the \ref TopicStorageOrders "storage order", i.e., the number of rows for a
|
||||||
* column-major matrix, and the number of columns for a row-major matrix. */
|
* column-major matrix, and the number of columns for a row-major matrix. */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerSize() const {
|
EIGEN_DEVICE_FUNC constexpr Index innerSize() const {
|
||||||
return IsVectorAtCompileTime ? this->size() : int(IsRowMajor) ? this->cols() : this->rows();
|
return IsVectorAtCompileTime ? this->size() : int(IsRowMajor) ? this->cols() : this->rows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,13 +89,12 @@ class DenseCoeffsBase<Derived, ReadOnlyAccessors> : public EigenBase<Derived> {
|
|||||||
*
|
*
|
||||||
* \sa operator()(Index,Index) const, coeffRef(Index,Index), coeff(Index) const
|
* \sa operator()(Index,Index) const, coeffRef(Index,Index), coeff(Index) const
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType coeff(Index row, Index col) const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType coeff(Index row, Index col) const {
|
||||||
eigen_internal_assert(row >= 0 && row < rows() && col >= 0 && col < cols());
|
eigen_internal_assert(row >= 0 && row < rows() && col >= 0 && col < cols());
|
||||||
return internal::evaluator<Derived>(derived()).coeff(row, col);
|
return internal::evaluator<Derived>(derived()).coeff(row, col);
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType coeffByOuterInner(Index outer,
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType coeffByOuterInner(Index outer, Index inner) const {
|
||||||
Index inner) const {
|
|
||||||
return coeff(rowIndexByOuterInner(outer, inner), colIndexByOuterInner(outer, inner));
|
return coeff(rowIndexByOuterInner(outer, inner), colIndexByOuterInner(outer, inner));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +102,7 @@ class DenseCoeffsBase<Derived, ReadOnlyAccessors> : public EigenBase<Derived> {
|
|||||||
*
|
*
|
||||||
* \sa operator()(Index,Index), operator[](Index)
|
* \sa operator()(Index,Index), operator[](Index)
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType operator()(Index row, Index col) const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType operator()(Index row, Index col) const {
|
||||||
eigen_assert(row >= 0 && row < rows() && col >= 0 && col < cols());
|
eigen_assert(row >= 0 && row < rows() && col >= 0 && col < cols());
|
||||||
return coeff(row, col);
|
return coeff(row, col);
|
||||||
}
|
}
|
||||||
@ -123,7 +122,7 @@ class DenseCoeffsBase<Derived, ReadOnlyAccessors> : public EigenBase<Derived> {
|
|||||||
* \sa operator[](Index) const, coeffRef(Index), coeff(Index,Index) const
|
* \sa operator[](Index) const, coeffRef(Index), coeff(Index,Index) const
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType coeff(Index index) const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType coeff(Index index) const {
|
||||||
EIGEN_STATIC_ASSERT(internal::evaluator<Derived>::Flags & LinearAccessBit,
|
EIGEN_STATIC_ASSERT(internal::evaluator<Derived>::Flags & LinearAccessBit,
|
||||||
THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS)
|
THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS)
|
||||||
eigen_internal_assert(index >= 0 && index < size());
|
eigen_internal_assert(index >= 0 && index < size());
|
||||||
@ -138,7 +137,7 @@ class DenseCoeffsBase<Derived, ReadOnlyAccessors> : public EigenBase<Derived> {
|
|||||||
* z() const, w() const
|
* z() const, w() const
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType operator[](Index index) const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType operator[](Index index) const {
|
||||||
EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime,
|
EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime,
|
||||||
THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD)
|
THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD)
|
||||||
eigen_assert(index >= 0 && index < size());
|
eigen_assert(index >= 0 && index < size());
|
||||||
@ -155,32 +154,32 @@ class DenseCoeffsBase<Derived, ReadOnlyAccessors> : public EigenBase<Derived> {
|
|||||||
* z() const, w() const
|
* z() const, w() const
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType operator()(Index index) const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType operator()(Index index) const {
|
||||||
eigen_assert(index >= 0 && index < size());
|
eigen_assert(index >= 0 && index < size());
|
||||||
return coeff(index);
|
return coeff(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** equivalent to operator[](0). */
|
/** equivalent to operator[](0). */
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType x() const { return (*this)[0]; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType x() const { return (*this)[0]; }
|
||||||
|
|
||||||
/** equivalent to operator[](1). */
|
/** equivalent to operator[](1). */
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType y() const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType y() const {
|
||||||
EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 2, OUT_OF_RANGE_ACCESS);
|
EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 2, OUT_OF_RANGE_ACCESS);
|
||||||
return (*this)[1];
|
return (*this)[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** equivalent to operator[](2). */
|
/** equivalent to operator[](2). */
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType z() const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType z() const {
|
||||||
EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 3, OUT_OF_RANGE_ACCESS);
|
EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 3, OUT_OF_RANGE_ACCESS);
|
||||||
return (*this)[2];
|
return (*this)[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** equivalent to operator[](3). */
|
/** equivalent to operator[](3). */
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType w() const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType w() const {
|
||||||
EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 4, OUT_OF_RANGE_ACCESS);
|
EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 4, OUT_OF_RANGE_ACCESS);
|
||||||
return (*this)[3];
|
return (*this)[3];
|
||||||
}
|
}
|
||||||
@ -362,32 +361,32 @@ class DenseCoeffsBase<Derived, WriteAccessors> : public DenseCoeffsBase<Derived,
|
|||||||
* \sa operator[](Index) const, operator()(Index,Index), x(), y(), z(), w()
|
* \sa operator[](Index) const, operator()(Index,Index), x(), y(), z(), w()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& operator()(Index index) {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& operator()(Index index) {
|
||||||
eigen_assert(index >= 0 && index < size());
|
eigen_assert(index >= 0 && index < size());
|
||||||
return coeffRef(index);
|
return coeffRef(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** equivalent to operator[](0). */
|
/** equivalent to operator[](0). */
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& x() { return (*this)[0]; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& x() { return (*this)[0]; }
|
||||||
|
|
||||||
/** equivalent to operator[](1). */
|
/** equivalent to operator[](1). */
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& y() {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& y() {
|
||||||
EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 2, OUT_OF_RANGE_ACCESS);
|
EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 2, OUT_OF_RANGE_ACCESS);
|
||||||
return (*this)[1];
|
return (*this)[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** equivalent to operator[](2). */
|
/** equivalent to operator[](2). */
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& z() {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& z() {
|
||||||
EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 3, OUT_OF_RANGE_ACCESS);
|
EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 3, OUT_OF_RANGE_ACCESS);
|
||||||
return (*this)[2];
|
return (*this)[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** equivalent to operator[](3). */
|
/** equivalent to operator[](3). */
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& w() {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& w() {
|
||||||
EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 4, OUT_OF_RANGE_ACCESS);
|
EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 4, OUT_OF_RANGE_ACCESS);
|
||||||
return (*this)[3];
|
return (*this)[3];
|
||||||
}
|
}
|
||||||
@ -421,33 +420,29 @@ class DenseCoeffsBase<Derived, DirectAccessors> : public DenseCoeffsBase<Derived
|
|||||||
*
|
*
|
||||||
* \sa outerStride(), rowStride(), colStride()
|
* \sa outerStride(), rowStride(), colStride()
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const { return derived().innerStride(); }
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const { return derived().innerStride(); }
|
||||||
|
|
||||||
/** \returns the pointer increment between two consecutive inner slices (for example, between two consecutive columns
|
/** \returns the pointer increment between two consecutive inner slices (for example, between two consecutive columns
|
||||||
* in a column-major matrix).
|
* in a column-major matrix).
|
||||||
*
|
*
|
||||||
* \sa innerStride(), rowStride(), colStride()
|
* \sa innerStride(), rowStride(), colStride()
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const { return derived().outerStride(); }
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const { return derived().outerStride(); }
|
||||||
|
|
||||||
// FIXME shall we remove it ?
|
// FIXME shall we remove it ?
|
||||||
EIGEN_CONSTEXPR inline Index stride() const { return Derived::IsVectorAtCompileTime ? innerStride() : outerStride(); }
|
constexpr Index stride() const { return Derived::IsVectorAtCompileTime ? innerStride() : outerStride(); }
|
||||||
|
|
||||||
/** \returns the pointer increment between two consecutive rows.
|
/** \returns the pointer increment between two consecutive rows.
|
||||||
*
|
*
|
||||||
* \sa innerStride(), outerStride(), colStride()
|
* \sa innerStride(), outerStride(), colStride()
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rowStride() const {
|
EIGEN_DEVICE_FUNC constexpr Index rowStride() const { return Derived::IsRowMajor ? outerStride() : innerStride(); }
|
||||||
return Derived::IsRowMajor ? outerStride() : innerStride();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \returns the pointer increment between two consecutive columns.
|
/** \returns the pointer increment between two consecutive columns.
|
||||||
*
|
*
|
||||||
* \sa innerStride(), outerStride(), rowStride()
|
* \sa innerStride(), outerStride(), rowStride()
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index colStride() const {
|
EIGEN_DEVICE_FUNC constexpr Index colStride() const { return Derived::IsRowMajor ? innerStride() : outerStride(); }
|
||||||
return Derived::IsRowMajor ? innerStride() : outerStride();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** \brief Base class providing direct read/write coefficient access to matrices and arrays.
|
/** \brief Base class providing direct read/write coefficient access to matrices and arrays.
|
||||||
@ -478,17 +473,17 @@ class DenseCoeffsBase<Derived, DirectWriteAccessors> : public DenseCoeffsBase<De
|
|||||||
*
|
*
|
||||||
* \sa outerStride(), rowStride(), colStride()
|
* \sa outerStride(), rowStride(), colStride()
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT { return derived().innerStride(); }
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return derived().innerStride(); }
|
||||||
|
|
||||||
/** \returns the pointer increment between two consecutive inner slices (for example, between two consecutive columns
|
/** \returns the pointer increment between two consecutive inner slices (for example, between two consecutive columns
|
||||||
* in a column-major matrix).
|
* in a column-major matrix).
|
||||||
*
|
*
|
||||||
* \sa innerStride(), rowStride(), colStride()
|
* \sa innerStride(), rowStride(), colStride()
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { return derived().outerStride(); }
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return derived().outerStride(); }
|
||||||
|
|
||||||
// FIXME shall we remove it ?
|
// FIXME shall we remove it ?
|
||||||
EIGEN_CONSTEXPR inline Index stride() const EIGEN_NOEXCEPT {
|
constexpr Index stride() const EIGEN_NOEXCEPT {
|
||||||
return Derived::IsVectorAtCompileTime ? innerStride() : outerStride();
|
return Derived::IsVectorAtCompileTime ? innerStride() : outerStride();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -496,7 +491,7 @@ class DenseCoeffsBase<Derived, DirectWriteAccessors> : public DenseCoeffsBase<De
|
|||||||
*
|
*
|
||||||
* \sa innerStride(), outerStride(), colStride()
|
* \sa innerStride(), outerStride(), colStride()
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rowStride() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index rowStride() const EIGEN_NOEXCEPT {
|
||||||
return Derived::IsRowMajor ? outerStride() : innerStride();
|
return Derived::IsRowMajor ? outerStride() : innerStride();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,7 +499,7 @@ class DenseCoeffsBase<Derived, DirectWriteAccessors> : public DenseCoeffsBase<De
|
|||||||
*
|
*
|
||||||
* \sa innerStride(), outerStride(), rowStride()
|
* \sa innerStride(), outerStride(), rowStride()
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index colStride() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index colStride() const EIGEN_NOEXCEPT {
|
||||||
return Derived::IsRowMajor ? innerStride() : outerStride();
|
return Derived::IsRowMajor ? innerStride() : outerStride();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -513,7 +508,7 @@ namespace internal {
|
|||||||
|
|
||||||
template <int Alignment, typename Derived, bool JustReturnZero>
|
template <int Alignment, typename Derived, bool JustReturnZero>
|
||||||
struct first_aligned_impl {
|
struct first_aligned_impl {
|
||||||
static EIGEN_CONSTEXPR inline Index run(const Derived&) EIGEN_NOEXCEPT { return 0; }
|
static constexpr Index run(const Derived&) EIGEN_NOEXCEPT { return 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <int Alignment, typename Derived>
|
template <int Alignment, typename Derived>
|
||||||
|
@ -87,13 +87,13 @@ template <typename Kernel, typename Device, int Traversal = Kernel::AssignmentTr
|
|||||||
int Unrolling = Kernel::AssignmentTraits::Unrolling>
|
int Unrolling = Kernel::AssignmentTraits::Unrolling>
|
||||||
struct dense_assignment_loop_with_device {
|
struct dense_assignment_loop_with_device {
|
||||||
using Base = dense_assignment_loop<Kernel, Traversal, Unrolling>;
|
using Base = dense_assignment_loop<Kernel, Traversal, Unrolling>;
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel, Device&) { Base::run(kernel); }
|
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel, Device&) { Base::run(kernel); }
|
||||||
};
|
};
|
||||||
|
|
||||||
// entry point for a generic expression with device
|
// entry point for a generic expression with device
|
||||||
template <typename Dst, typename Src, typename Func, typename Device>
|
template <typename Dst, typename Src, typename Func, typename Device>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias(DeviceWrapper<Dst, Device> dst,
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias(DeviceWrapper<Dst, Device> dst,
|
||||||
const Src& src, const Func& func) {
|
const Src& src, const Func& func) {
|
||||||
enum {
|
enum {
|
||||||
NeedToTranspose = ((int(Dst::RowsAtCompileTime) == 1 && int(Src::ColsAtCompileTime) == 1) ||
|
NeedToTranspose = ((int(Dst::RowsAtCompileTime) == 1 && int(Src::ColsAtCompileTime) == 1) ||
|
||||||
(int(Dst::ColsAtCompileTime) == 1 && int(Src::RowsAtCompileTime) == 1)) &&
|
(int(Dst::ColsAtCompileTime) == 1 && int(Src::RowsAtCompileTime) == 1)) &&
|
||||||
@ -115,10 +115,8 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_al
|
|||||||
|
|
||||||
// copy and pasted from AssignEvaluator except forward device to kernel
|
// copy and pasted from AssignEvaluator except forward device to kernel
|
||||||
template <typename DstXprType, typename SrcXprType, typename Functor, typename Device>
|
template <typename DstXprType, typename SrcXprType, typename Functor, typename Device>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_dense_assignment_loop(DstXprType& dst,
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_dense_assignment_loop(DstXprType& dst, const SrcXprType& src,
|
||||||
const SrcXprType& src,
|
const Functor& func, Device& device) {
|
||||||
const Functor& func,
|
|
||||||
Device& device) {
|
|
||||||
using DstEvaluatorType = evaluator<DstXprType>;
|
using DstEvaluatorType = evaluator<DstXprType>;
|
||||||
using SrcEvaluatorType = evaluator<SrcXprType>;
|
using SrcEvaluatorType = evaluator<SrcXprType>;
|
||||||
|
|
||||||
|
@ -83,13 +83,11 @@ class Diagonal : public internal::dense_xpr_base<Diagonal<MatrixType, DiagIndex_
|
|||||||
: numext::mini<Index>(m_matrix.rows(), m_matrix.cols() - m_index.value());
|
: numext::mini<Index>(m_matrix.rows(), m_matrix.cols() - m_index.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return 1; }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return 1; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return m_matrix.outerStride() + 1; }
|
||||||
return m_matrix.outerStride() + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { return 0; }
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return 0; }
|
||||||
|
|
||||||
typedef std::conditional_t<internal::is_lvalue<MatrixType>::value, Scalar, const Scalar> ScalarWithConstIfNotLvalue;
|
typedef std::conditional_t<internal::is_lvalue<MatrixType>::value, Scalar, const Scalar> ScalarWithConstIfNotLvalue;
|
||||||
|
|
||||||
@ -134,13 +132,13 @@ class Diagonal : public internal::dense_xpr_base<Diagonal<MatrixType, DiagIndex_
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// some compilers may fail to optimize std::max etc in case of compile-time constants...
|
// some compilers may fail to optimize std::max etc in case of compile-time constants...
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index absDiagIndex() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index absDiagIndex() const EIGEN_NOEXCEPT {
|
||||||
return m_index.value() > 0 ? m_index.value() : -m_index.value();
|
return m_index.value() > 0 ? m_index.value() : -m_index.value();
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rowOffset() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rowOffset() const EIGEN_NOEXCEPT {
|
||||||
return m_index.value() > 0 ? 0 : -m_index.value();
|
return m_index.value() > 0 ? 0 : -m_index.value();
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index colOffset() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index colOffset() const EIGEN_NOEXCEPT {
|
||||||
return m_index.value() > 0 ? m_index.value() : 0;
|
return m_index.value() > 0 ? m_index.value() : 0;
|
||||||
}
|
}
|
||||||
// trigger a compile-time error if someone try to call packet
|
// trigger a compile-time error if someone try to call packet
|
||||||
|
@ -76,9 +76,9 @@ class DiagonalBase : public EigenBase<Derived> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** \returns the number of rows. */
|
/** \returns the number of rows. */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const { return diagonal().size(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const { return diagonal().size(); }
|
||||||
/** \returns the number of columns. */
|
/** \returns the number of columns. */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const { return diagonal().size(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const { return diagonal().size(); }
|
||||||
|
|
||||||
/** \returns the diagonal matrix product of \c *this by the dense matrix, \a matrix */
|
/** \returns the diagonal matrix product of \c *this by the dense matrix, \a matrix */
|
||||||
template <typename MatrixDerived>
|
template <typename MatrixDerived>
|
||||||
|
@ -56,12 +56,12 @@ struct EigenBase {
|
|||||||
EIGEN_DEVICE_FUNC inline const Derived& const_derived() const { return *static_cast<const Derived*>(this); }
|
EIGEN_DEVICE_FUNC inline const Derived& const_derived() const { return *static_cast<const Derived*>(this); }
|
||||||
|
|
||||||
/** \returns the number of rows. \sa cols(), RowsAtCompileTime */
|
/** \returns the number of rows. \sa cols(), RowsAtCompileTime */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return derived().rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return derived().rows(); }
|
||||||
/** \returns the number of columns. \sa rows(), ColsAtCompileTime*/
|
/** \returns the number of columns. \sa rows(), ColsAtCompileTime*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return derived().cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return derived().cols(); }
|
||||||
/** \returns the number of coefficients, which is rows()*cols().
|
/** \returns the number of coefficients, which is rows()*cols().
|
||||||
* \sa rows(), cols(), SizeAtCompileTime. */
|
* \sa rows(), cols(), SizeAtCompileTime. */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index size() const EIGEN_NOEXCEPT { return rows() * cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index size() const EIGEN_NOEXCEPT { return rows() * cols(); }
|
||||||
|
|
||||||
/** \internal Don't use it, but do the equivalent: \code dst = *this; \endcode */
|
/** \internal Don't use it, but do the equivalent: \code dst = *this; \endcode */
|
||||||
template <typename Dest>
|
template <typename Dest>
|
||||||
|
@ -41,14 +41,10 @@ class ForceAlignedAccess : public internal::dense_xpr_base<ForceAlignedAccess<Ex
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC explicit inline ForceAlignedAccess(const ExpressionType& matrix) : m_expression(matrix) {}
|
EIGEN_DEVICE_FUNC explicit inline ForceAlignedAccess(const ExpressionType& matrix) : m_expression(matrix) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return m_expression.outerStride(); }
|
||||||
return m_expression.outerStride();
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return m_expression.innerStride(); }
|
||||||
}
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT {
|
|
||||||
return m_expression.innerStride();
|
|
||||||
}
|
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index row, Index col) const {
|
EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index row, Index col) const {
|
||||||
return m_expression.coeff(row, col);
|
return m_expression.coeff(row, col);
|
||||||
|
@ -455,48 +455,42 @@ EIGEN_DEVICE_FUNC inline Packet pcmp_lt_or_nan(const Packet& a, const Packet& b)
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct bit_and {
|
struct bit_and {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a & b; }
|
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a & b; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct bit_or {
|
struct bit_or {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a | b; }
|
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a | b; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct bit_xor {
|
struct bit_xor {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a ^ b; }
|
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a ^ b; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct bit_not {
|
struct bit_not {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a) const { return ~a; }
|
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE T operator()(const T& a) const { return ~a; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct bit_and<bool> {
|
struct bit_and<bool> {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const {
|
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const { return a && b; }
|
||||||
return a && b;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct bit_or<bool> {
|
struct bit_or<bool> {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const {
|
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const { return a || b; }
|
||||||
return a || b;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct bit_xor<bool> {
|
struct bit_xor<bool> {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const {
|
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const { return a != b; }
|
||||||
return a != b;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct bit_not<bool> {
|
struct bit_not<bool> {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool& a) const { return !a; }
|
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE bool operator()(const bool& a) const { return !a; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Use operators &, |, ^, ~.
|
// Use operators &, |, ^, ~.
|
||||||
|
@ -225,14 +225,14 @@ class IndexedViewImpl<XprType, RowIndices, ColIndices, StorageKind, true>
|
|||||||
return this->nestedExpression().data() + row_offset + col_offset;
|
return this->nestedExpression().data() + row_offset + col_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT {
|
||||||
if (traits<Derived>::InnerStrideAtCompileTime != Dynamic) {
|
if (traits<Derived>::InnerStrideAtCompileTime != Dynamic) {
|
||||||
return traits<Derived>::InnerStrideAtCompileTime;
|
return traits<Derived>::InnerStrideAtCompileTime;
|
||||||
}
|
}
|
||||||
return innerIncrement() * this->nestedExpression().innerStride();
|
return innerIncrement() * this->nestedExpression().innerStride();
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT {
|
||||||
if (traits<Derived>::OuterStrideAtCompileTime != Dynamic) {
|
if (traits<Derived>::OuterStrideAtCompileTime != Dynamic) {
|
||||||
return traits<Derived>::OuterStrideAtCompileTime;
|
return traits<Derived>::OuterStrideAtCompileTime;
|
||||||
}
|
}
|
||||||
|
@ -51,8 +51,8 @@ class Inverse : public InverseImpl<XprType, typename internal::traits<XprType>::
|
|||||||
|
|
||||||
explicit EIGEN_DEVICE_FUNC Inverse(const XprType& xpr) : m_xpr(xpr) {}
|
explicit EIGEN_DEVICE_FUNC Inverse(const XprType& xpr) : m_xpr(xpr) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_xpr.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_xpr.cols(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_xpr.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_xpr.rows(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC const XprTypeNestedCleaned& nestedExpression() const { return m_xpr; }
|
EIGEN_DEVICE_FUNC const XprTypeNestedCleaned& nestedExpression() const { return m_xpr; }
|
||||||
|
|
||||||
|
@ -102,11 +102,11 @@ class Map : public MapBase<Map<PlainObjectType, MapOptions, StrideType> > {
|
|||||||
typedef PointerType PointerArgType;
|
typedef PointerType PointerArgType;
|
||||||
EIGEN_DEVICE_FUNC inline PointerType cast_to_pointer_type(PointerArgType ptr) { return ptr; }
|
EIGEN_DEVICE_FUNC inline PointerType cast_to_pointer_type(PointerArgType ptr) { return ptr; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const {
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const {
|
||||||
return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;
|
return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const {
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const {
|
||||||
return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer()
|
return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer()
|
||||||
: internal::traits<Map>::OuterStrideAtCompileTime != Dynamic
|
: internal::traits<Map>::OuterStrideAtCompileTime != Dynamic
|
||||||
? Index(internal::traits<Map>::OuterStrideAtCompileTime)
|
? Index(internal::traits<Map>::OuterStrideAtCompileTime)
|
||||||
|
@ -84,9 +84,9 @@ class MapBase<Derived, ReadOnlyAccessors> : public internal::dense_xpr_base<Deri
|
|||||||
typedef typename Base::CoeffReturnType CoeffReturnType;
|
typedef typename Base::CoeffReturnType CoeffReturnType;
|
||||||
|
|
||||||
/** \copydoc DenseBase::rows() */
|
/** \copydoc DenseBase::rows() */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_rows.value(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_rows.value(); }
|
||||||
/** \copydoc DenseBase::cols() */
|
/** \copydoc DenseBase::cols() */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_cols.value(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_cols.value(); }
|
||||||
|
|
||||||
/** Returns a pointer to the first coefficient of the matrix or vector.
|
/** Returns a pointer to the first coefficient of the matrix or vector.
|
||||||
*
|
*
|
||||||
|
@ -170,8 +170,8 @@ struct imag_ref_default_impl {
|
|||||||
|
|
||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
struct imag_ref_default_impl<Scalar, false> {
|
struct imag_ref_default_impl<Scalar, false> {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline Scalar run(Scalar&) { return Scalar(0); }
|
EIGEN_DEVICE_FUNC constexpr static Scalar run(Scalar&) { return Scalar(0); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline const Scalar run(const Scalar&) { return Scalar(0); }
|
EIGEN_DEVICE_FUNC constexpr static const Scalar run(const Scalar&) { return Scalar(0); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
@ -1297,7 +1297,7 @@ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE double trunc(const double& x) {
|
|||||||
// Integer division with rounding up.
|
// Integer division with rounding up.
|
||||||
// T is assumed to be an integer type with a>=0, and b>0
|
// T is assumed to be an integer type with a>=0, and b>0
|
||||||
template <typename T>
|
template <typename T>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR T div_ceil(T a, T b) {
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE constexpr T div_ceil(T a, T b) {
|
||||||
using UnsignedT = typename internal::make_unsigned<T>::type;
|
using UnsignedT = typename internal::make_unsigned<T>::type;
|
||||||
EIGEN_STATIC_ASSERT((NumTraits<T>::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES)
|
EIGEN_STATIC_ASSERT((NumTraits<T>::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES)
|
||||||
// Note: explicitly declaring a and b as non-negative values allows the compiler to use better optimizations
|
// Note: explicitly declaring a and b as non-negative values allows the compiler to use better optimizations
|
||||||
@ -1310,7 +1310,7 @@ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR T div_ceil(T a, T b) {
|
|||||||
// Integer round down to nearest power of b
|
// Integer round down to nearest power of b
|
||||||
// T is assumed to be an integer type with a>=0, and b>0
|
// T is assumed to be an integer type with a>=0, and b>0
|
||||||
template <typename T, typename U>
|
template <typename T, typename U>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR T round_down(T a, U b) {
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE constexpr T round_down(T a, U b) {
|
||||||
using UnsignedT = typename internal::make_unsigned<T>::type;
|
using UnsignedT = typename internal::make_unsigned<T>::type;
|
||||||
using UnsignedU = typename internal::make_unsigned<U>::type;
|
using UnsignedU = typename internal::make_unsigned<U>::type;
|
||||||
EIGEN_STATIC_ASSERT((NumTraits<T>::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES)
|
EIGEN_STATIC_ASSERT((NumTraits<T>::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES)
|
||||||
@ -1323,7 +1323,7 @@ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR T round_down(T a, U b) {
|
|||||||
|
|
||||||
/** Log base 2 for 32 bits positive integers.
|
/** Log base 2 for 32 bits positive integers.
|
||||||
* Conveniently returns 0 for x==0. */
|
* Conveniently returns 0 for x==0. */
|
||||||
EIGEN_CONSTEXPR inline int log2(int x) {
|
constexpr int log2(int x) {
|
||||||
unsigned int v(x);
|
unsigned int v(x);
|
||||||
constexpr int table[32] = {0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30,
|
constexpr int table[32] = {0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30,
|
||||||
8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31};
|
8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31};
|
||||||
|
@ -393,8 +393,8 @@ class Matrix : public PlainObjectBase<Matrix<Scalar_, Rows_, Cols_, Options_, Ma
|
|||||||
template <typename OtherDerived>
|
template <typename OtherDerived>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(const EigenBase<OtherDerived>& other) : Base(other.derived()) {}
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(const EigenBase<OtherDerived>& other) : Base(other.derived()) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT { return 1; }
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return 1; }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { return this->innerSize(); }
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return this->innerSize(); }
|
||||||
|
|
||||||
/////////// Geometry module ///////////
|
/////////// Geometry module ///////////
|
||||||
|
|
||||||
|
@ -45,8 +45,8 @@ class NestByValue : public internal::dense_xpr_base<NestByValue<ExpressionType>
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC explicit inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {}
|
EIGEN_DEVICE_FUNC explicit inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC operator const ExpressionType&() const { return m_expression; }
|
EIGEN_DEVICE_FUNC operator const ExpressionType&() const { return m_expression; }
|
||||||
|
|
||||||
|
@ -22,13 +22,13 @@ namespace internal {
|
|||||||
template <typename T, bool use_numeric_limits = std::numeric_limits<T>::is_specialized,
|
template <typename T, bool use_numeric_limits = std::numeric_limits<T>::is_specialized,
|
||||||
bool is_integer = NumTraits<T>::IsInteger>
|
bool is_integer = NumTraits<T>::IsInteger>
|
||||||
struct default_digits_impl {
|
struct default_digits_impl {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { return std::numeric_limits<T>::digits; }
|
EIGEN_DEVICE_FUNC constexpr static int run() { return std::numeric_limits<T>::digits; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct default_digits_impl<T, false, false> // Floating point
|
struct default_digits_impl<T, false, false> // Floating point
|
||||||
{
|
{
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() {
|
EIGEN_DEVICE_FUNC constexpr static int run() {
|
||||||
using std::ceil;
|
using std::ceil;
|
||||||
using std::log2;
|
using std::log2;
|
||||||
typedef typename NumTraits<T>::Real Real;
|
typedef typename NumTraits<T>::Real Real;
|
||||||
@ -39,7 +39,7 @@ struct default_digits_impl<T, false, false> // Floating point
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
struct default_digits_impl<T, false, true> // Integer
|
struct default_digits_impl<T, false, true> // Integer
|
||||||
{
|
{
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { return 0; }
|
EIGEN_DEVICE_FUNC constexpr static int run() { return 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// default implementation of digits10(), based on numeric_limits if specialized,
|
// default implementation of digits10(), based on numeric_limits if specialized,
|
||||||
@ -47,13 +47,13 @@ struct default_digits_impl<T, false, true> // Integer
|
|||||||
template <typename T, bool use_numeric_limits = std::numeric_limits<T>::is_specialized,
|
template <typename T, bool use_numeric_limits = std::numeric_limits<T>::is_specialized,
|
||||||
bool is_integer = NumTraits<T>::IsInteger>
|
bool is_integer = NumTraits<T>::IsInteger>
|
||||||
struct default_digits10_impl {
|
struct default_digits10_impl {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { return std::numeric_limits<T>::digits10; }
|
EIGEN_DEVICE_FUNC constexpr static int run() { return std::numeric_limits<T>::digits10; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct default_digits10_impl<T, false, false> // Floating point
|
struct default_digits10_impl<T, false, false> // Floating point
|
||||||
{
|
{
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() {
|
EIGEN_DEVICE_FUNC constexpr static int run() {
|
||||||
using std::floor;
|
using std::floor;
|
||||||
using std::log10;
|
using std::log10;
|
||||||
typedef typename NumTraits<T>::Real Real;
|
typedef typename NumTraits<T>::Real Real;
|
||||||
@ -64,7 +64,7 @@ struct default_digits10_impl<T, false, false> // Floating point
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
struct default_digits10_impl<T, false, true> // Integer
|
struct default_digits10_impl<T, false, true> // Integer
|
||||||
{
|
{
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { return 0; }
|
EIGEN_DEVICE_FUNC constexpr static int run() { return 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// default implementation of max_digits10(), based on numeric_limits if specialized,
|
// default implementation of max_digits10(), based on numeric_limits if specialized,
|
||||||
@ -72,13 +72,13 @@ struct default_digits10_impl<T, false, true> // Integer
|
|||||||
template <typename T, bool use_numeric_limits = std::numeric_limits<T>::is_specialized,
|
template <typename T, bool use_numeric_limits = std::numeric_limits<T>::is_specialized,
|
||||||
bool is_integer = NumTraits<T>::IsInteger>
|
bool is_integer = NumTraits<T>::IsInteger>
|
||||||
struct default_max_digits10_impl {
|
struct default_max_digits10_impl {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { return std::numeric_limits<T>::max_digits10; }
|
EIGEN_DEVICE_FUNC constexpr static int run() { return std::numeric_limits<T>::max_digits10; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct default_max_digits10_impl<T, false, false> // Floating point
|
struct default_max_digits10_impl<T, false, false> // Floating point
|
||||||
{
|
{
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() {
|
EIGEN_DEVICE_FUNC constexpr static int run() {
|
||||||
using std::ceil;
|
using std::ceil;
|
||||||
using std::log10;
|
using std::log10;
|
||||||
typedef typename NumTraits<T>::Real Real;
|
typedef typename NumTraits<T>::Real Real;
|
||||||
@ -89,7 +89,7 @@ struct default_max_digits10_impl<T, false, false> // Floating point
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
struct default_max_digits10_impl<T, false, true> // Integer
|
struct default_max_digits10_impl<T, false, true> // Integer
|
||||||
{
|
{
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { return 0; }
|
EIGEN_DEVICE_FUNC constexpr static int run() { return 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace internal
|
} // end namespace internal
|
||||||
@ -188,32 +188,30 @@ struct GenericNumTraits {
|
|||||||
typedef T Nested;
|
typedef T Nested;
|
||||||
typedef T Literal;
|
typedef T Literal;
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline Real epsilon() { return numext::numeric_limits<T>::epsilon(); }
|
EIGEN_DEVICE_FUNC constexpr static Real epsilon() { return numext::numeric_limits<T>::epsilon(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int digits10() { return internal::default_digits10_impl<T>::run(); }
|
EIGEN_DEVICE_FUNC constexpr static int digits10() { return internal::default_digits10_impl<T>::run(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int max_digits10() {
|
EIGEN_DEVICE_FUNC constexpr static int max_digits10() { return internal::default_max_digits10_impl<T>::run(); }
|
||||||
return internal::default_max_digits10_impl<T>::run();
|
|
||||||
}
|
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int digits() { return internal::default_digits_impl<T>::run(); }
|
EIGEN_DEVICE_FUNC constexpr static int digits() { return internal::default_digits_impl<T>::run(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int min_exponent() { return numext::numeric_limits<T>::min_exponent; }
|
EIGEN_DEVICE_FUNC constexpr static int min_exponent() { return numext::numeric_limits<T>::min_exponent; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int max_exponent() { return numext::numeric_limits<T>::max_exponent; }
|
EIGEN_DEVICE_FUNC constexpr static int max_exponent() { return numext::numeric_limits<T>::max_exponent; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline Real dummy_precision() {
|
EIGEN_DEVICE_FUNC constexpr static Real dummy_precision() {
|
||||||
// make sure to override this for floating-point types
|
// make sure to override this for floating-point types
|
||||||
return Real(0);
|
return Real(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline T highest() { return (numext::numeric_limits<T>::max)(); }
|
EIGEN_DEVICE_FUNC constexpr static T highest() { return (numext::numeric_limits<T>::max)(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline T lowest() { return (numext::numeric_limits<T>::lowest)(); }
|
EIGEN_DEVICE_FUNC constexpr static T lowest() { return (numext::numeric_limits<T>::lowest)(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline T infinity() { return numext::numeric_limits<T>::infinity(); }
|
EIGEN_DEVICE_FUNC constexpr static T infinity() { return numext::numeric_limits<T>::infinity(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline T quiet_NaN() { return numext::numeric_limits<T>::quiet_NaN(); }
|
EIGEN_DEVICE_FUNC constexpr static T quiet_NaN() { return numext::numeric_limits<T>::quiet_NaN(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -221,25 +219,23 @@ struct NumTraits : GenericNumTraits<T> {};
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct NumTraits<float> : GenericNumTraits<float> {
|
struct NumTraits<float> : GenericNumTraits<float> {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline float dummy_precision() { return 1e-5f; }
|
EIGEN_DEVICE_FUNC constexpr static float dummy_precision() { return 1e-5f; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct NumTraits<double> : GenericNumTraits<double> {
|
struct NumTraits<double> : GenericNumTraits<double> {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline double dummy_precision() { return 1e-12; }
|
EIGEN_DEVICE_FUNC constexpr static double dummy_precision() { return 1e-12; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// GPU devices treat `long double` as `double`.
|
// GPU devices treat `long double` as `double`.
|
||||||
#ifndef EIGEN_GPU_COMPILE_PHASE
|
#ifndef EIGEN_GPU_COMPILE_PHASE
|
||||||
template <>
|
template <>
|
||||||
struct NumTraits<long double> : GenericNumTraits<long double> {
|
struct NumTraits<long double> : GenericNumTraits<long double> {
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline long double dummy_precision() {
|
EIGEN_DEVICE_FUNC constexpr static long double dummy_precision() { return static_cast<long double>(1e-15l); }
|
||||||
return static_cast<long double>(1e-15l);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(EIGEN_ARCH_PPC) && (__LDBL_MANT_DIG__ == 106)
|
#if defined(EIGEN_ARCH_PPC) && (__LDBL_MANT_DIG__ == 106)
|
||||||
// PowerPC double double causes issues with some values
|
// PowerPC double double causes issues with some values
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline long double epsilon() {
|
EIGEN_DEVICE_FUNC constexpr static long double epsilon() {
|
||||||
// 2^(-(__LDBL_MANT_DIG__)+1)
|
// 2^(-(__LDBL_MANT_DIG__)+1)
|
||||||
return static_cast<long double>(2.4651903288156618919116517665087e-32l);
|
return static_cast<long double>(2.4651903288156618919116517665087e-32l);
|
||||||
}
|
}
|
||||||
@ -260,10 +256,10 @@ struct NumTraits<std::complex<Real_> > : GenericNumTraits<std::complex<Real_> >
|
|||||||
MulCost = 4 * NumTraits<Real>::MulCost + 2 * NumTraits<Real>::AddCost
|
MulCost = 4 * NumTraits<Real>::MulCost + 2 * NumTraits<Real>::AddCost
|
||||||
};
|
};
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline Real epsilon() { return NumTraits<Real>::epsilon(); }
|
EIGEN_DEVICE_FUNC constexpr static Real epsilon() { return NumTraits<Real>::epsilon(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline Real dummy_precision() { return NumTraits<Real>::dummy_precision(); }
|
EIGEN_DEVICE_FUNC constexpr static Real dummy_precision() { return NumTraits<Real>::dummy_precision(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int digits10() { return NumTraits<Real>::digits10(); }
|
EIGEN_DEVICE_FUNC constexpr static int digits10() { return NumTraits<Real>::digits10(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int max_digits10() { return NumTraits<Real>::max_digits10(); }
|
EIGEN_DEVICE_FUNC constexpr static int max_digits10() { return NumTraits<Real>::max_digits10(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
|
template <typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
|
||||||
@ -290,25 +286,19 @@ struct NumTraits<Array<Scalar, Rows, Cols, Options, MaxRows, MaxCols> > {
|
|||||||
: ArrayType::SizeAtCompileTime * int(NumTraits<Scalar>::MulCost)
|
: ArrayType::SizeAtCompileTime * int(NumTraits<Scalar>::MulCost)
|
||||||
};
|
};
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline RealScalar epsilon() { return NumTraits<RealScalar>::epsilon(); }
|
EIGEN_DEVICE_FUNC constexpr static RealScalar epsilon() { return NumTraits<RealScalar>::epsilon(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline RealScalar dummy_precision() {
|
EIGEN_DEVICE_FUNC constexpr static RealScalar dummy_precision() { return NumTraits<RealScalar>::dummy_precision(); }
|
||||||
return NumTraits<RealScalar>::dummy_precision();
|
|
||||||
}
|
|
||||||
|
|
||||||
EIGEN_CONSTEXPR
|
constexpr static int digits10() { return NumTraits<Scalar>::digits10(); }
|
||||||
static inline int digits10() { return NumTraits<Scalar>::digits10(); }
|
constexpr static int max_digits10() { return NumTraits<Scalar>::max_digits10(); }
|
||||||
EIGEN_CONSTEXPR
|
|
||||||
static inline int max_digits10() { return NumTraits<Scalar>::max_digits10(); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct NumTraits<std::string> : GenericNumTraits<std::string> {
|
struct NumTraits<std::string> : GenericNumTraits<std::string> {
|
||||||
enum { RequireInitialization = 1, ReadCost = HugeCost, AddCost = HugeCost, MulCost = HugeCost };
|
enum { RequireInitialization = 1, ReadCost = HugeCost, AddCost = HugeCost, MulCost = HugeCost };
|
||||||
|
|
||||||
EIGEN_CONSTEXPR
|
constexpr static int digits10() { return 0; }
|
||||||
static inline int digits10() { return 0; }
|
constexpr static int max_digits10() { return 0; }
|
||||||
EIGEN_CONSTEXPR
|
|
||||||
static inline int max_digits10() { return 0; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static inline std::string epsilon();
|
static inline std::string epsilon();
|
||||||
|
@ -162,8 +162,8 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
|||||||
EIGEN_DEVICE_FUNC Base& base() { return *static_cast<Base*>(this); }
|
EIGEN_DEVICE_FUNC Base& base() { return *static_cast<Base*>(this); }
|
||||||
EIGEN_DEVICE_FUNC const Base& base() const { return *static_cast<const Base*>(this); }
|
EIGEN_DEVICE_FUNC const Base& base() const { return *static_cast<const Base*>(this); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_storage.rows(); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const EIGEN_NOEXCEPT { return m_storage.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_storage.cols(); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const EIGEN_NOEXCEPT { return m_storage.cols(); }
|
||||||
|
|
||||||
/** This is an overloaded version of DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index,Index) const
|
/** This is an overloaded version of DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index,Index) const
|
||||||
* provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.
|
* provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.
|
||||||
@ -298,7 +298,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
|||||||
*
|
*
|
||||||
* \sa resize(Index,Index), resize(NoChange_t, Index), resize(Index, NoChange_t)
|
* \sa resize(Index,Index), resize(NoChange_t, Index), resize(Index, NoChange_t)
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC inline constexpr void resize(Index size) {
|
EIGEN_DEVICE_FUNC constexpr void resize(Index size) {
|
||||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(PlainObjectBase)
|
EIGEN_STATIC_ASSERT_VECTOR_ONLY(PlainObjectBase)
|
||||||
eigen_assert(((SizeAtCompileTime == Dynamic && (MaxSizeAtCompileTime == Dynamic || size <= MaxSizeAtCompileTime)) ||
|
eigen_assert(((SizeAtCompileTime == Dynamic && (MaxSizeAtCompileTime == Dynamic || size <= MaxSizeAtCompileTime)) ||
|
||||||
SizeAtCompileTime == size) &&
|
SizeAtCompileTime == size) &&
|
||||||
@ -323,7 +323,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
|||||||
*
|
*
|
||||||
* \sa resize(Index,Index)
|
* \sa resize(Index,Index)
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC inline constexpr void resize(NoChange_t, Index cols) { resize(rows(), cols); }
|
EIGEN_DEVICE_FUNC constexpr void resize(NoChange_t, Index cols) { resize(rows(), cols); }
|
||||||
|
|
||||||
/** Resizes the matrix, changing only the number of rows. For the parameter of type NoChange_t, just pass the special
|
/** Resizes the matrix, changing only the number of rows. For the parameter of type NoChange_t, just pass the special
|
||||||
* value \c NoChange as in the example below.
|
* value \c NoChange as in the example below.
|
||||||
@ -333,7 +333,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
|||||||
*
|
*
|
||||||
* \sa resize(Index,Index)
|
* \sa resize(Index,Index)
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC inline constexpr void resize(Index rows, NoChange_t) { resize(rows, cols()); }
|
EIGEN_DEVICE_FUNC constexpr void resize(Index rows, NoChange_t) { resize(rows, cols()); }
|
||||||
|
|
||||||
/** Resizes \c *this to have the same dimensions as \a other.
|
/** Resizes \c *this to have the same dimensions as \a other.
|
||||||
* Takes care of doing all the checking that's needed.
|
* Takes care of doing all the checking that's needed.
|
||||||
|
@ -224,8 +224,8 @@ class Product
|
|||||||
"if you wanted a coeff-wise or a dot product use the respective explicit functions");
|
"if you wanted a coeff-wise or a dot product use the respective explicit functions");
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const LhsNestedCleaned& lhs() const { return m_lhs; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const LhsNestedCleaned& lhs() const { return m_lhs; }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const RhsNestedCleaned& rhs() const { return m_rhs; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const RhsNestedCleaned& rhs() const { return m_rhs; }
|
||||||
|
@ -122,7 +122,7 @@ template <bool Specialize = (sizeof(long double) == 2 * sizeof(uint64_t)) &&
|
|||||||
((std::numeric_limits<long double>::digits != (2 * std::numeric_limits<double>::digits)))>
|
((std::numeric_limits<long double>::digits != (2 * std::numeric_limits<double>::digits)))>
|
||||||
struct random_longdouble_impl {
|
struct random_longdouble_impl {
|
||||||
static constexpr int Size = sizeof(long double);
|
static constexpr int Size = sizeof(long double);
|
||||||
static constexpr EIGEN_DEVICE_FUNC inline int mantissaBits() { return NumTraits<long double>::digits() - 1; }
|
static constexpr EIGEN_DEVICE_FUNC int mantissaBits() { return NumTraits<long double>::digits() - 1; }
|
||||||
static EIGEN_DEVICE_FUNC inline long double run(int numRandomBits) {
|
static EIGEN_DEVICE_FUNC inline long double run(int numRandomBits) {
|
||||||
eigen_assert(numRandomBits >= 0 && numRandomBits <= mantissaBits());
|
eigen_assert(numRandomBits >= 0 && numRandomBits <= mantissaBits());
|
||||||
EIGEN_USING_STD(memcpy);
|
EIGEN_USING_STD(memcpy);
|
||||||
@ -140,7 +140,7 @@ struct random_longdouble_impl {
|
|||||||
};
|
};
|
||||||
template <>
|
template <>
|
||||||
struct random_longdouble_impl<false> {
|
struct random_longdouble_impl<false> {
|
||||||
static constexpr EIGEN_DEVICE_FUNC inline int mantissaBits() { return NumTraits<double>::digits() - 1; }
|
static constexpr EIGEN_DEVICE_FUNC int mantissaBits() { return NumTraits<double>::digits() - 1; }
|
||||||
static EIGEN_DEVICE_FUNC inline long double run(int numRandomBits) {
|
static EIGEN_DEVICE_FUNC inline long double run(int numRandomBits) {
|
||||||
return static_cast<long double>(random_float_impl<double>::run(numRandomBits));
|
return static_cast<long double>(random_float_impl<double>::run(numRandomBits));
|
||||||
}
|
}
|
||||||
|
@ -73,11 +73,11 @@ class RefBase : public MapBase<Derived> {
|
|||||||
typedef MapBase<Derived> Base;
|
typedef MapBase<Derived> Base;
|
||||||
EIGEN_DENSE_PUBLIC_INTERFACE(RefBase)
|
EIGEN_DENSE_PUBLIC_INTERFACE(RefBase)
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const {
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const {
|
||||||
return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;
|
return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const {
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const {
|
||||||
return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer()
|
return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer()
|
||||||
: IsVectorAtCompileTime ? this->size()
|
: IsVectorAtCompileTime ? this->size()
|
||||||
: int(Flags) & RowMajorBit ? this->cols()
|
: int(Flags) & RowMajorBit ? this->cols()
|
||||||
@ -97,11 +97,11 @@ class RefBase : public MapBase<Derived> {
|
|||||||
typedef Stride<StrideType::OuterStrideAtCompileTime, StrideType::InnerStrideAtCompileTime> StrideBase;
|
typedef Stride<StrideType::OuterStrideAtCompileTime, StrideType::InnerStrideAtCompileTime> StrideBase;
|
||||||
|
|
||||||
// Resolves inner stride if default 0.
|
// Resolves inner stride if default 0.
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index resolveInnerStride(Index inner) { return inner == 0 ? 1 : inner; }
|
static EIGEN_DEVICE_FUNC constexpr Index resolveInnerStride(Index inner) { return inner == 0 ? 1 : inner; }
|
||||||
|
|
||||||
// Resolves outer stride if default 0.
|
// Resolves outer stride if default 0.
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index resolveOuterStride(Index inner, Index outer, Index rows, Index cols,
|
static EIGEN_DEVICE_FUNC constexpr Index resolveOuterStride(Index inner, Index outer, Index rows, Index cols,
|
||||||
bool isVectorAtCompileTime, bool isRowMajor) {
|
bool isVectorAtCompileTime, bool isRowMajor) {
|
||||||
return outer == 0 ? isVectorAtCompileTime ? inner * rows * cols : isRowMajor ? inner * cols : inner * rows : outer;
|
return outer == 0 ? isVectorAtCompileTime ? inner * rows * cols : isRowMajor ? inner * cols : inner * rows : outer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,8 +85,8 @@ class Replicate : public internal::dense_xpr_base<Replicate<MatrixType, RowFacto
|
|||||||
THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
|
THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const { return m_matrix.rows() * m_rowFactor.value(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const { return m_matrix.rows() * m_rowFactor.value(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const { return m_matrix.cols() * m_colFactor.value(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const { return m_matrix.cols() * m_colFactor.value(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC const MatrixTypeNested_& nestedExpression() const { return m_matrix; }
|
EIGEN_DEVICE_FUNC const MatrixTypeNested_& nestedExpression() const { return m_matrix; }
|
||||||
|
|
||||||
|
@ -215,10 +215,10 @@ class ReshapedImpl_dense<XprType, Rows, Cols, Order, true> : public MapBase<Resh
|
|||||||
EIGEN_DEVICE_FUNC XprType& nestedExpression() { return m_xpr; }
|
EIGEN_DEVICE_FUNC XprType& nestedExpression() { return m_xpr; }
|
||||||
|
|
||||||
/** \sa MapBase::innerStride() */
|
/** \sa MapBase::innerStride() */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const { return m_xpr.innerStride(); }
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const { return m_xpr.innerStride(); }
|
||||||
|
|
||||||
/** \sa MapBase::outerStride() */
|
/** \sa MapBase::outerStride() */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const {
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const {
|
||||||
return (((Flags & RowMajorBit) == RowMajorBit) ? this->cols() : this->rows()) * m_xpr.innerStride();
|
return (((Flags & RowMajorBit) == RowMajorBit) ? this->cols() : this->rows()) * m_xpr.innerStride();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,12 +58,8 @@ class ReturnByValue : public internal::dense_xpr_base<ReturnByValue<Derived> >::
|
|||||||
EIGEN_DEVICE_FUNC inline void evalTo(Dest& dst) const {
|
EIGEN_DEVICE_FUNC inline void evalTo(Dest& dst) const {
|
||||||
static_cast<const Derived*>(this)->evalTo(dst);
|
static_cast<const Derived*>(this)->evalTo(dst);
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return static_cast<const Derived*>(this)->rows(); }
|
||||||
return static_cast<const Derived*>(this)->rows();
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return static_cast<const Derived*>(this)->cols(); }
|
||||||
}
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT {
|
|
||||||
return static_cast<const Derived*>(this)->cols();
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||||
#define Unusable \
|
#define Unusable \
|
||||||
|
@ -87,8 +87,8 @@ class Reverse : public internal::dense_xpr_base<Reverse<MatrixType, Direction> >
|
|||||||
|
|
||||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Reverse)
|
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Reverse)
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC inline Index innerStride() const { return -m_matrix.innerStride(); }
|
EIGEN_DEVICE_FUNC inline Index innerStride() const { return -m_matrix.innerStride(); }
|
||||||
|
|
||||||
|
@ -63,8 +63,8 @@ class Select : public internal::dense_xpr_base<Select<ConditionMatrixType, ThenM
|
|||||||
eigen_assert(m_condition.cols() == m_then.cols() && m_condition.cols() == m_else.cols());
|
eigen_assert(m_condition.cols() == m_then.cols() && m_condition.cols() == m_else.cols());
|
||||||
}
|
}
|
||||||
|
|
||||||
inline EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_condition.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_condition.rows(); }
|
||||||
inline EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_condition.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_condition.cols(); }
|
||||||
|
|
||||||
inline EIGEN_DEVICE_FUNC const Scalar coeff(Index i, Index j) const {
|
inline EIGEN_DEVICE_FUNC const Scalar coeff(Index i, Index j) const {
|
||||||
if (m_condition.coeff(i, j))
|
if (m_condition.coeff(i, j))
|
||||||
|
@ -73,10 +73,10 @@ class SelfAdjointView : public TriangularBase<SelfAdjointView<MatrixType_, UpLo>
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC explicit inline SelfAdjointView(MatrixType& matrix) : m_matrix(matrix) {}
|
EIGEN_DEVICE_FUNC explicit inline SelfAdjointView(MatrixType& matrix) : m_matrix(matrix) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { return m_matrix.outerStride(); }
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return m_matrix.outerStride(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT { return m_matrix.innerStride(); }
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return m_matrix.innerStride(); }
|
||||||
|
|
||||||
/** \sa MatrixBase::coeff()
|
/** \sa MatrixBase::coeff()
|
||||||
* \warning the coordinates must fit into the referenced triangular part
|
* \warning the coordinates must fit into the referenced triangular part
|
||||||
|
@ -66,7 +66,7 @@ class SkewSymmetricBase : public EigenBase<Derived> {
|
|||||||
EIGEN_DEVICE_FUNC DenseMatrixType toDenseMatrix() const { return derived(); }
|
EIGEN_DEVICE_FUNC DenseMatrixType toDenseMatrix() const { return derived(); }
|
||||||
|
|
||||||
/** Determinant vanishes */
|
/** Determinant vanishes */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar determinant() const { return 0; }
|
EIGEN_DEVICE_FUNC constexpr Scalar determinant() const { return 0; }
|
||||||
|
|
||||||
/** A.transpose() = -A */
|
/** A.transpose() = -A */
|
||||||
EIGEN_DEVICE_FUNC PlainObject transpose() const { return (-vector()).asSkewSymmetric(); }
|
EIGEN_DEVICE_FUNC PlainObject transpose() const { return (-vector()).asSkewSymmetric(); }
|
||||||
@ -91,9 +91,9 @@ class SkewSymmetricBase : public EigenBase<Derived> {
|
|||||||
EIGEN_DEVICE_FUNC inline SkewSymmetricVectorType& vector() { return derived().vector(); }
|
EIGEN_DEVICE_FUNC inline SkewSymmetricVectorType& vector() { return derived().vector(); }
|
||||||
|
|
||||||
/** \returns the number of rows. */
|
/** \returns the number of rows. */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const { return 3; }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const { return 3; }
|
||||||
/** \returns the number of columns. */
|
/** \returns the number of columns. */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const { return 3; }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const { return 3; }
|
||||||
|
|
||||||
/** \returns the matrix product of \c *this by the dense matrix, \a matrix */
|
/** \returns the matrix product of \c *this by the dense matrix, \a matrix */
|
||||||
template <typename MatrixDerived>
|
template <typename MatrixDerived>
|
||||||
|
@ -66,8 +66,8 @@ class Solve : public SolveImpl<Decomposition, RhsType, typename internal::traits
|
|||||||
|
|
||||||
Solve(const Decomposition &dec, const RhsType &rhs) : m_dec(dec), m_rhs(rhs) {}
|
Solve(const Decomposition &dec, const RhsType &rhs) : m_dec(dec), m_rhs(rhs) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_dec.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_dec.cols(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC const Decomposition &dec() const { return m_dec; }
|
EIGEN_DEVICE_FUNC const Decomposition &dec() const { return m_dec; }
|
||||||
EIGEN_DEVICE_FUNC const RhsType &rhs() const { return m_rhs; }
|
EIGEN_DEVICE_FUNC const RhsType &rhs() const { return m_rhs; }
|
||||||
|
@ -216,8 +216,8 @@ struct triangular_solve_retval : public ReturnByValue<triangular_solve_retval<Si
|
|||||||
|
|
||||||
triangular_solve_retval(const TriangularType& tri, const Rhs& rhs) : m_triangularMatrix(tri), m_rhs(rhs) {}
|
triangular_solve_retval(const TriangularType& tri, const Rhs& rhs) : m_triangularMatrix(tri), m_rhs(rhs) {}
|
||||||
|
|
||||||
inline EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_rhs.rows(); }
|
constexpr Index rows() const EIGEN_NOEXCEPT { return m_rhs.rows(); }
|
||||||
inline EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); }
|
constexpr Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); }
|
||||||
|
|
||||||
template <typename Dest>
|
template <typename Dest>
|
||||||
inline void evalTo(Dest& dst) const {
|
inline void evalTo(Dest& dst) const {
|
||||||
|
@ -78,9 +78,9 @@ class Stride {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** \returns the outer stride */
|
/** \returns the outer stride */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outer() const { return m_outer.value(); }
|
EIGEN_DEVICE_FUNC constexpr Index outer() const { return m_outer.value(); }
|
||||||
/** \returns the inner stride */
|
/** \returns the inner stride */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index inner() const { return m_inner.value(); }
|
EIGEN_DEVICE_FUNC constexpr Index inner() const { return m_inner.value(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
internal::variable_if_dynamic<Index, OuterStrideAtCompileTime> m_outer;
|
internal::variable_if_dynamic<Index, OuterStrideAtCompileTime> m_outer;
|
||||||
|
@ -65,8 +65,8 @@ class Transpose : public TransposeImpl<MatrixType, typename internal::traits<Mat
|
|||||||
|
|
||||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Transpose)
|
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Transpose)
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
||||||
|
|
||||||
/** \returns the nested expression */
|
/** \returns the nested expression */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::remove_all_t<MatrixTypeNested>& nestedExpression() const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::remove_all_t<MatrixTypeNested>& nestedExpression() const {
|
||||||
|
@ -293,9 +293,9 @@ class Transpose<TranspositionsBase<TranspositionsDerived> > {
|
|||||||
public:
|
public:
|
||||||
explicit Transpose(const TranspositionType& t) : m_transpositions(t) {}
|
explicit Transpose(const TranspositionType& t) : m_transpositions(t) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT { return m_transpositions.size(); }
|
EIGEN_DEVICE_FUNC constexpr Index size() const EIGEN_NOEXCEPT { return m_transpositions.size(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_transpositions.size(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_transpositions.size(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_transpositions.size(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_transpositions.size(); }
|
||||||
|
|
||||||
/** \returns the \a matrix with the inverse transpositions applied to the columns.
|
/** \returns the \a matrix with the inverse transpositions applied to the columns.
|
||||||
*/
|
*/
|
||||||
|
@ -58,10 +58,10 @@ class TriangularBase : public EigenBase<Derived> {
|
|||||||
eigen_assert(!((int(Mode) & int(UnitDiag)) && (int(Mode) & int(ZeroDiag))));
|
eigen_assert(!((int(Mode) & int(UnitDiag)) && (int(Mode) & int(ZeroDiag))));
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return derived().rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return derived().rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return derived().cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return derived().cols(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { return derived().outerStride(); }
|
EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return derived().outerStride(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT { return derived().innerStride(); }
|
EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return derived().innerStride(); }
|
||||||
|
|
||||||
// dummy resize function
|
// dummy resize function
|
||||||
EIGEN_DEVICE_FUNC void resize(Index rows, Index cols) {
|
EIGEN_DEVICE_FUNC void resize(Index rows, Index cols) {
|
||||||
@ -194,9 +194,9 @@ class TriangularView
|
|||||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(TriangularView)
|
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(TriangularView)
|
||||||
|
|
||||||
/** \copydoc EigenBase::rows() */
|
/** \copydoc EigenBase::rows() */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
||||||
/** \copydoc EigenBase::cols() */
|
/** \copydoc EigenBase::cols() */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
||||||
|
|
||||||
/** \returns a const reference to the nested expression */
|
/** \returns a const reference to the nested expression */
|
||||||
EIGEN_DEVICE_FUNC const NestedExpression& nestedExpression() const { return m_matrix; }
|
EIGEN_DEVICE_FUNC const NestedExpression& nestedExpression() const { return m_matrix; }
|
||||||
|
@ -64,10 +64,10 @@ class PartialReduxExpr : public internal::dense_xpr_base<PartialReduxExpr<Matrix
|
|||||||
EIGEN_DEVICE_FUNC explicit PartialReduxExpr(const MatrixType& mat, const MemberOp& func = MemberOp())
|
EIGEN_DEVICE_FUNC explicit PartialReduxExpr(const MatrixType& mat, const MemberOp& func = MemberOp())
|
||||||
: m_matrix(mat), m_functor(func) {}
|
: m_matrix(mat), m_functor(func) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT {
|
||||||
return (Direction == Vertical ? 1 : m_matrix.rows());
|
return (Direction == Vertical ? 1 : m_matrix.rows());
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT {
|
||||||
return (Direction == Horizontal ? 1 : m_matrix.cols());
|
return (Direction == Horizontal ? 1 : m_matrix.cols());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,14 +25,12 @@ struct visitor_impl;
|
|||||||
template <typename Visitor, bool ShortCircuitEvaluation = false>
|
template <typename Visitor, bool ShortCircuitEvaluation = false>
|
||||||
struct short_circuit_eval_impl {
|
struct short_circuit_eval_impl {
|
||||||
// if short circuit evaluation is not used, do nothing
|
// if short circuit evaluation is not used, do nothing
|
||||||
static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool run(const Visitor&) { return false; }
|
static constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool run(const Visitor&) { return false; }
|
||||||
};
|
};
|
||||||
template <typename Visitor>
|
template <typename Visitor>
|
||||||
struct short_circuit_eval_impl<Visitor, true> {
|
struct short_circuit_eval_impl<Visitor, true> {
|
||||||
// if short circuit evaluation is used, check the visitor
|
// if short circuit evaluation is used, check the visitor
|
||||||
static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool run(const Visitor& visitor) {
|
static constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool run(const Visitor& visitor) { return visitor.done(); }
|
||||||
return visitor.done();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// unrolled inner-outer traversal
|
// unrolled inner-outer traversal
|
||||||
@ -296,9 +294,9 @@ class visitor_evaluator {
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC explicit visitor_evaluator(const XprType& xpr) : m_evaluator(xpr), m_xpr(xpr) {}
|
EIGEN_DEVICE_FUNC explicit visitor_evaluator(const XprType& xpr) : m_evaluator(xpr), m_xpr(xpr) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_xpr.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_xpr.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_xpr.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_xpr.cols(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT { return m_xpr.size(); }
|
EIGEN_DEVICE_FUNC constexpr Index size() const EIGEN_NOEXCEPT { return m_xpr.size(); }
|
||||||
// outer-inner access
|
// outer-inner access
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||||
return m_evaluator.coeff(row, col);
|
return m_evaluator.coeff(row, col);
|
||||||
|
@ -187,7 +187,7 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Packet pfrexp_generic(const Packet& a, Pac
|
|||||||
static constexpr int TotalBits = sizeof(Scalar) * CHAR_BIT, MantissaBits = numext::numeric_limits<Scalar>::digits - 1,
|
static constexpr int TotalBits = sizeof(Scalar) * CHAR_BIT, MantissaBits = numext::numeric_limits<Scalar>::digits - 1,
|
||||||
ExponentBits = TotalBits - MantissaBits - 1;
|
ExponentBits = TotalBits - MantissaBits - 1;
|
||||||
|
|
||||||
EIGEN_CONSTEXPR ScalarUI scalar_sign_mantissa_mask =
|
constexpr ScalarUI scalar_sign_mantissa_mask =
|
||||||
~(((ScalarUI(1) << ExponentBits) - ScalarUI(1)) << MantissaBits); // ~0x7f800000
|
~(((ScalarUI(1) << ExponentBits) - ScalarUI(1)) << MantissaBits); // ~0x7f800000
|
||||||
const Packet sign_mantissa_mask = pset1frombits<Packet>(static_cast<ScalarUI>(scalar_sign_mantissa_mask));
|
const Packet sign_mantissa_mask = pset1frombits<Packet>(static_cast<ScalarUI>(scalar_sign_mantissa_mask));
|
||||||
const Packet half = pset1<Packet>(Scalar(0.5));
|
const Packet half = pset1<Packet>(Scalar(0.5));
|
||||||
@ -196,7 +196,7 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Packet pfrexp_generic(const Packet& a, Pac
|
|||||||
|
|
||||||
// To handle denormals, normalize by multiplying by 2^(int(MantissaBits)+1).
|
// To handle denormals, normalize by multiplying by 2^(int(MantissaBits)+1).
|
||||||
const Packet is_denormal = pcmp_lt(pabs(a), normal_min);
|
const Packet is_denormal = pcmp_lt(pabs(a), normal_min);
|
||||||
EIGEN_CONSTEXPR ScalarUI scalar_normalization_offset = ScalarUI(MantissaBits + 1); // 24
|
constexpr ScalarUI scalar_normalization_offset = ScalarUI(MantissaBits + 1); // 24
|
||||||
// The following cannot be constexpr because bfloat16(uint16_t) is not constexpr.
|
// The following cannot be constexpr because bfloat16(uint16_t) is not constexpr.
|
||||||
const Scalar scalar_normalization_factor = Scalar(ScalarUI(1) << int(scalar_normalization_offset)); // 2^24
|
const Scalar scalar_normalization_factor = Scalar(ScalarUI(1) << int(scalar_normalization_offset)); // 2^24
|
||||||
const Packet normalization_factor = pset1<Packet>(scalar_normalization_factor);
|
const Packet normalization_factor = pset1<Packet>(scalar_normalization_factor);
|
||||||
@ -1822,7 +1822,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet twoprod_low(const Packet& x, const
|
|||||||
template <typename Packet>
|
template <typename Packet>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void veltkamp_splitting(const Packet& x, Packet& x_hi, Packet& x_lo) {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void veltkamp_splitting(const Packet& x, Packet& x_hi, Packet& x_lo) {
|
||||||
typedef typename unpacket_traits<Packet>::type Scalar;
|
typedef typename unpacket_traits<Packet>::type Scalar;
|
||||||
EIGEN_CONSTEXPR int shift = (NumTraits<Scalar>::digits() + 1) / 2;
|
constexpr int shift = (NumTraits<Scalar>::digits() + 1) / 2;
|
||||||
const Scalar shift_scale = Scalar(uint64_t(1) << shift); // Scalar constructor not necessarily constexpr.
|
const Scalar shift_scale = Scalar(uint64_t(1) << shift); // Scalar constructor not necessarily constexpr.
|
||||||
const Packet gamma = pmul(pset1<Packet>(shift_scale + Scalar(1)), x);
|
const Packet gamma = pmul(pset1<Packet>(shift_scale + Scalar(1)), x);
|
||||||
Packet rho = psub(x, gamma);
|
Packet rho = psub(x, gamma);
|
||||||
@ -2128,7 +2128,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet generic_pow_impl(const Packet& x, c
|
|||||||
Packet m_x = pfrexp(x, e_x);
|
Packet m_x = pfrexp(x, e_x);
|
||||||
|
|
||||||
// Adjust m_x to lie in [1/sqrt(2):sqrt(2)] to minimize absolute error in log2(m_x).
|
// Adjust m_x to lie in [1/sqrt(2):sqrt(2)] to minimize absolute error in log2(m_x).
|
||||||
EIGEN_CONSTEXPR Scalar sqrt_half = Scalar(0.70710678118654752440);
|
constexpr Scalar sqrt_half = Scalar(0.70710678118654752440);
|
||||||
const Packet m_x_scale_mask = pcmp_lt(m_x, pset1<Packet>(sqrt_half));
|
const Packet m_x_scale_mask = pcmp_lt(m_x, pset1<Packet>(sqrt_half));
|
||||||
m_x = pselect(m_x_scale_mask, pmul(pset1<Packet>(Scalar(2)), m_x), m_x);
|
m_x = pselect(m_x_scale_mask, pmul(pset1<Packet>(Scalar(2)), m_x), m_x);
|
||||||
e_x = pselect(m_x_scale_mask, psub(e_x, pset1<Packet>(Scalar(1))), e_x);
|
e_x = pselect(m_x_scale_mask, psub(e_x, pset1<Packet>(Scalar(1))), e_x);
|
||||||
@ -2211,7 +2211,7 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet generic_pow(const Pac
|
|||||||
const Packet y_is_even = pcmp_eq(pround(y_div_2), y_div_2);
|
const Packet y_is_even = pcmp_eq(pround(y_div_2), y_div_2);
|
||||||
const Packet y_is_odd_int = pandnot(y_is_int, y_is_even);
|
const Packet y_is_odd_int = pandnot(y_is_int, y_is_even);
|
||||||
// Smallest exponent for which (1 + epsilon) overflows to infinity.
|
// Smallest exponent for which (1 + epsilon) overflows to infinity.
|
||||||
EIGEN_CONSTEXPR Scalar huge_exponent =
|
constexpr Scalar huge_exponent =
|
||||||
(NumTraits<Scalar>::max_exponent() * Scalar(EIGEN_LN2)) / NumTraits<Scalar>::epsilon();
|
(NumTraits<Scalar>::max_exponent() * Scalar(EIGEN_LN2)) / NumTraits<Scalar>::epsilon();
|
||||||
const Packet y_abs_is_huge = pcmp_le(pset1<Packet>(huge_exponent), y_abs);
|
const Packet y_abs_is_huge = pcmp_le(pset1<Packet>(huge_exponent), y_abs);
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class TupleImpl<N, T1, Ts...> {
|
|||||||
template <typename U1 = T1,
|
template <typename U1 = T1,
|
||||||
typename EnableIf = std::enable_if_t<std::is_default_constructible<U1>::value &&
|
typename EnableIf = std::enable_if_t<std::is_default_constructible<U1>::value &&
|
||||||
reduce_all<std::is_default_constructible<Ts>::value...>::value>>
|
reduce_all<std::is_default_constructible<Ts>::value...>::value>>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC TupleImpl() : head_{}, tail_{} {}
|
constexpr EIGEN_DEVICE_FUNC TupleImpl() : head_{}, tail_{} {}
|
||||||
|
|
||||||
// Element constructor.
|
// Element constructor.
|
||||||
template <typename U1, typename... Us,
|
template <typename U1, typename... Us,
|
||||||
@ -44,7 +44,7 @@ class TupleImpl<N, T1, Ts...> {
|
|||||||
sizeof...(Us) == sizeof...(Ts) && (
|
sizeof...(Us) == sizeof...(Ts) && (
|
||||||
// this does not look like a copy/move constructor.
|
// this does not look like a copy/move constructor.
|
||||||
N > 1 || std::is_convertible<U1, T1>::value)>>
|
N > 1 || std::is_convertible<U1, T1>::value)>>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC TupleImpl(U1&& arg1, Us&&... args)
|
constexpr EIGEN_DEVICE_FUNC TupleImpl(U1&& arg1, Us&&... args)
|
||||||
: head_(std::forward<U1>(arg1)), tail_(std::forward<Us>(args)...) {}
|
: head_(std::forward<U1>(arg1)), tail_(std::forward<Us>(args)...) {}
|
||||||
|
|
||||||
// The first stored value.
|
// The first stored value.
|
||||||
@ -102,11 +102,11 @@ struct tuple_get_impl {
|
|||||||
using TupleType = TupleImpl<sizeof...(Ts) + 1, T1, Ts...>;
|
using TupleType = TupleImpl<sizeof...(Ts) + 1, T1, Ts...>;
|
||||||
using ReturnType = typename tuple_get_impl<Idx - 1, Ts...>::ReturnType;
|
using ReturnType = typename tuple_get_impl<Idx - 1, Ts...>::ReturnType;
|
||||||
|
|
||||||
static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE ReturnType& run(TupleType& tuple) {
|
static constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE ReturnType& run(TupleType& tuple) {
|
||||||
return tuple_get_impl<Idx - 1, Ts...>::run(tuple.tail());
|
return tuple_get_impl<Idx - 1, Ts...>::run(tuple.tail());
|
||||||
}
|
}
|
||||||
|
|
||||||
static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const ReturnType& run(const TupleType& tuple) {
|
static constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const ReturnType& run(const TupleType& tuple) {
|
||||||
return tuple_get_impl<Idx - 1, Ts...>::run(tuple.tail());
|
return tuple_get_impl<Idx - 1, Ts...>::run(tuple.tail());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -117,11 +117,9 @@ struct tuple_get_impl<0, T1, Ts...> {
|
|||||||
using TupleType = TupleImpl<sizeof...(Ts) + 1, T1, Ts...>;
|
using TupleType = TupleImpl<sizeof...(Ts) + 1, T1, Ts...>;
|
||||||
using ReturnType = T1;
|
using ReturnType = T1;
|
||||||
|
|
||||||
static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T1& run(TupleType& tuple) { return tuple.head(); }
|
static constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T1& run(TupleType& tuple) { return tuple.head(); }
|
||||||
|
|
||||||
static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const T1& run(const TupleType& tuple) {
|
static constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const T1& run(const TupleType& tuple) { return tuple.head(); }
|
||||||
return tuple.head();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Concatenates N Tuples.
|
// Concatenates N Tuples.
|
||||||
@ -139,11 +137,9 @@ struct tuple_cat_impl<NTuples, TupleImpl<N1, Args1...>, TupleImpl<N2, Args2...>,
|
|||||||
// Uses the index sequences to extract and merge elements from tuple1 and tuple2,
|
// Uses the index sequences to extract and merge elements from tuple1 and tuple2,
|
||||||
// then recursively calls again.
|
// then recursively calls again.
|
||||||
template <typename Tuple1, size_t... I1s, typename Tuple2, size_t... I2s, typename... MoreTuples>
|
template <typename Tuple1, size_t... I1s, typename Tuple2, size_t... I2s, typename... MoreTuples>
|
||||||
static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1,
|
static constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1, std::index_sequence<I1s...>,
|
||||||
std::index_sequence<I1s...>,
|
Tuple2&& tuple2, std::index_sequence<I2s...>,
|
||||||
Tuple2&& tuple2,
|
MoreTuples&&... tuples) {
|
||||||
std::index_sequence<I2s...>,
|
|
||||||
MoreTuples&&... tuples) {
|
|
||||||
return tuple_cat_impl<NTuples - 1, MergedTupleType, Tuples...>::run(
|
return tuple_cat_impl<NTuples - 1, MergedTupleType, Tuples...>::run(
|
||||||
MergedTupleType(tuple_get_impl<I1s, Args1...>::run(std::forward<Tuple1>(tuple1))...,
|
MergedTupleType(tuple_get_impl<I1s, Args1...>::run(std::forward<Tuple1>(tuple1))...,
|
||||||
tuple_get_impl<I2s, Args2...>::run(std::forward<Tuple2>(tuple2))...),
|
tuple_get_impl<I2s, Args2...>::run(std::forward<Tuple2>(tuple2))...),
|
||||||
@ -152,8 +148,8 @@ struct tuple_cat_impl<NTuples, TupleImpl<N1, Args1...>, TupleImpl<N2, Args2...>,
|
|||||||
|
|
||||||
// Concatenates the first two tuples.
|
// Concatenates the first two tuples.
|
||||||
template <typename Tuple1, typename Tuple2, typename... MoreTuples>
|
template <typename Tuple1, typename Tuple2, typename... MoreTuples>
|
||||||
static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1, Tuple2&& tuple2,
|
static constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1, Tuple2&& tuple2,
|
||||||
MoreTuples&&... tuples) {
|
MoreTuples&&... tuples) {
|
||||||
return run(std::forward<Tuple1>(tuple1), std::make_index_sequence<N1>{}, std::forward<Tuple2>(tuple2),
|
return run(std::forward<Tuple1>(tuple1), std::make_index_sequence<N1>{}, std::forward<Tuple2>(tuple2),
|
||||||
std::make_index_sequence<N2>{}, std::forward<MoreTuples>(tuples)...);
|
std::make_index_sequence<N2>{}, std::forward<MoreTuples>(tuples)...);
|
||||||
}
|
}
|
||||||
@ -165,7 +161,7 @@ struct tuple_cat_impl<1, TupleImpl<N, Args...>> {
|
|||||||
using ReturnType = TupleImpl<N, Args...>;
|
using ReturnType = TupleImpl<N, Args...>;
|
||||||
|
|
||||||
template <typename Tuple1>
|
template <typename Tuple1>
|
||||||
static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1) {
|
static constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1) {
|
||||||
return tuple1;
|
return tuple1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -174,7 +170,7 @@ struct tuple_cat_impl<1, TupleImpl<N, Args...>> {
|
|||||||
template <>
|
template <>
|
||||||
struct tuple_cat_impl<0> {
|
struct tuple_cat_impl<0> {
|
||||||
using ReturnType = TupleImpl<0>;
|
using ReturnType = TupleImpl<0>;
|
||||||
static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run() { return ReturnType{}; }
|
static constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run() { return ReturnType{}; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// For use in make_tuple, unwraps a reference_wrapper.
|
// For use in make_tuple, unwraps a reference_wrapper.
|
||||||
@ -211,13 +207,13 @@ struct tuple_size<TupleImpl<sizeof...(Types), Types...>> : std::integral_constan
|
|||||||
* \return a reference to the desired element.
|
* \return a reference to the desired element.
|
||||||
*/
|
*/
|
||||||
template <size_t Idx, typename... Types>
|
template <size_t Idx, typename... Types>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename tuple_get_impl<Idx, Types...>::ReturnType& get(
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename tuple_get_impl<Idx, Types...>::ReturnType& get(
|
||||||
const TupleImpl<sizeof...(Types), Types...>& tuple) {
|
const TupleImpl<sizeof...(Types), Types...>& tuple) {
|
||||||
return tuple_get_impl<Idx, Types...>::run(tuple);
|
return tuple_get_impl<Idx, Types...>::run(tuple);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t Idx, typename... Types>
|
template <size_t Idx, typename... Types>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename tuple_get_impl<Idx, Types...>::ReturnType& get(
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename tuple_get_impl<Idx, Types...>::ReturnType& get(
|
||||||
TupleImpl<sizeof...(Types), Types...>& tuple) {
|
TupleImpl<sizeof...(Types), Types...>& tuple) {
|
||||||
return tuple_get_impl<Idx, Types...>::run(tuple);
|
return tuple_get_impl<Idx, Types...>::run(tuple);
|
||||||
}
|
}
|
||||||
@ -229,7 +225,7 @@ EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename tuple_get_impl<Id
|
|||||||
*/
|
*/
|
||||||
template <typename... Tuples, typename EnableIf = std::enable_if_t<
|
template <typename... Tuples, typename EnableIf = std::enable_if_t<
|
||||||
internal::reduce_all<is_tuple<typename std::decay<Tuples>::type>::value...>::value>>
|
internal::reduce_all<is_tuple<typename std::decay<Tuples>::type>::value...>::value>>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
typename tuple_cat_impl<sizeof...(Tuples), typename std::decay<Tuples>::type...>::ReturnType
|
typename tuple_cat_impl<sizeof...(Tuples), typename std::decay<Tuples>::type...>::ReturnType
|
||||||
tuple_cat(Tuples&&... tuples) {
|
tuple_cat(Tuples&&... tuples) {
|
||||||
return tuple_cat_impl<sizeof...(Tuples), typename std::decay<Tuples>::type...>::run(std::forward<Tuples>(tuples)...);
|
return tuple_cat_impl<sizeof...(Tuples), typename std::decay<Tuples>::type...>::run(std::forward<Tuples>(tuples)...);
|
||||||
@ -239,7 +235,7 @@ EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|||||||
* Tie arguments together into a tuple.
|
* Tie arguments together into a tuple.
|
||||||
*/
|
*/
|
||||||
template <typename... Args, typename ReturnType = TupleImpl<sizeof...(Args), Args&...>>
|
template <typename... Args, typename ReturnType = TupleImpl<sizeof...(Args), Args&...>>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType tie(Args&... args) EIGEN_NOEXCEPT {
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType tie(Args&... args) EIGEN_NOEXCEPT {
|
||||||
return ReturnType{args...};
|
return ReturnType{args...};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,7 +243,7 @@ EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType tie(Args&... ar
|
|||||||
* Create a tuple of l-values with the supplied arguments.
|
* Create a tuple of l-values with the supplied arguments.
|
||||||
*/
|
*/
|
||||||
template <typename... Args, typename ReturnType = TupleImpl<sizeof...(Args), typename unwrap_decay<Args>::type...>>
|
template <typename... Args, typename ReturnType = TupleImpl<sizeof...(Args), typename unwrap_decay<Args>::type...>>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType make_tuple(Args&&... args) {
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType make_tuple(Args&&... args) {
|
||||||
return ReturnType{std::forward<Args>(args)...};
|
return ReturnType{std::forward<Args>(args)...};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,8 +251,7 @@ EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType make_tuple(Args
|
|||||||
* Forward a set of arguments as a tuple.
|
* Forward a set of arguments as a tuple.
|
||||||
*/
|
*/
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TupleImpl<sizeof...(Args), Args...> forward_as_tuple(
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TupleImpl<sizeof...(Args), Args...> forward_as_tuple(Args&&... args) {
|
||||||
Args&&... args) {
|
|
||||||
return TupleImpl<sizeof...(Args), Args...>(std::forward<Args>(args)...);
|
return TupleImpl<sizeof...(Args), Args...>(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,15 +248,15 @@ namespace internal {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <std::size_t I_, class T, std::size_t N>
|
template <std::size_t I_, class T, std::size_t N>
|
||||||
constexpr inline T& array_get(std::array<T, N>& a) {
|
constexpr T& array_get(std::array<T, N>& a) {
|
||||||
return (T&)STD_GET_ARR_HACK;
|
return (T&)STD_GET_ARR_HACK;
|
||||||
}
|
}
|
||||||
template <std::size_t I_, class T, std::size_t N>
|
template <std::size_t I_, class T, std::size_t N>
|
||||||
constexpr inline T&& array_get(std::array<T, N>&& a) {
|
constexpr T&& array_get(std::array<T, N>&& a) {
|
||||||
return (T&&)STD_GET_ARR_HACK;
|
return (T&&)STD_GET_ARR_HACK;
|
||||||
}
|
}
|
||||||
template <std::size_t I_, class T, std::size_t N>
|
template <std::size_t I_, class T, std::size_t N>
|
||||||
constexpr inline T const& array_get(std::array<T, N> const& a) {
|
constexpr T const& array_get(std::array<T, N> const& a) {
|
||||||
return (T const&)STD_GET_ARR_HACK;
|
return (T const&)STD_GET_ARR_HACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ struct array_size<std::array<T, N>> {
|
|||||||
#if EIGEN_COMP_CXXVER >= 20 && defined(__cpp_lib_ssize) && __cpp_lib_ssize >= 201902L
|
#if EIGEN_COMP_CXXVER >= 20 && defined(__cpp_lib_ssize) && __cpp_lib_ssize >= 201902L
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
EIGEN_CONSTEXPR auto index_list_size(T&& x) {
|
constexpr auto index_list_size(T&& x) {
|
||||||
using std::ssize;
|
using std::ssize;
|
||||||
return ssize(std::forward<T>(x));
|
return ssize(std::forward<T>(x));
|
||||||
}
|
}
|
||||||
@ -345,13 +345,13 @@ EIGEN_CONSTEXPR auto index_list_size(T&& x) {
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
EIGEN_CONSTEXPR auto index_list_size(const T& x) {
|
constexpr auto index_list_size(const T& x) {
|
||||||
using R = std::common_type_t<std::ptrdiff_t, std::make_signed_t<decltype(x.size())>>;
|
using R = std::common_type_t<std::ptrdiff_t, std::make_signed_t<decltype(x.size())>>;
|
||||||
return static_cast<R>(x.size());
|
return static_cast<R>(x.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, std::ptrdiff_t N>
|
template <typename T, std::ptrdiff_t N>
|
||||||
EIGEN_CONSTEXPR std::ptrdiff_t index_list_size(const T (&)[N]) {
|
constexpr std::ptrdiff_t index_list_size(const T (&)[N]) {
|
||||||
return N;
|
return N;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -637,21 +637,21 @@ template <typename A>
|
|||||||
constexpr bool is_int_or_enum_v = std::is_enum<A>::value || std::is_integral<A>::value;
|
constexpr bool is_int_or_enum_v = std::is_enum<A>::value || std::is_integral<A>::value;
|
||||||
|
|
||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
inline constexpr void plain_enum_asserts(A, B) {
|
constexpr void plain_enum_asserts(A, B) {
|
||||||
static_assert(is_int_or_enum_v<A>, "Argument a must be an integer or enum");
|
static_assert(is_int_or_enum_v<A>, "Argument a must be an integer or enum");
|
||||||
static_assert(is_int_or_enum_v<B>, "Argument b must be an integer or enum");
|
static_assert(is_int_or_enum_v<B>, "Argument b must be an integer or enum");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \internal Gets the minimum of two values which may be integers or enums
|
/// \internal Gets the minimum of two values which may be integers or enums
|
||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
inline constexpr int plain_enum_min(A a, B b) {
|
constexpr int plain_enum_min(A a, B b) {
|
||||||
plain_enum_asserts(a, b);
|
plain_enum_asserts(a, b);
|
||||||
return ((int)a <= (int)b) ? (int)a : (int)b;
|
return ((int)a <= (int)b) ? (int)a : (int)b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \internal Gets the maximum of two values which may be integers or enums
|
/// \internal Gets the maximum of two values which may be integers or enums
|
||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
inline constexpr int plain_enum_max(A a, B b) {
|
constexpr int plain_enum_max(A a, B b) {
|
||||||
plain_enum_asserts(a, b);
|
plain_enum_asserts(a, b);
|
||||||
return ((int)a >= (int)b) ? (int)a : (int)b;
|
return ((int)a >= (int)b) ? (int)a : (int)b;
|
||||||
}
|
}
|
||||||
@ -663,7 +663,7 @@ inline constexpr int plain_enum_max(A a, B b) {
|
|||||||
* finite values is that min(3, Dynamic) should be Dynamic, since that could be anything between 0 and 3.
|
* finite values is that min(3, Dynamic) should be Dynamic, since that could be anything between 0 and 3.
|
||||||
*/
|
*/
|
||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
inline constexpr int min_size_prefer_dynamic(A a, B b) {
|
constexpr int min_size_prefer_dynamic(A a, B b) {
|
||||||
plain_enum_asserts(a, b);
|
plain_enum_asserts(a, b);
|
||||||
if ((int)a == 0 || (int)b == 0) return 0;
|
if ((int)a == 0 || (int)b == 0) return 0;
|
||||||
if ((int)a == 1 || (int)b == 1) return 1;
|
if ((int)a == 1 || (int)b == 1) return 1;
|
||||||
@ -678,7 +678,7 @@ inline constexpr int min_size_prefer_dynamic(A a, B b) {
|
|||||||
* 0 and 3), it is not more than 3.
|
* 0 and 3), it is not more than 3.
|
||||||
*/
|
*/
|
||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
inline constexpr int min_size_prefer_fixed(A a, B b) {
|
constexpr int min_size_prefer_fixed(A a, B b) {
|
||||||
plain_enum_asserts(a, b);
|
plain_enum_asserts(a, b);
|
||||||
if ((int)a == 0 || (int)b == 0) return 0;
|
if ((int)a == 0 || (int)b == 0) return 0;
|
||||||
if ((int)a == 1 || (int)b == 1) return 1;
|
if ((int)a == 1 || (int)b == 1) return 1;
|
||||||
@ -690,7 +690,7 @@ inline constexpr int min_size_prefer_fixed(A a, B b) {
|
|||||||
|
|
||||||
/// \internal see `min_size_prefer_fixed`. No need for a separate variant for MaxSizes here.
|
/// \internal see `min_size_prefer_fixed`. No need for a separate variant for MaxSizes here.
|
||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
inline constexpr int max_size_prefer_dynamic(A a, B b) {
|
constexpr int max_size_prefer_dynamic(A a, B b) {
|
||||||
plain_enum_asserts(a, b);
|
plain_enum_asserts(a, b);
|
||||||
if ((int)a == Dynamic || (int)b == Dynamic) return Dynamic;
|
if ((int)a == Dynamic || (int)b == Dynamic) return Dynamic;
|
||||||
return plain_enum_max(a, b);
|
return plain_enum_max(a, b);
|
||||||
@ -710,38 +710,38 @@ inline constexpr bool enum_eq_not_dynamic(A a, B b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
inline constexpr bool enum_lt_not_dynamic(A a, B b) {
|
constexpr bool enum_lt_not_dynamic(A a, B b) {
|
||||||
plain_enum_asserts(a, b);
|
plain_enum_asserts(a, b);
|
||||||
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
||||||
return (int)a < (int)b;
|
return (int)a < (int)b;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
inline constexpr bool enum_le_not_dynamic(A a, B b) {
|
constexpr bool enum_le_not_dynamic(A a, B b) {
|
||||||
plain_enum_asserts(a, b);
|
plain_enum_asserts(a, b);
|
||||||
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
||||||
return (int)a <= (int)b;
|
return (int)a <= (int)b;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
inline constexpr bool enum_gt_not_dynamic(A a, B b) {
|
constexpr bool enum_gt_not_dynamic(A a, B b) {
|
||||||
plain_enum_asserts(a, b);
|
plain_enum_asserts(a, b);
|
||||||
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
||||||
return (int)a > (int)b;
|
return (int)a > (int)b;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
inline constexpr bool enum_ge_not_dynamic(A a, B b) {
|
constexpr bool enum_ge_not_dynamic(A a, B b) {
|
||||||
plain_enum_asserts(a, b);
|
plain_enum_asserts(a, b);
|
||||||
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
if ((int)a == Dynamic || (int)b == Dynamic) return false;
|
||||||
return (int)a >= (int)b;
|
return (int)a >= (int)b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \internal Calculate logical XOR at compile time
|
/// \internal Calculate logical XOR at compile time
|
||||||
inline constexpr bool logical_xor(bool a, bool b) { return a != b; }
|
constexpr bool logical_xor(bool a, bool b) { return a != b; }
|
||||||
|
|
||||||
/// \internal Calculate logical IMPLIES at compile time
|
/// \internal Calculate logical IMPLIES at compile time
|
||||||
inline constexpr bool check_implication(bool a, bool b) { return !a || b; }
|
constexpr bool check_implication(bool a, bool b) { return !a || b; }
|
||||||
|
|
||||||
/// \internal Provide fallback for std::is_constant_evaluated for pre-C++20.
|
/// \internal Provide fallback for std::is_constant_evaluated for pre-C++20.
|
||||||
#if EIGEN_COMP_CXXVER >= 20 && defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L
|
#if EIGEN_COMP_CXXVER >= 20 && defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L
|
||||||
|
@ -40,7 +40,7 @@ struct get_compiletime_reshape_size<AutoSize_t, OtherSize, TotalSize> {
|
|||||||
|
|
||||||
inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) { return total / other; }
|
inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) { return total / other; }
|
||||||
|
|
||||||
constexpr inline int get_compiletime_reshape_order(int flags, int order) {
|
constexpr int get_compiletime_reshape_order(int flags, int order) {
|
||||||
return order == AutoOrder ? flags & RowMajorBit : order;
|
return order == AutoOrder ? flags & RowMajorBit : order;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,8 +158,8 @@ class variable_if_dynamic {
|
|||||||
EIGEN_ONLY_USED_FOR_DEBUG(v);
|
EIGEN_ONLY_USED_FOR_DEBUG(v);
|
||||||
eigen_assert(v == T(Value));
|
eigen_assert(v == T(Value));
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value() { return T(Value); }
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr T value() { return T(Value); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR operator T() const { return T(Value); }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr operator T() const { return T(Value); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T v) const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T v) const {
|
||||||
EIGEN_ONLY_USED_FOR_DEBUG(v);
|
EIGEN_ONLY_USED_FOR_DEBUG(v);
|
||||||
eigen_assert(v == T(Value));
|
eigen_assert(v == T(Value));
|
||||||
@ -186,7 +186,7 @@ class variable_if_dynamicindex {
|
|||||||
EIGEN_ONLY_USED_FOR_DEBUG(v);
|
EIGEN_ONLY_USED_FOR_DEBUG(v);
|
||||||
eigen_assert(v == T(Value));
|
eigen_assert(v == T(Value));
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value() { return T(Value); }
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr T value() { return T(Value); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T) {}
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ struct find_packet_by_size<T, 1> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if EIGEN_MAX_STATIC_ALIGN_BYTES > 0
|
#if EIGEN_MAX_STATIC_ALIGN_BYTES > 0
|
||||||
constexpr inline int compute_default_alignment_helper(int ArrayBytes, int AlignmentBytes) {
|
constexpr int compute_default_alignment_helper(int ArrayBytes, int AlignmentBytes) {
|
||||||
if ((ArrayBytes % AlignmentBytes) == 0) {
|
if ((ArrayBytes % AlignmentBytes) == 0) {
|
||||||
return AlignmentBytes;
|
return AlignmentBytes;
|
||||||
} else if (EIGEN_MIN_ALIGN_BYTES < AlignmentBytes) {
|
} else if (EIGEN_MIN_ALIGN_BYTES < AlignmentBytes) {
|
||||||
@ -327,7 +327,7 @@ constexpr inline int compute_default_alignment_helper(int ArrayBytes, int Alignm
|
|||||||
#else
|
#else
|
||||||
// If static alignment is disabled, no need to bother.
|
// If static alignment is disabled, no need to bother.
|
||||||
// This also avoids a division by zero
|
// This also avoids a division by zero
|
||||||
constexpr inline int compute_default_alignment_helper(int ArrayBytes, int AlignmentBytes) {
|
constexpr int compute_default_alignment_helper(int ArrayBytes, int AlignmentBytes) {
|
||||||
EIGEN_UNUSED_VARIABLE(ArrayBytes);
|
EIGEN_UNUSED_VARIABLE(ArrayBytes);
|
||||||
EIGEN_UNUSED_VARIABLE(AlignmentBytes);
|
EIGEN_UNUSED_VARIABLE(AlignmentBytes);
|
||||||
return 0;
|
return 0;
|
||||||
@ -362,7 +362,7 @@ class make_proper_matrix_type {
|
|||||||
typedef Matrix<Scalar_, Rows_, Cols_, Options, MaxRows_, MaxCols_> type;
|
typedef Matrix<Scalar_, Rows_, Cols_, Options, MaxRows_, MaxCols_> type;
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr inline unsigned compute_matrix_flags(int Options) {
|
constexpr unsigned compute_matrix_flags(int Options) {
|
||||||
unsigned row_major_bit = Options & RowMajor ? RowMajorBit : 0;
|
unsigned row_major_bit = Options & RowMajor ? RowMajorBit : 0;
|
||||||
// FIXME currently we still have to handle DirectAccessBit at the expression level to handle DenseCoeffsBase<>
|
// FIXME currently we still have to handle DirectAccessBit at the expression level to handle DenseCoeffsBase<>
|
||||||
// and then propagate this information to the evaluator's flags.
|
// and then propagate this information to the evaluator's flags.
|
||||||
@ -370,7 +370,7 @@ constexpr inline unsigned compute_matrix_flags(int Options) {
|
|||||||
return DirectAccessBit | LvalueBit | NestByRefBit | row_major_bit;
|
return DirectAccessBit | LvalueBit | NestByRefBit | row_major_bit;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr inline int size_at_compile_time(int rows, int cols) {
|
constexpr int size_at_compile_time(int rows, int cols) {
|
||||||
if (rows == 0 || cols == 0) return 0;
|
if (rows == 0 || cols == 0) return 0;
|
||||||
if (rows == Dynamic || cols == Dynamic) return Dynamic;
|
if (rows == Dynamic || cols == Dynamic) return Dynamic;
|
||||||
return rows * cols;
|
return rows * cols;
|
||||||
|
@ -515,8 +515,8 @@ struct TridiagonalizationMatrixTReturnType : public ReturnByValue<Tridiagonaliza
|
|||||||
result.template diagonal<-1>() = m_matrix.template diagonal<-1>();
|
result.template diagonal<-1>() = m_matrix.template diagonal<-1>();
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
|
||||||
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typename MatrixType::Nested m_matrix;
|
typename MatrixType::Nested m_matrix;
|
||||||
|
@ -69,10 +69,10 @@ class Homogeneous : public MatrixBase<Homogeneous<MatrixType, Direction_> >, int
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC explicit inline Homogeneous(const MatrixType& matrix) : m_matrix(matrix) {}
|
EIGEN_DEVICE_FUNC explicit inline Homogeneous(const MatrixType& matrix) : m_matrix(matrix) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT {
|
||||||
return m_matrix.rows() + (int(Direction) == Vertical ? 1 : 0);
|
return m_matrix.rows() + (int(Direction) == Vertical ? 1 : 0);
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT {
|
||||||
return m_matrix.cols() + (int(Direction) == Horizontal ? 1 : 0);
|
return m_matrix.cols() + (int(Direction) == Horizontal ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,8 +244,8 @@ struct homogeneous_left_product_impl<Homogeneous<MatrixType, Vertical>, Lhs>
|
|||||||
EIGEN_DEVICE_FUNC homogeneous_left_product_impl(const Lhs& lhs, const MatrixType& rhs)
|
EIGEN_DEVICE_FUNC homogeneous_left_product_impl(const Lhs& lhs, const MatrixType& rhs)
|
||||||
: m_lhs(take_matrix_for_product<Lhs>::run(lhs)), m_rhs(rhs) {}
|
: m_lhs(take_matrix_for_product<Lhs>::run(lhs)), m_rhs(rhs) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); }
|
||||||
|
|
||||||
template <typename Dest>
|
template <typename Dest>
|
||||||
EIGEN_DEVICE_FUNC void evalTo(Dest& dst) const {
|
EIGEN_DEVICE_FUNC void evalTo(Dest& dst) const {
|
||||||
@ -275,8 +275,8 @@ struct homogeneous_right_product_impl<Homogeneous<MatrixType, Horizontal>, Rhs>
|
|||||||
typedef remove_all_t<typename Rhs::Nested> RhsNested;
|
typedef remove_all_t<typename Rhs::Nested> RhsNested;
|
||||||
EIGEN_DEVICE_FUNC homogeneous_right_product_impl(const MatrixType& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) {}
|
EIGEN_DEVICE_FUNC homogeneous_right_product_impl(const MatrixType& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); }
|
||||||
|
|
||||||
template <typename Dest>
|
template <typename Dest>
|
||||||
EIGEN_DEVICE_FUNC void evalTo(Dest& dst) const {
|
EIGEN_DEVICE_FUNC void evalTo(Dest& dst) const {
|
||||||
|
@ -57,22 +57,22 @@ class QuaternionBase : public RotationBase<Derived, 3> {
|
|||||||
typedef AngleAxis<Scalar> AngleAxisType;
|
typedef AngleAxis<Scalar> AngleAxisType;
|
||||||
|
|
||||||
/** \returns the \c x coefficient */
|
/** \returns the \c x coefficient */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline CoeffReturnType x() const { return this->derived().coeffs().coeff(0); }
|
EIGEN_DEVICE_FUNC constexpr CoeffReturnType x() const { return this->derived().coeffs().coeff(0); }
|
||||||
/** \returns the \c y coefficient */
|
/** \returns the \c y coefficient */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline CoeffReturnType y() const { return this->derived().coeffs().coeff(1); }
|
EIGEN_DEVICE_FUNC constexpr CoeffReturnType y() const { return this->derived().coeffs().coeff(1); }
|
||||||
/** \returns the \c z coefficient */
|
/** \returns the \c z coefficient */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline CoeffReturnType z() const { return this->derived().coeffs().coeff(2); }
|
EIGEN_DEVICE_FUNC constexpr CoeffReturnType z() const { return this->derived().coeffs().coeff(2); }
|
||||||
/** \returns the \c w coefficient */
|
/** \returns the \c w coefficient */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline CoeffReturnType w() const { return this->derived().coeffs().coeff(3); }
|
EIGEN_DEVICE_FUNC constexpr CoeffReturnType w() const { return this->derived().coeffs().coeff(3); }
|
||||||
|
|
||||||
/** \returns a reference to the \c x coefficient (if Derived is a non-const lvalue) */
|
/** \returns a reference to the \c x coefficient (if Derived is a non-const lvalue) */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline NonConstCoeffReturnType x() { return this->derived().coeffs().x(); }
|
EIGEN_DEVICE_FUNC constexpr NonConstCoeffReturnType x() { return this->derived().coeffs().x(); }
|
||||||
/** \returns a reference to the \c y coefficient (if Derived is a non-const lvalue) */
|
/** \returns a reference to the \c y coefficient (if Derived is a non-const lvalue) */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline NonConstCoeffReturnType y() { return this->derived().coeffs().y(); }
|
EIGEN_DEVICE_FUNC constexpr NonConstCoeffReturnType y() { return this->derived().coeffs().y(); }
|
||||||
/** \returns a reference to the \c z coefficient (if Derived is a non-const lvalue) */
|
/** \returns a reference to the \c z coefficient (if Derived is a non-const lvalue) */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline NonConstCoeffReturnType z() { return this->derived().coeffs().z(); }
|
EIGEN_DEVICE_FUNC constexpr NonConstCoeffReturnType z() { return this->derived().coeffs().z(); }
|
||||||
/** \returns a reference to the \c w coefficient (if Derived is a non-const lvalue) */
|
/** \returns a reference to the \c w coefficient (if Derived is a non-const lvalue) */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline NonConstCoeffReturnType w() { return this->derived().coeffs().w(); }
|
EIGEN_DEVICE_FUNC constexpr NonConstCoeffReturnType w() { return this->derived().coeffs().w(); }
|
||||||
|
|
||||||
/** \returns a read-only vector expression of the imaginary part (x,y,z) */
|
/** \returns a read-only vector expression of the imaginary part (x,y,z) */
|
||||||
EIGEN_DEVICE_FUNC inline const VectorBlock<const Coefficients, 3> vec() const { return coeffs().template head<3>(); }
|
EIGEN_DEVICE_FUNC inline const VectorBlock<const Coefficients, 3> vec() const { return coeffs().template head<3>(); }
|
||||||
|
@ -353,10 +353,10 @@ class Transform {
|
|||||||
inline QTransform toQTransform(void) const;
|
inline QTransform toQTransform(void) const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT {
|
||||||
return int(Mode) == int(Projective) ? m_matrix.cols() : (m_matrix.cols() - 1);
|
return int(Mode) == int(Projective) ? m_matrix.cols() : (m_matrix.cols() - 1);
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
|
||||||
|
|
||||||
/** shortcut for m_matrix(row,col);
|
/** shortcut for m_matrix(row,col);
|
||||||
* \sa MatrixBase::operator(Index,Index) const */
|
* \sa MatrixBase::operator(Index,Index) const */
|
||||||
|
@ -69,18 +69,18 @@ class Translation {
|
|||||||
EIGEN_DEVICE_FUNC explicit inline Translation(const VectorType& vector) : m_coeffs(vector) {}
|
EIGEN_DEVICE_FUNC explicit inline Translation(const VectorType& vector) : m_coeffs(vector) {}
|
||||||
|
|
||||||
/** \brief Returns the x-translation by value. **/
|
/** \brief Returns the x-translation by value. **/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar x() const { return m_coeffs.x(); }
|
EIGEN_DEVICE_FUNC constexpr Scalar x() const { return m_coeffs.x(); }
|
||||||
/** \brief Returns the y-translation by value. **/
|
/** \brief Returns the y-translation by value. **/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar y() const { return m_coeffs.y(); }
|
EIGEN_DEVICE_FUNC constexpr Scalar y() const { return m_coeffs.y(); }
|
||||||
/** \brief Returns the z-translation by value. **/
|
/** \brief Returns the z-translation by value. **/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar z() const { return m_coeffs.z(); }
|
EIGEN_DEVICE_FUNC constexpr Scalar z() const { return m_coeffs.z(); }
|
||||||
|
|
||||||
/** \brief Returns the x-translation as a reference. **/
|
/** \brief Returns the x-translation as a reference. **/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar& x() { return m_coeffs.x(); }
|
EIGEN_DEVICE_FUNC constexpr Scalar& x() { return m_coeffs.x(); }
|
||||||
/** \brief Returns the y-translation as a reference. **/
|
/** \brief Returns the y-translation as a reference. **/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar& y() { return m_coeffs.y(); }
|
EIGEN_DEVICE_FUNC constexpr Scalar& y() { return m_coeffs.y(); }
|
||||||
/** \brief Returns the z-translation as a reference. **/
|
/** \brief Returns the z-translation as a reference. **/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar& z() { return m_coeffs.z(); }
|
EIGEN_DEVICE_FUNC constexpr Scalar& z() { return m_coeffs.z(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC const VectorType& vector() const { return m_coeffs; }
|
EIGEN_DEVICE_FUNC const VectorType& vector() const { return m_coeffs; }
|
||||||
EIGEN_DEVICE_FUNC VectorType& vector() { return m_coeffs; }
|
EIGEN_DEVICE_FUNC VectorType& vector() { return m_coeffs; }
|
||||||
|
@ -183,7 +183,7 @@ class HouseholderSequence : public EigenBase<HouseholderSequence<VectorsType, Co
|
|||||||
* \returns Number of rows
|
* \returns Number of rows
|
||||||
* \details This equals the dimension of the space that the transformation acts on.
|
* \details This equals the dimension of the space that the transformation acts on.
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT {
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT {
|
||||||
return Side == OnTheLeft ? m_vectors.rows() : m_vectors.cols();
|
return Side == OnTheLeft ? m_vectors.rows() : m_vectors.cols();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ class HouseholderSequence : public EigenBase<HouseholderSequence<VectorsType, Co
|
|||||||
* \returns Number of columns
|
* \returns Number of columns
|
||||||
* \details This equals the dimension of the space that the transformation acts on.
|
* \details This equals the dimension of the space that the transformation acts on.
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return rows(); }
|
||||||
|
|
||||||
/** \brief Essential part of a Householder vector.
|
/** \brief Essential part of a Householder vector.
|
||||||
* \param[in] k Index of Householder reflection
|
* \param[in] k Index of Householder reflection
|
||||||
|
@ -51,8 +51,8 @@ class DiagonalPreconditioner {
|
|||||||
compute(mat);
|
compute(mat);
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_invdiag.size(); }
|
constexpr Index rows() const EIGEN_NOEXCEPT { return m_invdiag.size(); }
|
||||||
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_invdiag.size(); }
|
constexpr Index cols() const EIGEN_NOEXCEPT { return m_invdiag.size(); }
|
||||||
|
|
||||||
template <typename MatType>
|
template <typename MatType>
|
||||||
DiagonalPreconditioner& analyzePattern(const MatType&) {
|
DiagonalPreconditioner& analyzePattern(const MatType&) {
|
||||||
|
@ -84,10 +84,10 @@ class IncompleteCholesky : public SparseSolverBase<IncompleteCholesky<Scalar, Up
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** \returns number of rows of the factored matrix */
|
/** \returns number of rows of the factored matrix */
|
||||||
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_L.rows(); }
|
constexpr Index rows() const EIGEN_NOEXCEPT { return m_L.rows(); }
|
||||||
|
|
||||||
/** \returns number of columns of the factored matrix */
|
/** \returns number of columns of the factored matrix */
|
||||||
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_L.cols(); }
|
constexpr Index cols() const EIGEN_NOEXCEPT { return m_L.cols(); }
|
||||||
|
|
||||||
/** \brief Reports whether previous computation was successful.
|
/** \brief Reports whether previous computation was successful.
|
||||||
*
|
*
|
||||||
|
@ -135,9 +135,9 @@ class IncompleteLUT : public SparseSolverBase<IncompleteLUT<Scalar_, StorageInde
|
|||||||
/** \brief Extraction Method for U-Factor */
|
/** \brief Extraction Method for U-Factor */
|
||||||
const FactorType matrixU() const;
|
const FactorType matrixU() const;
|
||||||
|
|
||||||
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_lu.rows(); }
|
constexpr Index rows() const EIGEN_NOEXCEPT { return m_lu.rows(); }
|
||||||
|
|
||||||
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_lu.cols(); }
|
constexpr Index cols() const EIGEN_NOEXCEPT { return m_lu.cols(); }
|
||||||
|
|
||||||
/** \brief Reports whether previous computation was successful.
|
/** \brief Reports whether previous computation was successful.
|
||||||
*
|
*
|
||||||
@ -446,4 +446,4 @@ void IncompleteLUT<Scalar, StorageIndex>::factorize(const MatrixType_& amat) {
|
|||||||
|
|
||||||
} // end namespace Eigen
|
} // end namespace Eigen
|
||||||
|
|
||||||
#endif // EIGEN_INCOMPLETE_LUT_H
|
#endif // EIGEN_INCOMPLETE_LUT_H
|
||||||
|
@ -218,10 +218,10 @@ class IterativeSolverBase : public SparseSolverBase<Derived> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** \internal */
|
/** \internal */
|
||||||
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return matrix().rows(); }
|
constexpr Index rows() const EIGEN_NOEXCEPT { return matrix().rows(); }
|
||||||
|
|
||||||
/** \internal */
|
/** \internal */
|
||||||
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return matrix().cols(); }
|
constexpr Index cols() const EIGEN_NOEXCEPT { return matrix().cols(); }
|
||||||
|
|
||||||
/** \returns the tolerance threshold used by the stopping criteria.
|
/** \returns the tolerance threshold used by the stopping criteria.
|
||||||
* \sa setTolerance()
|
* \sa setTolerance()
|
||||||
|
@ -50,8 +50,8 @@ class SolveWithGuess : public internal::generic_xpr_base<SolveWithGuess<Decompos
|
|||||||
SolveWithGuess(const Decomposition &dec, const RhsType &rhs, const GuessType &guess)
|
SolveWithGuess(const Decomposition &dec, const RhsType &rhs, const GuessType &guess)
|
||||||
: m_dec(dec), m_rhs(rhs), m_guess(guess) {}
|
: m_dec(dec), m_rhs(rhs), m_guess(guess) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_dec.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_dec.cols(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC const Decomposition &dec() const { return m_dec; }
|
EIGEN_DEVICE_FUNC const Decomposition &dec() const { return m_dec; }
|
||||||
EIGEN_DEVICE_FUNC const RhsType &rhs() const { return m_rhs; }
|
EIGEN_DEVICE_FUNC const RhsType &rhs() const { return m_rhs; }
|
||||||
|
@ -100,8 +100,8 @@ class KLU : public SparseSolverBase<KLU<MatrixType_> > {
|
|||||||
if (m_numeric) klu_free_numeric(&m_numeric, &m_common);
|
if (m_numeric) klu_free_numeric(&m_numeric, &m_common);
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return mp_matrix.rows(); }
|
constexpr Index rows() const EIGEN_NOEXCEPT { return mp_matrix.rows(); }
|
||||||
EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return mp_matrix.cols(); }
|
constexpr Index cols() const EIGEN_NOEXCEPT { return mp_matrix.cols(); }
|
||||||
|
|
||||||
/** \brief Reports whether previous computation was successful.
|
/** \brief Reports whether previous computation was successful.
|
||||||
*
|
*
|
||||||
|
@ -391,8 +391,8 @@ class FullPivLU : public SolverBase<FullPivLU<MatrixType_, PermutationIndex_> >
|
|||||||
|
|
||||||
MatrixType reconstructedMatrix() const;
|
MatrixType reconstructedMatrix() const;
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_lu.rows(); }
|
EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_lu.rows(); }
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_lu.cols(); }
|
EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_lu.cols(); }
|
||||||
|
|
||||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||||
template <typename RhsType, typename DstType>
|
template <typename RhsType, typename DstType>
|
||||||
|
@ -210,8 +210,8 @@ class PartialPivLU : public SolverBase<PartialPivLU<MatrixType_, PermutationInde
|
|||||||
|
|
||||||
MatrixType reconstructedMatrix() const;
|
MatrixType reconstructedMatrix() const;
|
||||||
|
|
||||||
EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_lu.rows(); }
|
constexpr Index rows() const EIGEN_NOEXCEPT { return m_lu.rows(); }
|
||||||
EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_lu.cols(); }
|
constexpr Index cols() const EIGEN_NOEXCEPT { return m_lu.cols(); }
|
||||||
|
|
||||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||||
template <typename RhsType, typename DstType>
|
template <typename RhsType, typename DstType>
|
||||||
|
@ -75,7 +75,7 @@ EIGEN_ALWAYS_INLINE lapack_int to_lapack(Index index) { return convert_index<lap
|
|||||||
|
|
||||||
/// translates storage order of the given Eigen object to the corresponding lapack constant
|
/// translates storage order of the given Eigen object to the corresponding lapack constant
|
||||||
template <typename Derived>
|
template <typename Derived>
|
||||||
EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR lapack_int lapack_storage_of(const EigenBase<Derived> &) {
|
EIGEN_ALWAYS_INLINE constexpr lapack_int lapack_storage_of(const EigenBase<Derived> &) {
|
||||||
return Derived::IsRowMajor ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR;
|
return Derived::IsRowMajor ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1365,6 +1365,6 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical,
|
|||||||
* \sa subVector(Index)
|
* \sa subVector(Index)
|
||||||
*/
|
*/
|
||||||
template <DirectionType Direction>
|
template <DirectionType Direction>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index subVectors() const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index subVectors() const {
|
||||||
return (Direction == Vertical) ? cols() : rows();
|
return (Direction == Vertical) ? cols() : rows();
|
||||||
}
|
}
|
||||||
|
@ -45,19 +45,19 @@ namespace internal {
|
|||||||
template <typename Scalar, typename StorageIndex, StorageIndex NCWindow, StorageIndex CFactor, StorageIndex NCFactor>
|
template <typename Scalar, typename StorageIndex, StorageIndex NCWindow, StorageIndex CFactor, StorageIndex NCFactor>
|
||||||
struct TVPanelSize {
|
struct TVPanelSize {
|
||||||
// LocalThreadSizeC: determines total number of thread per workgroup for the contracting dimension
|
// LocalThreadSizeC: determines total number of thread per workgroup for the contracting dimension
|
||||||
static EIGEN_CONSTEXPR StorageIndex LocalThreadSizeC = EIGEN_SYCL_LOCAL_THREAD_DIM0;
|
static constexpr StorageIndex LocalThreadSizeC = EIGEN_SYCL_LOCAL_THREAD_DIM0;
|
||||||
// LocalThreadSizeNC: determines total number of thread per workgroup for the non-contracting dimension
|
// LocalThreadSizeNC: determines total number of thread per workgroup for the non-contracting dimension
|
||||||
static EIGEN_CONSTEXPR StorageIndex LocalThreadSizeNC = EIGEN_SYCL_LOCAL_THREAD_DIM1;
|
static constxpr StorageIndex LocalThreadSizeNC = EIGEN_SYCL_LOCAL_THREAD_DIM1;
|
||||||
// TileSizeDimNC: determines the tile size for the non-contracting dimension
|
// TileSizeDimNC: determines the tile size for the non-contracting dimension
|
||||||
static EIGEN_CONSTEXPR StorageIndex TileSizeDimNC = NCWindow / NCFactor;
|
static constexpr StorageIndex TileSizeDimNC = NCWindow / NCFactor;
|
||||||
// TileSizeDimC: determines the tile size for the contracting dimension
|
// TileSizeDimC: determines the tile size for the contracting dimension
|
||||||
static EIGEN_CONSTEXPR StorageIndex TileSizeDimC = CFactor * LocalThreadSizeNC * LocalThreadSizeC;
|
static constexpr StorageIndex TileSizeDimC = CFactor * LocalThreadSizeNC * LocalThreadSizeC;
|
||||||
// WorkLoadPerThreadNC : determines workload per thread for loading the non-contracting dimension
|
// WorkLoadPerThreadNC : determines workload per thread for loading the non-contracting dimension
|
||||||
static EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadNC = TileSizeDimNC / LocalThreadSizeNC;
|
static constexpr StorageIndex WorkLoadPerThreadNC = TileSizeDimNC / LocalThreadSizeNC;
|
||||||
// WorkLoadPerThreadC: determines workload per thread for loading the non-contracting dimension
|
// WorkLoadPerThreadC: determines workload per thread for loading the non-contracting dimension
|
||||||
static EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadC = TileSizeDimC / LocalThreadSizeC;
|
static constexpr StorageIndex WorkLoadPerThreadC = TileSizeDimC / LocalThreadSizeC;
|
||||||
// BC : determines if supporting bank conflict is required
|
// BC : determines if supporting bank conflict is required
|
||||||
static EIGEN_CONSTEXPR bool BC = false;
|
static constexpr bool BC = false;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -81,40 +81,40 @@ struct TVPanelSize {
|
|||||||
template <typename Scalar, typename StorageIndex, StorageIndex REG_SIZE_M, StorageIndex REG_SIZE_N, StorageIndex TSDK>
|
template <typename Scalar, typename StorageIndex, StorageIndex REG_SIZE_M, StorageIndex REG_SIZE_N, StorageIndex TSDK>
|
||||||
struct TTPanelSize {
|
struct TTPanelSize {
|
||||||
// TileSizeDimK: determines Tile size for dimension K. The packet size is assumed to be considered
|
// TileSizeDimK: determines Tile size for dimension K. The packet size is assumed to be considered
|
||||||
static EIGEN_CONSTEXPR StorageIndex TileSizeDimK = TSDK;
|
static constexpr StorageIndex TileSizeDimK = TSDK;
|
||||||
// WorkLoadPerThreadM : determines workload per thread for loading the M dimension This can be varied based on the
|
// WorkLoadPerThreadM : determines workload per thread for loading the M dimension This can be varied based on the
|
||||||
// available register on a chosen device(can be controlled by EIGEN_SYCL_REG_M macro//
|
// available register on a chosen device(can be controlled by EIGEN_SYCL_REG_M macro//
|
||||||
#ifndef EIGEN_SYCL_REG_M
|
#ifndef EIGEN_SYCL_REG_M
|
||||||
static EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadM = REG_SIZE_M;
|
static constexpr StorageIndex WorkLoadPerThreadM = REG_SIZE_M;
|
||||||
#else
|
#else
|
||||||
static EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadM = EIGEN_SYCL_REG_M;
|
static constexpr StorageIndex WorkLoadPerThreadM = EIGEN_SYCL_REG_M;
|
||||||
#endif
|
#endif
|
||||||
// WorkLoadPerThreadN : determines workload per thread for loading the N dimension This can be varied based on the
|
// WorkLoadPerThreadN : determines workload per thread for loading the N dimension This can be varied based on the
|
||||||
// available register on a chosen device(can be controlled by EIGEN_SYCL_REG_N macro
|
// available register on a chosen device(can be controlled by EIGEN_SYCL_REG_N macro
|
||||||
#ifndef EIGEN_SYCL_REG_N
|
#ifndef EIGEN_SYCL_REG_N
|
||||||
static EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadN = REG_SIZE_N;
|
static constexpr StorageIndex WorkLoadPerThreadN = REG_SIZE_N;
|
||||||
#else
|
#else
|
||||||
static EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadN = EIGEN_SYCL_REG_N;
|
static constexpr StorageIndex WorkLoadPerThreadN = EIGEN_SYCL_REG_N;
|
||||||
#endif
|
#endif
|
||||||
// LocalThreadSizeM: determines total number of thread per workgroup for the m dimension
|
// LocalThreadSizeM: determines total number of thread per workgroup for the m dimension
|
||||||
static EIGEN_CONSTEXPR StorageIndex LocalThreadSizeM = EIGEN_SYCL_LOCAL_THREAD_DIM0;
|
static constexpr StorageIndex LocalThreadSizeM = EIGEN_SYCL_LOCAL_THREAD_DIM0;
|
||||||
// LocalThreadSizeN: determines total number of thread per workgroup for the n dimension
|
// LocalThreadSizeN: determines total number of thread per workgroup for the n dimension
|
||||||
static EIGEN_CONSTEXPR StorageIndex LocalThreadSizeN = EIGEN_SYCL_LOCAL_THREAD_DIM1;
|
static constexpr StorageIndex LocalThreadSizeN = EIGEN_SYCL_LOCAL_THREAD_DIM1;
|
||||||
// TileSizeDimM: determines the tile size for the m dimension
|
// TileSizeDimM: determines the tile size for the m dimension
|
||||||
static EIGEN_CONSTEXPR StorageIndex TileSizeDimM = LocalThreadSizeM * WorkLoadPerThreadM;
|
static constexpr StorageIndex TileSizeDimM = LocalThreadSizeM * WorkLoadPerThreadM;
|
||||||
// TileSizeDimN: determines the tile size for the n dimension
|
// TileSizeDimN: determines the tile size for the n dimension
|
||||||
static EIGEN_CONSTEXPR StorageIndex TileSizeDimN = LocalThreadSizeN * WorkLoadPerThreadN;
|
static constexpr StorageIndex TileSizeDimN = LocalThreadSizeN * WorkLoadPerThreadN;
|
||||||
// LoadPerThreadLhs: determines workload per thread for loading Lhs Tensor. This must be divisible by packetsize
|
// LoadPerThreadLhs: determines workload per thread for loading Lhs Tensor. This must be divisible by packetsize
|
||||||
static EIGEN_CONSTEXPR StorageIndex LoadPerThreadLhs =
|
static constexpr StorageIndex LoadPerThreadLhs =
|
||||||
((TileSizeDimK * WorkLoadPerThreadM * WorkLoadPerThreadN) / (TileSizeDimN));
|
((TileSizeDimK * WorkLoadPerThreadM * WorkLoadPerThreadN) / (TileSizeDimN));
|
||||||
// LoadPerThreadRhs: determines workload per thread for loading Rhs Tensor. This must be divisible by packetsize
|
// LoadPerThreadRhs: determines workload per thread for loading Rhs Tensor. This must be divisible by packetsize
|
||||||
static EIGEN_CONSTEXPR StorageIndex LoadPerThreadRhs =
|
static constexpr StorageIndex LoadPerThreadRhs =
|
||||||
((TileSizeDimK * WorkLoadPerThreadM * WorkLoadPerThreadN) / (TileSizeDimM));
|
((TileSizeDimK * WorkLoadPerThreadM * WorkLoadPerThreadN) / (TileSizeDimM));
|
||||||
// BC : determines if supporting bank conflict is required
|
// BC : determines if supporting bank conflict is required
|
||||||
static EIGEN_CONSTEXPR bool BC = true;
|
static constexpr bool BC = true;
|
||||||
// DoubleBuffer: determines if double buffering technique should be used (This can be disabled by
|
// DoubleBuffer: determines if double buffering technique should be used (This can be disabled by
|
||||||
// EIGEN_SYCL_DISABLE_DOUBLE_BUFFER macro when the device does not have sufficient local memory)
|
// EIGEN_SYCL_DISABLE_DOUBLE_BUFFER macro when the device does not have sufficient local memory)
|
||||||
static EIGEN_CONSTEXPR bool DoubleBuffer =
|
static constexpr bool DoubleBuffer =
|
||||||
#ifdef EIGEN_SYCL_DISABLE_DOUBLE_BUFFER
|
#ifdef EIGEN_SYCL_DISABLE_DOUBLE_BUFFER
|
||||||
false;
|
false;
|
||||||
#else
|
#else
|
||||||
@ -220,7 +220,7 @@ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<!PacketLoad, Packe
|
|||||||
template <typename StorageIndex, StorageIndex ld, data_source dt, typename PacketType, typename DataScalar>
|
template <typename StorageIndex, StorageIndex ld, data_source dt, typename PacketType, typename DataScalar>
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<dt != data_source::global_mem, void> write(
|
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<dt != data_source::global_mem, void> write(
|
||||||
PacketType &packet_data, DataScalar ptr) {
|
PacketType &packet_data, DataScalar ptr) {
|
||||||
EIGEN_CONSTEXPR int PacketSize = Eigen::internal::unpacket_traits<PacketType>::size;
|
constexpr int PacketSize = Eigen::internal::unpacket_traits<PacketType>::size;
|
||||||
EIGEN_UNROLL_LOOP
|
EIGEN_UNROLL_LOOP
|
||||||
for (int i = 0; i < PacketSize; i++) {
|
for (int i = 0; i < PacketSize; i++) {
|
||||||
*ptr = PacketWrapper<PacketType, PacketSize>::scalarize(i, packet_data);
|
*ptr = PacketWrapper<PacketType, PacketSize>::scalarize(i, packet_data);
|
||||||
@ -320,14 +320,14 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool check_boundary<false>(bool cond) {
|
|||||||
*/
|
*/
|
||||||
template <bool is_transposed, bool is_rhs_, bool packet_load_, typename PacketType>
|
template <bool is_transposed, bool is_rhs_, bool packet_load_, typename PacketType>
|
||||||
struct BlockProperties {
|
struct BlockProperties {
|
||||||
static EIGEN_CONSTEXPR bool packet_load = packet_load_;
|
static constexpr bool packet_load = packet_load_;
|
||||||
typedef typename Eigen::internal::unpacket_traits<PacketType>::type OutScalar;
|
typedef typename Eigen::internal::unpacket_traits<PacketType>::type OutScalar;
|
||||||
static EIGEN_CONSTEXPR bool is_rhs = is_rhs_;
|
static constexpr bool is_rhs = is_rhs_;
|
||||||
typedef std::conditional_t<packet_load, PacketType, OutScalar> OutType;
|
typedef std::conditional_t<packet_load, PacketType, OutScalar> OutType;
|
||||||
static EIGEN_CONSTEXPR int elements_per_access = Eigen::internal::unpacket_traits<OutType>::size;
|
static constexpr int elements_per_access = Eigen::internal::unpacket_traits<OutType>::size;
|
||||||
static EIGEN_CONSTEXPR bool is_coalesced_layout = !(is_transposed ^ is_rhs);
|
static constexpr bool is_coalesced_layout = !(is_transposed ^ is_rhs);
|
||||||
static EIGEN_CONSTEXPR int nc_stride = (is_coalesced_layout ? elements_per_access : 1);
|
static constexpr int nc_stride = (is_coalesced_layout ? elements_per_access : 1);
|
||||||
static EIGEN_CONSTEXPR int c_stride = (is_coalesced_layout ? 1 : elements_per_access);
|
static constexpr int c_stride = (is_coalesced_layout ? 1 : elements_per_access);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -458,11 +458,11 @@ class TensorContractionKernel {
|
|||||||
public:
|
public:
|
||||||
typedef typename Eigen::TensorSycl::internal::Vectorise<OutScalar, Eigen::SyclDevice, Vectorizable>::PacketReturnType
|
typedef typename Eigen::TensorSycl::internal::Vectorise<OutScalar, Eigen::SyclDevice, Vectorizable>::PacketReturnType
|
||||||
PacketReturnType;
|
PacketReturnType;
|
||||||
static EIGEN_CONSTEXPR int PacketSize =
|
static constexpr int PacketSize =
|
||||||
Eigen::TensorSycl::internal::Vectorise<OutScalar, Eigen::SyclDevice, Vectorizable>::PacketSize;
|
Eigen::TensorSycl::internal::Vectorise<OutScalar, Eigen::SyclDevice, Vectorizable>::PacketSize;
|
||||||
static EIGEN_CONSTEXPR bool is_lhs_transposed =
|
static constexpr bool is_lhs_transposed =
|
||||||
!::Eigen::internal::TensorContractionInputMapperTrait<LhsMapper>::inner_dim_contiguous;
|
!::Eigen::internal::TensorContractionInputMapperTrait<LhsMapper>::inner_dim_contiguous;
|
||||||
static EIGEN_CONSTEXPR bool is_rhs_transposed =
|
static constexpr bool is_rhs_transposed =
|
||||||
!::Eigen::internal::TensorContractionInputMapperTrait<RhsMapper>::inner_dim_contiguous;
|
!::Eigen::internal::TensorContractionInputMapperTrait<RhsMapper>::inner_dim_contiguous;
|
||||||
|
|
||||||
typedef BlockProperties<is_lhs_transposed, false, input_mapper_properties::is_lhs_matrix && Vectorizable,
|
typedef BlockProperties<is_lhs_transposed, false, input_mapper_properties::is_lhs_matrix && Vectorizable,
|
||||||
@ -473,20 +473,20 @@ class TensorContractionKernel {
|
|||||||
PacketReturnType>
|
PacketReturnType>
|
||||||
RHSBlockProperties;
|
RHSBlockProperties;
|
||||||
|
|
||||||
static EIGEN_CONSTEXPR StorageIndex NStride =
|
static constexpr StorageIndex NStride =
|
||||||
contraction_tp == contraction_type::local ? Properties::WorkLoadPerThreadN : RHSBlockProperties::nc_stride;
|
contraction_tp == contraction_type::local ? Properties::WorkLoadPerThreadN : RHSBlockProperties::nc_stride;
|
||||||
|
|
||||||
typedef cl::sycl::accessor<OutScalar, 1, cl::sycl::access::mode::read_write, cl::sycl::access::target::local> Scratch;
|
typedef cl::sycl::accessor<OutScalar, 1, cl::sycl::access::mode::read_write, cl::sycl::access::target::local> Scratch;
|
||||||
typedef cl::sycl::multi_ptr<OutScalar, cl::sycl::access::address_space::local_space> local_ptr;
|
typedef cl::sycl::multi_ptr<OutScalar, cl::sycl::access::address_space::local_space> local_ptr;
|
||||||
typedef OutScalar * /*cl::sycl::multi_ptr<OutScalar, cl::sycl::access::address_space::private_space>*/ private_ptr;
|
typedef OutScalar * /*cl::sycl::multi_ptr<OutScalar, cl::sycl::access::address_space::private_space>*/ private_ptr;
|
||||||
typedef std::conditional_t<contraction_tp == contraction_type::local, local_ptr, private_ptr> tile_ptr;
|
typedef std::conditional_t<contraction_tp == contraction_type::local, local_ptr, private_ptr> tile_ptr;
|
||||||
static EIGEN_CONSTEXPR StorageIndex LSDL = contraction_tp == contraction_type::local
|
static constexpr StorageIndex LSDL = contraction_tp == contraction_type::local
|
||||||
? Properties::TileSizeDimM + Properties::BC
|
? Properties::TileSizeDimM + Properties::BC
|
||||||
: Properties::WorkLoadPerThreadM;
|
: Properties::WorkLoadPerThreadM;
|
||||||
static EIGEN_CONSTEXPR StorageIndex LSDR = contraction_tp == contraction_type::local
|
static constexpr StorageIndex LSDR = contraction_tp == contraction_type::local
|
||||||
? Properties::TileSizeDimN + Properties::BC
|
? Properties::TileSizeDimN + Properties::BC
|
||||||
: Properties::WorkLoadPerThreadN;
|
: Properties::WorkLoadPerThreadN;
|
||||||
static EIGEN_CONSTEXPR StorageIndex LocalOffset = Properties::LocalThreadSizeM * Properties::LocalThreadSizeN;
|
static constexpr StorageIndex LocalOffset = Properties::LocalThreadSizeM * Properties::LocalThreadSizeN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief MemHolder this is a place holder struct for creating memory hierarchy in SYCL. Inside SYCL kernel it is not
|
* \brief MemHolder this is a place holder struct for creating memory hierarchy in SYCL. Inside SYCL kernel it is not
|
||||||
@ -638,7 +638,7 @@ class TensorContractionKernel {
|
|||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void compute_block_per_tile(OutScalar *lhs_block_ptr, OutScalar *rhs_block_ptr,
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void compute_block_per_tile(OutScalar *lhs_block_ptr, OutScalar *rhs_block_ptr,
|
||||||
PacketReturnType *privateRes) const {
|
PacketReturnType *privateRes) const {
|
||||||
StorageIndex idx = 0;
|
StorageIndex idx = 0;
|
||||||
EIGEN_CONSTEXPR StorageIndex lhs_stride =
|
constexpr StorageIndex lhs_stride =
|
||||||
contraction_tp == contraction_type::local ? (PacketSize * Properties::LocalThreadSizeM) : 1;
|
contraction_tp == contraction_type::local ? (PacketSize * Properties::LocalThreadSizeM) : 1;
|
||||||
EIGEN_UNROLL_LOOP
|
EIGEN_UNROLL_LOOP
|
||||||
for (StorageIndex wLPTN = 0; wLPTN < Properties::WorkLoadPerThreadN; wLPTN++) {
|
for (StorageIndex wLPTN = 0; wLPTN < Properties::WorkLoadPerThreadN; wLPTN++) {
|
||||||
@ -668,8 +668,7 @@ class TensorContractionKernel {
|
|||||||
// when local memory is not used M and N are both accessed in a coalesced way. However, when local memory is
|
// when local memory is not used M and N are both accessed in a coalesced way. However, when local memory is
|
||||||
// available the k*N is transposed in the local to N*K therefore, each blocks operates on blockId*
|
// available the k*N is transposed in the local to N*K therefore, each blocks operates on blockId*
|
||||||
// WorkLoadPerThreadN slice of N
|
// WorkLoadPerThreadN slice of N
|
||||||
EIGEN_CONSTEXPR StorageIndex GlobalNStride =
|
constexpr StorageIndex GlobalNStride = contraction_tp == contraction_type::local ? 1 : Properties::LocalThreadSizeN;
|
||||||
contraction_tp == contraction_type::local ? 1 : Properties::LocalThreadSizeN;
|
|
||||||
EIGEN_UNROLL_LOOP
|
EIGEN_UNROLL_LOOP
|
||||||
for (StorageIndex wLPTN = 0; wLPTN < Properties::WorkLoadPerThreadN / PrivateNStride; wLPTN++) {
|
for (StorageIndex wLPTN = 0; wLPTN < Properties::WorkLoadPerThreadN / PrivateNStride; wLPTN++) {
|
||||||
// output leading dimension
|
// output leading dimension
|
||||||
@ -713,9 +712,9 @@ class TensorContractionKernel {
|
|||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<contract_tp == contraction_type::no_local> extract_block(
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<contract_tp == contraction_type::no_local> extract_block(
|
||||||
const Input &inpt, PrivateReg private_ptr, const std::pair<StorageIndex, StorageIndex> &,
|
const Input &inpt, PrivateReg private_ptr, const std::pair<StorageIndex, StorageIndex> &,
|
||||||
const StorageIndex &ncOffset, const StorageIndex cOffset) const {
|
const StorageIndex &ncOffset, const StorageIndex cOffset) const {
|
||||||
EIGEN_CONSTEXPR StorageIndex LocalThreadSizeNC =
|
constexpr StorageIndex LocalThreadSizeNC =
|
||||||
InputBlockProperties::is_rhs ? Properties::LocalThreadSizeN : Properties::LocalThreadSizeM;
|
InputBlockProperties::is_rhs ? Properties::LocalThreadSizeN : Properties::LocalThreadSizeM;
|
||||||
EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadNC =
|
constexpr StorageIndex WorkLoadPerThreadNC =
|
||||||
InputBlockProperties::is_rhs ? Properties::WorkLoadPerThreadN : Properties::WorkLoadPerThreadM;
|
InputBlockProperties::is_rhs ? Properties::WorkLoadPerThreadN : Properties::WorkLoadPerThreadM;
|
||||||
const StorageIndex &NC = InputBlockProperties::is_rhs ? triple_dim.N : triple_dim.M;
|
const StorageIndex &NC = InputBlockProperties::is_rhs ? triple_dim.N : triple_dim.M;
|
||||||
|
|
||||||
@ -891,11 +890,11 @@ class TensorContractionKernel {
|
|||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<contract_tp == contraction_type::local> extract_block(
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<contract_tp == contraction_type::local> extract_block(
|
||||||
const Input &inpt, Local local_ptr, const std::pair<StorageIndex, StorageIndex> &local_index,
|
const Input &inpt, Local local_ptr, const std::pair<StorageIndex, StorageIndex> &local_index,
|
||||||
const StorageIndex &ncOffset, const StorageIndex cOffset) const {
|
const StorageIndex &ncOffset, const StorageIndex cOffset) const {
|
||||||
EIGEN_CONSTEXPR StorageIndex TileSizeDimNC =
|
constexpr StorageIndex TileSizeDimNC =
|
||||||
InputBlockProperties::is_rhs ? Properties::TileSizeDimN : Properties::TileSizeDimM;
|
InputBlockProperties::is_rhs ? Properties::TileSizeDimN : Properties::TileSizeDimM;
|
||||||
EIGEN_CONSTEXPR StorageIndex LoadPerThread =
|
constexpr StorageIndex LoadPerThread =
|
||||||
InputBlockProperties::is_rhs ? Properties::LoadPerThreadRhs : Properties::LoadPerThreadLhs;
|
InputBlockProperties::is_rhs ? Properties::LoadPerThreadRhs : Properties::LoadPerThreadLhs;
|
||||||
EIGEN_CONSTEXPR StorageIndex LSD = InputBlockProperties::is_rhs ? LSDR : LSDL;
|
constexpr StorageIndex LSD = InputBlockProperties::is_rhs ? LSDR : LSDL;
|
||||||
static_assert(((LocalOffset % (TileSizeDimNC / InputBlockProperties::nc_stride) == 0) &&
|
static_assert(((LocalOffset % (TileSizeDimNC / InputBlockProperties::nc_stride) == 0) &&
|
||||||
(LocalOffset % (Properties::TileSizeDimK / InputBlockProperties::c_stride) == 0)),
|
(LocalOffset % (Properties::TileSizeDimK / InputBlockProperties::c_stride) == 0)),
|
||||||
" LocalOffset must be divisible by stride");
|
" LocalOffset must be divisible by stride");
|
||||||
@ -995,11 +994,11 @@ template <typename OutScalar, typename OutAccessor, typename VectorMapper, typen
|
|||||||
struct GeneralVectorTensor {
|
struct GeneralVectorTensor {
|
||||||
typedef typename Eigen::TensorSycl::internal::Vectorise<OutScalar, Eigen::SyclDevice, Vectorizable>::PacketReturnType
|
typedef typename Eigen::TensorSycl::internal::Vectorise<OutScalar, Eigen::SyclDevice, Vectorizable>::PacketReturnType
|
||||||
PacketReturnType;
|
PacketReturnType;
|
||||||
static EIGEN_CONSTEXPR int PacketSize =
|
static constexpr int PacketSize =
|
||||||
Eigen::TensorSycl::internal::Vectorise<OutScalar, Eigen::SyclDevice, Vectorizable>::PacketSize;
|
Eigen::TensorSycl::internal::Vectorise<OutScalar, Eigen::SyclDevice, Vectorizable>::PacketSize;
|
||||||
typedef cl::sycl::accessor<OutScalar, 1, cl::sycl::access::mode::read_write, cl::sycl::access::target::local> Scratch;
|
typedef cl::sycl::accessor<OutScalar, 1, cl::sycl::access::mode::read_write, cl::sycl::access::target::local> Scratch;
|
||||||
|
|
||||||
static EIGEN_CONSTEXPR StorageIndex OutScratchOffset =
|
static constexpr StorageIndex OutScratchOffset =
|
||||||
KFactor * Properties::LocalThreadSizeC * Properties::LocalThreadSizeNC;
|
KFactor * Properties::LocalThreadSizeC * Properties::LocalThreadSizeNC;
|
||||||
|
|
||||||
// Since the access layout for a vector can always be coalesced, when LHS is a vector, we pass false and false to make
|
// Since the access layout for a vector can always be coalesced, when LHS is a vector, we pass false and false to make
|
||||||
@ -1328,8 +1327,8 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
|
|||||||
|
|
||||||
template <bool lhs_inner_dim_contiguous, bool rhs_inner_dim_contiguous, bool rhs_inner_dim_reordered>
|
template <bool lhs_inner_dim_contiguous, bool rhs_inner_dim_contiguous, bool rhs_inner_dim_reordered>
|
||||||
struct input_mapper_propertis {
|
struct input_mapper_propertis {
|
||||||
static EIGEN_CONSTEXPR bool is_lhs_matrix = (LDims == 2 && ContractDims == 1) || lhs_inner_dim_contiguous;
|
static constexpr bool is_lhs_matrix = (LDims == 2 && ContractDims == 1) || lhs_inner_dim_contiguous;
|
||||||
static EIGEN_CONSTEXPR bool is_rhs_matrix =
|
static constexpr bool is_rhs_matrix =
|
||||||
(RDims == 2 && ContractDims == 1) || (rhs_inner_dim_contiguous && !rhs_inner_dim_reordered);
|
(RDims == 2 && ContractDims == 1) || (rhs_inner_dim_contiguous && !rhs_inner_dim_reordered);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1537,9 +1536,9 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
|
|||||||
void EIGEN_ALWAYS_INLINE LaunchVT(EvaluatorPointerType buffer, const VectorMapper &vec, const TensorMapper &mat,
|
void EIGEN_ALWAYS_INLINE LaunchVT(EvaluatorPointerType buffer, const VectorMapper &vec, const TensorMapper &mat,
|
||||||
StorageIndex NC, StorageIndex C) const {
|
StorageIndex NC, StorageIndex C) const {
|
||||||
const StorageIndex nonContractDim = NC;
|
const StorageIndex nonContractDim = NC;
|
||||||
EIGEN_CONSTEXPR StorageIndex NCFactor = 1;
|
constexpr StorageIndex NCFactor = 1;
|
||||||
EIGEN_CONSTEXPR StorageIndex CFactor = 1;
|
constexpr StorageIndex CFactor = 1;
|
||||||
EIGEN_CONSTEXPR StorageIndex NCWindow = 16;
|
constexpr StorageIndex NCWindow = 16;
|
||||||
typedef Eigen::TensorSycl::internal::TVPanelSize<CoeffReturnType, StorageIndex, NCWindow, CFactor, NCFactor>
|
typedef Eigen::TensorSycl::internal::TVPanelSize<CoeffReturnType, StorageIndex, NCWindow, CFactor, NCFactor>
|
||||||
Properties;
|
Properties;
|
||||||
const StorageIndex roundUpC = Eigen::TensorSycl::internal::roundUp(C, Properties::TileSizeDimC);
|
const StorageIndex roundUpC = Eigen::TensorSycl::internal::roundUp(C, Properties::TileSizeDimC);
|
||||||
@ -1601,7 +1600,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
|
|||||||
(EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1 - 1)),
|
(EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1 - 1)),
|
||||||
"The Local thread size must be a power of 2 for the reduction "
|
"The Local thread size must be a power of 2 for the reduction "
|
||||||
"operation");
|
"operation");
|
||||||
EIGEN_CONSTEXPR StorageIndex local_range = EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1;
|
constexpr StorageIndex local_range = EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1;
|
||||||
|
|
||||||
// Here we force the code not to be more than 2-step reduction: Our empirical research shows that if each thread
|
// Here we force the code not to be more than 2-step reduction: Our empirical research shows that if each thread
|
||||||
// reduces at least 512 elementss individually, we get better performance.
|
// reduces at least 512 elementss individually, we get better performance.
|
||||||
|
@ -42,10 +42,10 @@ struct NumTraits<type2index<n>> {
|
|||||||
typedef Index Real;
|
typedef Index Real;
|
||||||
enum { IsComplex = 0, RequireInitialization = false, ReadCost = 1, AddCost = 1, MulCost = 1 };
|
enum { IsComplex = 0, RequireInitialization = false, ReadCost = 1, AddCost = 1, MulCost = 1 };
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real epsilon() { return 0; }
|
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Real epsilon() { return 0; }
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real dummy_precision() { return 0; }
|
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Real dummy_precision() { return 0; }
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real highest() { return n; }
|
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Real highest() { return n; }
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real lowest() { return n; }
|
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Real lowest() { return n; }
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
@ -569,47 +569,47 @@ struct index_pair_second_statically_eq_impl<const IndexPairList<FirstType, Other
|
|||||||
namespace Eigen {
|
namespace Eigen {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_known_statically(Index i) {
|
static EIGEN_DEVICE_FUNC constexpr bool index_known_statically(Index i) {
|
||||||
return index_known_statically_impl<T>::run(i);
|
return index_known_statically_impl<T>::run(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool all_indices_known_statically() {
|
static EIGEN_DEVICE_FUNC constexpr bool all_indices_known_statically() {
|
||||||
return all_indices_known_statically_impl<T>::run();
|
return all_indices_known_statically_impl<T>::run();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool indices_statically_known_to_increase() {
|
static EIGEN_DEVICE_FUNC constexpr bool indices_statically_known_to_increase() {
|
||||||
return indices_statically_known_to_increase_impl<T>::run();
|
return indices_statically_known_to_increase_impl<T>::run();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_eq(Index i, Index value) {
|
static EIGEN_DEVICE_FUNC constexpr bool index_statically_eq(Index i, Index value) {
|
||||||
return index_statically_eq_impl<T>::run(i, value);
|
return index_statically_eq_impl<T>::run(i, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_ne(Index i, Index value) {
|
static EIGEN_DEVICE_FUNC constexpr bool index_statically_ne(Index i, Index value) {
|
||||||
return index_statically_ne_impl<T>::run(i, value);
|
return index_statically_ne_impl<T>::run(i, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_gt(Index i, Index value) {
|
static EIGEN_DEVICE_FUNC constexpr bool index_statically_gt(Index i, Index value) {
|
||||||
return index_statically_gt_impl<T>::run(i, value);
|
return index_statically_gt_impl<T>::run(i, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_lt(Index i, Index value) {
|
static EIGEN_DEVICE_FUNC constexpr bool index_statically_lt(Index i, Index value) {
|
||||||
return index_statically_lt_impl<T>::run(i, value);
|
return index_statically_lt_impl<T>::run(i, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_pair_first_statically_eq(Index i, Index value) {
|
static EIGEN_DEVICE_FUNC constexpr bool index_pair_first_statically_eq(Index i, Index value) {
|
||||||
return index_pair_first_statically_eq_impl<T>::run(i, value);
|
return index_pair_first_statically_eq_impl<T>::run(i, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_pair_second_statically_eq(Index i, Index value) {
|
static EIGEN_DEVICE_FUNC constexpr bool index_pair_second_statically_eq(Index i, Index value) {
|
||||||
return index_pair_second_statically_eq_impl<T>::run(i, value);
|
return index_pair_second_statically_eq_impl<T>::run(i, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,9 +212,9 @@ struct Pair {
|
|||||||
typedef U first_type;
|
typedef U first_type;
|
||||||
typedef V second_type;
|
typedef V second_type;
|
||||||
|
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Pair() : first(), second() {}
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Pair() : first(), second() {}
|
||||||
|
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Pair(const U& f, const V& s) : first(f), second(s) {}
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Pair(const U& f, const V& s) : first(f), second(s) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(Pair& rhs) {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(Pair& rhs) {
|
||||||
using numext::swap;
|
using numext::swap;
|
||||||
@ -224,20 +224,20 @@ struct Pair {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename U, typename V>
|
template <typename U, typename V>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator==(const Pair<U, V>& x, const Pair<U, V>& y) {
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator==(const Pair<U, V>& x, const Pair<U, V>& y) {
|
||||||
return (x.first == y.first && x.second == y.second);
|
return (x.first == y.first && x.second == y.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename U, typename V>
|
template <typename U, typename V>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator!=(const Pair<U, V>& x, const Pair<U, V>& y) {
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator!=(const Pair<U, V>& x, const Pair<U, V>& y) {
|
||||||
return !(x == y);
|
return !(x == y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can't use std::pairs on cuda devices
|
// Can't use std::pairs on cuda devices
|
||||||
template <typename Idx>
|
template <typename Idx>
|
||||||
struct IndexPair {
|
struct IndexPair {
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair() : first(0), second(0) {}
|
constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair() : first(0), second(0) {}
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair(Idx f, Idx s) : first(f), second(s) {}
|
constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair(Idx f, Idx s) : first(f), second(s) {}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC void set(IndexPair<Idx> val) {
|
EIGEN_DEVICE_FUNC void set(IndexPair<Idx> val) {
|
||||||
first = val.first;
|
first = val.first;
|
||||||
@ -251,19 +251,18 @@ struct IndexPair {
|
|||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <typename IndexType, typename Index, Index First, Index... Is>
|
template <typename IndexType, typename Index, Index First, Index... Is>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array<Index, 1 + sizeof...(Is)> customIndices2Array(
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array<Index, 1 + sizeof...(Is)> customIndices2Array(
|
||||||
IndexType& idx, numeric_list<Index, First, Is...>) {
|
IndexType& idx, numeric_list<Index, First, Is...>) {
|
||||||
return {static_cast<Index>(idx[First]), static_cast<Index>(idx[Is])...};
|
return {static_cast<Index>(idx[First]), static_cast<Index>(idx[Is])...};
|
||||||
}
|
}
|
||||||
template <typename IndexType, typename Index>
|
template <typename IndexType, typename Index>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array<Index, 0> customIndices2Array(IndexType&,
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array<Index, 0> customIndices2Array(IndexType&, numeric_list<Index>) {
|
||||||
numeric_list<Index>) {
|
|
||||||
return array<Index, 0>();
|
return array<Index, 0>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Make an array (for index/dimensions) out of a custom index */
|
/** Make an array (for index/dimensions) out of a custom index */
|
||||||
template <typename Index, std::size_t NumIndices, typename IndexType>
|
template <typename Index, std::size_t NumIndices, typename IndexType>
|
||||||
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array<Index, NumIndices> customIndices2Array(IndexType& idx) {
|
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array<Index, NumIndices> customIndices2Array(IndexType& idx) {
|
||||||
return customIndices2Array(idx, typename gen_numeric_list<Index, NumIndices>::type{});
|
return customIndices2Array(idx, typename gen_numeric_list<Index, NumIndices>::type{});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,9 +402,9 @@ struct SecondStepPartialReduction {
|
|||||||
|
|
||||||
template <typename Index, Index LTP, Index LTR, bool BC_>
|
template <typename Index, Index LTP, Index LTR, bool BC_>
|
||||||
struct ReductionPannel {
|
struct ReductionPannel {
|
||||||
static EIGEN_CONSTEXPR Index LocalThreadSizeP = LTP;
|
static constexpr Index LocalThreadSizeP = LTP;
|
||||||
static EIGEN_CONSTEXPR Index LocalThreadSizeR = LTR;
|
static constexpr Index LocalThreadSizeR = LTR;
|
||||||
static EIGEN_CONSTEXPR bool BC = BC_;
|
static constexpr bool BC = BC_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Self, typename Op, TensorSycl::internal::reduction_dim rt>
|
template <typename Self, typename Op, TensorSycl::internal::reduction_dim rt>
|
||||||
@ -430,7 +430,7 @@ struct PartialReducerLauncher {
|
|||||||
"The Local thread size must be a power of 2 for the reduction "
|
"The Local thread size must be a power of 2 for the reduction "
|
||||||
"operation");
|
"operation");
|
||||||
|
|
||||||
EIGEN_CONSTEXPR Index localRange = PannelParameters::LocalThreadSizeP * PannelParameters::LocalThreadSizeR;
|
constexpr Index localRange = PannelParameters::LocalThreadSizeP * PannelParameters::LocalThreadSizeR;
|
||||||
// In this step, we force the code not to be more than 2-step reduction:
|
// In this step, we force the code not to be more than 2-step reduction:
|
||||||
// Our empirical research shows that if each thread reduces at least 64
|
// Our empirical research shows that if each thread reduces at least 64
|
||||||
// elements individually, we get better performance. However, this can change
|
// elements individually, we get better performance. However, this can change
|
||||||
@ -445,7 +445,7 @@ struct PartialReducerLauncher {
|
|||||||
const Index rNumGroups = num_coeffs_to_reduce > reductionPerThread * localRange ? std::min(rGroups, localRange) : 1;
|
const Index rNumGroups = num_coeffs_to_reduce > reductionPerThread * localRange ? std::min(rGroups, localRange) : 1;
|
||||||
const Index globalRange = pNumGroups * rNumGroups * localRange;
|
const Index globalRange = pNumGroups * rNumGroups * localRange;
|
||||||
|
|
||||||
EIGEN_CONSTEXPR Index scratchSize =
|
constexpr Index scratchSize =
|
||||||
PannelParameters::LocalThreadSizeR * (PannelParameters::LocalThreadSizeP + PannelParameters::BC);
|
PannelParameters::LocalThreadSizeR * (PannelParameters::LocalThreadSizeP + PannelParameters::BC);
|
||||||
auto thread_range = cl::sycl::nd_range<1>(cl::sycl::range<1>(globalRange), cl::sycl::range<1>(localRange));
|
auto thread_range = cl::sycl::nd_range<1>(cl::sycl::range<1>(globalRange), cl::sycl::range<1>(localRange));
|
||||||
if (rNumGroups > 1) {
|
if (rNumGroups > 1) {
|
||||||
@ -482,15 +482,15 @@ template <typename Self, typename Op, bool Vectorizable>
|
|||||||
struct FullReducer<Self, Op, Eigen::SyclDevice, Vectorizable> {
|
struct FullReducer<Self, Op, Eigen::SyclDevice, Vectorizable> {
|
||||||
typedef typename Self::CoeffReturnType CoeffReturnType;
|
typedef typename Self::CoeffReturnType CoeffReturnType;
|
||||||
typedef typename Self::EvaluatorPointerType EvaluatorPointerType;
|
typedef typename Self::EvaluatorPointerType EvaluatorPointerType;
|
||||||
static EIGEN_CONSTEXPR bool HasOptimizedImplementation = true;
|
static constexpr bool HasOptimizedImplementation = true;
|
||||||
static EIGEN_CONSTEXPR int PacketSize = Self::PacketAccess ? Self::PacketSize : 1;
|
static constexpr int PacketSize = Self::PacketAccess ? Self::PacketSize : 1;
|
||||||
static void run(const Self &self, Op &reducer, const Eigen::SyclDevice &dev, EvaluatorPointerType data) {
|
static void run(const Self &self, Op &reducer, const Eigen::SyclDevice &dev, EvaluatorPointerType data) {
|
||||||
typedef std::conditional_t<Self::PacketAccess, typename Self::PacketReturnType, CoeffReturnType> OutType;
|
typedef std::conditional_t<Self::PacketAccess, typename Self::PacketReturnType, CoeffReturnType> OutType;
|
||||||
static_assert(!((EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1) &
|
static_assert(!((EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1) &
|
||||||
(EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1 - 1)),
|
(EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1 - 1)),
|
||||||
"The Local thread size must be a power of 2 for the reduction "
|
"The Local thread size must be a power of 2 for the reduction "
|
||||||
"operation");
|
"operation");
|
||||||
EIGEN_CONSTEXPR Index local_range = EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1;
|
constexpr Index local_range = EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1;
|
||||||
|
|
||||||
typename Self::Index inputSize = self.impl().dimensions().TotalSize();
|
typename Self::Index inputSize = self.impl().dimensions().TotalSize();
|
||||||
// In this step we force the code not to be more than 2-step reduction:
|
// In this step we force the code not to be more than 2-step reduction:
|
||||||
@ -535,7 +535,7 @@ struct FullReducer<Self, Op, Eigen::SyclDevice, Vectorizable> {
|
|||||||
// col reduction
|
// col reduction
|
||||||
template <typename Self, typename Op>
|
template <typename Self, typename Op>
|
||||||
struct OuterReducer<Self, Op, Eigen::SyclDevice> {
|
struct OuterReducer<Self, Op, Eigen::SyclDevice> {
|
||||||
static EIGEN_CONSTEXPR bool HasOptimizedImplementation = true;
|
static constexpr bool HasOptimizedImplementation = true;
|
||||||
|
|
||||||
static bool run(const Self &self, const Op &reducer, const Eigen::SyclDevice &dev,
|
static bool run(const Self &self, const Op &reducer, const Eigen::SyclDevice &dev,
|
||||||
typename Self::EvaluatorPointerType output, typename Self::Index num_coeffs_to_reduce,
|
typename Self::EvaluatorPointerType output, typename Self::Index num_coeffs_to_reduce,
|
||||||
@ -549,7 +549,7 @@ struct OuterReducer<Self, Op, Eigen::SyclDevice> {
|
|||||||
// row reduction
|
// row reduction
|
||||||
template <typename Self, typename Op>
|
template <typename Self, typename Op>
|
||||||
struct InnerReducer<Self, Op, Eigen::SyclDevice> {
|
struct InnerReducer<Self, Op, Eigen::SyclDevice> {
|
||||||
static EIGEN_CONSTEXPR bool HasOptimizedImplementation = true;
|
static constexpr bool HasOptimizedImplementation = true;
|
||||||
|
|
||||||
static bool run(const Self &self, const Op &reducer, const Eigen::SyclDevice &dev,
|
static bool run(const Self &self, const Op &reducer, const Eigen::SyclDevice &dev,
|
||||||
typename Self::EvaluatorPointerType output, typename Self::Index num_coeffs_to_reduce,
|
typename Self::EvaluatorPointerType output, typename Self::Index num_coeffs_to_reduce,
|
||||||
@ -566,7 +566,7 @@ struct InnerReducer<Self, Op, Eigen::SyclDevice> {
|
|||||||
// generic partial reduction
|
// generic partial reduction
|
||||||
template <typename Self, typename Op>
|
template <typename Self, typename Op>
|
||||||
struct GenericReducer<Self, Op, Eigen::SyclDevice> {
|
struct GenericReducer<Self, Op, Eigen::SyclDevice> {
|
||||||
static EIGEN_CONSTEXPR bool HasOptimizedImplementation = false;
|
static constexpr bool HasOptimizedImplementation = false;
|
||||||
static bool run(const Self &self, const Op &reducer, const Eigen::SyclDevice &dev,
|
static bool run(const Self &self, const Op &reducer, const Eigen::SyclDevice &dev,
|
||||||
typename Self::EvaluatorPointerType output, typename Self::Index num_values_to_reduce,
|
typename Self::EvaluatorPointerType output, typename Self::Index num_values_to_reduce,
|
||||||
typename Self::Index num_coeffs_to_preserve) {
|
typename Self::Index num_coeffs_to_preserve) {
|
||||||
|
@ -197,7 +197,7 @@ struct ScanLauncher {
|
|||||||
// threads. Currently set to twice the cache line size on Intel and ARM
|
// threads. Currently set to twice the cache line size on Intel and ARM
|
||||||
// processors.
|
// processors.
|
||||||
EIGEN_STRONG_INLINE Index AdjustBlockSize(Index item_size, Index block_size) {
|
EIGEN_STRONG_INLINE Index AdjustBlockSize(Index item_size, Index block_size) {
|
||||||
EIGEN_CONSTEXPR Index kBlockAlignment = 128;
|
constexpr Index kBlockAlignment = 128;
|
||||||
const Index items_per_cacheline = numext::maxi<Index>(1, kBlockAlignment / item_size);
|
const Index items_per_cacheline = numext::maxi<Index>(1, kBlockAlignment / item_size);
|
||||||
return items_per_cacheline * numext::div_ceil(block_size, items_per_cacheline);
|
return items_per_cacheline * numext::div_ceil(block_size, items_per_cacheline);
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ namespace internal {
|
|||||||
template <typename index_t>
|
template <typename index_t>
|
||||||
struct ScanParameters {
|
struct ScanParameters {
|
||||||
// must be power of 2
|
// must be power of 2
|
||||||
static EIGEN_CONSTEXPR index_t ScanPerThread = 8;
|
static constexpr index_t ScanPerThread = 8;
|
||||||
const index_t total_size;
|
const index_t total_size;
|
||||||
const index_t non_scan_size;
|
const index_t non_scan_size;
|
||||||
const index_t scan_size;
|
const index_t scan_size;
|
||||||
@ -86,7 +86,7 @@ template <typename Evaluator, typename CoeffReturnType, typename OutAccessor, ty
|
|||||||
struct ScanKernelFunctor {
|
struct ScanKernelFunctor {
|
||||||
typedef cl::sycl::accessor<CoeffReturnType, 1, cl::sycl::access::mode::read_write, cl::sycl::access::target::local>
|
typedef cl::sycl::accessor<CoeffReturnType, 1, cl::sycl::access::mode::read_write, cl::sycl::access::target::local>
|
||||||
LocalAccessor;
|
LocalAccessor;
|
||||||
static EIGEN_CONSTEXPR int PacketSize = ScanParameters<Index>::ScanPerThread / 2;
|
static constexpr int PacketSize = ScanParameters<Index>::ScanPerThread / 2;
|
||||||
|
|
||||||
LocalAccessor scratch;
|
LocalAccessor scratch;
|
||||||
Evaluator dev_eval;
|
Evaluator dev_eval;
|
||||||
@ -288,7 +288,7 @@ template <typename CoeffReturnType, typename InAccessor, typename OutAccessor, t
|
|||||||
struct ScanAdjustmentKernelFunctor {
|
struct ScanAdjustmentKernelFunctor {
|
||||||
typedef cl::sycl::accessor<CoeffReturnType, 1, cl::sycl::access::mode::read_write, cl::sycl::access::target::local>
|
typedef cl::sycl::accessor<CoeffReturnType, 1, cl::sycl::access::mode::read_write, cl::sycl::access::target::local>
|
||||||
LocalAccessor;
|
LocalAccessor;
|
||||||
static EIGEN_CONSTEXPR int PacketSize = ScanParameters<Index>::ScanPerThread / 2;
|
static constexpr int PacketSize = ScanParameters<Index>::ScanPerThread / 2;
|
||||||
InAccessor in_ptr;
|
InAccessor in_ptr;
|
||||||
OutAccessor out_ptr;
|
OutAccessor out_ptr;
|
||||||
const ScanParameters<Index> scanParameters;
|
const ScanParameters<Index> scanParameters;
|
||||||
|
@ -106,7 +106,7 @@ class DynamicSGroup {
|
|||||||
int one;
|
int one;
|
||||||
int two;
|
int two;
|
||||||
int flags;
|
int flags;
|
||||||
constexpr inline Generator(int one_, int two_, int flags_) : one(one_), two(two_), flags(flags_) {}
|
constexpr Generator(int one_, int two_, int flags_) : one(one_), two(two_), flags(flags_) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
std::size_t m_numIndices;
|
std::size_t m_numIndices;
|
||||||
|
@ -25,7 +25,7 @@ struct tensor_static_symgroup_permutate<numeric_list<int, nn...>> {
|
|||||||
constexpr static std::size_t N = sizeof...(nn);
|
constexpr static std::size_t N = sizeof...(nn);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
constexpr static inline std::array<T, N> run(const std::array<T, N>& indices) {
|
constexpr static std::array<T, N> run(const std::array<T, N>& indices) {
|
||||||
return {{indices[nn]...}};
|
return {{indices[nn]...}};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -51,7 +51,7 @@ struct tensor_static_symgroup_identity_ctor {
|
|||||||
template <typename iib>
|
template <typename iib>
|
||||||
struct tensor_static_symgroup_multiply_helper {
|
struct tensor_static_symgroup_multiply_helper {
|
||||||
template <int... iia>
|
template <int... iia>
|
||||||
constexpr static inline numeric_list<int, get<iia, iib>::value...> helper(numeric_list<int, iia...>) {
|
constexpr static numeric_list<int, get<iia, iib>::value...> helper(numeric_list<int, iia...>) {
|
||||||
return numeric_list<int, get<iia, iib>::value...>();
|
return numeric_list<int, get<iia, iib>::value...>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -107,9 +107,9 @@ struct tensor_static_symgroup {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename Index, std::size_t N, int... ii, int... jj>
|
template <typename Index, std::size_t N, int... ii, int... jj>
|
||||||
constexpr static inline std::array<Index, N> tensor_static_symgroup_index_permute(std::array<Index, N> idx,
|
constexpr static std::array<Index, N> tensor_static_symgroup_index_permute(std::array<Index, N> idx,
|
||||||
internal::numeric_list<int, ii...>,
|
internal::numeric_list<int, ii...>,
|
||||||
internal::numeric_list<int, jj...>) {
|
internal::numeric_list<int, jj...>) {
|
||||||
return {{idx[ii]..., idx[jj]...}};
|
return {{idx[ii]..., idx[jj]...}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,9 +179,9 @@ class StaticSGroup {
|
|||||||
typedef typename group_elements::type ge;
|
typedef typename group_elements::type ge;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
constexpr inline StaticSGroup() {}
|
constexpr StaticSGroup() {}
|
||||||
constexpr inline StaticSGroup(const StaticSGroup<Gen...>&) {}
|
constexpr StaticSGroup(const StaticSGroup<Gen...>&) {}
|
||||||
constexpr inline StaticSGroup(StaticSGroup<Gen...>&&) {}
|
constexpr StaticSGroup(StaticSGroup<Gen...>&&) {}
|
||||||
|
|
||||||
template <typename Op, typename RV, typename Index, std::size_t N, typename... Args>
|
template <typename Op, typename RV, typename Index, std::size_t N, typename... Args>
|
||||||
static inline RV apply(const std::array<Index, N>& idx, RV initial, Args&&... args) {
|
static inline RV apply(const std::array<Index, N>& idx, RV initial, Args&&... args) {
|
||||||
@ -196,8 +196,8 @@ class StaticSGroup {
|
|||||||
|
|
||||||
constexpr static std::size_t static_size = ge::count;
|
constexpr static std::size_t static_size = ge::count;
|
||||||
|
|
||||||
constexpr static inline std::size_t size() { return ge::count; }
|
constexpr static std::size_t size() { return ge::count; }
|
||||||
constexpr static inline int globalFlags() { return group_elements::global_flags; }
|
constexpr static int globalFlags() { return group_elements::global_flags; }
|
||||||
|
|
||||||
template <typename Tensor_, typename... IndexTypes>
|
template <typename Tensor_, typename... IndexTypes>
|
||||||
inline internal::tensor_symmetry_value_setter<Tensor_, StaticSGroup<Gen...>> operator()(
|
inline internal::tensor_symmetry_value_setter<Tensor_, StaticSGroup<Gen...>> operator()(
|
||||||
|
@ -36,15 +36,15 @@ namespace internal {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
template <std::size_t I_, class T>
|
template <std::size_t I_, class T>
|
||||||
constexpr inline T& array_get(std::vector<T>& a) {
|
constexpr T& array_get(std::vector<T>& a) {
|
||||||
return a[I_];
|
return a[I_];
|
||||||
}
|
}
|
||||||
template <std::size_t I_, class T>
|
template <std::size_t I_, class T>
|
||||||
constexpr inline T&& array_get(std::vector<T>&& a) {
|
constexpr T&& array_get(std::vector<T>&& a) {
|
||||||
return a[I_];
|
return a[I_];
|
||||||
}
|
}
|
||||||
template <std::size_t I_, class T>
|
template <std::size_t I_, class T>
|
||||||
constexpr inline T const& array_get(std::vector<T> const& a) {
|
constexpr T const& array_get(std::vector<T> const& a) {
|
||||||
return a[I_];
|
return a[I_];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user