mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Selectively add constexpr to Core expression template scaffolding
libeigen/eigen!2184 Closes #3041 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
@@ -245,7 +245,7 @@ class Array : public PlainObjectBase<Array<Scalar_, Rows_, Cols_, Options_, MaxR
|
||||
public:
|
||||
/** \sa MatrixBase::operator=(const EigenBase<OtherDerived>&) */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Array(
|
||||
const EigenBase<OtherDerived>& other,
|
||||
std::enable_if_t<internal::is_convertible<typename OtherDerived::Scalar, Scalar>::value, PrivateType> =
|
||||
PrivateType())
|
||||
|
||||
@@ -168,13 +168,13 @@ class ArrayBase : public DenseBase<Derived> {
|
||||
}
|
||||
|
||||
public:
|
||||
EIGEN_DEVICE_FUNC ArrayBase<Derived>& array() { return *this; }
|
||||
EIGEN_DEVICE_FUNC const ArrayBase<Derived>& array() const { return *this; }
|
||||
EIGEN_DEVICE_FUNC constexpr ArrayBase<Derived>& array() { return *this; }
|
||||
EIGEN_DEVICE_FUNC constexpr const ArrayBase<Derived>& array() const { return *this; }
|
||||
|
||||
/** \returns an \link Eigen::MatrixBase Matrix \endlink expression of this array
|
||||
* \sa MatrixBase::array() */
|
||||
EIGEN_DEVICE_FUNC MatrixWrapper<Derived> matrix() { return MatrixWrapper<Derived>(derived()); }
|
||||
EIGEN_DEVICE_FUNC const MatrixWrapper<const Derived> matrix() const {
|
||||
EIGEN_DEVICE_FUNC constexpr MatrixWrapper<Derived> matrix() { return MatrixWrapper<Derived>(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr const MatrixWrapper<const Derived> matrix() const {
|
||||
return MatrixWrapper<const Derived>(derived());
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,8 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> > {
|
||||
|
||||
using Base::coeffRef;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit EIGEN_STRONG_INLINE ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit EIGEN_STRONG_INLINE ArrayWrapper(ExpressionType& matrix)
|
||||
: m_expression(matrix) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_expression.rows(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_expression.cols(); }
|
||||
@@ -75,7 +76,7 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> > {
|
||||
dst = m_expression;
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC const internal::remove_all_t<NestedExpressionType>& nestedExpression() const {
|
||||
EIGEN_DEVICE_FUNC constexpr const internal::remove_all_t<NestedExpressionType>& nestedExpression() const {
|
||||
return m_expression;
|
||||
}
|
||||
|
||||
@@ -129,7 +130,7 @@ class MatrixWrapper : public MatrixBase<MatrixWrapper<ExpressionType> > {
|
||||
|
||||
using Base::coeffRef;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit inline MatrixWrapper(ExpressionType& matrix) : m_expression(matrix) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit inline MatrixWrapper(ExpressionType& matrix) : m_expression(matrix) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_expression.rows(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_expression.cols(); }
|
||||
@@ -145,7 +146,7 @@ class MatrixWrapper : public MatrixBase<MatrixWrapper<ExpressionType> > {
|
||||
|
||||
EIGEN_DEVICE_FUNC inline const Scalar& coeffRef(Index index) const { return m_expression.coeffRef(index); }
|
||||
|
||||
EIGEN_DEVICE_FUNC const internal::remove_all_t<NestedExpressionType>& nestedExpression() const {
|
||||
EIGEN_DEVICE_FUNC constexpr const internal::remove_all_t<NestedExpressionType>& nestedExpression() const {
|
||||
return m_expression;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@ namespace Eigen {
|
||||
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::lazyAssign(const DenseBase<OtherDerived>& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::lazyAssign(
|
||||
const DenseBase<OtherDerived>& other) {
|
||||
enum { SameType = internal::is_same<typename Derived::Scalar, typename OtherDerived::Scalar>::value };
|
||||
|
||||
EIGEN_STATIC_ASSERT_LVALUE(Derived)
|
||||
@@ -36,40 +37,43 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::lazyAssign(co
|
||||
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator=(const DenseBase<OtherDerived>& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator=(
|
||||
const DenseBase<OtherDerived>& other) {
|
||||
internal::call_assignment(derived(), other.derived());
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator=(const DenseBase& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator=(const DenseBase& other) {
|
||||
internal::call_assignment(derived(), other.derived());
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::operator=(const MatrixBase& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::operator=(const MatrixBase& other) {
|
||||
internal::call_assignment(derived(), other.derived());
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::operator=(const DenseBase<OtherDerived>& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::operator=(
|
||||
const DenseBase<OtherDerived>& other) {
|
||||
internal::call_assignment(derived(), other.derived());
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::operator=(const EigenBase<OtherDerived>& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::operator=(
|
||||
const EigenBase<OtherDerived>& other) {
|
||||
internal::call_assignment(derived(), other.derived());
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::operator=(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::operator=(
|
||||
const ReturnByValue<OtherDerived>& other) {
|
||||
other.derived().evalTo(derived());
|
||||
return derived();
|
||||
|
||||
@@ -681,8 +681,8 @@ class generic_dense_assignment_kernel {
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_dstExpr.cols(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index outerStride() const noexcept { return m_dstExpr.outerStride(); }
|
||||
|
||||
EIGEN_DEVICE_FUNC DstEvaluatorType& dstEvaluator() noexcept { return m_dst; }
|
||||
EIGEN_DEVICE_FUNC const SrcEvaluatorType& srcEvaluator() const noexcept { return m_src; }
|
||||
EIGEN_DEVICE_FUNC constexpr DstEvaluatorType& dstEvaluator() noexcept { return m_dst; }
|
||||
EIGEN_DEVICE_FUNC constexpr const SrcEvaluatorType& srcEvaluator() const noexcept { return m_src; }
|
||||
|
||||
/// Assign src(row,col) to dst(row,col) through the assignment functor.
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void assignCoeff(Index row, Index col) {
|
||||
@@ -690,7 +690,7 @@ class generic_dense_assignment_kernel {
|
||||
}
|
||||
|
||||
/// \sa assignCoeff(Index,Index)
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(Index index) {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void assignCoeff(Index index) {
|
||||
m_functor.assignCoeff(m_dst.coeffRef(index), m_src.coeff(index));
|
||||
}
|
||||
|
||||
|
||||
@@ -121,14 +121,14 @@ class Block
|
||||
|
||||
/** Column or Row constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Block(XprType& xpr, Index i) : Impl(xpr, i) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Block(XprType& xpr, Index i) : Impl(xpr, i) {
|
||||
eigen_assert((i >= 0) && (((BlockRows == 1) && (BlockCols == XprType::ColsAtCompileTime) && i < xpr.rows()) ||
|
||||
((BlockRows == XprType::RowsAtCompileTime) && (BlockCols == 1) && i < xpr.cols())));
|
||||
}
|
||||
|
||||
/** Fixed-size constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Block(XprType& xpr, Index startRow, Index startCol)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Block(XprType& xpr, Index startRow, Index startCol)
|
||||
: Impl(xpr, startRow, startCol) {
|
||||
EIGEN_STATIC_ASSERT(RowsAtCompileTime != Dynamic && ColsAtCompileTime != Dynamic,
|
||||
THIS_METHOD_IS_ONLY_FOR_FIXED_SIZE)
|
||||
@@ -138,8 +138,8 @@ class Block
|
||||
|
||||
/** Dynamic-size constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Block(XprType& xpr, Index startRow, Index startCol, Index blockRows,
|
||||
Index blockCols)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Block(XprType& xpr, Index startRow, Index startCol, Index blockRows,
|
||||
Index blockCols)
|
||||
: Impl(xpr, startRow, startCol, blockRows, blockCols) {
|
||||
eigen_assert((RowsAtCompileTime == Dynamic || RowsAtCompileTime == blockRows) &&
|
||||
(ColsAtCompileTime == Dynamic || ColsAtCompileTime == blockCols));
|
||||
@@ -175,11 +175,11 @@ class BlockImpl<XprType, BlockRows, BlockCols, InnerPanel, Dense>
|
||||
public:
|
||||
typedef Impl Base;
|
||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl)
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl(XprType& xpr, Index i) : Impl(xpr, i) {}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl(XprType& xpr, Index startRow, Index startCol)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE BlockImpl(XprType& xpr, Index i) : Impl(xpr, i) {}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE BlockImpl(XprType& xpr, Index startRow, Index startCol)
|
||||
: Impl(xpr, startRow, startCol) {}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl(XprType& xpr, Index startRow, Index startCol, Index blockRows,
|
||||
Index blockCols)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE BlockImpl(XprType& xpr, Index startRow, Index startCol,
|
||||
Index blockRows, Index blockCols)
|
||||
: Impl(xpr, startRow, startCol, blockRows, blockCols) {}
|
||||
};
|
||||
|
||||
@@ -198,7 +198,7 @@ class BlockImpl_dense : public internal::dense_xpr_base<Block<XprType, BlockRows
|
||||
|
||||
/** Column or Row constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline BlockImpl_dense(XprType& xpr, Index i)
|
||||
EIGEN_DEVICE_FUNC constexpr BlockImpl_dense(XprType& xpr, Index i)
|
||||
: m_xpr(xpr),
|
||||
// It is a row if and only if BlockRows==1 and BlockCols==XprType::ColsAtCompileTime,
|
||||
// and it is a column if and only if BlockRows==XprType::RowsAtCompileTime and BlockCols==1,
|
||||
@@ -211,17 +211,17 @@ class BlockImpl_dense : public internal::dense_xpr_base<Block<XprType, BlockRows
|
||||
|
||||
/** Fixed-size constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline BlockImpl_dense(XprType& xpr, Index startRow, Index startCol)
|
||||
EIGEN_DEVICE_FUNC constexpr BlockImpl_dense(XprType& xpr, Index startRow, Index startCol)
|
||||
: m_xpr(xpr), m_startRow(startRow), m_startCol(startCol), m_blockRows(BlockRows), m_blockCols(BlockCols) {}
|
||||
|
||||
/** Dynamic-size constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline BlockImpl_dense(XprType& xpr, Index startRow, Index startCol, Index blockRows,
|
||||
Index blockCols)
|
||||
EIGEN_DEVICE_FUNC constexpr BlockImpl_dense(XprType& xpr, Index startRow, Index startCol, Index blockRows,
|
||||
Index blockCols)
|
||||
: m_xpr(xpr), m_startRow(startRow), m_startCol(startCol), m_blockRows(blockRows), m_blockCols(blockCols) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC inline Index rows() const { return m_blockRows.value(); }
|
||||
EIGEN_DEVICE_FUNC inline Index cols() const { return m_blockCols.value(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const { return m_blockRows.value(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const { return m_blockCols.value(); }
|
||||
|
||||
EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index rowId, Index colId) {
|
||||
EIGEN_STATIC_ASSERT_LVALUE(XprType)
|
||||
|
||||
@@ -31,7 +31,7 @@ template <typename XprType>
|
||||
struct CommaInitializer {
|
||||
typedef typename XprType::Scalar Scalar;
|
||||
|
||||
EIGEN_DEVICE_FUNC inline CommaInitializer(XprType& xpr, const Scalar& s)
|
||||
EIGEN_DEVICE_FUNC constexpr CommaInitializer(XprType& xpr, const Scalar& s)
|
||||
: m_xpr(xpr), m_row(0), m_col(1), m_currentBlockRows(1) {
|
||||
eigen_assert(m_xpr.rows() > 0 && m_xpr.cols() > 0 && "Cannot comma-initialize a 0x0 matrix (operator<<)");
|
||||
m_xpr.coeffRef(0, 0) = s;
|
||||
|
||||
@@ -103,13 +103,13 @@ struct evaluator_assume_aliasing {
|
||||
template <typename T>
|
||||
struct evaluator : public unary_evaluator<T> {
|
||||
typedef unary_evaluator<T> Base;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const T& xpr) : Base(xpr) {}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit evaluator(const T& xpr) : Base(xpr) {}
|
||||
};
|
||||
|
||||
// TODO: Think about const-correctness
|
||||
template <typename T>
|
||||
struct evaluator<const T> : evaluator<T> {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const T& xpr) : evaluator<T>(xpr) {}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit evaluator(const T& xpr) : evaluator<T>(xpr) {}
|
||||
};
|
||||
|
||||
// ---------- base class for all evaluators ----------
|
||||
@@ -293,20 +293,25 @@ struct unary_evaluator<Transpose<ArgType>, IndexBased> : evaluator_base<Transpos
|
||||
Alignment = evaluator<ArgType>::Alignment
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& t) : m_argImpl(t.nestedExpression()) {}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& t)
|
||||
: m_argImpl(t.nestedExpression()) {}
|
||||
|
||||
typedef typename XprType::Scalar Scalar;
|
||||
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
return m_argImpl.coeff(col, row);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const { return m_argImpl.coeff(index); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
return m_argImpl.coeff(index);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) { return m_argImpl.coeffRef(col, row); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
return m_argImpl.coeffRef(col, row);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename XprType::Scalar& coeffRef(Index index) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename XprType::Scalar& coeffRef(Index index) {
|
||||
return m_argImpl.coeffRef(index);
|
||||
}
|
||||
|
||||
@@ -365,11 +370,12 @@ template <typename Scalar, typename NullaryOp, bool has_nullary = has_nullary_op
|
||||
bool has_binary = has_binary_operator<NullaryOp>::value>
|
||||
struct nullary_wrapper {
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i,
|
||||
IndexType j) const {
|
||||
return op(i, j);
|
||||
}
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i) const {
|
||||
return op(i);
|
||||
}
|
||||
|
||||
@@ -386,7 +392,8 @@ struct nullary_wrapper {
|
||||
template <typename Scalar, typename NullaryOp>
|
||||
struct nullary_wrapper<Scalar, NullaryOp, true, false, false> {
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType = 0, IndexType = 0) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType = 0,
|
||||
IndexType = 0) const {
|
||||
return op();
|
||||
}
|
||||
template <typename T, typename IndexType>
|
||||
@@ -398,7 +405,8 @@ struct nullary_wrapper<Scalar, NullaryOp, true, false, false> {
|
||||
template <typename Scalar, typename NullaryOp>
|
||||
struct nullary_wrapper<Scalar, NullaryOp, false, false, true> {
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j = 0) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i,
|
||||
IndexType j = 0) const {
|
||||
return op(i, j);
|
||||
}
|
||||
template <typename T, typename IndexType>
|
||||
@@ -413,7 +421,8 @@ struct nullary_wrapper<Scalar, NullaryOp, false, false, true> {
|
||||
template <typename Scalar, typename NullaryOp>
|
||||
struct nullary_wrapper<Scalar, NullaryOp, false, true, false> {
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i,
|
||||
IndexType j) const {
|
||||
eigen_assert(i == 0 || j == 0);
|
||||
return op(i + j);
|
||||
}
|
||||
@@ -424,7 +433,7 @@ struct nullary_wrapper<Scalar, NullaryOp, false, true, false> {
|
||||
}
|
||||
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i) const {
|
||||
return op(i);
|
||||
}
|
||||
template <typename T, typename IndexType>
|
||||
@@ -452,19 +461,19 @@ struct evaluator<CwiseNullaryOp<NullaryOp, PlainObjectType>>
|
||||
Alignment = AlignedMax
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& n) : m_functor(n.functor()), m_wrapper() {
|
||||
EIGEN_DEVICE_FUNC constexpr explicit evaluator(const XprType& n) : m_functor(n.functor()), m_wrapper() {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
}
|
||||
|
||||
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
||||
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(IndexType row, IndexType col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(IndexType row, IndexType col) const {
|
||||
return m_wrapper(m_functor, row, col);
|
||||
}
|
||||
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(IndexType index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(IndexType index) const {
|
||||
return m_wrapper(m_functor, index);
|
||||
}
|
||||
|
||||
@@ -509,18 +518,18 @@ struct unary_evaluator<CwiseUnaryOp<UnaryOp, ArgType>, IndexBased> : evaluator_b
|
||||
Alignment = evaluator<ArgType>::Alignment
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& op) : m_d(op) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& op) : m_d(op) {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<UnaryOp>::Cost);
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
}
|
||||
|
||||
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
return m_d.func()(m_d.argImpl.coeff(row, col));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
return m_d.func()(m_d.argImpl.coeff(index));
|
||||
}
|
||||
|
||||
@@ -547,9 +556,9 @@ struct unary_evaluator<CwiseUnaryOp<UnaryOp, ArgType>, IndexBased> : evaluator_b
|
||||
protected:
|
||||
// this helper permits to completely eliminate the functor if it is empty
|
||||
struct Data {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Data(const XprType& xpr)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Data(const XprType& xpr)
|
||||
: op(xpr.functor()), argImpl(xpr.nestedExpression()) {}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const UnaryOp& func() const { return op; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const UnaryOp& func() const { return op; }
|
||||
UnaryOp op;
|
||||
evaluator<ArgType> argImpl;
|
||||
};
|
||||
@@ -578,7 +587,7 @@ struct unary_evaluator<CwiseUnaryOp<core_cast_op<SrcType, DstType>, ArgType>, In
|
||||
Alignment = evaluator<ArgType>::Alignment
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& xpr)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& xpr)
|
||||
: m_argImpl(xpr.nestedExpression()), m_rows(xpr.rows()), m_cols(xpr.cols()) {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<CastOp>::Cost);
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
@@ -610,15 +619,15 @@ struct unary_evaluator<CwiseUnaryOp<core_cast_op<SrcType, DstType>, ArgType>, In
|
||||
Index actualCol = IsRowMajor ? col + offset : col;
|
||||
return m_argImpl.coeff(actualRow, actualCol);
|
||||
}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE SrcType srcCoeff(Index index, Index offset) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE SrcType srcCoeff(Index index, Index offset) const {
|
||||
Index actualIndex = index + offset;
|
||||
return m_argImpl.coeff(actualIndex);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DstType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE DstType coeff(Index row, Index col) const {
|
||||
return cast<SrcType, DstType>(srcCoeff(row, col, 0));
|
||||
}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DstType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE DstType coeff(Index index) const {
|
||||
return cast<SrcType, DstType>(srcCoeff(index, 0));
|
||||
}
|
||||
|
||||
@@ -900,7 +909,7 @@ struct evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3>>
|
||||
typedef CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> XprType;
|
||||
typedef ternary_evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3>> Base;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) : Base(xpr) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit evaluator(const XprType& xpr) : Base(xpr) {}
|
||||
};
|
||||
|
||||
template <typename TernaryOp, typename Arg1, typename Arg2, typename Arg3>
|
||||
@@ -929,18 +938,18 @@ struct ternary_evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3>, IndexBased
|
||||
evaluator<Arg3>::Alignment)
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit ternary_evaluator(const XprType& xpr) : m_d(xpr) {
|
||||
EIGEN_DEVICE_FUNC constexpr explicit ternary_evaluator(const XprType& xpr) : m_d(xpr) {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<TernaryOp>::Cost);
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
}
|
||||
|
||||
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
return m_d.func()(m_d.arg1Impl.coeff(row, col), m_d.arg2Impl.coeff(row, col), m_d.arg3Impl.coeff(row, col));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
return m_d.func()(m_d.arg1Impl.coeff(index), m_d.arg2Impl.coeff(index), m_d.arg3Impl.coeff(index));
|
||||
}
|
||||
|
||||
@@ -975,9 +984,9 @@ struct ternary_evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3>, IndexBased
|
||||
protected:
|
||||
// this helper permits to completely eliminate the functor if it is empty
|
||||
struct Data {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Data(const XprType& xpr)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Data(const XprType& xpr)
|
||||
: op(xpr.functor()), arg1Impl(xpr.arg1()), arg2Impl(xpr.arg2()), arg3Impl(xpr.arg3()) {}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TernaryOp& func() const { return op; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const TernaryOp& func() const { return op; }
|
||||
TernaryOp op;
|
||||
evaluator<Arg1> arg1Impl;
|
||||
evaluator<Arg2> arg2Impl;
|
||||
@@ -1015,7 +1024,7 @@ struct evaluator<CwiseTernaryOp<scalar_boolean_select_op<Scalar, Scalar, bool>,
|
||||
using Arg3 = typename Helper::Arg3;
|
||||
using XprType = typename Helper::XprType;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const DummyXprType& xpr)
|
||||
EIGEN_DEVICE_FUNC constexpr explicit evaluator(const DummyXprType& xpr)
|
||||
: Base(XprType(xpr.arg1(), xpr.arg2(), Arg3(xpr.arg3().lhs(), xpr.arg3().rhs()))) {}
|
||||
};
|
||||
|
||||
@@ -1027,7 +1036,7 @@ struct evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>> : public binary_evaluator<Cw
|
||||
typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> XprType;
|
||||
typedef binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>> Base;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const XprType& xpr) : Base(xpr) {}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit evaluator(const XprType& xpr) : Base(xpr) {}
|
||||
};
|
||||
|
||||
template <typename BinaryOp, typename Lhs, typename Rhs>
|
||||
@@ -1052,18 +1061,18 @@ struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IndexBased, IndexBase
|
||||
Alignment = plain_enum_min(evaluator<Lhs>::Alignment, evaluator<Rhs>::Alignment)
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit binary_evaluator(const XprType& xpr) : m_d(xpr) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit binary_evaluator(const XprType& xpr) : m_d(xpr) {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
}
|
||||
|
||||
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
return m_d.func()(m_d.lhsImpl.coeff(row, col), m_d.rhsImpl.coeff(row, col));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
return m_d.func()(m_d.lhsImpl.coeff(index), m_d.rhsImpl.coeff(index));
|
||||
}
|
||||
|
||||
@@ -1094,9 +1103,9 @@ struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IndexBased, IndexBase
|
||||
protected:
|
||||
// this helper permits to completely eliminate the functor if it is empty
|
||||
struct Data {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Data(const XprType& xpr)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Data(const XprType& xpr)
|
||||
: op(xpr.functor()), lhsImpl(xpr.lhs()), rhsImpl(xpr.rhs()) {}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const BinaryOp& func() const { return op; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const BinaryOp& func() const { return op; }
|
||||
BinaryOp op;
|
||||
evaluator<Lhs> lhsImpl;
|
||||
evaluator<Rhs> rhsImpl;
|
||||
@@ -1120,7 +1129,7 @@ struct unary_evaluator<CwiseUnaryView<UnaryOp, ArgType, StrideType>, IndexBased>
|
||||
Alignment = 0 // FIXME: clarify why alignment is lost for CwiseUnaryView.
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& op) : m_d(op) {
|
||||
EIGEN_DEVICE_FUNC constexpr explicit unary_evaluator(const XprType& op) : m_d(op) {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<UnaryOp>::Cost);
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
}
|
||||
@@ -1128,28 +1137,28 @@ struct unary_evaluator<CwiseUnaryView<UnaryOp, ArgType, StrideType>, IndexBased>
|
||||
typedef typename XprType::Scalar Scalar;
|
||||
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
return m_d.func()(m_d.argImpl.coeff(row, col));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
return m_d.func()(m_d.argImpl.coeff(index));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
return m_d.func()(m_d.argImpl.coeffRef(row, col));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
|
||||
return m_d.func()(m_d.argImpl.coeffRef(index));
|
||||
}
|
||||
|
||||
protected:
|
||||
// this helper permits to completely eliminate the functor if it is empty
|
||||
struct Data {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Data(const XprType& xpr)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Data(const XprType& xpr)
|
||||
: op(xpr.functor()), argImpl(xpr.nestedExpression()) {}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const UnaryOp& func() const { return op; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const UnaryOp& func() const { return op; }
|
||||
UnaryOp op;
|
||||
evaluator<ArgType> argImpl;
|
||||
};
|
||||
@@ -1177,7 +1186,7 @@ struct mapbase_evaluator : evaluator_base<Derived> {
|
||||
CoeffReadCost = NumTraits<Scalar>::ReadCost
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit mapbase_evaluator(const XprType& map)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit mapbase_evaluator(const XprType& map)
|
||||
: m_data(const_cast<PointerType>(map.data())),
|
||||
m_innerStride(map.innerStride()),
|
||||
m_outerStride(map.outerStride()) {
|
||||
@@ -1187,19 +1196,21 @@ struct mapbase_evaluator : evaluator_base<Derived> {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
return m_data[col * colStride() + row * rowStride()];
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
return m_data[index * m_innerStride.value()];
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
return m_data[col * colStride() + row * rowStride()];
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) { return m_data[index * m_innerStride.value()]; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
|
||||
return m_data[index * m_innerStride.value()];
|
||||
}
|
||||
|
||||
template <int LoadMode, typename PacketType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const {
|
||||
@@ -1288,7 +1299,8 @@ struct evaluator<Map<PlainObjectType, MapOptions, StrideType>>
|
||||
Alignment = int(MapOptions) & int(AlignedMask)
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& map) : mapbase_evaluator<XprType, PlainObjectType>(map) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit evaluator(const XprType& map)
|
||||
: mapbase_evaluator<XprType, PlainObjectType>(map) {}
|
||||
};
|
||||
|
||||
// -------------------- Ref --------------------
|
||||
@@ -1303,7 +1315,7 @@ struct evaluator<Ref<PlainObjectType, RefOptions, StrideType>>
|
||||
Alignment = evaluator<Map<PlainObjectType, RefOptions, StrideType>>::Alignment
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const XprType& ref)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit evaluator(const XprType& ref)
|
||||
: mapbase_evaluator<XprType, PlainObjectType>(ref) {}
|
||||
};
|
||||
|
||||
@@ -1357,7 +1369,8 @@ struct evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>>
|
||||
Alignment = plain_enum_min(evaluator<ArgType>::Alignment, Alignment0)
|
||||
};
|
||||
typedef block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel> block_evaluator_type;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const XprType& block) : block_evaluator_type(block) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit evaluator(const XprType& block)
|
||||
: block_evaluator_type(block) {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
}
|
||||
};
|
||||
@@ -1368,7 +1381,7 @@ struct block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, /*HasDirectAcc
|
||||
: unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>> {
|
||||
typedef Block<ArgType, BlockRows, BlockCols, InnerPanel> XprType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit block_evaluator(const XprType& block)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit block_evaluator(const XprType& block)
|
||||
: unary_evaluator<XprType>(block) {}
|
||||
};
|
||||
|
||||
@@ -1377,7 +1390,7 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
|
||||
: evaluator_base<Block<ArgType, BlockRows, BlockCols, InnerPanel>> {
|
||||
typedef Block<ArgType, BlockRows, BlockCols, InnerPanel> XprType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& block)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& block)
|
||||
: m_argImpl(block.nestedExpression()),
|
||||
m_startRow(block.startRow()),
|
||||
m_startCol(block.startCol()),
|
||||
@@ -1396,19 +1409,19 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
|
||||
bool(evaluator<ArgType>::Flags & LinearAccessBit)
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
return m_argImpl.coeff(m_startRow.value() + row, m_startCol.value() + col);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
return linear_coeff_impl(index, bool_constant<ForwardLinearAccess>());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
return m_argImpl.coeffRef(m_startRow.value() + row, m_startCol.value() + col);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
|
||||
return linear_coeffRef_impl(index, bool_constant<ForwardLinearAccess>());
|
||||
}
|
||||
|
||||
@@ -1473,20 +1486,20 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
|
||||
}
|
||||
|
||||
protected:
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType
|
||||
linear_coeff_impl(Index index, internal::true_type /* ForwardLinearAccess */) const {
|
||||
return m_argImpl.coeff(m_linear_offset.value() + index);
|
||||
}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType
|
||||
linear_coeff_impl(Index index, internal::false_type /* not ForwardLinearAccess */) const {
|
||||
return coeff(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& linear_coeffRef_impl(Index index,
|
||||
internal::true_type /* ForwardLinearAccess */) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& linear_coeffRef_impl(
|
||||
Index index, internal::true_type /* ForwardLinearAccess */) {
|
||||
return m_argImpl.coeffRef(m_linear_offset.value() + index);
|
||||
}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& linear_coeffRef_impl(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& linear_coeffRef_impl(
|
||||
Index index, internal::false_type /* not ForwardLinearAccess */) {
|
||||
return coeffRef(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
|
||||
}
|
||||
@@ -1507,7 +1520,7 @@ struct block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, /* HasDirectAc
|
||||
typedef Block<ArgType, BlockRows, BlockCols, InnerPanel> XprType;
|
||||
typedef typename XprType::Scalar Scalar;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit block_evaluator(const XprType& block)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit block_evaluator(const XprType& block)
|
||||
: mapbase_evaluator<XprType, typename XprType::PlainObject>(block) {
|
||||
eigen_internal_assert((internal::is_constant_evaluated() ||
|
||||
(std::uintptr_t(block.data()) % plain_enum_max(1, evaluator<XprType>::Alignment)) == 0) &&
|
||||
@@ -1535,13 +1548,13 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor>>
|
||||
Alignment = evaluator<ArgTypeNestedCleaned>::Alignment
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& replicate)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& replicate)
|
||||
: m_arg(replicate.nestedExpression()),
|
||||
m_argImpl(m_arg),
|
||||
m_rows(replicate.nestedExpression().rows()),
|
||||
m_cols(replicate.nestedExpression().cols()) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
// try to avoid using modulo; this is a pure optimization strategy
|
||||
const Index actual_row = traits<XprType>::RowsAtCompileTime == 1 ? 0 : RowFactor == 1 ? row : row % m_rows.value();
|
||||
const Index actual_col = traits<XprType>::ColsAtCompileTime == 1 ? 0 : ColFactor == 1 ? col : col % m_cols.value();
|
||||
@@ -1549,7 +1562,7 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor>>
|
||||
return m_argImpl.coeff(actual_row, actual_col);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
// try to avoid using modulo; this is a pure optimization strategy
|
||||
const Index actual_index = traits<XprType>::RowsAtCompileTime == 1
|
||||
? (ColFactor == 1 ? index : index % m_cols.value())
|
||||
@@ -1618,15 +1631,19 @@ struct evaluator_wrapper_base : evaluator_base<XprType> {
|
||||
typedef typename ArgType::Scalar Scalar;
|
||||
typedef typename ArgType::CoeffReturnType CoeffReturnType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
return m_argImpl.coeff(row, col);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const { return m_argImpl.coeff(index); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
return m_argImpl.coeff(index);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) { return m_argImpl.coeffRef(row, col); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
return m_argImpl.coeffRef(row, col);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) { return m_argImpl.coeffRef(index); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) { return m_argImpl.coeffRef(index); }
|
||||
|
||||
template <int LoadMode, typename PacketType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const {
|
||||
@@ -1678,7 +1695,7 @@ template <typename TArgType>
|
||||
struct unary_evaluator<MatrixWrapper<TArgType>> : evaluator_wrapper_base<MatrixWrapper<TArgType>> {
|
||||
typedef MatrixWrapper<TArgType> XprType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& wrapper)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& wrapper)
|
||||
: evaluator_wrapper_base<MatrixWrapper<TArgType>>(wrapper.nestedExpression()) {}
|
||||
};
|
||||
|
||||
@@ -1686,7 +1703,7 @@ template <typename TArgType>
|
||||
struct unary_evaluator<ArrayWrapper<TArgType>> : evaluator_wrapper_base<ArrayWrapper<TArgType>> {
|
||||
typedef ArrayWrapper<TArgType> XprType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& wrapper)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& wrapper)
|
||||
: evaluator_wrapper_base<ArrayWrapper<TArgType>>(wrapper.nestedExpression()) {}
|
||||
};
|
||||
|
||||
@@ -1726,24 +1743,24 @@ struct unary_evaluator<Reverse<ArgType, Direction>> : evaluator_base<Reverse<Arg
|
||||
Alignment = 0 // FIXME: in some rare cases, Alignment could be preserved.
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& reverse)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& reverse)
|
||||
: m_argImpl(reverse.nestedExpression()),
|
||||
m_rows(ReverseRow ? reverse.nestedExpression().rows() : 1),
|
||||
m_cols(ReverseCol ? reverse.nestedExpression().cols() : 1) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
return m_argImpl.coeff(ReverseRow ? m_rows.value() - row - 1 : row, ReverseCol ? m_cols.value() - col - 1 : col);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
return m_argImpl.coeff(m_rows.value() * m_cols.value() - index - 1);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
return m_argImpl.coeffRef(ReverseRow ? m_rows.value() - row - 1 : row, ReverseCol ? m_cols.value() - col - 1 : col);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
|
||||
return m_argImpl.coeffRef(m_rows.value() * m_cols.value() - index - 1);
|
||||
}
|
||||
|
||||
@@ -1866,25 +1883,25 @@ struct evaluator<Diagonal<ArgType, DiagIndex>> : evaluator_base<Diagonal<ArgType
|
||||
Alignment = 0
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const XprType& diagonal)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit evaluator(const XprType& diagonal)
|
||||
: m_argImpl(diagonal.nestedExpression()), m_index(diagonal.index()) {}
|
||||
|
||||
typedef typename XprType::Scalar Scalar;
|
||||
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index) const {
|
||||
return m_argImpl.coeff(row + rowOffset(), row + colOffset());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
return m_argImpl.coeff(index + rowOffset(), index + colOffset());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index) {
|
||||
return m_argImpl.coeffRef(row + rowOffset(), row + colOffset());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
|
||||
return m_argImpl.coeffRef(index + rowOffset(), index + colOffset());
|
||||
}
|
||||
|
||||
@@ -1935,12 +1952,14 @@ struct evaluator<EvalToTemp<ArgType>> : public evaluator<typename ArgType::Plain
|
||||
typedef typename ArgType::PlainObject PlainObject;
|
||||
typedef evaluator<PlainObject> Base;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) : m_result(xpr.arg()) {
|
||||
EIGEN_DEVICE_FUNC constexpr explicit evaluator(const XprType& xpr) : m_result(xpr.arg()) {
|
||||
internal::construct_at<Base>(this, m_result);
|
||||
}
|
||||
|
||||
// This constructor is used when nesting an EvalTo evaluator in another evaluator
|
||||
EIGEN_DEVICE_FUNC evaluator(const ArgType& arg) : m_result(arg) { internal::construct_at<Base>(this, m_result); }
|
||||
EIGEN_DEVICE_FUNC constexpr evaluator(const ArgType& arg) : m_result(arg) {
|
||||
internal::construct_at<Base>(this, m_result);
|
||||
}
|
||||
|
||||
protected:
|
||||
PlainObject m_result;
|
||||
|
||||
@@ -102,8 +102,8 @@ class CwiseBinaryOp : public CwiseBinaryOpImpl<BinaryOp, LhsType, RhsType,
|
||||
EIGEN_STRONG_INLINE CwiseBinaryOp(const CwiseBinaryOp<BinaryOp, LhsType, RhsType>&) = default;
|
||||
#endif
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CwiseBinaryOp(const Lhs& aLhs, const Rhs& aRhs,
|
||||
const BinaryOp& func = BinaryOp())
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CwiseBinaryOp(const Lhs& aLhs, const Rhs& aRhs,
|
||||
const BinaryOp& func = BinaryOp())
|
||||
: m_lhs(aLhs), m_rhs(aRhs), m_functor(func) {
|
||||
eigen_assert(aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols());
|
||||
}
|
||||
@@ -120,11 +120,11 @@ class CwiseBinaryOp : public CwiseBinaryOpImpl<BinaryOp, LhsType, RhsType,
|
||||
}
|
||||
|
||||
/** \returns the left hand side nested expression */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const LhsNested_& lhs() const { return m_lhs; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const LhsNested_& lhs() const { return m_lhs; }
|
||||
/** \returns the right hand side nested expression */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const RhsNested_& rhs() const { return m_rhs; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const RhsNested_& rhs() const { return m_rhs; }
|
||||
/** \returns the functor representing the binary operation */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const BinaryOp& functor() const { return m_functor; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const BinaryOp& functor() const { return m_functor; }
|
||||
|
||||
protected:
|
||||
LhsNested m_lhs;
|
||||
|
||||
@@ -66,12 +66,12 @@ class CwiseNullaryOp : public internal::dense_xpr_base<CwiseNullaryOp<NullaryOp,
|
||||
typedef typename internal::dense_xpr_base<CwiseNullaryOp>::type Base;
|
||||
EIGEN_DENSE_PUBLIC_INTERFACE(CwiseNullaryOp)
|
||||
|
||||
EIGEN_DEVICE_FUNC CwiseNullaryOp(Index rows, Index cols, const NullaryOp& func = NullaryOp())
|
||||
EIGEN_DEVICE_FUNC constexpr CwiseNullaryOp(Index rows, Index cols, const NullaryOp& func = NullaryOp())
|
||||
: m_rows(rows), m_cols(cols), m_functor(func) {
|
||||
eigen_assert(rows >= 0 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows) && cols >= 0 &&
|
||||
(ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols));
|
||||
}
|
||||
EIGEN_DEVICE_FUNC CwiseNullaryOp(Index size, const NullaryOp& func = NullaryOp())
|
||||
EIGEN_DEVICE_FUNC constexpr CwiseNullaryOp(Index size, const NullaryOp& func = NullaryOp())
|
||||
: CwiseNullaryOp(RowsAtCompileTime == 1 ? 1 : size, RowsAtCompileTime == 1 ? size : 1, func) {
|
||||
EIGEN_STATIC_ASSERT(CwiseNullaryOp::IsVectorAtCompileTime, YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
|
||||
}
|
||||
@@ -80,7 +80,7 @@ class CwiseNullaryOp : public internal::dense_xpr_base<CwiseNullaryOp<NullaryOp,
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const { return m_cols.value(); }
|
||||
|
||||
/** \returns the functor representing the nullary operation */
|
||||
EIGEN_DEVICE_FUNC const NullaryOp& functor() const { return m_functor; }
|
||||
EIGEN_DEVICE_FUNC constexpr const NullaryOp& functor() const { return m_functor; }
|
||||
|
||||
protected:
|
||||
const internal::variable_if_dynamic<Index, RowsAtCompileTime> m_rows;
|
||||
|
||||
@@ -118,7 +118,7 @@ class CwiseTernaryOp : public CwiseTernaryOpImpl<TernaryOp, Arg1Type, Arg2Type,
|
||||
eigen_assert(a1.rows() == a2.rows() && a1.cols() == a2.cols() && a1.rows() == a3.rows() && a1.cols() == a3.cols());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Index rows() const {
|
||||
// return the fixed size type if available to enable compile time
|
||||
// optimizations
|
||||
if (internal::traits<internal::remove_all_t<Arg1Nested>>::RowsAtCompileTime == Dynamic &&
|
||||
@@ -130,7 +130,7 @@ class CwiseTernaryOp : public CwiseTernaryOpImpl<TernaryOp, Arg1Type, Arg2Type,
|
||||
else
|
||||
return m_arg1.rows();
|
||||
}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Index cols() const {
|
||||
// return the fixed size type if available to enable compile time
|
||||
// optimizations
|
||||
if (internal::traits<internal::remove_all_t<Arg1Nested>>::ColsAtCompileTime == Dynamic &&
|
||||
@@ -144,13 +144,13 @@ class CwiseTernaryOp : public CwiseTernaryOpImpl<TernaryOp, Arg1Type, Arg2Type,
|
||||
}
|
||||
|
||||
/** \returns the first argument nested expression */
|
||||
EIGEN_DEVICE_FUNC const Arg1Nested_& arg1() const { return m_arg1; }
|
||||
EIGEN_DEVICE_FUNC constexpr const Arg1Nested_& arg1() const { return m_arg1; }
|
||||
/** \returns the first argument nested expression */
|
||||
EIGEN_DEVICE_FUNC const Arg2Nested_& arg2() const { return m_arg2; }
|
||||
EIGEN_DEVICE_FUNC constexpr const Arg2Nested_& arg2() const { return m_arg2; }
|
||||
/** \returns the third argument nested expression */
|
||||
EIGEN_DEVICE_FUNC const Arg3Nested_& arg3() const { return m_arg3; }
|
||||
EIGEN_DEVICE_FUNC constexpr const Arg3Nested_& arg3() const { return m_arg3; }
|
||||
/** \returns the functor representing the ternary operation */
|
||||
EIGEN_DEVICE_FUNC const TernaryOp& functor() const { return m_functor; }
|
||||
EIGEN_DEVICE_FUNC constexpr const TernaryOp& functor() const { return m_functor; }
|
||||
|
||||
protected:
|
||||
Arg1Nested m_arg1;
|
||||
|
||||
@@ -57,22 +57,26 @@ class CwiseUnaryOp : public CwiseUnaryOpImpl<UnaryOp, XprType, typename internal
|
||||
typedef typename internal::ref_selector<XprType>::type XprTypeNested;
|
||||
typedef internal::remove_all_t<XprType> NestedExpression;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit CwiseUnaryOp(const XprType& xpr, const UnaryOp& func = UnaryOp())
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit CwiseUnaryOp(const XprType& xpr,
|
||||
const UnaryOp& func = UnaryOp())
|
||||
: m_xpr(xpr), m_functor(func) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_xpr.rows(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_xpr.cols(); }
|
||||
|
||||
/** \returns the functor representing the unary operation */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const UnaryOp& functor() const { return m_functor; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const UnaryOp& functor() const { return m_functor; }
|
||||
|
||||
/** \returns the nested expression */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::remove_all_t<XprTypeNested>& nestedExpression() const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const internal::remove_all_t<XprTypeNested>& nestedExpression()
|
||||
const {
|
||||
return m_xpr;
|
||||
}
|
||||
|
||||
/** \returns the nested expression */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::remove_all_t<XprTypeNested>& nestedExpression() { return m_xpr; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE internal::remove_all_t<XprTypeNested>& nestedExpression() {
|
||||
return m_xpr;
|
||||
}
|
||||
|
||||
protected:
|
||||
XprTypeNested m_xpr;
|
||||
|
||||
@@ -140,7 +140,7 @@ class CwiseUnaryView : public internal::CwiseUnaryViewImpl<ViewOp, MatrixType, S
|
||||
typedef typename internal::ref_selector<MatrixType>::non_const_type MatrixTypeNested;
|
||||
typedef internal::remove_all_t<MatrixType> NestedExpression;
|
||||
|
||||
explicit EIGEN_DEVICE_FUNC inline CwiseUnaryView(MatrixType& mat, const ViewOp& func = ViewOp())
|
||||
explicit EIGEN_DEVICE_FUNC constexpr inline CwiseUnaryView(MatrixType& mat, const ViewOp& func = ViewOp())
|
||||
: m_matrix(mat), m_functor(func) {}
|
||||
|
||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(CwiseUnaryView)
|
||||
@@ -149,13 +149,15 @@ class CwiseUnaryView : public internal::CwiseUnaryViewImpl<ViewOp, MatrixType, S
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_matrix.cols(); }
|
||||
|
||||
/** \returns the functor representing unary operation */
|
||||
EIGEN_DEVICE_FUNC const ViewOp& functor() const { return m_functor; }
|
||||
EIGEN_DEVICE_FUNC constexpr const ViewOp& functor() const { return m_functor; }
|
||||
|
||||
/** \returns the nested expression */
|
||||
EIGEN_DEVICE_FUNC const internal::remove_all_t<MatrixTypeNested>& nestedExpression() const { return m_matrix; }
|
||||
EIGEN_DEVICE_FUNC constexpr const internal::remove_all_t<MatrixTypeNested>& nestedExpression() const {
|
||||
return m_matrix;
|
||||
}
|
||||
|
||||
/** \returns the nested expression */
|
||||
EIGEN_DEVICE_FUNC std::remove_reference_t<MatrixTypeNested>& nestedExpression() { return m_matrix; }
|
||||
EIGEN_DEVICE_FUNC constexpr std::remove_reference_t<MatrixTypeNested>& nestedExpression() { return m_matrix; }
|
||||
|
||||
protected:
|
||||
MatrixTypeNested m_matrix;
|
||||
|
||||
@@ -260,21 +260,21 @@ class DenseBase
|
||||
|
||||
/** Copies \a other into *this. \returns a reference to *this. */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other);
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other);
|
||||
|
||||
/** Special case of the template operator=, in order to prevent the compiler
|
||||
* from generating a default operator= (issue hit with g++ 4.1)
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const DenseBase& other);
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& operator=(const DenseBase& other);
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC Derived& operator=(const EigenBase<OtherDerived>& other);
|
||||
EIGEN_DEVICE_FUNC constexpr Derived& operator=(const EigenBase<OtherDerived>& other);
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC Derived& operator+=(const EigenBase<OtherDerived>& other);
|
||||
EIGEN_DEVICE_FUNC constexpr Derived& operator+=(const EigenBase<OtherDerived>& other);
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC Derived& operator-=(const EigenBase<OtherDerived>& other);
|
||||
EIGEN_DEVICE_FUNC constexpr Derived& operator-=(const EigenBase<OtherDerived>& other);
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC Derived& operator=(const ReturnByValue<OtherDerived>& func);
|
||||
@@ -283,7 +283,7 @@ class DenseBase
|
||||
* Copies \a other into *this without evaluating other. \returns a reference to *this. */
|
||||
template <typename OtherDerived>
|
||||
/** \deprecated */
|
||||
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC Derived& lazyAssign(const DenseBase<OtherDerived>& other);
|
||||
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC constexpr Derived& lazyAssign(const DenseBase<OtherDerived>& other);
|
||||
|
||||
EIGEN_DEVICE_FUNC CommaInitializer<Derived> operator<<(const Scalar& s);
|
||||
|
||||
@@ -348,13 +348,13 @@ class DenseBase
|
||||
EIGEN_DEVICE_FUNC Derived& setRandom();
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC bool isApprox(const DenseBase<OtherDerived>& other,
|
||||
const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||
EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const RealScalar& other,
|
||||
const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||
EIGEN_DEVICE_FUNC constexpr bool isApprox(const DenseBase<OtherDerived>& other,
|
||||
const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||
EIGEN_DEVICE_FUNC constexpr bool isMuchSmallerThan(
|
||||
const RealScalar& other, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const DenseBase<OtherDerived>& other,
|
||||
const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||
EIGEN_DEVICE_FUNC constexpr bool isMuchSmallerThan(
|
||||
const DenseBase<OtherDerived>& other, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||
|
||||
EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar& value,
|
||||
const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||
@@ -366,13 +366,13 @@ class DenseBase
|
||||
EIGEN_DEVICE_FUNC inline bool hasNaN() const;
|
||||
EIGEN_DEVICE_FUNC inline bool allFinite() const;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator*=(const Scalar& other);
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& operator*=(const Scalar& other);
|
||||
template <bool Enable = internal::complex_array_access<Scalar>::value, typename = std::enable_if_t<Enable>>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator*=(const RealScalar& other);
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& operator*=(const RealScalar& other);
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator/=(const Scalar& other);
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& operator/=(const Scalar& other);
|
||||
template <bool Enable = internal::complex_array_access<Scalar>::value, typename = std::enable_if_t<Enable>>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator/=(const RealScalar& other);
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& operator/=(const RealScalar& other);
|
||||
|
||||
typedef internal::add_const_on_value_type_t<typename internal::eval<Derived>::type> EvalReturnType;
|
||||
/** \returns the matrix or vector obtained by evaluating this expression.
|
||||
@@ -409,7 +409,7 @@ class DenseBase
|
||||
call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC inline const NestByValue<Derived> nestByValue() const;
|
||||
EIGEN_DEVICE_FUNC constexpr inline const NestByValue<Derived> nestByValue() const;
|
||||
EIGEN_DEVICE_FUNC inline const ForceAlignedAccess<Derived> forceAlignedAccess() const;
|
||||
EIGEN_DEVICE_FUNC inline ForceAlignedAccess<Derived> forceAlignedAccess();
|
||||
template <bool Enable>
|
||||
@@ -523,25 +523,25 @@ class DenseBase
|
||||
static const RandomReturnType Random();
|
||||
|
||||
template <typename ThenDerived, typename ElseDerived>
|
||||
inline EIGEN_DEVICE_FUNC
|
||||
CwiseTernaryOp<internal::scalar_boolean_select_op<typename DenseBase<ThenDerived>::Scalar,
|
||||
typename DenseBase<ElseDerived>::Scalar, Scalar>,
|
||||
ThenDerived, ElseDerived, Derived>
|
||||
select(const DenseBase<ThenDerived>& thenMatrix, const DenseBase<ElseDerived>& elseMatrix) const;
|
||||
inline EIGEN_DEVICE_FUNC constexpr CwiseTernaryOp<
|
||||
internal::scalar_boolean_select_op<typename DenseBase<ThenDerived>::Scalar,
|
||||
typename DenseBase<ElseDerived>::Scalar, Scalar>,
|
||||
ThenDerived, ElseDerived, Derived>
|
||||
select(const DenseBase<ThenDerived>& thenMatrix, const DenseBase<ElseDerived>& elseMatrix) const;
|
||||
|
||||
template <typename ThenDerived>
|
||||
inline EIGEN_DEVICE_FUNC
|
||||
CwiseTernaryOp<internal::scalar_boolean_select_op<typename DenseBase<ThenDerived>::Scalar,
|
||||
typename DenseBase<ThenDerived>::Scalar, Scalar>,
|
||||
ThenDerived, typename DenseBase<ThenDerived>::ConstantReturnType, Derived>
|
||||
select(const DenseBase<ThenDerived>& thenMatrix, const typename DenseBase<ThenDerived>::Scalar& elseScalar) const;
|
||||
inline EIGEN_DEVICE_FUNC constexpr CwiseTernaryOp<
|
||||
internal::scalar_boolean_select_op<typename DenseBase<ThenDerived>::Scalar,
|
||||
typename DenseBase<ThenDerived>::Scalar, Scalar>,
|
||||
ThenDerived, typename DenseBase<ThenDerived>::ConstantReturnType, Derived>
|
||||
select(const DenseBase<ThenDerived>& thenMatrix, const typename DenseBase<ThenDerived>::Scalar& elseScalar) const;
|
||||
|
||||
template <typename ElseDerived>
|
||||
inline EIGEN_DEVICE_FUNC
|
||||
CwiseTernaryOp<internal::scalar_boolean_select_op<typename DenseBase<ElseDerived>::Scalar,
|
||||
typename DenseBase<ElseDerived>::Scalar, Scalar>,
|
||||
typename DenseBase<ElseDerived>::ConstantReturnType, ElseDerived, Derived>
|
||||
select(const typename DenseBase<ElseDerived>::Scalar& thenScalar, const DenseBase<ElseDerived>& elseMatrix) const;
|
||||
inline EIGEN_DEVICE_FUNC constexpr CwiseTernaryOp<
|
||||
internal::scalar_boolean_select_op<typename DenseBase<ElseDerived>::Scalar,
|
||||
typename DenseBase<ElseDerived>::Scalar, Scalar>,
|
||||
typename DenseBase<ElseDerived>::ConstantReturnType, ElseDerived, Derived>
|
||||
select(const typename DenseBase<ElseDerived>::Scalar& thenScalar, const DenseBase<ElseDerived>& elseMatrix) const;
|
||||
|
||||
template <int p>
|
||||
RealScalar lpNorm() const;
|
||||
|
||||
@@ -67,14 +67,14 @@ class DenseCoeffsBase<Derived, ReadOnlyAccessors> : public EigenBase<Derived> {
|
||||
using Base::rows;
|
||||
using Base::size;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rowIndexByOuterInner(Index outer, Index inner) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Index rowIndexByOuterInner(Index outer, Index inner) const {
|
||||
return int(Derived::RowsAtCompileTime) == 1 ? 0
|
||||
: int(Derived::ColsAtCompileTime) == 1 ? inner
|
||||
: int(Derived::Flags) & RowMajorBit ? outer
|
||||
: inner;
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index colIndexByOuterInner(Index outer, Index inner) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Index colIndexByOuterInner(Index outer, Index inner) const {
|
||||
return int(Derived::ColsAtCompileTime) == 1 ? 0
|
||||
: int(Derived::RowsAtCompileTime) == 1 ? inner
|
||||
: int(Derived::Flags) & RowMajorBit ? inner
|
||||
@@ -316,7 +316,7 @@ class DenseCoeffsBase<Derived, WriteAccessors> : public DenseCoeffsBase<Derived,
|
||||
return internal::evaluator<Derived>(derived()).coeffRef(row, col);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRefByOuterInner(Index outer, Index inner) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRefByOuterInner(Index outer, Index inner) {
|
||||
return coeffRef(rowIndexByOuterInner(outer, inner), colIndexByOuterInner(outer, inner));
|
||||
}
|
||||
|
||||
|
||||
@@ -71,14 +71,14 @@ class Diagonal : public internal::dense_xpr_base<Diagonal<MatrixType, DiagIndex_
|
||||
typedef typename internal::dense_xpr_base<Diagonal>::type Base;
|
||||
EIGEN_DENSE_PUBLIC_INTERFACE(Diagonal)
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit inline Diagonal(MatrixType& matrix, Index a_index = DiagIndex)
|
||||
EIGEN_DEVICE_FUNC constexpr explicit inline Diagonal(MatrixType& matrix, Index a_index = DiagIndex)
|
||||
: m_matrix(matrix), m_index(a_index) {
|
||||
eigen_assert(a_index <= m_matrix.cols() && -a_index <= m_matrix.rows());
|
||||
}
|
||||
|
||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Diagonal)
|
||||
|
||||
EIGEN_DEVICE_FUNC inline Index rows() const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline Index rows() const {
|
||||
return m_index.value() < 0 ? numext::mini<Index>(m_matrix.cols(), m_matrix.rows() + m_index.value())
|
||||
: numext::mini<Index>(m_matrix.rows(), m_matrix.cols() - m_index.value());
|
||||
}
|
||||
@@ -124,11 +124,12 @@ class Diagonal : public internal::dense_xpr_base<Diagonal<MatrixType, DiagIndex_
|
||||
return m_matrix.coeff(idx + rowOffset(), idx + colOffset());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC inline const internal::remove_all_t<typename MatrixType::Nested>& nestedExpression() const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const internal::remove_all_t<typename MatrixType::Nested>& nestedExpression()
|
||||
const {
|
||||
return m_matrix;
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC inline Index index() const { return m_index.value(); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Index index() const { return m_index.value(); }
|
||||
|
||||
protected:
|
||||
typename internal::ref_selector<MatrixType>::non_const_type m_matrix;
|
||||
@@ -157,13 +158,13 @@ class Diagonal : public internal::dense_xpr_base<Diagonal<MatrixType, DiagIndex_
|
||||
*
|
||||
* \sa class Diagonal */
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline typename MatrixBase<Derived>::DiagonalReturnType MatrixBase<Derived>::diagonal() {
|
||||
EIGEN_DEVICE_FUNC constexpr typename MatrixBase<Derived>::DiagonalReturnType MatrixBase<Derived>::diagonal() {
|
||||
return DiagonalReturnType(derived());
|
||||
}
|
||||
|
||||
/** This is the const version of diagonal(). */
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline const typename MatrixBase<Derived>::ConstDiagonalReturnType MatrixBase<Derived>::diagonal()
|
||||
EIGEN_DEVICE_FUNC constexpr const typename MatrixBase<Derived>::ConstDiagonalReturnType MatrixBase<Derived>::diagonal()
|
||||
const {
|
||||
return ConstDiagonalReturnType(derived());
|
||||
}
|
||||
@@ -180,13 +181,14 @@ EIGEN_DEVICE_FUNC inline const typename MatrixBase<Derived>::ConstDiagonalReturn
|
||||
*
|
||||
* \sa MatrixBase::diagonal(), class Diagonal */
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline Diagonal<Derived, DynamicIndex> MatrixBase<Derived>::diagonal(Index index) {
|
||||
EIGEN_DEVICE_FUNC constexpr Diagonal<Derived, DynamicIndex> MatrixBase<Derived>::diagonal(Index index) {
|
||||
return Diagonal<Derived, DynamicIndex>(derived(), index);
|
||||
}
|
||||
|
||||
/** This is the const version of diagonal(Index). */
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline const Diagonal<const Derived, DynamicIndex> MatrixBase<Derived>::diagonal(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr const Diagonal<const Derived, DynamicIndex> MatrixBase<Derived>::diagonal(
|
||||
Index index) const {
|
||||
return Diagonal<const Derived, DynamicIndex>(derived(), index);
|
||||
}
|
||||
|
||||
@@ -203,14 +205,14 @@ EIGEN_DEVICE_FUNC inline const Diagonal<const Derived, DynamicIndex> MatrixBase<
|
||||
* \sa MatrixBase::diagonal(), class Diagonal */
|
||||
template <typename Derived>
|
||||
template <int Index_>
|
||||
EIGEN_DEVICE_FUNC inline Diagonal<Derived, Index_> MatrixBase<Derived>::diagonal() {
|
||||
EIGEN_DEVICE_FUNC constexpr Diagonal<Derived, Index_> MatrixBase<Derived>::diagonal() {
|
||||
return Diagonal<Derived, Index_>(derived());
|
||||
}
|
||||
|
||||
/** This is the const version of diagonal<int>(). */
|
||||
template <typename Derived>
|
||||
template <int Index_>
|
||||
EIGEN_DEVICE_FUNC inline const Diagonal<const Derived, Index_> MatrixBase<Derived>::diagonal() const {
|
||||
EIGEN_DEVICE_FUNC constexpr const Diagonal<const Derived, Index_> MatrixBase<Derived>::diagonal() const {
|
||||
return Diagonal<const Derived, Index_>(derived());
|
||||
}
|
||||
|
||||
|
||||
@@ -184,21 +184,22 @@ class DiagonalMatrix : public DiagonalBase<DiagonalMatrix<Scalar_, SizeAtCompile
|
||||
|
||||
public:
|
||||
/** const version of diagonal(). */
|
||||
EIGEN_DEVICE_FUNC inline const DiagonalVectorType& diagonal() const { return m_diagonal; }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const DiagonalVectorType& diagonal() const { return m_diagonal; }
|
||||
/** \returns a reference to the stored vector of diagonal coefficients. */
|
||||
EIGEN_DEVICE_FUNC inline DiagonalVectorType& diagonal() { return m_diagonal; }
|
||||
EIGEN_DEVICE_FUNC constexpr inline DiagonalVectorType& diagonal() { return m_diagonal; }
|
||||
|
||||
/** Default constructor without initialization */
|
||||
EIGEN_DEVICE_FUNC inline DiagonalMatrix() {}
|
||||
EIGEN_DEVICE_FUNC constexpr inline DiagonalMatrix() {}
|
||||
|
||||
/** Constructs a diagonal matrix with given dimension */
|
||||
EIGEN_DEVICE_FUNC explicit inline DiagonalMatrix(Index dim) : m_diagonal(dim) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit inline DiagonalMatrix(Index dim) : m_diagonal(dim) {}
|
||||
|
||||
/** 2D constructor. */
|
||||
EIGEN_DEVICE_FUNC inline DiagonalMatrix(const Scalar& x, const Scalar& y) : m_diagonal(x, y) {}
|
||||
EIGEN_DEVICE_FUNC constexpr inline DiagonalMatrix(const Scalar& x, const Scalar& y) : m_diagonal(x, y) {}
|
||||
|
||||
/** 3D constructor. */
|
||||
EIGEN_DEVICE_FUNC inline DiagonalMatrix(const Scalar& x, const Scalar& y, const Scalar& z) : m_diagonal(x, y, z) {}
|
||||
EIGEN_DEVICE_FUNC constexpr inline DiagonalMatrix(const Scalar& x, const Scalar& y, const Scalar& z)
|
||||
: m_diagonal(x, y, z) {}
|
||||
|
||||
/** \brief Construct a diagonal matrix with fixed size from an arbitrary number of coefficients.
|
||||
*
|
||||
@@ -209,8 +210,8 @@ class DiagonalMatrix : public DiagonalBase<DiagonalMatrix<Scalar_, SizeAtCompile
|
||||
* \sa DiagonalMatrix(const Scalar&, const Scalar&, const Scalar&)
|
||||
*/
|
||||
template <typename... ArgTypes>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DiagonalMatrix(const Scalar& a0, const Scalar& a1, const Scalar& a2,
|
||||
const ArgTypes&... args)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE DiagonalMatrix(const Scalar& a0, const Scalar& a1, const Scalar& a2,
|
||||
const ArgTypes&... args)
|
||||
: m_diagonal(a0, a1, a2, args...) {}
|
||||
|
||||
/** \brief Constructs a DiagonalMatrix and initializes it by elements given by an initializer list of initializer
|
||||
@@ -221,11 +222,12 @@ class DiagonalMatrix : public DiagonalBase<DiagonalMatrix<Scalar_, SizeAtCompile
|
||||
: m_diagonal(list) {}
|
||||
|
||||
/** \brief Constructs a DiagonalMatrix from an r-value diagonal vector type */
|
||||
EIGEN_DEVICE_FUNC explicit inline DiagonalMatrix(DiagonalVectorType&& diag) : m_diagonal(std::move(diag)) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit inline DiagonalMatrix(DiagonalVectorType&& diag) : m_diagonal(std::move(diag)) {}
|
||||
|
||||
/** Copy constructor. */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline DiagonalMatrix(const DiagonalBase<OtherDerived>& other) : m_diagonal(other.diagonal()) {}
|
||||
EIGEN_DEVICE_FUNC constexpr inline DiagonalMatrix(const DiagonalBase<OtherDerived>& other)
|
||||
: m_diagonal(other.diagonal()) {}
|
||||
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
/** copy constructor. prevent a default copy constructor from hiding the other templated constructor */
|
||||
@@ -234,7 +236,8 @@ class DiagonalMatrix : public DiagonalBase<DiagonalMatrix<Scalar_, SizeAtCompile
|
||||
|
||||
/** generic constructor from expression of the diagonal coefficients */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC explicit inline DiagonalMatrix(const MatrixBase<OtherDerived>& other) : m_diagonal(other) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit inline DiagonalMatrix(const MatrixBase<OtherDerived>& other)
|
||||
: m_diagonal(other) {}
|
||||
|
||||
/** Copy operator. */
|
||||
template <typename OtherDerived>
|
||||
@@ -325,10 +328,11 @@ class DiagonalWrapper : public DiagonalBase<DiagonalWrapper<DiagonalVectorType_>
|
||||
#endif
|
||||
|
||||
/** Constructor from expression of diagonal coefficients to wrap. */
|
||||
EIGEN_DEVICE_FUNC explicit inline DiagonalWrapper(DiagonalVectorType& a_diagonal) : m_diagonal(a_diagonal) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit inline DiagonalWrapper(DiagonalVectorType& a_diagonal)
|
||||
: m_diagonal(a_diagonal) {}
|
||||
|
||||
/** \returns a const reference to the wrapped expression of diagonal coefficients. */
|
||||
EIGEN_DEVICE_FUNC const DiagonalVectorType& diagonal() const { return m_diagonal; }
|
||||
EIGEN_DEVICE_FUNC constexpr const DiagonalVectorType& diagonal() const { return m_diagonal; }
|
||||
|
||||
protected:
|
||||
typename DiagonalVectorType::Nested m_diagonal;
|
||||
@@ -344,7 +348,7 @@ class DiagonalWrapper : public DiagonalBase<DiagonalWrapper<DiagonalVectorType_>
|
||||
* \sa class DiagonalWrapper, class DiagonalMatrix, diagonal(), isDiagonal()
|
||||
**/
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline const DiagonalWrapper<const Derived> MatrixBase<Derived>::asDiagonal() const {
|
||||
EIGEN_DEVICE_FUNC constexpr const DiagonalWrapper<const Derived> MatrixBase<Derived>::asDiagonal() const {
|
||||
return DiagonalWrapper<const Derived>(derived());
|
||||
}
|
||||
|
||||
@@ -383,7 +387,7 @@ bool MatrixBase<Derived>::isDiagonal(const RealScalar& prec) const {
|
||||
/** This is the non-const version of diagonalView() with DiagIndex_ . */
|
||||
template <typename Derived>
|
||||
template <int DiagIndex_>
|
||||
EIGEN_DEVICE_FUNC DiagonalWrapper<Diagonal<Derived, DiagIndex_>> MatrixBase<Derived>::diagonalView() {
|
||||
EIGEN_DEVICE_FUNC constexpr DiagonalWrapper<Diagonal<Derived, DiagIndex_>> MatrixBase<Derived>::diagonalView() {
|
||||
typedef Diagonal<Derived, DiagIndex_> DiagType;
|
||||
typedef DiagonalWrapper<DiagType> ReturnType;
|
||||
DiagType diag(this->derived());
|
||||
@@ -393,7 +397,8 @@ EIGEN_DEVICE_FUNC DiagonalWrapper<Diagonal<Derived, DiagIndex_>> MatrixBase<Deri
|
||||
/** This is the const version of diagonalView() with DiagIndex_ . */
|
||||
template <typename Derived>
|
||||
template <int DiagIndex_>
|
||||
EIGEN_DEVICE_FUNC DiagonalWrapper<Diagonal<const Derived, DiagIndex_>> MatrixBase<Derived>::diagonalView() const {
|
||||
EIGEN_DEVICE_FUNC constexpr DiagonalWrapper<Diagonal<const Derived, DiagIndex_>> MatrixBase<Derived>::diagonalView()
|
||||
const {
|
||||
typedef Diagonal<const Derived, DiagIndex_> DiagType;
|
||||
typedef DiagonalWrapper<DiagType> ReturnType;
|
||||
DiagType diag(this->derived());
|
||||
@@ -402,7 +407,8 @@ EIGEN_DEVICE_FUNC DiagonalWrapper<Diagonal<const Derived, DiagIndex_>> MatrixBas
|
||||
|
||||
/** This is the non-const version of diagonalView() with dynamic index. */
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC DiagonalWrapper<Diagonal<Derived, DynamicIndex>> MatrixBase<Derived>::diagonalView(Index index) {
|
||||
EIGEN_DEVICE_FUNC constexpr DiagonalWrapper<Diagonal<Derived, DynamicIndex>> MatrixBase<Derived>::diagonalView(
|
||||
Index index) {
|
||||
typedef Diagonal<Derived, DynamicIndex> DiagType;
|
||||
typedef DiagonalWrapper<DiagType> ReturnType;
|
||||
DiagType diag(this->derived(), index);
|
||||
@@ -411,7 +417,7 @@ EIGEN_DEVICE_FUNC DiagonalWrapper<Diagonal<Derived, DynamicIndex>> MatrixBase<De
|
||||
|
||||
/** This is the const version of diagonalView() with dynamic index. */
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC DiagonalWrapper<Diagonal<const Derived, DynamicIndex>> MatrixBase<Derived>::diagonalView(
|
||||
EIGEN_DEVICE_FUNC constexpr DiagonalWrapper<Diagonal<const Derived, DynamicIndex>> MatrixBase<Derived>::diagonalView(
|
||||
Index index) const {
|
||||
typedef Diagonal<const Derived, DynamicIndex> DiagType;
|
||||
typedef DiagonalWrapper<DiagType> ReturnType;
|
||||
|
||||
@@ -20,12 +20,14 @@ namespace internal {
|
||||
template <typename Derived, typename Scalar = typename traits<Derived>::Scalar>
|
||||
struct squared_norm_impl {
|
||||
using Real = typename NumTraits<Scalar>::Real;
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Real run(const Derived& a) { return a.realView().cwiseAbs2().sum(); }
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Real run(const Derived& a) {
|
||||
return a.realView().cwiseAbs2().sum();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Derived>
|
||||
struct squared_norm_impl<Derived, bool> {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool run(const Derived& a) { return a.any(); }
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE bool run(const Derived& a) { return a.any(); }
|
||||
};
|
||||
|
||||
} // end namespace internal
|
||||
@@ -43,7 +45,7 @@ struct squared_norm_impl<Derived, bool> {
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
typename ScalarBinaryOpTraits<typename internal::traits<Derived>::Scalar,
|
||||
typename internal::traits<OtherDerived>::Scalar>::ReturnType
|
||||
MatrixBase<Derived>::dot(const MatrixBase<OtherDerived>& other) const {
|
||||
@@ -59,7 +61,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
* \sa dot(), norm(), lpNorm()
|
||||
*/
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NumTraits<typename internal::traits<Derived>::Scalar>::Real
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NumTraits<typename internal::traits<Derived>::Scalar>::Real
|
||||
MatrixBase<Derived>::squaredNorm() const {
|
||||
return internal::squared_norm_impl<Derived>::run(derived());
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ struct EigenBase {
|
||||
EIGEN_DEVICE_FUNC inline constexpr Derived& const_cast_derived() const {
|
||||
return *static_cast<Derived*>(const_cast<EigenBase*>(this));
|
||||
}
|
||||
EIGEN_DEVICE_FUNC inline const Derived& const_derived() const { return *static_cast<const Derived*>(this); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Derived& const_derived() const { return *static_cast<const Derived*>(this); }
|
||||
|
||||
/** \returns the number of rows. \sa cols(), RowsAtCompileTime */
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return derived().rows(); }
|
||||
@@ -65,13 +65,13 @@ struct EigenBase {
|
||||
|
||||
/** \internal Don't use it, but do the equivalent: \code dst = *this; \endcode */
|
||||
template <typename Dest>
|
||||
EIGEN_DEVICE_FUNC inline void evalTo(Dest& dst) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline void evalTo(Dest& dst) const {
|
||||
derived().evalTo(dst);
|
||||
}
|
||||
|
||||
/** \internal Don't use it, but do the equivalent: \code dst += *this; \endcode */
|
||||
template <typename Dest>
|
||||
EIGEN_DEVICE_FUNC inline void addTo(Dest& dst) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline void addTo(Dest& dst) const {
|
||||
// This is the default implementation,
|
||||
// derived class can reimplement it in a more optimized way.
|
||||
typename Dest::PlainObject res(rows(), cols());
|
||||
@@ -81,7 +81,7 @@ struct EigenBase {
|
||||
|
||||
/** \internal Don't use it, but do the equivalent: \code dst -= *this; \endcode */
|
||||
template <typename Dest>
|
||||
EIGEN_DEVICE_FUNC inline void subTo(Dest& dst) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline void subTo(Dest& dst) const {
|
||||
// This is the default implementation,
|
||||
// derived class can reimplement it in a more optimized way.
|
||||
typename Dest::PlainObject res(rows(), cols());
|
||||
@@ -91,7 +91,7 @@ struct EigenBase {
|
||||
|
||||
/** \internal Don't use it, but do the equivalent: \code dst.applyOnTheRight(*this); \endcode */
|
||||
template <typename Dest>
|
||||
EIGEN_DEVICE_FUNC inline void applyThisOnTheRight(Dest& dst) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline void applyThisOnTheRight(Dest& dst) const {
|
||||
// This is the default implementation,
|
||||
// derived class can reimplement it in a more optimized way.
|
||||
dst = dst * this->derived();
|
||||
@@ -99,7 +99,7 @@ struct EigenBase {
|
||||
|
||||
/** \internal Don't use it, but do the equivalent: \code dst.applyOnTheLeft(*this); \endcode */
|
||||
template <typename Dest>
|
||||
EIGEN_DEVICE_FUNC inline void applyThisOnTheLeft(Dest& dst) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline void applyThisOnTheLeft(Dest& dst) const {
|
||||
// This is the default implementation,
|
||||
// derived class can reimplement it in a more optimized way.
|
||||
dst = this->derived() * dst;
|
||||
@@ -125,21 +125,21 @@ struct EigenBase {
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC Derived& DenseBase<Derived>::operator=(const EigenBase<OtherDerived>& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr Derived& DenseBase<Derived>::operator=(const EigenBase<OtherDerived>& other) {
|
||||
call_assignment(derived(), other.derived());
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC Derived& DenseBase<Derived>::operator+=(const EigenBase<OtherDerived>& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr Derived& DenseBase<Derived>::operator+=(const EigenBase<OtherDerived>& other) {
|
||||
call_assignment(derived(), other.derived(), internal::add_assign_op<Scalar, typename OtherDerived::Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC Derived& DenseBase<Derived>::operator-=(const EigenBase<OtherDerived>& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr Derived& DenseBase<Derived>::operator-=(const EigenBase<OtherDerived>& other) {
|
||||
call_assignment(derived(), other.derived(), internal::sub_assign_op<Scalar, typename OtherDerived::Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class ForceAlignedAccess : public internal::dense_xpr_base<ForceAlignedAccess<Ex
|
||||
typedef typename internal::dense_xpr_base<ForceAlignedAccess>::type Base;
|
||||
EIGEN_DENSE_PUBLIC_INTERFACE(ForceAlignedAccess)
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit inline ForceAlignedAccess(const ExpressionType& matrix) : m_expression(matrix) {}
|
||||
EIGEN_DEVICE_FUNC explicit constexpr ForceAlignedAccess(const ExpressionType& matrix) : m_expression(matrix) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_expression.rows(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_expression.cols(); }
|
||||
|
||||
@@ -86,8 +86,8 @@ struct isMuchSmallerThan_scalar_selector<Derived, true> {
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isApprox(const DenseBase<OtherDerived>& other,
|
||||
const RealScalar& prec) const {
|
||||
EIGEN_DEVICE_FUNC constexpr bool DenseBase<Derived>::isApprox(const DenseBase<OtherDerived>& other,
|
||||
const RealScalar& prec) const {
|
||||
return internal::isApprox_selector<Derived, OtherDerived>::run(derived(), other.derived(), prec);
|
||||
}
|
||||
|
||||
@@ -105,8 +105,8 @@ EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isApprox(const DenseBase<OtherDerived
|
||||
* \sa isApprox(), isMuchSmallerThan(const DenseBase<OtherDerived>&, RealScalar) const
|
||||
*/
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isMuchSmallerThan(const typename NumTraits<Scalar>::Real& other,
|
||||
const RealScalar& prec) const {
|
||||
EIGEN_DEVICE_FUNC constexpr bool DenseBase<Derived>::isMuchSmallerThan(const typename NumTraits<Scalar>::Real& other,
|
||||
const RealScalar& prec) const {
|
||||
return internal::isMuchSmallerThan_scalar_selector<Derived>::run(derived(), other, prec);
|
||||
}
|
||||
|
||||
@@ -122,8 +122,8 @@ EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isMuchSmallerThan(const typename NumT
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isMuchSmallerThan(const DenseBase<OtherDerived>& other,
|
||||
const RealScalar& prec) const {
|
||||
EIGEN_DEVICE_FUNC constexpr bool DenseBase<Derived>::isMuchSmallerThan(const DenseBase<OtherDerived>& other,
|
||||
const RealScalar& prec) const {
|
||||
return internal::isMuchSmallerThan_object_selector<Derived, OtherDerived>::run(derived(), other.derived(), prec);
|
||||
}
|
||||
|
||||
|
||||
@@ -130,12 +130,12 @@ using GlobalUnaryPowReturnType = std::enable_if_t<
|
||||
*/
|
||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
||||
template <typename Derived, typename ScalarExponent>
|
||||
EIGEN_DEVICE_FUNC inline const GlobalUnaryPowReturnType<Derived, ScalarExponent> pow(const Eigen::ArrayBase<Derived>& x,
|
||||
const ScalarExponent& exponent);
|
||||
EIGEN_DEVICE_FUNC constexpr inline const GlobalUnaryPowReturnType<Derived, ScalarExponent> pow(
|
||||
const Eigen::ArrayBase<Derived>& x, const ScalarExponent& exponent);
|
||||
#else
|
||||
template <typename Derived, typename ScalarExponent>
|
||||
EIGEN_DEVICE_FUNC inline const GlobalUnaryPowReturnType<Derived, ScalarExponent> pow(const Eigen::ArrayBase<Derived>& x,
|
||||
const ScalarExponent& exponent) {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const GlobalUnaryPowReturnType<Derived, ScalarExponent> pow(
|
||||
const Eigen::ArrayBase<Derived>& x, const ScalarExponent& exponent) {
|
||||
return GlobalUnaryPowReturnType<Derived, ScalarExponent>(
|
||||
x.derived(), internal::scalar_unary_pow_op<typename Derived::Scalar, ScalarExponent>(exponent));
|
||||
}
|
||||
|
||||
@@ -259,26 +259,27 @@ struct unary_evaluator<IndexedView<ArgType, RowIndices, ColIndices>, IndexBased>
|
||||
Alignment = 0
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_xpr(xpr) {
|
||||
EIGEN_DEVICE_FUNC constexpr explicit unary_evaluator(const XprType& xpr)
|
||||
: m_argImpl(xpr.nestedExpression()), m_xpr(xpr) {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
}
|
||||
|
||||
typedef typename XprType::Scalar Scalar;
|
||||
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
eigen_assert(m_xpr.rowIndices()[row] >= 0 && m_xpr.rowIndices()[row] < m_xpr.nestedExpression().rows() &&
|
||||
m_xpr.colIndices()[col] >= 0 && m_xpr.colIndices()[col] < m_xpr.nestedExpression().cols());
|
||||
return m_argImpl.coeff(m_xpr.rowIndices()[row], m_xpr.colIndices()[col]);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
eigen_assert(m_xpr.rowIndices()[row] >= 0 && m_xpr.rowIndices()[row] < m_xpr.nestedExpression().rows() &&
|
||||
m_xpr.colIndices()[col] >= 0 && m_xpr.colIndices()[col] < m_xpr.nestedExpression().cols());
|
||||
return m_argImpl.coeffRef(m_xpr.rowIndices()[row], m_xpr.colIndices()[col]);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
|
||||
EIGEN_STATIC_ASSERT_LVALUE(XprType)
|
||||
Index row = XprType::RowsAtCompileTime == 1 ? 0 : index;
|
||||
Index col = XprType::RowsAtCompileTime == 1 ? index : 0;
|
||||
@@ -287,7 +288,7 @@ struct unary_evaluator<IndexedView<ArgType, RowIndices, ColIndices>, IndexBased>
|
||||
return m_argImpl.coeffRef(m_xpr.rowIndices()[row], m_xpr.colIndices()[col]);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar& coeffRef(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalar& coeffRef(Index index) const {
|
||||
Index row = XprType::RowsAtCompileTime == 1 ? 0 : index;
|
||||
Index col = XprType::RowsAtCompileTime == 1 ? index : 0;
|
||||
eigen_assert(m_xpr.rowIndices()[row] >= 0 && m_xpr.rowIndices()[row] < m_xpr.nestedExpression().rows() &&
|
||||
@@ -295,7 +296,7 @@ struct unary_evaluator<IndexedView<ArgType, RowIndices, ColIndices>, IndexBased>
|
||||
return m_argImpl.coeffRef(m_xpr.rowIndices()[row], m_xpr.colIndices()[col]);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index index) const {
|
||||
Index row = XprType::RowsAtCompileTime == 1 ? 0 : index;
|
||||
Index col = XprType::RowsAtCompileTime == 1 ? index : 0;
|
||||
eigen_assert(m_xpr.rowIndices()[row] >= 0 && m_xpr.rowIndices()[row] < m_xpr.nestedExpression().rows() &&
|
||||
|
||||
@@ -49,12 +49,12 @@ class Inverse : public InverseImpl<XprType, typename internal::traits<XprType>::
|
||||
typedef typename internal::ref_selector<Inverse>::type Nested;
|
||||
typedef internal::remove_all_t<XprType> NestedExpression;
|
||||
|
||||
explicit EIGEN_DEVICE_FUNC Inverse(const XprType& xpr) : m_xpr(xpr) {}
|
||||
explicit EIGEN_DEVICE_FUNC constexpr Inverse(const XprType& xpr) : m_xpr(xpr) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_xpr.cols(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_xpr.rows(); }
|
||||
|
||||
EIGEN_DEVICE_FUNC const XprTypeNestedCleaned& nestedExpression() const { return m_xpr; }
|
||||
EIGEN_DEVICE_FUNC constexpr const XprTypeNestedCleaned& nestedExpression() const { return m_xpr; }
|
||||
|
||||
protected:
|
||||
XprTypeNested m_xpr;
|
||||
|
||||
@@ -100,7 +100,7 @@ class Map : public MapBase<Map<PlainObjectType, MapOptions, StrideType> > {
|
||||
|
||||
typedef typename Base::PointerType PointerType;
|
||||
typedef PointerType PointerArgType;
|
||||
EIGEN_DEVICE_FUNC inline PointerType cast_to_pointer_type(PointerArgType ptr) { return ptr; }
|
||||
EIGEN_DEVICE_FUNC constexpr inline PointerType cast_to_pointer_type(PointerArgType ptr) { return ptr; }
|
||||
|
||||
EIGEN_DEVICE_FUNC constexpr Index innerStride() const {
|
||||
return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;
|
||||
@@ -120,7 +120,7 @@ class Map : public MapBase<Map<PlainObjectType, MapOptions, StrideType> > {
|
||||
* \param dataPtr pointer to the array to map
|
||||
* \param stride optional Stride object, passing the strides.
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC explicit inline Map(PointerArgType dataPtr, const StrideType& stride = StrideType())
|
||||
EIGEN_DEVICE_FUNC constexpr explicit inline Map(PointerArgType dataPtr, const StrideType& stride = StrideType())
|
||||
: Base(cast_to_pointer_type(dataPtr)), m_stride(stride) {}
|
||||
|
||||
/** Constructor in the dynamic-size vector case.
|
||||
@@ -129,7 +129,7 @@ class Map : public MapBase<Map<PlainObjectType, MapOptions, StrideType> > {
|
||||
* \param size the size of the vector expression
|
||||
* \param stride optional Stride object, passing the strides.
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline Map(PointerArgType dataPtr, Index size, const StrideType& stride = StrideType())
|
||||
EIGEN_DEVICE_FUNC constexpr inline Map(PointerArgType dataPtr, Index size, const StrideType& stride = StrideType())
|
||||
: Base(cast_to_pointer_type(dataPtr), size), m_stride(stride) {}
|
||||
|
||||
/** Constructor in the dynamic-size matrix case.
|
||||
@@ -139,7 +139,8 @@ class Map : public MapBase<Map<PlainObjectType, MapOptions, StrideType> > {
|
||||
* \param cols the number of columns of the matrix expression
|
||||
* \param stride optional Stride object, passing the strides.
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline Map(PointerArgType dataPtr, Index rows, Index cols, const StrideType& stride = StrideType())
|
||||
EIGEN_DEVICE_FUNC constexpr inline Map(PointerArgType dataPtr, Index rows, Index cols,
|
||||
const StrideType& stride = StrideType())
|
||||
: Base(cast_to_pointer_type(dataPtr), rows, cols), m_stride(stride) {}
|
||||
|
||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Map)
|
||||
|
||||
@@ -97,23 +97,23 @@ class MapBase<Derived, ReadOnlyAccessors> : public internal::dense_xpr_base<Deri
|
||||
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_data; }
|
||||
|
||||
/** \copydoc PlainObjectBase::coeff(Index,Index) const */
|
||||
EIGEN_DEVICE_FUNC inline const Scalar& coeff(Index rowId, Index colId) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Scalar& coeff(Index rowId, Index colId) const {
|
||||
return m_data[colId * colStride() + rowId * rowStride()];
|
||||
}
|
||||
|
||||
/** \copydoc PlainObjectBase::coeff(Index) const */
|
||||
EIGEN_DEVICE_FUNC inline const Scalar& coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Scalar& coeff(Index index) const {
|
||||
EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived)
|
||||
return m_data[index * innerStride()];
|
||||
}
|
||||
|
||||
/** \copydoc PlainObjectBase::coeffRef(Index,Index) const */
|
||||
EIGEN_DEVICE_FUNC inline const Scalar& coeffRef(Index rowId, Index colId) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Scalar& coeffRef(Index rowId, Index colId) const {
|
||||
return this->m_data[colId * colStride() + rowId * rowStride()];
|
||||
}
|
||||
|
||||
/** \copydoc PlainObjectBase::coeffRef(Index) const */
|
||||
EIGEN_DEVICE_FUNC inline const Scalar& coeffRef(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Scalar& coeffRef(Index index) const {
|
||||
EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived)
|
||||
return this->m_data[index * innerStride()];
|
||||
}
|
||||
@@ -132,14 +132,14 @@ class MapBase<Derived, ReadOnlyAccessors> : public internal::dense_xpr_base<Deri
|
||||
}
|
||||
|
||||
/** \internal Constructor for fixed size matrices or vectors */
|
||||
EIGEN_DEVICE_FUNC explicit inline MapBase(PointerType dataPtr)
|
||||
EIGEN_DEVICE_FUNC constexpr explicit inline MapBase(PointerType dataPtr)
|
||||
: m_data(dataPtr), m_rows(RowsAtCompileTime), m_cols(ColsAtCompileTime) {
|
||||
EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived)
|
||||
checkSanity<Derived>();
|
||||
}
|
||||
|
||||
/** \internal Constructor for dynamically sized vectors */
|
||||
EIGEN_DEVICE_FUNC inline MapBase(PointerType dataPtr, Index vecSize)
|
||||
EIGEN_DEVICE_FUNC constexpr inline MapBase(PointerType dataPtr, Index vecSize)
|
||||
: m_data(dataPtr),
|
||||
m_rows(RowsAtCompileTime == Dynamic ? vecSize : Index(RowsAtCompileTime)),
|
||||
m_cols(ColsAtCompileTime == Dynamic ? vecSize : Index(ColsAtCompileTime)) {
|
||||
@@ -150,7 +150,7 @@ class MapBase<Derived, ReadOnlyAccessors> : public internal::dense_xpr_base<Deri
|
||||
}
|
||||
|
||||
/** \internal Constructor for dynamically sized matrices */
|
||||
EIGEN_DEVICE_FUNC inline MapBase(PointerType dataPtr, Index rows, Index cols)
|
||||
EIGEN_DEVICE_FUNC constexpr inline MapBase(PointerType dataPtr, Index rows, Index cols)
|
||||
: m_data(dataPtr), m_rows(rows), m_cols(cols) {
|
||||
eigen_assert((dataPtr == 0) || (rows >= 0 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows) &&
|
||||
cols >= 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols)));
|
||||
@@ -238,11 +238,11 @@ class MapBase<Derived, WriteAccessors> : public MapBase<Derived, ReadOnlyAccesso
|
||||
return this->m_data;
|
||||
} // no const-cast here so non-const-correct code will give a compile error
|
||||
|
||||
EIGEN_DEVICE_FUNC inline ScalarWithConstIfNotLvalue& coeffRef(Index row, Index col) {
|
||||
EIGEN_DEVICE_FUNC constexpr inline ScalarWithConstIfNotLvalue& coeffRef(Index row, Index col) {
|
||||
return this->m_data[col * colStride() + row * rowStride()];
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC inline ScalarWithConstIfNotLvalue& coeffRef(Index index) {
|
||||
EIGEN_DEVICE_FUNC constexpr inline ScalarWithConstIfNotLvalue& coeffRef(Index index) {
|
||||
EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived)
|
||||
return this->m_data[index * innerStride()];
|
||||
}
|
||||
@@ -258,9 +258,9 @@ class MapBase<Derived, WriteAccessors> : public MapBase<Derived, ReadOnlyAccesso
|
||||
internal::pstoret<Scalar, PacketScalar, StoreMode>(this->m_data + index * innerStride(), val);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit inline MapBase(PointerType dataPtr) : Base(dataPtr) {}
|
||||
EIGEN_DEVICE_FUNC inline MapBase(PointerType dataPtr, Index vecSize) : Base(dataPtr, vecSize) {}
|
||||
EIGEN_DEVICE_FUNC inline MapBase(PointerType dataPtr, Index rows, Index cols) : Base(dataPtr, rows, cols) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit inline MapBase(PointerType dataPtr) : Base(dataPtr) {}
|
||||
EIGEN_DEVICE_FUNC constexpr inline MapBase(PointerType dataPtr, Index vecSize) : Base(dataPtr, vecSize) {}
|
||||
EIGEN_DEVICE_FUNC constexpr inline MapBase(PointerType dataPtr, Index rows, Index cols) : Base(dataPtr, rows, cols) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC Derived& operator=(const MapBase& other) {
|
||||
ReadOnlyMapBase::Base::operator=(other);
|
||||
|
||||
@@ -74,7 +74,7 @@ struct global_math_functions_filtering_base<
|
||||
template <typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
|
||||
struct real_default_impl {
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
EIGEN_DEVICE_FUNC static inline RealScalar run(const Scalar& x) { return x; }
|
||||
EIGEN_DEVICE_FUNC static constexpr RealScalar run(const Scalar& x) { return x; }
|
||||
};
|
||||
|
||||
template <typename Scalar>
|
||||
@@ -222,7 +222,7 @@ namespace internal {
|
||||
|
||||
template <typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
|
||||
struct conj_default_impl {
|
||||
EIGEN_DEVICE_FUNC static inline Scalar run(const Scalar& x) { return x; }
|
||||
EIGEN_DEVICE_FUNC static constexpr Scalar run(const Scalar& x) { return x; }
|
||||
};
|
||||
|
||||
template <typename Scalar>
|
||||
@@ -287,7 +287,7 @@ struct sqrt_impl {
|
||||
|
||||
// Complex sqrt defined in MathFunctionsImpl.h.
|
||||
template <typename ComplexT>
|
||||
EIGEN_DEVICE_FUNC ComplexT complex_sqrt(const ComplexT& a_x);
|
||||
EIGEN_DEVICE_FUNC constexpr ComplexT complex_sqrt(const ComplexT& a_x);
|
||||
|
||||
// Custom implementation is faster than `std::sqrt`, works on
|
||||
// GPU, and correctly handles special cases (unlike MSVC).
|
||||
@@ -307,7 +307,7 @@ struct rsqrt_impl;
|
||||
|
||||
// Complex rsqrt defined in MathFunctionsImpl.h.
|
||||
template <typename ComplexT>
|
||||
EIGEN_DEVICE_FUNC ComplexT complex_rsqrt(const ComplexT& a_x);
|
||||
EIGEN_DEVICE_FUNC constexpr ComplexT complex_rsqrt(const ComplexT& a_x);
|
||||
|
||||
template <typename T>
|
||||
struct rsqrt_impl<std::complex<T>> {
|
||||
@@ -504,7 +504,7 @@ struct expm1_retval {
|
||||
|
||||
// Complex log defined in MathFunctionsImpl.h.
|
||||
template <typename ComplexT>
|
||||
EIGEN_DEVICE_FUNC ComplexT complex_log(const ComplexT& z);
|
||||
EIGEN_DEVICE_FUNC constexpr ComplexT complex_log(const ComplexT& z);
|
||||
|
||||
template <typename Scalar>
|
||||
struct log_impl {
|
||||
@@ -1023,13 +1023,13 @@ namespace numext {
|
||||
|
||||
#if (!defined(EIGEN_GPUCC) || defined(EIGEN_CONSTEXPR_ARE_DEVICE_FUNC))
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T& x, const T& y) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE T mini(const T& x, const T& y) {
|
||||
EIGEN_USING_STD(min)
|
||||
return min EIGEN_NOT_A_MACRO(x, y);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T& x, const T& y) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE T maxi(const T& x, const T& y) {
|
||||
EIGEN_USING_STD(max)
|
||||
return max EIGEN_NOT_A_MACRO(x, y);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,8 @@ struct generic_sqrt_newton_step {
|
||||
};
|
||||
|
||||
template <typename RealScalar>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RealScalar positive_real_hypot(const RealScalar& x, const RealScalar& y) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE RealScalar positive_real_hypot(const RealScalar& x,
|
||||
const RealScalar& y) {
|
||||
// IEEE IEC 6059 special cases.
|
||||
if ((numext::isinf)(x) || (numext::isinf)(y)) return NumTraits<RealScalar>::infinity();
|
||||
if ((numext::isnan)(x) || (numext::isnan)(y)) return NumTraits<RealScalar>::quiet_NaN();
|
||||
@@ -173,7 +174,7 @@ struct hypot_impl {
|
||||
// Generic complex sqrt implementation that correctly handles corner cases
|
||||
// according to https://en.cppreference.com/w/cpp/numeric/complex/sqrt
|
||||
template <typename ComplexT>
|
||||
EIGEN_DEVICE_FUNC ComplexT complex_sqrt(const ComplexT& z) {
|
||||
EIGEN_DEVICE_FUNC constexpr ComplexT complex_sqrt(const ComplexT& z) {
|
||||
// Computes the principal sqrt of the input.
|
||||
//
|
||||
// For a complex square root of the number x + i*y. We want to find real
|
||||
@@ -209,7 +210,7 @@ EIGEN_DEVICE_FUNC ComplexT complex_sqrt(const ComplexT& z) {
|
||||
|
||||
// Generic complex rsqrt implementation.
|
||||
template <typename ComplexT>
|
||||
EIGEN_DEVICE_FUNC ComplexT complex_rsqrt(const ComplexT& z) {
|
||||
EIGEN_DEVICE_FUNC constexpr ComplexT complex_rsqrt(const ComplexT& z) {
|
||||
// Computes the principal reciprocal sqrt of the input.
|
||||
//
|
||||
// For a complex reciprocal square root of the number z = x + i*y. We want to
|
||||
@@ -248,7 +249,7 @@ EIGEN_DEVICE_FUNC ComplexT complex_rsqrt(const ComplexT& z) {
|
||||
}
|
||||
|
||||
template <typename ComplexT>
|
||||
EIGEN_DEVICE_FUNC ComplexT complex_log(const ComplexT& z) {
|
||||
EIGEN_DEVICE_FUNC constexpr ComplexT complex_log(const ComplexT& z) {
|
||||
// Computes complex log.
|
||||
using T = typename NumTraits<ComplexT>::Real;
|
||||
T a = numext::abs(z);
|
||||
|
||||
@@ -316,12 +316,12 @@ class Matrix : public PlainObjectBase<Matrix<Scalar_, Rows_, Cols_, Options_, Ma
|
||||
|
||||
// This constructor is for both 1x1 matrices and dynamic vectors
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit Matrix(const T& x) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit Matrix(const T& x) {
|
||||
Base::template _init1<T>(x);
|
||||
}
|
||||
|
||||
template <typename T0, typename T1>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(const T0& x, const T1& y) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Matrix(const T0& x, const T1& y) {
|
||||
Base::template _init2<T0, T1>(x, y);
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ class Matrix : public PlainObjectBase<Matrix<Scalar_, Rows_, Cols_, Options_, Ma
|
||||
/** \brief Constructs an initialized 3D vector with given coefficients
|
||||
* \sa Matrix(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&...)
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z) {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 3)
|
||||
m_storage.data()[0] = x;
|
||||
m_storage.data()[1] = y;
|
||||
@@ -376,7 +376,8 @@ class Matrix : public PlainObjectBase<Matrix<Scalar_, Rows_, Cols_, Options_, Ma
|
||||
/** \brief Constructs an initialized 4D vector with given coefficients
|
||||
* \sa Matrix(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&...)
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z, const Scalar& w) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z,
|
||||
const Scalar& w) {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 4)
|
||||
m_storage.data()[0] = x;
|
||||
m_storage.data()[1] = y;
|
||||
@@ -391,7 +392,8 @@ class Matrix : public PlainObjectBase<Matrix<Scalar_, Rows_, Cols_, Options_, Ma
|
||||
* \sa MatrixBase::operator=(const EigenBase<OtherDerived>&)
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(const EigenBase<OtherDerived>& other) : Base(other.derived()) {}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Matrix(const EigenBase<OtherDerived>& other)
|
||||
: Base(other.derived()) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC constexpr Index innerStride() const noexcept { return 1; }
|
||||
EIGEN_DEVICE_FUNC constexpr Index outerStride() const noexcept { return this->innerSize(); }
|
||||
|
||||
@@ -99,7 +99,7 @@ class MatrixBase : public DenseBase<Derived> {
|
||||
|
||||
/** \returns the size of the main diagonal, which is min(rows(),cols()).
|
||||
* \sa rows(), cols(), SizeAtCompileTime. */
|
||||
EIGEN_DEVICE_FUNC inline Index diagonalSize() const { return (numext::mini)(rows(), cols()); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index diagonalSize() const { return (numext::mini)(rows(), cols()); }
|
||||
|
||||
typedef typename Base::PlainObject PlainObject;
|
||||
|
||||
@@ -136,19 +136,19 @@ class MatrixBase : public DenseBase<Derived> {
|
||||
/** Special case of the template operator=, in order to prevent the compiler
|
||||
* from generating a default operator= (issue hit with g++ 4.1)
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const MatrixBase& other);
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& operator=(const MatrixBase& other);
|
||||
|
||||
// We cannot inherit here via Base::operator= since it is causing
|
||||
// trouble with MSVC.
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other);
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other);
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC Derived& operator=(const EigenBase<OtherDerived>& other);
|
||||
EIGEN_DEVICE_FUNC constexpr Derived& operator=(const EigenBase<OtherDerived>& other);
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC Derived& operator=(const ReturnByValue<OtherDerived>& other);
|
||||
EIGEN_DEVICE_FUNC constexpr Derived& operator=(const ReturnByValue<OtherDerived>& other);
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator+=(const MatrixBase<OtherDerived>& other);
|
||||
@@ -180,11 +180,11 @@ class MatrixBase : public DenseBase<Derived> {
|
||||
const SkewSymmetricBase<SkewDerived>& skew) const;
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC typename ScalarBinaryOpTraits<typename internal::traits<Derived>::Scalar,
|
||||
typename internal::traits<OtherDerived>::Scalar>::ReturnType
|
||||
EIGEN_DEVICE_FUNC constexpr typename ScalarBinaryOpTraits<typename internal::traits<Derived>::Scalar,
|
||||
typename internal::traits<OtherDerived>::Scalar>::ReturnType
|
||||
dot(const MatrixBase<OtherDerived>& other) const;
|
||||
|
||||
EIGEN_DEVICE_FUNC RealScalar squaredNorm() const;
|
||||
EIGEN_DEVICE_FUNC constexpr RealScalar squaredNorm() const;
|
||||
EIGEN_DEVICE_FUNC RealScalar norm() const;
|
||||
RealScalar stableNorm() const;
|
||||
RealScalar blueNorm() const;
|
||||
@@ -194,23 +194,23 @@ class MatrixBase : public DenseBase<Derived> {
|
||||
EIGEN_DEVICE_FUNC void normalize();
|
||||
EIGEN_DEVICE_FUNC void stableNormalize();
|
||||
|
||||
EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const;
|
||||
EIGEN_DEVICE_FUNC constexpr const AdjointReturnType adjoint() const;
|
||||
EIGEN_DEVICE_FUNC void adjointInPlace();
|
||||
|
||||
typedef Diagonal<Derived> DiagonalReturnType;
|
||||
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal();
|
||||
EIGEN_DEVICE_FUNC constexpr DiagonalReturnType diagonal();
|
||||
|
||||
typedef Diagonal<const Derived> ConstDiagonalReturnType;
|
||||
EIGEN_DEVICE_FUNC const ConstDiagonalReturnType diagonal() const;
|
||||
EIGEN_DEVICE_FUNC constexpr const ConstDiagonalReturnType diagonal() const;
|
||||
|
||||
template <int Index>
|
||||
EIGEN_DEVICE_FUNC Diagonal<Derived, Index> diagonal();
|
||||
EIGEN_DEVICE_FUNC constexpr Diagonal<Derived, Index> diagonal();
|
||||
|
||||
template <int Index>
|
||||
EIGEN_DEVICE_FUNC const Diagonal<const Derived, Index> diagonal() const;
|
||||
EIGEN_DEVICE_FUNC constexpr const Diagonal<const Derived, Index> diagonal() const;
|
||||
|
||||
EIGEN_DEVICE_FUNC Diagonal<Derived, DynamicIndex> diagonal(Index index);
|
||||
EIGEN_DEVICE_FUNC const Diagonal<const Derived, DynamicIndex> diagonal(Index index) const;
|
||||
EIGEN_DEVICE_FUNC constexpr Diagonal<Derived, DynamicIndex> diagonal(Index index);
|
||||
EIGEN_DEVICE_FUNC constexpr const Diagonal<const Derived, DynamicIndex> diagonal(Index index) const;
|
||||
|
||||
template <unsigned int Mode>
|
||||
struct TriangularViewReturnType {
|
||||
@@ -222,9 +222,9 @@ class MatrixBase : public DenseBase<Derived> {
|
||||
};
|
||||
|
||||
template <unsigned int Mode>
|
||||
EIGEN_DEVICE_FUNC typename TriangularViewReturnType<Mode>::Type triangularView();
|
||||
EIGEN_DEVICE_FUNC constexpr typename TriangularViewReturnType<Mode>::Type triangularView();
|
||||
template <unsigned int Mode>
|
||||
EIGEN_DEVICE_FUNC typename ConstTriangularViewReturnType<Mode>::Type triangularView() const;
|
||||
EIGEN_DEVICE_FUNC constexpr typename ConstTriangularViewReturnType<Mode>::Type triangularView() const;
|
||||
|
||||
template <unsigned int UpLo>
|
||||
struct SelfAdjointViewReturnType {
|
||||
@@ -236,9 +236,9 @@ class MatrixBase : public DenseBase<Derived> {
|
||||
};
|
||||
|
||||
template <unsigned int UpLo>
|
||||
EIGEN_DEVICE_FUNC typename SelfAdjointViewReturnType<UpLo>::Type selfadjointView();
|
||||
EIGEN_DEVICE_FUNC constexpr typename SelfAdjointViewReturnType<UpLo>::Type selfadjointView();
|
||||
template <unsigned int UpLo>
|
||||
EIGEN_DEVICE_FUNC typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView() const;
|
||||
EIGEN_DEVICE_FUNC constexpr typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView() const;
|
||||
|
||||
const SparseView<Derived> sparseView(
|
||||
const Scalar& m_reference = Scalar(0),
|
||||
@@ -252,9 +252,9 @@ class MatrixBase : public DenseBase<Derived> {
|
||||
EIGEN_DEVICE_FUNC static const BasisReturnType UnitZ();
|
||||
EIGEN_DEVICE_FUNC static const BasisReturnType UnitW();
|
||||
|
||||
EIGEN_DEVICE_FUNC const DiagonalWrapper<const Derived> asDiagonal() const;
|
||||
EIGEN_DEVICE_FUNC constexpr const DiagonalWrapper<const Derived> asDiagonal() const;
|
||||
const PermutationWrapper<const Derived> asPermutation() const;
|
||||
EIGEN_DEVICE_FUNC const SkewSymmetricWrapper<const Derived> asSkewSymmetric() const;
|
||||
EIGEN_DEVICE_FUNC constexpr const SkewSymmetricWrapper<const Derived> asSkewSymmetric() const;
|
||||
|
||||
EIGEN_DEVICE_FUNC Derived& setIdentity();
|
||||
EIGEN_DEVICE_FUNC Derived& setIdentity(Index rows, Index cols);
|
||||
@@ -276,14 +276,14 @@ class MatrixBase : public DenseBase<Derived> {
|
||||
|
||||
/* diagonalView */
|
||||
template <int DiagIndex_ = 0>
|
||||
EIGEN_DEVICE_FUNC DiagonalWrapper<Diagonal<Derived, DiagIndex_>> diagonalView();
|
||||
EIGEN_DEVICE_FUNC constexpr DiagonalWrapper<Diagonal<Derived, DiagIndex_>> diagonalView();
|
||||
|
||||
template <int DiagIndex_ = 0>
|
||||
EIGEN_DEVICE_FUNC DiagonalWrapper<Diagonal<const Derived, DiagIndex_>> diagonalView() const;
|
||||
EIGEN_DEVICE_FUNC constexpr DiagonalWrapper<Diagonal<const Derived, DiagIndex_>> diagonalView() const;
|
||||
|
||||
EIGEN_DEVICE_FUNC DiagonalWrapper<Diagonal<Derived, DynamicIndex>> diagonalView(Index index);
|
||||
EIGEN_DEVICE_FUNC constexpr DiagonalWrapper<Diagonal<Derived, DynamicIndex>> diagonalView(Index index);
|
||||
|
||||
EIGEN_DEVICE_FUNC DiagonalWrapper<Diagonal<const Derived, DynamicIndex>> diagonalView(Index index) const;
|
||||
EIGEN_DEVICE_FUNC constexpr DiagonalWrapper<Diagonal<const Derived, DynamicIndex>> diagonalView(Index index) const;
|
||||
|
||||
/** \returns true if each coefficients of \c *this and \a other are all exactly equal.
|
||||
* \warning When using floating point scalar values you probably should rather use a
|
||||
@@ -307,14 +307,14 @@ class MatrixBase : public DenseBase<Derived> {
|
||||
|
||||
// TODO forceAlignedAccess is temporarily disabled
|
||||
// Need to find a nicer workaround.
|
||||
inline const Derived& forceAlignedAccess() const { return derived(); }
|
||||
inline Derived& forceAlignedAccess() { return derived(); }
|
||||
constexpr const Derived& forceAlignedAccess() const { return derived(); }
|
||||
constexpr Derived& forceAlignedAccess() { return derived(); }
|
||||
template <bool Enable>
|
||||
inline const Derived& forceAlignedAccessIf() const {
|
||||
constexpr const Derived& forceAlignedAccessIf() const {
|
||||
return derived();
|
||||
}
|
||||
template <bool Enable>
|
||||
inline Derived& forceAlignedAccessIf() {
|
||||
constexpr Derived& forceAlignedAccessIf() {
|
||||
return derived();
|
||||
}
|
||||
|
||||
@@ -323,15 +323,17 @@ class MatrixBase : public DenseBase<Derived> {
|
||||
template <int p>
|
||||
EIGEN_DEVICE_FUNC RealScalar lpNorm() const;
|
||||
|
||||
EIGEN_DEVICE_FUNC MatrixBase<Derived>& matrix() { return *this; }
|
||||
EIGEN_DEVICE_FUNC const MatrixBase<Derived>& matrix() const { return *this; }
|
||||
EIGEN_DEVICE_FUNC constexpr MatrixBase<Derived>& matrix() { return *this; }
|
||||
EIGEN_DEVICE_FUNC constexpr const MatrixBase<Derived>& matrix() const { return *this; }
|
||||
|
||||
/** \returns an \link Eigen::ArrayBase Array \endlink expression of this matrix
|
||||
* \sa ArrayBase::matrix() */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper<Derived> array() { return ArrayWrapper<Derived>(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ArrayWrapper<Derived> array() {
|
||||
return ArrayWrapper<Derived>(derived());
|
||||
}
|
||||
/** \returns a const \link Eigen::ArrayBase Array \endlink expression of this matrix
|
||||
* \sa ArrayBase::matrix() */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper<const Derived> array() const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const ArrayWrapper<const Derived> array() const {
|
||||
return ArrayWrapper<const Derived>(derived());
|
||||
}
|
||||
|
||||
|
||||
@@ -43,20 +43,26 @@ class NestByValue : public internal::dense_xpr_base<NestByValue<ExpressionType>
|
||||
|
||||
EIGEN_DENSE_PUBLIC_INTERFACE(NestByValue)
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_expression.rows(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_expression.cols(); }
|
||||
|
||||
EIGEN_DEVICE_FUNC operator const ExpressionType&() const { return m_expression; }
|
||||
EIGEN_DEVICE_FUNC constexpr operator const ExpressionType&() const { return m_expression; }
|
||||
|
||||
EIGEN_DEVICE_FUNC const ExpressionType& nestedExpression() const { return m_expression; }
|
||||
EIGEN_DEVICE_FUNC constexpr const ExpressionType& nestedExpression() const { return m_expression; }
|
||||
|
||||
EIGEN_DEVICE_FUNC std::enable_if_t<HasDirectAccess, const Scalar*> data() const { return m_expression.data(); }
|
||||
EIGEN_DEVICE_FUNC constexpr std::enable_if_t<HasDirectAccess, const Scalar*> data() const {
|
||||
return m_expression.data();
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC std::enable_if_t<HasDirectAccess, Index> innerStride() const { return m_expression.innerStride(); }
|
||||
EIGEN_DEVICE_FUNC constexpr std::enable_if_t<HasDirectAccess, Index> innerStride() const {
|
||||
return m_expression.innerStride();
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC std::enable_if_t<HasDirectAccess, Index> outerStride() const { return m_expression.outerStride(); }
|
||||
EIGEN_DEVICE_FUNC constexpr std::enable_if_t<HasDirectAccess, Index> outerStride() const {
|
||||
return m_expression.outerStride();
|
||||
}
|
||||
|
||||
protected:
|
||||
const ExpressionType m_expression;
|
||||
@@ -65,7 +71,7 @@ class NestByValue : public internal::dense_xpr_base<NestByValue<ExpressionType>
|
||||
/** \returns an expression of the temporary version of *this.
|
||||
*/
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline const NestByValue<Derived> DenseBase<Derived>::nestByValue() const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const NestByValue<Derived> DenseBase<Derived>::nestByValue() const {
|
||||
return NestByValue<Derived>(derived());
|
||||
}
|
||||
|
||||
@@ -76,7 +82,7 @@ template <typename ArgType>
|
||||
struct evaluator<NestByValue<ArgType> > : public evaluator<ArgType> {
|
||||
typedef evaluator<ArgType> Base;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const NestByValue<ArgType>& xpr) : Base(xpr.nestedExpression()) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit evaluator(const NestByValue<ArgType>& xpr) : Base(xpr.nestedExpression()) {}
|
||||
};
|
||||
} // namespace internal
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class NoAlias {
|
||||
public:
|
||||
typedef typename ExpressionType::Scalar Scalar;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit NoAlias(ExpressionType& expression) : m_expression(expression) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit NoAlias(ExpressionType& expression) : m_expression(expression) {}
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ExpressionType& operator=(const StorageBase<OtherDerived>& other) {
|
||||
@@ -58,7 +58,7 @@ class NoAlias {
|
||||
return m_expression;
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC ExpressionType& expression() const { return m_expression; }
|
||||
EIGEN_DEVICE_FUNC constexpr ExpressionType& expression() const { return m_expression; }
|
||||
|
||||
protected:
|
||||
ExpressionType& m_expression;
|
||||
|
||||
@@ -159,8 +159,8 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
||||
INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
||||
EIGEN_STATIC_ASSERT(((Options & (DontAlign | RowMajor)) == Options), INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
||||
|
||||
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 constexpr Base& base() { return *static_cast<Base*>(this); }
|
||||
EIGEN_DEVICE_FUNC constexpr const Base& base() const { return *static_cast<const Base*>(this); }
|
||||
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_storage.rows(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_storage.cols(); }
|
||||
@@ -339,7 +339,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
||||
* remain row-vectors and vectors remain vectors.
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resizeLike(const EigenBase<OtherDerived>& _other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void resizeLike(const EigenBase<OtherDerived>& _other) {
|
||||
const OtherDerived& other = _other.derived();
|
||||
#ifndef EIGEN_NO_DEBUG
|
||||
internal::check_rows_cols_for_overflow<MaxSizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime>::run(
|
||||
@@ -518,14 +518,14 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
||||
|
||||
/** \sa PlainObjectBase::operator=(const EigenBase<OtherDerived>&) */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase(const DenseBase<OtherDerived>& other) : m_storage() {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE PlainObjectBase(const DenseBase<OtherDerived>& other) : m_storage() {
|
||||
resizeLike(other);
|
||||
_set_noalias(other);
|
||||
}
|
||||
|
||||
/** \sa PlainObjectBase::operator=(const EigenBase<OtherDerived>&) */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase(const EigenBase<OtherDerived>& other) : m_storage() {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE PlainObjectBase(const EigenBase<OtherDerived>& other) : m_storage() {
|
||||
resizeLike(other);
|
||||
*this = other.derived();
|
||||
}
|
||||
@@ -731,23 +731,23 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
||||
}
|
||||
|
||||
template <typename T0, typename T1>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2(Index rows, Index cols,
|
||||
std::enable_if_t<Base::SizeAtCompileTime != 2, T0>* = 0) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init2(Index rows, Index cols,
|
||||
std::enable_if_t<Base::SizeAtCompileTime != 2, T0>* = 0) {
|
||||
EIGEN_STATIC_ASSERT(internal::is_valid_index_type<T0>::value && internal::is_valid_index_type<T1>::value,
|
||||
T0 AND T1 MUST BE INTEGER TYPES)
|
||||
resize(rows, cols);
|
||||
}
|
||||
|
||||
template <typename T0, typename T1>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2(const T0& val0, const T1& val1,
|
||||
std::enable_if_t<Base::SizeAtCompileTime == 2, T0>* = 0) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init2(const T0& val0, const T1& val1,
|
||||
std::enable_if_t<Base::SizeAtCompileTime == 2, T0>* = 0) {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 2)
|
||||
m_storage.data()[0] = Scalar(val0);
|
||||
m_storage.data()[1] = Scalar(val1);
|
||||
}
|
||||
|
||||
template <typename T0, typename T1>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init2(
|
||||
const Index& val0, const Index& val1,
|
||||
std::enable_if_t<(!internal::is_same<Index, Scalar>::value) && (internal::is_same<T0, Index>::value) &&
|
||||
(internal::is_same<T1, Index>::value) && Base::SizeAtCompileTime == 2,
|
||||
@@ -760,7 +760,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
||||
// The argument is convertible to the Index type and we either have a non 1x1 Matrix, or a dynamic-sized Array,
|
||||
// then the argument is meant to be the size of the object.
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init1(
|
||||
Index size,
|
||||
std::enable_if_t<(Base::SizeAtCompileTime != 1 || !internal::is_convertible<T, Scalar>::value) &&
|
||||
((!internal::is_same<typename internal::traits<Derived>::XprKind, ArrayXpr>::value ||
|
||||
@@ -776,7 +776,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
||||
// We have a 1x1 matrix/array => the argument is interpreted as the value of the unique coefficient (case where scalar
|
||||
// type can be implicitly converted)
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init1(
|
||||
const Scalar& val0,
|
||||
std::enable_if_t<Base::SizeAtCompileTime == 1 && internal::is_convertible<T, Scalar>::value, T>* = 0) {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 1)
|
||||
@@ -786,7 +786,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
||||
// We have a 1x1 matrix/array => the argument is interpreted as the value of the unique coefficient (case where scalar
|
||||
// type match the index type)
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init1(
|
||||
const Index& val0,
|
||||
std::enable_if_t<(!internal::is_same<Index, Scalar>::value) && (internal::is_same<Index, T>::value) &&
|
||||
Base::SizeAtCompileTime == 1 && internal::is_convertible<T, Scalar>::value,
|
||||
@@ -797,42 +797,42 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
||||
|
||||
// Initialize a fixed size matrix from a pointer to raw data
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const Scalar* data) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init1(const Scalar* data) {
|
||||
this->_set_noalias(ConstMapType(data));
|
||||
}
|
||||
|
||||
// Initialize an arbitrary matrix from a dense expression
|
||||
template <typename T, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const DenseBase<OtherDerived>& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init1(const DenseBase<OtherDerived>& other) {
|
||||
this->_set_noalias(other);
|
||||
}
|
||||
|
||||
// Initialize an arbitrary matrix from an object convertible to the Derived type.
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const Derived& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init1(const Derived& other) {
|
||||
this->_set_noalias(other);
|
||||
}
|
||||
|
||||
// Initialize an arbitrary matrix from a generic Eigen expression
|
||||
template <typename T, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const EigenBase<OtherDerived>& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init1(const EigenBase<OtherDerived>& other) {
|
||||
this->derived() = other;
|
||||
}
|
||||
|
||||
template <typename T, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const ReturnByValue<OtherDerived>& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init1(const ReturnByValue<OtherDerived>& other) {
|
||||
resize(other.rows(), other.cols());
|
||||
other.evalTo(this->derived());
|
||||
}
|
||||
|
||||
template <typename T, typename OtherDerived, int ColsAtCompileTime>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const RotationBase<OtherDerived, ColsAtCompileTime>& r) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init1(const RotationBase<OtherDerived, ColsAtCompileTime>& r) {
|
||||
this->derived() = r;
|
||||
}
|
||||
|
||||
// For fixed-size Array<Scalar,...>
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init1(
|
||||
const Scalar& val0,
|
||||
std::enable_if_t<Base::SizeAtCompileTime != Dynamic && Base::SizeAtCompileTime != 1 &&
|
||||
internal::is_convertible<T, Scalar>::value &&
|
||||
@@ -843,7 +843,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
||||
|
||||
// For fixed-size Array<Index,...>
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void _init1(
|
||||
const Index& val0,
|
||||
std::enable_if_t<(!internal::is_same<Index, Scalar>::value) && (internal::is_same<Index, T>::value) &&
|
||||
Base::SizeAtCompileTime != Dynamic && Base::SizeAtCompileTime != 1 &&
|
||||
|
||||
@@ -219,7 +219,7 @@ class Product
|
||||
using TransposeReturnType = typename internal::product_transpose_helper<Lhs, Rhs, Option>::TransposeType;
|
||||
using AdjointReturnType = typename internal::product_transpose_helper<Lhs, Rhs, Option>::AdjointType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Product(const Lhs& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Product(const Lhs& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) {
|
||||
eigen_assert(lhs.cols() == rhs.rows() && "invalid matrix product" &&
|
||||
"if you wanted a coeff-wise or a dot product use the respective explicit functions");
|
||||
}
|
||||
@@ -227,8 +227,8 @@ class Product
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_lhs.rows(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const 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 RhsNestedCleaned& rhs() const { return m_rhs; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const LhsNestedCleaned& lhs() const { return m_lhs; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const RhsNestedCleaned& rhs() const { return m_rhs; }
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TransposeReturnType transpose() const {
|
||||
return internal::product_transpose_helper<Lhs, Rhs, Option>::run_transpose(*this);
|
||||
|
||||
@@ -237,17 +237,17 @@ template <typename Lhs, typename Rhs>
|
||||
struct generic_product_impl<Lhs, Rhs, DenseShape, DenseShape, InnerProduct> {
|
||||
using impl = default_inner_product_impl<Lhs, Rhs, false>;
|
||||
template <typename Dst>
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) {
|
||||
dst.coeffRef(0, 0) = impl::run(lhs, rhs);
|
||||
}
|
||||
|
||||
template <typename Dst>
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) {
|
||||
dst.coeffRef(0, 0) += impl::run(lhs, rhs);
|
||||
}
|
||||
|
||||
template <typename Dst>
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void subTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void subTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) {
|
||||
dst.coeffRef(0, 0) -= impl::run(lhs, rhs);
|
||||
}
|
||||
};
|
||||
@@ -592,7 +592,7 @@ struct product_evaluator<Product<Lhs, Rhs, LazyProduct>, ProductTag, DenseShape,
|
||||
(int(InnerSize) % packet_traits<Scalar>::size == 0)
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index row, Index col) const {
|
||||
return (m_lhs.row(row).transpose().cwiseProduct(m_rhs.col(col))).sum();
|
||||
}
|
||||
|
||||
@@ -600,7 +600,7 @@ struct product_evaluator<Product<Lhs, Rhs, LazyProduct>, ProductTag, DenseShape,
|
||||
* which is why we don't set the LinearAccessBit.
|
||||
* TODO: this seems possible when the result is a vector
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index index) const {
|
||||
const Index row = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime == 1) ? 0 : index;
|
||||
const Index col = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime == 1) ? index : 0;
|
||||
return (m_lhs.row(row).transpose().cwiseProduct(m_rhs.col(col))).sum();
|
||||
@@ -705,8 +705,8 @@ struct etor_product_packet_impl<ColMajor, UnrollingIndex, Lhs, Rhs, Packet, Load
|
||||
|
||||
template <typename Lhs, typename Rhs, typename Packet, int LoadMode>
|
||||
struct etor_product_packet_impl<RowMajor, 1, Lhs, Rhs, Packet, LoadMode> {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs,
|
||||
Index /*innerDim*/, Packet& res) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs,
|
||||
Index /*innerDim*/, Packet& res) {
|
||||
res = pmul(pset1<Packet>(lhs.coeff(row, Index(0))), rhs.template packet<LoadMode, Packet>(Index(0), col));
|
||||
}
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run_segment(Index row, Index col, const Lhs& lhs, const Rhs& rhs,
|
||||
@@ -719,8 +719,8 @@ struct etor_product_packet_impl<RowMajor, 1, Lhs, Rhs, Packet, LoadMode> {
|
||||
|
||||
template <typename Lhs, typename Rhs, typename Packet, int LoadMode>
|
||||
struct etor_product_packet_impl<ColMajor, 1, Lhs, Rhs, Packet, LoadMode> {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs,
|
||||
Index /*innerDim*/, Packet& res) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs,
|
||||
Index /*innerDim*/, Packet& res) {
|
||||
res = pmul(lhs.template packet<LoadMode, Packet>(row, Index(0)), pset1<Packet>(rhs.coeff(Index(0), col)));
|
||||
}
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run_segment(Index row, Index col, const Lhs& lhs, const Rhs& rhs,
|
||||
@@ -901,7 +901,7 @@ struct diagonal_product_evaluator_base : evaluator_base<Derived> {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index idx) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalar coeff(Index idx) const {
|
||||
if (AsScalarProduct)
|
||||
return m_diagImpl.coeff(0) * m_matImpl.coeff(idx);
|
||||
else
|
||||
@@ -971,9 +971,9 @@ struct product_evaluator<Product<Lhs, Rhs, ProductKind>, ProductTag, DiagonalSha
|
||||
static constexpr int StorageOrder = Base::StorageOrder_;
|
||||
using IsRowMajor_t = bool_constant<StorageOrder == RowMajor>;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr) : Base(xpr.rhs(), xpr.lhs().diagonal()) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit product_evaluator(const XprType& xpr) : Base(xpr.rhs(), xpr.lhs().diagonal()) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalar coeff(Index row, Index col) const {
|
||||
return m_diagImpl.coeff(row) * m_matImpl.coeff(row, col);
|
||||
}
|
||||
|
||||
@@ -1025,9 +1025,9 @@ struct product_evaluator<Product<Lhs, Rhs, ProductKind>, ProductTag, DenseShape,
|
||||
static constexpr int StorageOrder = Base::StorageOrder_;
|
||||
using IsColMajor_t = bool_constant<StorageOrder == ColMajor>;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr) : Base(xpr.lhs(), xpr.rhs().diagonal()) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit product_evaluator(const XprType& xpr) : Base(xpr.lhs(), xpr.rhs().diagonal()) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index row, Index col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalar coeff(Index row, Index col) const {
|
||||
return m_matImpl.coeff(row, col) * m_diagImpl.coeff(col);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ struct redux_novec_unroller {
|
||||
|
||||
typedef typename Evaluator::Scalar Scalar;
|
||||
|
||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Scalar run(const Evaluator& eval, const Func& func) {
|
||||
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Scalar run(const Evaluator& eval, const Func& func) {
|
||||
return func(redux_novec_unroller<Func, Evaluator, Start, HalfLength>::run(eval, func),
|
||||
redux_novec_unroller<Func, Evaluator, Start + HalfLength, Length - HalfLength>::run(eval, func));
|
||||
}
|
||||
@@ -114,7 +114,7 @@ struct redux_novec_unroller<Func, Evaluator, Start, 1> {
|
||||
|
||||
typedef typename Evaluator::Scalar Scalar;
|
||||
|
||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Scalar run(const Evaluator& eval, const Func&) {
|
||||
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Scalar run(const Evaluator& eval, const Func&) {
|
||||
return eval.coeffByOuterInner(outer, inner);
|
||||
}
|
||||
};
|
||||
@@ -125,7 +125,7 @@ struct redux_novec_unroller<Func, Evaluator, Start, 1> {
|
||||
template <typename Func, typename Evaluator, Index Start>
|
||||
struct redux_novec_unroller<Func, Evaluator, Start, 0> {
|
||||
typedef typename Evaluator::Scalar Scalar;
|
||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Scalar run(const Evaluator&, const Func&) { return Scalar(); }
|
||||
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Scalar run(const Evaluator&, const Func&) { return Scalar(); }
|
||||
};
|
||||
|
||||
template <typename Func, typename Evaluator, Index Start, Index Length>
|
||||
@@ -134,7 +134,7 @@ struct redux_novec_linear_unroller {
|
||||
|
||||
typedef typename Evaluator::Scalar Scalar;
|
||||
|
||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Scalar run(const Evaluator& eval, const Func& func) {
|
||||
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Scalar run(const Evaluator& eval, const Func& func) {
|
||||
return func(redux_novec_linear_unroller<Func, Evaluator, Start, HalfLength>::run(eval, func),
|
||||
redux_novec_linear_unroller<Func, Evaluator, Start + HalfLength, Length - HalfLength>::run(eval, func));
|
||||
}
|
||||
@@ -144,7 +144,7 @@ template <typename Func, typename Evaluator, Index Start>
|
||||
struct redux_novec_linear_unroller<Func, Evaluator, Start, 1> {
|
||||
typedef typename Evaluator::Scalar Scalar;
|
||||
|
||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Scalar run(const Evaluator& eval, const Func&) {
|
||||
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Scalar run(const Evaluator& eval, const Func&) {
|
||||
return eval.coeff(Start);
|
||||
}
|
||||
};
|
||||
@@ -155,7 +155,7 @@ struct redux_novec_linear_unroller<Func, Evaluator, Start, 1> {
|
||||
template <typename Func, typename Evaluator, Index Start>
|
||||
struct redux_novec_linear_unroller<Func, Evaluator, Start, 0> {
|
||||
typedef typename Evaluator::Scalar Scalar;
|
||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Scalar run(const Evaluator&, const Func&) { return Scalar(); }
|
||||
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Scalar run(const Evaluator&, const Func&) { return Scalar(); }
|
||||
};
|
||||
|
||||
/*** vectorization ***/
|
||||
|
||||
@@ -265,7 +265,7 @@ class Ref : public RefBase<Ref<PlainObjectType, Options, StrideType> > {
|
||||
private:
|
||||
typedef internal::traits<Ref> Traits;
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline Ref(
|
||||
EIGEN_DEVICE_FUNC constexpr inline Ref(
|
||||
const PlainObjectBase<Derived>& expr,
|
||||
std::enable_if_t<bool(Traits::template match<Derived>::MatchAtCompileTime), Derived>* = 0);
|
||||
|
||||
@@ -275,7 +275,7 @@ class Ref : public RefBase<Ref<PlainObjectType, Options, StrideType> > {
|
||||
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline Ref(
|
||||
EIGEN_DEVICE_FUNC constexpr inline Ref(
|
||||
PlainObjectBase<Derived>& expr,
|
||||
std::enable_if_t<bool(Traits::template match<Derived>::MatchAtCompileTime), Derived>* = 0) {
|
||||
EIGEN_STATIC_ASSERT(bool(Traits::template match<Derived>::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
|
||||
@@ -285,7 +285,7 @@ class Ref : public RefBase<Ref<PlainObjectType, Options, StrideType> > {
|
||||
eigen_assert(success);
|
||||
}
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline Ref(
|
||||
EIGEN_DEVICE_FUNC constexpr inline Ref(
|
||||
const DenseBase<Derived>& expr,
|
||||
std::enable_if_t<bool(Traits::template match<Derived>::MatchAtCompileTime), Derived>* = 0)
|
||||
#else
|
||||
@@ -327,8 +327,9 @@ class Ref<const TPlainObjectType, Options, StrideType>
|
||||
EIGEN_DENSE_PUBLIC_INTERFACE(Ref)
|
||||
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline Ref(const DenseBase<Derived>& expr,
|
||||
std::enable_if_t<bool(Traits::template match<Derived>::ScalarTypeMatch), Derived>* = 0) {
|
||||
EIGEN_DEVICE_FUNC constexpr inline Ref(
|
||||
const DenseBase<Derived>& expr,
|
||||
std::enable_if_t<bool(Traits::template match<Derived>::ScalarTypeMatch), Derived>* = 0) {
|
||||
// std::cout << match_helper<Derived>::HasDirectAccess << "," << match_helper<Derived>::OuterStrideMatch << ","
|
||||
// << match_helper<Derived>::InnerStrideMatch << "\n"; std::cout << int(StrideType::OuterStrideAtCompileTime)
|
||||
// << " - " << int(Derived::OuterStrideAtCompileTime) << "\n"; std::cout <<
|
||||
@@ -338,11 +339,11 @@ class Ref<const TPlainObjectType, Options, StrideType>
|
||||
construct(expr.derived(), typename Traits::template match<Derived>::type());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC inline Ref(const Ref& other) : Base(other) {
|
||||
EIGEN_DEVICE_FUNC constexpr inline Ref(const Ref& other) : Base(other) {
|
||||
// copy constructor shall not copy the m_object, to avoid unnecessary malloc and copy
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC inline Ref(Ref&& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr inline Ref(Ref&& other) {
|
||||
if (other.data() == other.m_object.data()) {
|
||||
m_object = std::move(other.m_object);
|
||||
Base::construct(m_object);
|
||||
@@ -351,7 +352,7 @@ class Ref<const TPlainObjectType, Options, StrideType>
|
||||
}
|
||||
|
||||
template <typename OtherRef>
|
||||
EIGEN_DEVICE_FUNC inline Ref(const RefBase<OtherRef>& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr inline Ref(const RefBase<OtherRef>& other) {
|
||||
EIGEN_STATIC_ASSERT(Traits::template match<OtherRef>::type::value || may_map_m_object_successfully,
|
||||
STORAGE_LAYOUT_DOES_NOT_MATCH);
|
||||
construct(other.derived(), typename Traits::template match<OtherRef>::type());
|
||||
|
||||
@@ -71,7 +71,7 @@ class Replicate : public internal::dense_xpr_base<Replicate<MatrixType, RowFacto
|
||||
typedef internal::remove_all_t<MatrixType> NestedExpression;
|
||||
|
||||
template <typename OriginalMatrixType>
|
||||
EIGEN_DEVICE_FUNC inline explicit Replicate(const OriginalMatrixType& matrix)
|
||||
EIGEN_DEVICE_FUNC constexpr inline explicit Replicate(const OriginalMatrixType& matrix)
|
||||
: m_matrix(matrix), m_rowFactor(RowFactor), m_colFactor(ColFactor) {
|
||||
EIGEN_STATIC_ASSERT((internal::is_same<std::remove_const_t<MatrixType>, OriginalMatrixType>::value),
|
||||
THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
|
||||
@@ -79,7 +79,7 @@ class Replicate : public internal::dense_xpr_base<Replicate<MatrixType, RowFacto
|
||||
}
|
||||
|
||||
template <typename OriginalMatrixType>
|
||||
EIGEN_DEVICE_FUNC inline Replicate(const OriginalMatrixType& matrix, Index rowFactor, Index colFactor)
|
||||
EIGEN_DEVICE_FUNC constexpr inline Replicate(const OriginalMatrixType& matrix, Index rowFactor, Index colFactor)
|
||||
: m_matrix(matrix), m_rowFactor(rowFactor), m_colFactor(colFactor) {
|
||||
EIGEN_STATIC_ASSERT((internal::is_same<std::remove_const_t<MatrixType>, OriginalMatrixType>::value),
|
||||
THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
|
||||
@@ -88,7 +88,7 @@ class Replicate : public internal::dense_xpr_base<Replicate<MatrixType, RowFacto
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const { return m_matrix.rows() * m_rowFactor.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 constexpr const MatrixTypeNested_& nestedExpression() const { return m_matrix; }
|
||||
|
||||
protected:
|
||||
MatrixTypeNested m_matrix;
|
||||
|
||||
@@ -107,7 +107,7 @@ class Reshaped : public ReshapedImpl<XprType, Rows, Cols, Order, typename intern
|
||||
|
||||
/** Fixed-size constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline Reshaped(XprType& xpr) : Impl(xpr) {
|
||||
EIGEN_DEVICE_FUNC constexpr inline Reshaped(XprType& xpr) : Impl(xpr) {
|
||||
EIGEN_STATIC_ASSERT(RowsAtCompileTime != Dynamic && ColsAtCompileTime != Dynamic,
|
||||
THIS_METHOD_IS_ONLY_FOR_FIXED_SIZE)
|
||||
eigen_assert(Rows * Cols == xpr.rows() * xpr.cols());
|
||||
@@ -115,7 +115,7 @@ class Reshaped : public ReshapedImpl<XprType, Rows, Cols, Order, typename intern
|
||||
|
||||
/** Dynamic-size constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline Reshaped(XprType& xpr, Index reshapeRows, Index reshapeCols)
|
||||
EIGEN_DEVICE_FUNC constexpr inline Reshaped(XprType& xpr, Index reshapeRows, Index reshapeCols)
|
||||
: Impl(xpr, reshapeRows, reshapeCols) {
|
||||
eigen_assert((RowsAtCompileTime == Dynamic || RowsAtCompileTime == reshapeRows) &&
|
||||
(ColsAtCompileTime == Dynamic || ColsAtCompileTime == reshapeCols));
|
||||
@@ -136,8 +136,8 @@ class ReshapedImpl<XprType, Rows, Cols, Order, Dense>
|
||||
public:
|
||||
typedef Impl Base;
|
||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(ReshapedImpl)
|
||||
EIGEN_DEVICE_FUNC inline ReshapedImpl(XprType& xpr) : Impl(xpr) {}
|
||||
EIGEN_DEVICE_FUNC inline ReshapedImpl(XprType& xpr, Index reshapeRows, Index reshapeCols)
|
||||
EIGEN_DEVICE_FUNC constexpr inline ReshapedImpl(XprType& xpr) : Impl(xpr) {}
|
||||
EIGEN_DEVICE_FUNC constexpr inline ReshapedImpl(XprType& xpr, Index reshapeRows, Index reshapeCols)
|
||||
: Impl(xpr, reshapeRows, reshapeCols) {}
|
||||
};
|
||||
|
||||
@@ -161,15 +161,15 @@ class ReshapedImpl_dense<XprType, Rows, Cols, Order, false>
|
||||
|
||||
/** Fixed-size constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline ReshapedImpl_dense(XprType& xpr) : m_xpr(xpr), m_rows(Rows), m_cols(Cols) {}
|
||||
EIGEN_DEVICE_FUNC constexpr inline ReshapedImpl_dense(XprType& xpr) : m_xpr(xpr), m_rows(Rows), m_cols(Cols) {}
|
||||
|
||||
/** Dynamic-size constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline ReshapedImpl_dense(XprType& xpr, Index nRows, Index nCols)
|
||||
EIGEN_DEVICE_FUNC constexpr inline ReshapedImpl_dense(XprType& xpr, Index nRows, Index nCols)
|
||||
: m_xpr(xpr), m_rows(nRows), m_cols(nCols) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC Index rows() const { return m_rows; }
|
||||
EIGEN_DEVICE_FUNC Index cols() const { return m_cols; }
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const { return m_rows; }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const { return m_cols; }
|
||||
|
||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
||||
/** \sa MapBase::data() */
|
||||
@@ -179,10 +179,10 @@ class ReshapedImpl_dense<XprType, Rows, Cols, Order, false>
|
||||
#endif
|
||||
|
||||
/** \returns the nested expression */
|
||||
EIGEN_DEVICE_FUNC const internal::remove_all_t<XprType>& nestedExpression() const { return m_xpr; }
|
||||
EIGEN_DEVICE_FUNC constexpr const internal::remove_all_t<XprType>& nestedExpression() const { return m_xpr; }
|
||||
|
||||
/** \returns the nested expression */
|
||||
EIGEN_DEVICE_FUNC std::remove_reference_t<XprType>& nestedExpression() { return m_xpr; }
|
||||
EIGEN_DEVICE_FUNC constexpr std::remove_reference_t<XprType>& nestedExpression() { return m_xpr; }
|
||||
|
||||
protected:
|
||||
MatrixTypeNested m_xpr;
|
||||
@@ -203,16 +203,16 @@ class ReshapedImpl_dense<XprType, Rows, Cols, Order, true> : public MapBase<Resh
|
||||
|
||||
/** Fixed-size constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline ReshapedImpl_dense(XprType& xpr) : Base(xpr.data()), m_xpr(xpr) {}
|
||||
EIGEN_DEVICE_FUNC constexpr inline ReshapedImpl_dense(XprType& xpr) : Base(xpr.data()), m_xpr(xpr) {}
|
||||
|
||||
/** Dynamic-size constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline ReshapedImpl_dense(XprType& xpr, Index nRows, Index nCols)
|
||||
EIGEN_DEVICE_FUNC constexpr inline ReshapedImpl_dense(XprType& xpr, Index nRows, Index nCols)
|
||||
: Base(xpr.data(), nRows, nCols), m_xpr(xpr) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC const internal::remove_all_t<XprTypeNested>& nestedExpression() const { return m_xpr; }
|
||||
EIGEN_DEVICE_FUNC constexpr const internal::remove_all_t<XprTypeNested>& nestedExpression() const { return m_xpr; }
|
||||
|
||||
EIGEN_DEVICE_FUNC XprType& nestedExpression() { return m_xpr; }
|
||||
EIGEN_DEVICE_FUNC constexpr XprType& nestedExpression() { return m_xpr; }
|
||||
|
||||
/** \sa MapBase::innerStride() */
|
||||
EIGEN_DEVICE_FUNC constexpr Index innerStride() const { return m_xpr.innerStride(); }
|
||||
@@ -265,7 +265,7 @@ struct evaluator<Reshaped<ArgType, Rows, Cols, Order> >
|
||||
Alignment = evaluator<ArgType>::Alignment
|
||||
};
|
||||
typedef reshaped_evaluator<ArgType, Rows, Cols, Order, HasDirectAccess> reshaped_evaluator_type;
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) : reshaped_evaluator_type(xpr) {
|
||||
EIGEN_DEVICE_FUNC constexpr explicit evaluator(const XprType& xpr) : reshaped_evaluator_type(xpr) {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
}
|
||||
};
|
||||
@@ -283,7 +283,8 @@ struct reshaped_evaluator<ArgType, Rows, Cols, Order, /* HasDirectAccess */ fals
|
||||
Alignment = 0
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit reshaped_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_xpr(xpr) {
|
||||
EIGEN_DEVICE_FUNC constexpr explicit reshaped_evaluator(const XprType& xpr)
|
||||
: m_argImpl(xpr.nestedExpression()), m_xpr(xpr) {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
}
|
||||
|
||||
@@ -292,7 +293,7 @@ struct reshaped_evaluator<ArgType, Rows, Cols, Order, /* HasDirectAccess */ fals
|
||||
|
||||
typedef std::pair<Index, Index> RowCol;
|
||||
|
||||
EIGEN_DEVICE_FUNC inline RowCol index_remap(Index rowId, Index colId) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline RowCol index_remap(Index rowId, Index colId) const {
|
||||
if (Order == ColMajor) {
|
||||
const Index nth_elem_idx = colId * m_xpr.rows() + rowId;
|
||||
return RowCol(nth_elem_idx % m_xpr.nestedExpression().rows(), nth_elem_idx / m_xpr.nestedExpression().rows());
|
||||
@@ -302,34 +303,34 @@ struct reshaped_evaluator<ArgType, Rows, Cols, Order, /* HasDirectAccess */ fals
|
||||
}
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index rowId, Index colId) {
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar& coeffRef(Index rowId, Index colId) {
|
||||
EIGEN_STATIC_ASSERT_LVALUE(XprType)
|
||||
const RowCol row_col = index_remap(rowId, colId);
|
||||
return m_argImpl.coeffRef(row_col.first, row_col.second);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC inline const Scalar& coeffRef(Index rowId, Index colId) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Scalar& coeffRef(Index rowId, Index colId) const {
|
||||
const RowCol row_col = index_remap(rowId, colId);
|
||||
return m_argImpl.coeffRef(row_col.first, row_col.second);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index rowId, Index colId) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index rowId, Index colId) const {
|
||||
const RowCol row_col = index_remap(rowId, colId);
|
||||
return m_argImpl.coeff(row_col.first, row_col.second);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index index) {
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar& coeffRef(Index index) {
|
||||
EIGEN_STATIC_ASSERT_LVALUE(XprType)
|
||||
const RowCol row_col = index_remap(Rows == 1 ? 0 : index, Rows == 1 ? index : 0);
|
||||
return m_argImpl.coeffRef(row_col.first, row_col.second);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC inline const Scalar& coeffRef(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Scalar& coeffRef(Index index) const {
|
||||
const RowCol row_col = index_remap(Rows == 1 ? 0 : index, Rows == 1 ? index : 0);
|
||||
return m_argImpl.coeffRef(row_col.first, row_col.second);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index index) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CoeffReturnType coeff(Index index) const {
|
||||
const RowCol row_col = index_remap(Rows == 1 ? 0 : index, Rows == 1 ? index : 0);
|
||||
return m_argImpl.coeff(row_col.first, row_col.second);
|
||||
}
|
||||
@@ -346,7 +347,7 @@ struct reshaped_evaluator<ArgType, Rows, Cols, Order, /* HasDirectAccess */ true
|
||||
typedef Reshaped<ArgType, Rows, Cols, Order> XprType;
|
||||
typedef typename XprType::Scalar Scalar;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit reshaped_evaluator(const XprType& xpr)
|
||||
EIGEN_DEVICE_FUNC constexpr explicit reshaped_evaluator(const XprType& xpr)
|
||||
: mapbase_evaluator<XprType, typename XprType::PlainObject>(xpr) {
|
||||
// TODO: for the 3.4 release, this should be turned to an internal assertion, but let's keep it as is for the beta
|
||||
// lifetime
|
||||
|
||||
@@ -83,7 +83,7 @@ class Reverse : public internal::dense_xpr_base<Reverse<MatrixType, Direction> >
|
||||
typedef internal::reverse_packet_cond<PacketScalar, ReversePacket> reverse_packet;
|
||||
|
||||
public:
|
||||
EIGEN_DEVICE_FUNC explicit inline Reverse(const MatrixType& matrix) : m_matrix(matrix) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit inline Reverse(const MatrixType& matrix) : m_matrix(matrix) {}
|
||||
|
||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Reverse)
|
||||
|
||||
@@ -92,7 +92,7 @@ class Reverse : public internal::dense_xpr_base<Reverse<MatrixType, Direction> >
|
||||
|
||||
EIGEN_DEVICE_FUNC inline Index innerStride() const { return -m_matrix.innerStride(); }
|
||||
|
||||
EIGEN_DEVICE_FUNC const internal::remove_all_t<typename MatrixType::Nested>& nestedExpression() const {
|
||||
EIGEN_DEVICE_FUNC constexpr const internal::remove_all_t<typename MatrixType::Nested>& nestedExpression() const {
|
||||
return m_matrix;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ using Select = CwiseTernaryOp<internal::scalar_boolean_select_op<typename DenseB
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename ThenDerived, typename ElseDerived>
|
||||
inline EIGEN_DEVICE_FUNC CwiseTernaryOp<
|
||||
inline EIGEN_DEVICE_FUNC constexpr CwiseTernaryOp<
|
||||
internal::scalar_boolean_select_op<typename DenseBase<ThenDerived>::Scalar, typename DenseBase<ElseDerived>::Scalar,
|
||||
typename DenseBase<Derived>::Scalar>,
|
||||
ThenDerived, ElseDerived, Derived>
|
||||
@@ -59,7 +59,7 @@ DenseBase<Derived>::select(const DenseBase<ThenDerived>& thenMatrix, const Dense
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename ThenDerived>
|
||||
inline EIGEN_DEVICE_FUNC CwiseTernaryOp<
|
||||
inline EIGEN_DEVICE_FUNC constexpr CwiseTernaryOp<
|
||||
internal::scalar_boolean_select_op<typename DenseBase<ThenDerived>::Scalar, typename DenseBase<ThenDerived>::Scalar,
|
||||
typename DenseBase<Derived>::Scalar>,
|
||||
ThenDerived, typename DenseBase<ThenDerived>::ConstantReturnType, Derived>
|
||||
@@ -76,7 +76,7 @@ DenseBase<Derived>::select(const DenseBase<ThenDerived>& thenMatrix,
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename ElseDerived>
|
||||
inline EIGEN_DEVICE_FUNC CwiseTernaryOp<
|
||||
inline EIGEN_DEVICE_FUNC constexpr CwiseTernaryOp<
|
||||
internal::scalar_boolean_select_op<typename DenseBase<ElseDerived>::Scalar, typename DenseBase<ElseDerived>::Scalar,
|
||||
typename DenseBase<Derived>::Scalar>,
|
||||
typename DenseBase<ElseDerived>::ConstantReturnType, ElseDerived, Derived>
|
||||
|
||||
@@ -302,7 +302,7 @@ class triangular_dense_assignment_kernel<UpLo, SelfAdjoint, SetOpposite, DstEval
|
||||
/** This is the const version of MatrixBase::selfadjointView() */
|
||||
template <typename Derived>
|
||||
template <unsigned int UpLo>
|
||||
EIGEN_DEVICE_FUNC typename MatrixBase<Derived>::template ConstSelfAdjointViewReturnType<UpLo>::Type
|
||||
EIGEN_DEVICE_FUNC constexpr typename MatrixBase<Derived>::template ConstSelfAdjointViewReturnType<UpLo>::Type
|
||||
MatrixBase<Derived>::selfadjointView() const {
|
||||
return typename ConstSelfAdjointViewReturnType<UpLo>::Type(derived());
|
||||
}
|
||||
@@ -319,7 +319,7 @@ MatrixBase<Derived>::selfadjointView() const {
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <unsigned int UpLo>
|
||||
EIGEN_DEVICE_FUNC typename MatrixBase<Derived>::template SelfAdjointViewReturnType<UpLo>::Type
|
||||
EIGEN_DEVICE_FUNC constexpr typename MatrixBase<Derived>::template SelfAdjointViewReturnType<UpLo>::Type
|
||||
MatrixBase<Derived>::selfadjointView() {
|
||||
return typename SelfAdjointViewReturnType<UpLo>::Type(derived());
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
namespace Eigen {
|
||||
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(const Scalar& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(const Scalar& other) {
|
||||
using ConstantExpr = typename internal::plain_constant_type<Derived, Scalar>::type;
|
||||
using Op = internal::mul_assign_op<Scalar>;
|
||||
internal::call_assignment(derived(), ConstantExpr(rows(), cols(), other), Op());
|
||||
@@ -25,13 +25,13 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(co
|
||||
|
||||
template <typename Derived>
|
||||
template <bool Enable, typename>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(const RealScalar& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(const RealScalar& other) {
|
||||
realView() *= other;
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(const Scalar& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(const Scalar& other) {
|
||||
using ConstantExpr = typename internal::plain_constant_type<Derived, Scalar>::type;
|
||||
using Op = internal::div_assign_op<Scalar>;
|
||||
internal::call_assignment(derived(), ConstantExpr(rows(), cols(), other), Op());
|
||||
@@ -40,7 +40,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(co
|
||||
|
||||
template <typename Derived>
|
||||
template <bool Enable, typename>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(const RealScalar& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(const RealScalar& other) {
|
||||
realView() /= other;
|
||||
return derived();
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ class SkewSymmetricWrapper : public SkewSymmetricBase<SkewSymmetricWrapper<SkewS
|
||||
* \sa class SkewSymmetricWrapper, class SkewSymmetricMatrix3, vector(), isSkewSymmetric()
|
||||
**/
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline const SkewSymmetricWrapper<const Derived> MatrixBase<Derived>::asSkewSymmetric() const {
|
||||
EIGEN_DEVICE_FUNC constexpr const SkewSymmetricWrapper<const Derived> MatrixBase<Derived>::asSkewSymmetric() const {
|
||||
return SkewSymmetricWrapper<const Derived>(derived());
|
||||
}
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@ class Solve : public SolveImpl<Decomposition, RhsType, typename internal::traits
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_dec.cols(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_rhs.cols(); }
|
||||
|
||||
EIGEN_DEVICE_FUNC const Decomposition &dec() const { return m_dec; }
|
||||
EIGEN_DEVICE_FUNC const RhsType &rhs() const { return m_rhs; }
|
||||
EIGEN_DEVICE_FUNC constexpr const Decomposition &dec() const { return m_dec; }
|
||||
EIGEN_DEVICE_FUNC constexpr const RhsType &rhs() const { return m_rhs; }
|
||||
|
||||
protected:
|
||||
const Decomposition &m_dec;
|
||||
|
||||
@@ -58,20 +58,21 @@ class Stride {
|
||||
enum { InnerStrideAtCompileTime = InnerStrideAtCompileTime_, OuterStrideAtCompileTime = OuterStrideAtCompileTime_ };
|
||||
|
||||
/** Default constructor, for use when strides are fixed at compile time */
|
||||
EIGEN_DEVICE_FUNC Stride() : m_outer(OuterStrideAtCompileTime), m_inner(InnerStrideAtCompileTime) {
|
||||
EIGEN_DEVICE_FUNC constexpr Stride() : m_outer(OuterStrideAtCompileTime), m_inner(InnerStrideAtCompileTime) {
|
||||
// FIXME: for Eigen 4 we should use DynamicIndex instead of Dynamic.
|
||||
// FIXME: for Eigen 4 we should also unify this API with fix<>
|
||||
eigen_assert(InnerStrideAtCompileTime != Dynamic && OuterStrideAtCompileTime != Dynamic);
|
||||
}
|
||||
|
||||
/** Constructor allowing to pass the strides at runtime */
|
||||
EIGEN_DEVICE_FUNC Stride(Index outerStride, Index innerStride) : m_outer(outerStride), m_inner(innerStride) {}
|
||||
EIGEN_DEVICE_FUNC constexpr Stride(Index outerStride, Index innerStride)
|
||||
: m_outer(outerStride), m_inner(innerStride) {}
|
||||
|
||||
/** Copy constructor */
|
||||
EIGEN_DEVICE_FUNC Stride(const Stride& other) : m_outer(other.outer()), m_inner(other.inner()) {}
|
||||
EIGEN_DEVICE_FUNC constexpr Stride(const Stride& other) : m_outer(other.outer()), m_inner(other.inner()) {}
|
||||
|
||||
/** Copy assignment operator */
|
||||
EIGEN_DEVICE_FUNC Stride& operator=(const Stride& other) {
|
||||
EIGEN_DEVICE_FUNC constexpr Stride& operator=(const Stride& other) {
|
||||
m_outer.setValue(other.outer());
|
||||
m_inner.setValue(other.inner());
|
||||
return *this;
|
||||
@@ -94,8 +95,8 @@ class InnerStride : public Stride<0, Value> {
|
||||
typedef Stride<0, Value> Base;
|
||||
|
||||
public:
|
||||
EIGEN_DEVICE_FUNC InnerStride() : Base() {}
|
||||
EIGEN_DEVICE_FUNC InnerStride(Index v) : Base(0, v) {} // FIXME making this explicit could break valid code
|
||||
EIGEN_DEVICE_FUNC constexpr InnerStride() : Base() {}
|
||||
EIGEN_DEVICE_FUNC constexpr InnerStride(Index v) : Base(0, v) {} // FIXME making this explicit could break valid code
|
||||
};
|
||||
|
||||
/** \brief Convenience specialization of Stride to specify only an outer stride
|
||||
@@ -105,8 +106,8 @@ class OuterStride : public Stride<Value, 0> {
|
||||
typedef Stride<Value, 0> Base;
|
||||
|
||||
public:
|
||||
EIGEN_DEVICE_FUNC OuterStride() : Base() {}
|
||||
EIGEN_DEVICE_FUNC OuterStride(Index v) : Base(v, 0) {} // FIXME making this explicit could break valid code
|
||||
EIGEN_DEVICE_FUNC constexpr OuterStride() : Base() {}
|
||||
EIGEN_DEVICE_FUNC constexpr OuterStride(Index v) : Base(v, 0) {} // FIXME making this explicit could break valid code
|
||||
};
|
||||
|
||||
} // end namespace Eigen
|
||||
|
||||
@@ -36,9 +36,10 @@ class generic_dense_assignment_kernel<DstEvaluatorTypeT, SrcEvaluatorTypeT,
|
||||
typedef typename Base::DstXprType DstXprType;
|
||||
typedef swap_assign_op<Scalar> Functor;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE generic_dense_assignment_kernel(DstEvaluatorTypeT &dst,
|
||||
const SrcEvaluatorTypeT &src,
|
||||
const Functor &func, DstXprType &dstExpr)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE generic_dense_assignment_kernel(DstEvaluatorTypeT &dst,
|
||||
const SrcEvaluatorTypeT &src,
|
||||
const Functor &func,
|
||||
DstXprType &dstExpr)
|
||||
: Base(dst, src, func, dstExpr) {}
|
||||
|
||||
template <int StoreMode, int LoadMode, typename PacketType>
|
||||
|
||||
@@ -61,7 +61,7 @@ class Transpose : public TransposeImpl<MatrixType, typename internal::traits<Mat
|
||||
EIGEN_GENERIC_PUBLIC_INTERFACE(Transpose)
|
||||
typedef internal::remove_all_t<MatrixType> NestedExpression;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit EIGEN_STRONG_INLINE Transpose(MatrixType& matrix) : m_matrix(matrix) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit EIGEN_STRONG_INLINE Transpose(MatrixType& matrix) : m_matrix(matrix) {}
|
||||
|
||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Transpose)
|
||||
|
||||
@@ -69,12 +69,13 @@ class Transpose : public TransposeImpl<MatrixType, typename internal::traits<Mat
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_matrix.rows(); }
|
||||
|
||||
/** \returns the nested expression */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::remove_all_t<MatrixTypeNested>& nestedExpression() const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const internal::remove_all_t<MatrixTypeNested>& nestedExpression()
|
||||
const {
|
||||
return m_matrix;
|
||||
}
|
||||
|
||||
/** \returns the nested expression */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::remove_reference_t<MatrixTypeNested>& nestedExpression() {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE std::remove_reference_t<MatrixTypeNested>& nestedExpression() {
|
||||
return m_matrix;
|
||||
}
|
||||
|
||||
@@ -114,8 +115,12 @@ class TransposeImpl<MatrixType, Dense> : public internal::TransposeImpl_base<Mat
|
||||
EIGEN_DENSE_PUBLIC_INTERFACE(Transpose<MatrixType>)
|
||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(TransposeImpl)
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index innerStride() const { return derived().nestedExpression().innerStride(); }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index outerStride() const { return derived().nestedExpression().outerStride(); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Index innerStride() const {
|
||||
return derived().nestedExpression().innerStride();
|
||||
}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Index outerStride() const {
|
||||
return derived().nestedExpression().outerStride();
|
||||
}
|
||||
|
||||
typedef std::conditional_t<internal::is_lvalue<MatrixType>::value, Scalar, const Scalar> ScalarWithConstIfNotLvalue;
|
||||
|
||||
@@ -190,7 +195,7 @@ DenseBase<Derived>::transpose() const {
|
||||
*
|
||||
* \sa adjointInPlace(), transpose(), conjugate(), class Transpose, class internal::scalar_conjugate_op */
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline const typename MatrixBase<Derived>::AdjointReturnType MatrixBase<Derived>::adjoint() const {
|
||||
EIGEN_DEVICE_FUNC constexpr const typename MatrixBase<Derived>::AdjointReturnType MatrixBase<Derived>::adjoint() const {
|
||||
return AdjointReturnType(this->transpose());
|
||||
}
|
||||
|
||||
|
||||
@@ -568,7 +568,7 @@ EIGEN_DEVICE_FUNC void TriangularBase<Derived>::evalTo(MatrixBase<DenseDerived>&
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <unsigned int Mode>
|
||||
EIGEN_DEVICE_FUNC typename MatrixBase<Derived>::template TriangularViewReturnType<Mode>::Type
|
||||
EIGEN_DEVICE_FUNC constexpr typename MatrixBase<Derived>::template TriangularViewReturnType<Mode>::Type
|
||||
MatrixBase<Derived>::triangularView() {
|
||||
return typename TriangularViewReturnType<Mode>::Type(derived());
|
||||
}
|
||||
@@ -576,7 +576,7 @@ MatrixBase<Derived>::triangularView() {
|
||||
/** This is the const version of MatrixBase::triangularView() */
|
||||
template <typename Derived>
|
||||
template <unsigned int Mode>
|
||||
EIGEN_DEVICE_FUNC typename MatrixBase<Derived>::template ConstTriangularViewReturnType<Mode>::Type
|
||||
EIGEN_DEVICE_FUNC constexpr typename MatrixBase<Derived>::template ConstTriangularViewReturnType<Mode>::Type
|
||||
MatrixBase<Derived>::triangularView() const {
|
||||
return typename ConstTriangularViewReturnType<Mode>::Type(derived());
|
||||
}
|
||||
|
||||
@@ -68,13 +68,13 @@ class VectorBlock : public Block<VectorType, internal::traits<VectorType>::Flags
|
||||
|
||||
/** Dynamic-size constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE VectorBlock(VectorType& vector, Index start, Index size)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE VectorBlock(VectorType& vector, Index start, Index size)
|
||||
: Base(vector, IsColVector ? start : 0, IsColVector ? 0 : start, IsColVector ? size : 1, IsColVector ? 1 : size) {
|
||||
}
|
||||
|
||||
/** Fixed-size constructor
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE VectorBlock(VectorType& vector, Index start)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE VectorBlock(VectorType& vector, Index start)
|
||||
: Base(vector, IsColVector ? start : 0, IsColVector ? 0 : start) {}
|
||||
};
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ struct functor_traits<div_assign_op<DstScalar, SrcScalar>> : div_assign_op<DstSc
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct swap_assign_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(Scalar& a, const Scalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void assignCoeff(Scalar& a, const Scalar& b) const {
|
||||
#ifdef EIGEN_GPUCC
|
||||
// FIXME: check whether cuda::swap exists.
|
||||
Scalar t = b;
|
||||
|
||||
@@ -36,7 +36,7 @@ struct scalar_sum_op : binary_op_base<LhsScalar, RhsScalar> {
|
||||
#ifdef EIGEN_SCALAR_BINARY_OP_PLUGIN
|
||||
scalar_sum_op(){EIGEN_SCALAR_BINARY_OP_PLUGIN}
|
||||
#endif
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type
|
||||
operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a + b;
|
||||
}
|
||||
@@ -60,7 +60,8 @@ struct functor_traits<scalar_sum_op<LhsScalar, RhsScalar>> {
|
||||
};
|
||||
|
||||
template <>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool scalar_sum_op<bool, bool>::operator()(const bool& a, const bool& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE bool scalar_sum_op<bool, bool>::operator()(const bool& a,
|
||||
const bool& b) const {
|
||||
return a || b;
|
||||
}
|
||||
|
||||
@@ -75,7 +76,7 @@ struct scalar_product_op : binary_op_base<LhsScalar, RhsScalar> {
|
||||
#ifdef EIGEN_SCALAR_BINARY_OP_PLUGIN
|
||||
scalar_product_op(){EIGEN_SCALAR_BINARY_OP_PLUGIN}
|
||||
#endif
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type
|
||||
operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a * b;
|
||||
}
|
||||
@@ -99,8 +100,8 @@ struct functor_traits<scalar_product_op<LhsScalar, RhsScalar>> {
|
||||
};
|
||||
|
||||
template <>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool scalar_product_op<bool, bool>::operator()(const bool& a,
|
||||
const bool& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE bool scalar_product_op<bool, bool>::operator()(const bool& a,
|
||||
const bool& b) const {
|
||||
return a && b;
|
||||
}
|
||||
|
||||
@@ -116,7 +117,7 @@ struct scalar_conj_product_op : binary_op_base<LhsScalar, RhsScalar> {
|
||||
|
||||
typedef typename ScalarBinaryOpTraits<LhsScalar, RhsScalar, scalar_conj_product_op>::ReturnType result_type;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return conj_helper<LhsScalar, RhsScalar, Conj, false>().pmul(a, b);
|
||||
}
|
||||
|
||||
@@ -141,7 +142,7 @@ struct functor_traits<scalar_conj_product_op<LhsScalar, RhsScalar>> {
|
||||
template <typename LhsScalar, typename RhsScalar, int NaNPropagation>
|
||||
struct scalar_min_op : binary_op_base<LhsScalar, RhsScalar> {
|
||||
typedef typename ScalarBinaryOpTraits<LhsScalar, RhsScalar, scalar_min_op>::ReturnType result_type;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return internal::pmin<NaNPropagation>(a, b);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -170,7 +171,7 @@ struct functor_traits<scalar_min_op<LhsScalar, RhsScalar, NaNPropagation>> {
|
||||
template <typename LhsScalar, typename RhsScalar, int NaNPropagation>
|
||||
struct scalar_max_op : binary_op_base<LhsScalar, RhsScalar> {
|
||||
typedef typename ScalarBinaryOpTraits<LhsScalar, RhsScalar, scalar_max_op>::ReturnType result_type;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return internal::pmax<NaNPropagation>(a, b);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -210,7 +211,7 @@ struct functor_traits<scalar_cmp_op<LhsScalar, RhsScalar, cmp, UseTypedComparato
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_EQ, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a == b ? result_type(1) : result_type(0);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -223,7 +224,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_EQ, UseTypedComparators> : binary
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_LT, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a < b ? result_type(1) : result_type(0);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -236,7 +237,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_LT, UseTypedComparators> : binary
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_LE, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a <= b ? result_type(1) : result_type(0);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -249,7 +250,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_LE, UseTypedComparators> : binary
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_GT, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a > b ? result_type(1) : result_type(0);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -262,7 +263,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_GT, UseTypedComparators> : binary
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_GE, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a >= b ? result_type(1) : result_type(0);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -275,7 +276,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_GE, UseTypedComparators> : binary
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_UNORD, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return !(a <= b || b <= a) ? result_type(1) : result_type(0);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -288,7 +289,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_UNORD, UseTypedComparators> : bin
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_NEQ, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a != b ? result_type(1) : result_type(0);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -305,7 +306,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_NEQ, UseTypedComparators> : binar
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_hypot_op<Scalar, Scalar> : binary_op_base<Scalar, Scalar> {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& x, const Scalar& y) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& x, const Scalar& y) const {
|
||||
// This functor is used by hypotNorm only for which it is faster to first apply abs
|
||||
// on all coefficients prior to reduction through hypot.
|
||||
// This way we avoid calling abs on positive and real entries, and this also permits
|
||||
@@ -337,7 +338,7 @@ struct scalar_pow_op : binary_op_base<Scalar, Exponent> {
|
||||
}
|
||||
#endif
|
||||
|
||||
EIGEN_DEVICE_FUNC inline result_type operator()(const Scalar& a, const Exponent& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline result_type operator()(const Scalar& a, const Exponent& b) const {
|
||||
return numext::pow(a, b);
|
||||
}
|
||||
|
||||
@@ -368,7 +369,7 @@ struct scalar_difference_op : binary_op_base<LhsScalar, RhsScalar> {
|
||||
#ifdef EIGEN_SCALAR_BINARY_OP_PLUGIN
|
||||
scalar_difference_op(){EIGEN_SCALAR_BINARY_OP_PLUGIN}
|
||||
#endif
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type
|
||||
operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a - b;
|
||||
}
|
||||
@@ -388,13 +389,13 @@ struct functor_traits<scalar_difference_op<LhsScalar, RhsScalar>> {
|
||||
|
||||
template <typename Packet, bool IsInteger = NumTraits<typename unpacket_traits<Packet>::type>::IsInteger>
|
||||
struct maybe_raise_div_by_zero {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Packet x) { EIGEN_UNUSED_VARIABLE(x); }
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void run(Packet x) { EIGEN_UNUSED_VARIABLE(x); }
|
||||
};
|
||||
|
||||
#ifndef EIGEN_GPU_COMPILE_PHASE
|
||||
template <typename Packet>
|
||||
struct maybe_raise_div_by_zero<Packet, true> {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Packet x) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void run(Packet x) {
|
||||
if (EIGEN_PREDICT_FALSE(predux_any(pcmp_eq(x, pzero(x))))) {
|
||||
// Use volatile variables to force a division by zero, which will
|
||||
// result in the default platform behaviour (usually SIGFPE).
|
||||
@@ -417,7 +418,7 @@ struct scalar_quotient_op : binary_op_base<LhsScalar, RhsScalar> {
|
||||
#ifdef EIGEN_SCALAR_BINARY_OP_PLUGIN
|
||||
scalar_quotient_op(){EIGEN_SCALAR_BINARY_OP_PLUGIN}
|
||||
#endif
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type
|
||||
operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a / b;
|
||||
}
|
||||
@@ -446,7 +447,7 @@ struct scalar_boolean_and_op {
|
||||
using result_type = Scalar;
|
||||
// `false` any value `a` that satisfies `a == Scalar(0)`
|
||||
// `true` is the complement of `false`
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a, const Scalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a, const Scalar& b) const {
|
||||
return (a != Scalar(0)) && (b != Scalar(0)) ? Scalar(1) : Scalar(0);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -474,7 +475,7 @@ struct scalar_boolean_or_op {
|
||||
using result_type = Scalar;
|
||||
// `false` any value `a` that satisfies `a == Scalar(0)`
|
||||
// `true` is the complement of `false`
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a, const Scalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a, const Scalar& b) const {
|
||||
return (a != Scalar(0)) || (b != Scalar(0)) ? Scalar(1) : Scalar(0);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -501,7 +502,7 @@ struct scalar_boolean_xor_op {
|
||||
using result_type = Scalar;
|
||||
// `false` any value `a` that satisfies `a == Scalar(0)`
|
||||
// `true` is the complement of `false`
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a, const Scalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a, const Scalar& b) const {
|
||||
return (a != Scalar(0)) != (b != Scalar(0)) ? Scalar(1) : Scalar(0);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -523,19 +524,19 @@ template <typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
|
||||
struct bitwise_binary_impl {
|
||||
static constexpr size_t Size = sizeof(Scalar);
|
||||
using uint_t = typename numext::get_integer_by_size<Size>::unsigned_type;
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_and(const Scalar& a, const Scalar& b) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar run_and(const Scalar& a, const Scalar& b) {
|
||||
uint_t a_as_uint = numext::bit_cast<uint_t, Scalar>(a);
|
||||
uint_t b_as_uint = numext::bit_cast<uint_t, Scalar>(b);
|
||||
uint_t result = a_as_uint & b_as_uint;
|
||||
return numext::bit_cast<Scalar, uint_t>(result);
|
||||
}
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_or(const Scalar& a, const Scalar& b) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar run_or(const Scalar& a, const Scalar& b) {
|
||||
uint_t a_as_uint = numext::bit_cast<uint_t, Scalar>(a);
|
||||
uint_t b_as_uint = numext::bit_cast<uint_t, Scalar>(b);
|
||||
uint_t result = a_as_uint | b_as_uint;
|
||||
return numext::bit_cast<Scalar, uint_t>(result);
|
||||
}
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_xor(const Scalar& a, const Scalar& b) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar run_xor(const Scalar& a, const Scalar& b) {
|
||||
uint_t a_as_uint = numext::bit_cast<uint_t, Scalar>(a);
|
||||
uint_t b_as_uint = numext::bit_cast<uint_t, Scalar>(b);
|
||||
uint_t result = a_as_uint ^ b_as_uint;
|
||||
@@ -546,17 +547,17 @@ struct bitwise_binary_impl {
|
||||
template <typename Scalar>
|
||||
struct bitwise_binary_impl<Scalar, true> {
|
||||
using Real = typename NumTraits<Scalar>::Real;
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_and(const Scalar& a, const Scalar& b) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar run_and(const Scalar& a, const Scalar& b) {
|
||||
Real real_result = bitwise_binary_impl<Real>::run_and(numext::real(a), numext::real(b));
|
||||
Real imag_result = bitwise_binary_impl<Real>::run_and(numext::imag(a), numext::imag(b));
|
||||
return Scalar(real_result, imag_result);
|
||||
}
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_or(const Scalar& a, const Scalar& b) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar run_or(const Scalar& a, const Scalar& b) {
|
||||
Real real_result = bitwise_binary_impl<Real>::run_or(numext::real(a), numext::real(b));
|
||||
Real imag_result = bitwise_binary_impl<Real>::run_or(numext::imag(a), numext::imag(b));
|
||||
return Scalar(real_result, imag_result);
|
||||
}
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_xor(const Scalar& a, const Scalar& b) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar run_xor(const Scalar& a, const Scalar& b) {
|
||||
Real real_result = bitwise_binary_impl<Real>::run_xor(numext::real(a), numext::real(b));
|
||||
Real imag_result = bitwise_binary_impl<Real>::run_xor(numext::imag(a), numext::imag(b));
|
||||
return Scalar(real_result, imag_result);
|
||||
@@ -574,7 +575,7 @@ struct scalar_bitwise_and_op {
|
||||
BITWISE OPERATIONS MAY ONLY BE PERFORMED ON PLAIN DATA TYPES)
|
||||
EIGEN_STATIC_ASSERT((!internal::is_same<Scalar, bool>::value), DONT USE BITWISE OPS ON BOOLEAN TYPES)
|
||||
using result_type = Scalar;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a, const Scalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a, const Scalar& b) const {
|
||||
return bitwise_binary_impl<Scalar>::run_and(a, b);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -598,7 +599,7 @@ struct scalar_bitwise_or_op {
|
||||
BITWISE OPERATIONS MAY ONLY BE PERFORMED ON PLAIN DATA TYPES)
|
||||
EIGEN_STATIC_ASSERT((!internal::is_same<Scalar, bool>::value), DONT USE BITWISE OPS ON BOOLEAN TYPES)
|
||||
using result_type = Scalar;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a, const Scalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a, const Scalar& b) const {
|
||||
return bitwise_binary_impl<Scalar>::run_or(a, b);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -622,7 +623,7 @@ struct scalar_bitwise_xor_op {
|
||||
BITWISE OPERATIONS MAY ONLY BE PERFORMED ON PLAIN DATA TYPES)
|
||||
EIGEN_STATIC_ASSERT((!internal::is_same<Scalar, bool>::value), DONT USE BITWISE OPS ON BOOLEAN TYPES)
|
||||
using result_type = Scalar;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a, const Scalar& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a, const Scalar& b) const {
|
||||
return bitwise_binary_impl<Scalar>::run_xor(a, b);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -646,7 +647,7 @@ struct scalar_absolute_difference_op : binary_op_base<LhsScalar, RhsScalar> {
|
||||
#ifdef EIGEN_SCALAR_BINARY_OP_PLUGIN
|
||||
scalar_absolute_difference_op(){EIGEN_SCALAR_BINARY_OP_PLUGIN}
|
||||
#endif
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type
|
||||
operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return numext::absdiff(a, b);
|
||||
}
|
||||
@@ -671,7 +672,7 @@ struct scalar_atan2_op {
|
||||
is_same<LhsScalar, RhsScalar>::value && !NumTraits<Scalar>::IsInteger && !NumTraits<Scalar>::IsComplex;
|
||||
EIGEN_STATIC_ASSERT(Enable, "LhsScalar and RhsScalar must be the same non-integer, non-complex type")
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& y, const Scalar& x) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& y, const Scalar& x) const {
|
||||
return numext::atan2(y, x);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -702,9 +703,9 @@ struct bind1st_op : BinaryOp {
|
||||
typedef typename BinaryOp::second_argument_type second_argument_type;
|
||||
typedef typename BinaryOp::result_type result_type;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit bind1st_op(const first_argument_type& val) : m_value(val) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit bind1st_op(const first_argument_type& val) : m_value(val) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const second_argument_type& b) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const second_argument_type& b) const {
|
||||
return BinaryOp::operator()(m_value, b);
|
||||
}
|
||||
|
||||
@@ -724,9 +725,9 @@ struct bind2nd_op : BinaryOp {
|
||||
typedef typename BinaryOp::second_argument_type second_argument_type;
|
||||
typedef typename BinaryOp::result_type result_type;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit bind2nd_op(const second_argument_type& val) : m_value(val) {}
|
||||
EIGEN_DEVICE_FUNC constexpr explicit bind2nd_op(const second_argument_type& val) : m_value(val) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const first_argument_type& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const first_argument_type& a) const {
|
||||
return BinaryOp::operator()(a, m_value);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace internal {
|
||||
|
||||
template <typename Scalar>
|
||||
struct scalar_constant_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_constant_op(const Scalar& other) : m_other(other) {}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()() const { return m_other; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE scalar_constant_op(const Scalar& other) : m_other(other) {}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()() const { return m_other; }
|
||||
template <typename PacketType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketType packetOp() const {
|
||||
return internal::pset1<PacketType>(m_other);
|
||||
@@ -39,7 +39,7 @@ struct functor_traits<scalar_constant_op<Scalar>> {
|
||||
template <typename Scalar>
|
||||
struct scalar_zero_op {
|
||||
EIGEN_DEVICE_FUNC scalar_zero_op() = default;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()() const { return Scalar(0); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()() const { return Scalar(0); }
|
||||
template <typename PacketType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketType packetOp() const {
|
||||
return internal::pzero<PacketType>(PacketType());
|
||||
@@ -51,7 +51,7 @@ struct functor_traits<scalar_zero_op<Scalar>> : functor_traits<scalar_constant_o
|
||||
template <typename Scalar>
|
||||
struct scalar_identity_op {
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(IndexType row, IndexType col) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(IndexType row, IndexType col) const {
|
||||
return row == col ? Scalar(1) : Scalar(0);
|
||||
}
|
||||
};
|
||||
@@ -67,7 +67,7 @@ template <typename Scalar>
|
||||
struct linspaced_op_impl<Scalar, /*IsInteger*/ false> {
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
|
||||
EIGEN_DEVICE_FUNC linspaced_op_impl(const Scalar& low, const Scalar& high, Index num_steps)
|
||||
EIGEN_DEVICE_FUNC constexpr linspaced_op_impl(const Scalar& low, const Scalar& high, Index num_steps)
|
||||
: m_low(low),
|
||||
m_high(high),
|
||||
m_size1(num_steps == 1 ? 1 : num_steps - 1),
|
||||
@@ -75,7 +75,7 @@ struct linspaced_op_impl<Scalar, /*IsInteger*/ false> {
|
||||
m_flip(numext::abs(high) < numext::abs(low)) {}
|
||||
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(IndexType i) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(IndexType i) const {
|
||||
if (m_flip)
|
||||
return (i == 0) ? m_low : Scalar(m_high - RealScalar(m_size1 - i) * m_step);
|
||||
else
|
||||
@@ -111,7 +111,7 @@ struct linspaced_op_impl<Scalar, /*IsInteger*/ false> {
|
||||
|
||||
template <typename Scalar>
|
||||
struct linspaced_op_impl<Scalar, /*IsInteger*/ true> {
|
||||
EIGEN_DEVICE_FUNC linspaced_op_impl(const Scalar& low, const Scalar& high, Index num_steps)
|
||||
EIGEN_DEVICE_FUNC constexpr linspaced_op_impl(const Scalar& low, const Scalar& high, Index num_steps)
|
||||
: m_low(low),
|
||||
m_multiplier((high - low) / convert_index<Scalar>(num_steps <= 1 ? 1 : num_steps - 1)),
|
||||
m_divisor(convert_index<Scalar>((high >= low ? num_steps : -num_steps) + (high - low)) /
|
||||
@@ -119,7 +119,7 @@ struct linspaced_op_impl<Scalar, /*IsInteger*/ true> {
|
||||
m_use_divisor(num_steps > 1 && (numext::abs(high - low) + 1) < num_steps) {}
|
||||
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(IndexType i) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(IndexType i) const {
|
||||
if (m_use_divisor)
|
||||
return m_low + convert_index<Scalar>(i) / m_divisor;
|
||||
else
|
||||
@@ -151,11 +151,11 @@ struct functor_traits<linspaced_op<Scalar>> {
|
||||
};
|
||||
template <typename Scalar>
|
||||
struct linspaced_op {
|
||||
EIGEN_DEVICE_FUNC linspaced_op(const Scalar& low, const Scalar& high, Index num_steps)
|
||||
EIGEN_DEVICE_FUNC constexpr linspaced_op(const Scalar& low, const Scalar& high, Index num_steps)
|
||||
: impl((num_steps == 1 ? high : low), high, num_steps) {}
|
||||
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(IndexType i) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(IndexType i) const {
|
||||
return impl(i);
|
||||
}
|
||||
|
||||
@@ -173,9 +173,9 @@ template <typename Scalar>
|
||||
struct equalspaced_op {
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
|
||||
EIGEN_DEVICE_FUNC equalspaced_op(const Scalar& start, const Scalar& step) : m_start(start), m_step(step) {}
|
||||
EIGEN_DEVICE_FUNC constexpr equalspaced_op(const Scalar& start, const Scalar& step) : m_start(start), m_step(step) {}
|
||||
template <typename IndexType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(IndexType i) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(IndexType i) const {
|
||||
return m_start + m_step * static_cast<Scalar>(i);
|
||||
}
|
||||
template <typename Packet, typename IndexType>
|
||||
|
||||
@@ -26,8 +26,8 @@ struct scalar_boolean_select_op {
|
||||
EIGEN_STATIC_ASSERT(ThenElseAreSame, THEN AND ELSE MUST BE SAME TYPE)
|
||||
using Scalar = ThenScalar;
|
||||
using result_type = Scalar;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const ThenScalar& a, const ElseScalar& b,
|
||||
const ConditionScalar& cond) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const ThenScalar& a, const ElseScalar& b,
|
||||
const ConditionScalar& cond) const {
|
||||
return cond == ConditionScalar(0) ? b : a;
|
||||
}
|
||||
template <typename Packet>
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace internal {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_opposite_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::negate(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::negate(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const {
|
||||
return internal::pnegate(a);
|
||||
@@ -43,7 +43,9 @@ struct functor_traits<scalar_opposite_op<Scalar>> {
|
||||
template <typename Scalar>
|
||||
struct scalar_abs_op {
|
||||
typedef typename NumTraits<Scalar>::Real result_type;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const { return numext::abs(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const {
|
||||
return numext::abs(a);
|
||||
}
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const {
|
||||
return internal::pabs(a);
|
||||
@@ -71,7 +73,7 @@ template <typename Scalar, typename = void>
|
||||
struct abs_knowing_score {
|
||||
typedef typename NumTraits<Scalar>::Real result_type;
|
||||
template <typename Score>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const Scalar& a, const Score&) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const Scalar& a, const Score&) const {
|
||||
return numext::abs(a);
|
||||
}
|
||||
};
|
||||
@@ -79,7 +81,7 @@ template <typename Scalar>
|
||||
struct abs_knowing_score<Scalar, typename scalar_score_coeff_op<Scalar>::Score_is_abs> {
|
||||
typedef typename NumTraits<Scalar>::Real result_type;
|
||||
template <typename Scal>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const Scal&, const result_type& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const Scal&, const result_type& a) const {
|
||||
return a;
|
||||
}
|
||||
};
|
||||
@@ -92,7 +94,9 @@ struct abs_knowing_score<Scalar, typename scalar_score_coeff_op<Scalar>::Score_i
|
||||
template <typename Scalar>
|
||||
struct scalar_abs2_op {
|
||||
typedef typename NumTraits<Scalar>::Real result_type;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const { return numext::abs2(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const {
|
||||
return numext::abs2(a);
|
||||
}
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const {
|
||||
return internal::pmul(a, a);
|
||||
@@ -113,7 +117,7 @@ struct functor_traits<scalar_abs2_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_conjugate_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::conj(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::conj(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const {
|
||||
return internal::pconj(a);
|
||||
@@ -143,7 +147,9 @@ struct functor_traits<scalar_conjugate_op<Scalar>> {
|
||||
template <typename Scalar>
|
||||
struct scalar_arg_op {
|
||||
typedef typename NumTraits<Scalar>::Real result_type;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const { return numext::arg(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const {
|
||||
return numext::arg(a);
|
||||
}
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const {
|
||||
return internal::parg(a);
|
||||
@@ -165,7 +171,9 @@ struct functor_traits<scalar_arg_op<Scalar>> {
|
||||
template <typename Scalar>
|
||||
struct scalar_carg_op {
|
||||
using result_type = Scalar;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return Scalar(numext::arg(a)); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
return Scalar(numext::arg(a));
|
||||
}
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const {
|
||||
return pcarg(a);
|
||||
@@ -185,7 +193,9 @@ struct functor_traits<scalar_carg_op<Scalar>> {
|
||||
template <typename Scalar, typename NewType>
|
||||
struct scalar_cast_op {
|
||||
typedef NewType result_type;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE NewType operator()(const Scalar& a) const { return cast<Scalar, NewType>(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE NewType operator()(const Scalar& a) const {
|
||||
return cast<Scalar, NewType>(a);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Scalar, typename NewType>
|
||||
@@ -218,7 +228,7 @@ struct functor_traits<core_cast_op<SrcType, DstType>> {
|
||||
*/
|
||||
template <typename Scalar, int N>
|
||||
struct scalar_shift_right_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
return numext::arithmetic_shift_right(a);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -238,7 +248,7 @@ struct functor_traits<scalar_shift_right_op<Scalar, N>> {
|
||||
*/
|
||||
template <typename Scalar, int N>
|
||||
struct scalar_shift_left_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
return numext::logical_shift_left(a);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -259,7 +269,9 @@ struct functor_traits<scalar_shift_left_op<Scalar, N>> {
|
||||
template <typename Scalar>
|
||||
struct scalar_real_op {
|
||||
typedef typename NumTraits<Scalar>::Real result_type;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const { return numext::real(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const {
|
||||
return numext::real(a);
|
||||
}
|
||||
};
|
||||
template <typename Scalar>
|
||||
struct functor_traits<scalar_real_op<Scalar>> {
|
||||
@@ -274,7 +286,9 @@ struct functor_traits<scalar_real_op<Scalar>> {
|
||||
template <typename Scalar>
|
||||
struct scalar_imag_op {
|
||||
typedef typename NumTraits<Scalar>::Real result_type;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const { return numext::imag(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const {
|
||||
return numext::imag(a);
|
||||
}
|
||||
};
|
||||
template <typename Scalar>
|
||||
struct functor_traits<scalar_imag_op<Scalar>> {
|
||||
@@ -289,10 +303,12 @@ struct functor_traits<scalar_imag_op<Scalar>> {
|
||||
template <typename Scalar>
|
||||
struct scalar_real_ref_op {
|
||||
typedef typename NumTraits<Scalar>::Real result_type;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type& operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const result_type& operator()(const Scalar& a) const {
|
||||
return numext::real_ref(a);
|
||||
}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type& operator()(Scalar& a) const {
|
||||
return numext::real_ref(a);
|
||||
}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type& operator()(Scalar& a) const { return numext::real_ref(a); }
|
||||
};
|
||||
template <typename Scalar>
|
||||
struct functor_traits<scalar_real_ref_op<Scalar>> {
|
||||
@@ -307,8 +323,10 @@ struct functor_traits<scalar_real_ref_op<Scalar>> {
|
||||
template <typename Scalar>
|
||||
struct scalar_imag_ref_op {
|
||||
typedef typename NumTraits<Scalar>::Real result_type;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type& operator()(Scalar& a) const { return numext::imag_ref(a); }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type& operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type& operator()(Scalar& a) const {
|
||||
return numext::imag_ref(a);
|
||||
}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const result_type& operator()(const Scalar& a) const {
|
||||
return numext::imag_ref(a);
|
||||
}
|
||||
};
|
||||
@@ -325,7 +343,7 @@ struct functor_traits<scalar_imag_ref_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_exp_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return internal::pexp(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return internal::pexp(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pexp(a);
|
||||
@@ -357,7 +375,7 @@ struct functor_traits<scalar_exp_op<Scalar>> {
|
||||
|
||||
template <typename Scalar>
|
||||
struct scalar_exp2_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return internal::pexp2(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return internal::pexp2(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pexp2(a);
|
||||
@@ -379,7 +397,7 @@ struct functor_traits<scalar_exp2_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_expm1_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::expm1(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::expm1(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pexpm1(a);
|
||||
@@ -401,7 +419,7 @@ struct functor_traits<scalar_expm1_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_log_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::log(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::log(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::plog(a);
|
||||
@@ -433,7 +451,7 @@ struct functor_traits<scalar_log_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_log1p_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::log1p(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::log1p(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::plog1p(a);
|
||||
@@ -455,7 +473,9 @@ struct functor_traits<scalar_log1p_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_log10_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { EIGEN_USING_STD(log10) return log10(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const {
|
||||
EIGEN_USING_STD(log10) return log10(a);
|
||||
}
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::plog10(a);
|
||||
@@ -475,7 +495,7 @@ struct functor_traits<scalar_log10_op<Scalar>> {
|
||||
template <typename Scalar>
|
||||
struct scalar_log2_op {
|
||||
using RealScalar = typename NumTraits<Scalar>::Real;
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const {
|
||||
return Scalar(RealScalar(EIGEN_LOG2E)) * numext::log(a);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -494,7 +514,7 @@ struct functor_traits<scalar_log2_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_sqrt_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::sqrt(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::sqrt(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::psqrt(a);
|
||||
@@ -536,7 +556,7 @@ struct functor_traits<scalar_sqrt_op<bool>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_cbrt_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::cbrt(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::cbrt(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pcbrt(a);
|
||||
@@ -554,7 +574,7 @@ struct functor_traits<scalar_cbrt_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_rsqrt_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::rsqrt(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::rsqrt(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::prsqrt(a);
|
||||
@@ -572,7 +592,7 @@ struct functor_traits<scalar_rsqrt_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_cos_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::cos(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::cos(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pcos(a);
|
||||
@@ -589,7 +609,7 @@ struct functor_traits<scalar_cos_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_sin_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::sin(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::sin(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::psin(a);
|
||||
@@ -606,7 +626,7 @@ struct functor_traits<scalar_sin_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_tan_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::tan(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::tan(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::ptan(a);
|
||||
@@ -623,7 +643,7 @@ struct functor_traits<scalar_tan_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_acos_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::acos(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::acos(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pacos(a);
|
||||
@@ -640,7 +660,7 @@ struct functor_traits<scalar_acos_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_asin_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::asin(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::asin(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pasin(a);
|
||||
@@ -657,7 +677,7 @@ struct functor_traits<scalar_asin_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_atan_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::atan(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::atan(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::patan(a);
|
||||
@@ -674,7 +694,7 @@ struct functor_traits<scalar_atan_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_tanh_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::tanh(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::tanh(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& x) const {
|
||||
return ptanh(x);
|
||||
@@ -709,7 +729,7 @@ struct functor_traits<scalar_tanh_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_atanh_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::atanh(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::atanh(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& x) const {
|
||||
return patanh(x);
|
||||
@@ -727,7 +747,7 @@ struct functor_traits<scalar_atanh_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_sinh_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::sinh(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::sinh(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::psinh(a);
|
||||
@@ -744,7 +764,7 @@ struct functor_traits<scalar_sinh_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_asinh_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::asinh(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::asinh(a); }
|
||||
};
|
||||
|
||||
template <typename Scalar>
|
||||
@@ -758,7 +778,7 @@ struct functor_traits<scalar_asinh_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_cosh_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::cosh(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::cosh(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pcosh(a);
|
||||
@@ -775,7 +795,7 @@ struct functor_traits<scalar_cosh_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_acosh_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::acosh(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::acosh(a); }
|
||||
};
|
||||
|
||||
template <typename Scalar>
|
||||
@@ -789,7 +809,7 @@ struct functor_traits<scalar_acosh_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_inverse_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return Scalar(1) / a; }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return Scalar(1) / a; }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::preciprocal(a);
|
||||
@@ -813,7 +833,7 @@ struct functor_traits<scalar_inverse_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_square_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return a * a; }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return a * a; }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pmul(a, a);
|
||||
@@ -844,7 +864,7 @@ struct functor_traits<scalar_square_op<bool>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_cube_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return a * a * a; }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return a * a * a; }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pmul(a, pmul(a, a));
|
||||
@@ -875,7 +895,7 @@ struct functor_traits<scalar_cube_op<bool>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_round_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::round(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::round(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pround(a);
|
||||
@@ -895,7 +915,7 @@ struct functor_traits<scalar_round_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_floor_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::floor(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::floor(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pfloor(a);
|
||||
@@ -915,7 +935,7 @@ struct functor_traits<scalar_floor_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_rint_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::rint(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::rint(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::print(a);
|
||||
@@ -935,7 +955,7 @@ struct functor_traits<scalar_rint_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_ceil_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::ceil(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::ceil(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::pceil(a);
|
||||
@@ -955,7 +975,7 @@ struct functor_traits<scalar_ceil_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_trunc_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::trunc(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { return numext::trunc(a); }
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
return internal::ptrunc(a);
|
||||
@@ -975,7 +995,7 @@ struct functor_traits<scalar_trunc_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar, bool UseTypedPredicate = false>
|
||||
struct scalar_isnan_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE bool operator()(const Scalar& a) const {
|
||||
#if defined(SYCL_DEVICE_ONLY)
|
||||
return numext::isnan(a);
|
||||
#else
|
||||
@@ -986,7 +1006,7 @@ struct scalar_isnan_op {
|
||||
|
||||
template <typename Scalar>
|
||||
struct scalar_isnan_op<Scalar, true> {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
#if defined(SYCL_DEVICE_ONLY)
|
||||
return (numext::isnan(a) ? ptrue(a) : pzero(a));
|
||||
#else
|
||||
@@ -1010,7 +1030,7 @@ struct functor_traits<scalar_isnan_op<Scalar, UseTypedPredicate>> {
|
||||
*/
|
||||
template <typename Scalar, bool UseTypedPredicate = false>
|
||||
struct scalar_isinf_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE bool operator()(const Scalar& a) const {
|
||||
#if defined(SYCL_DEVICE_ONLY)
|
||||
return numext::isinf(a);
|
||||
#else
|
||||
@@ -1021,7 +1041,7 @@ struct scalar_isinf_op {
|
||||
|
||||
template <typename Scalar>
|
||||
struct scalar_isinf_op<Scalar, true> {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
#if defined(SYCL_DEVICE_ONLY)
|
||||
return (numext::isinf(a) ? ptrue(a) : pzero(a));
|
||||
#else
|
||||
@@ -1044,7 +1064,7 @@ struct functor_traits<scalar_isinf_op<Scalar, UseTypedPredicate>> {
|
||||
*/
|
||||
template <typename Scalar, bool UseTypedPredicate = false>
|
||||
struct scalar_isfinite_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE bool operator()(const Scalar& a) const {
|
||||
#if defined(SYCL_DEVICE_ONLY)
|
||||
return numext::isfinite(a);
|
||||
#else
|
||||
@@ -1055,7 +1075,7 @@ struct scalar_isfinite_op {
|
||||
|
||||
template <typename Scalar>
|
||||
struct scalar_isfinite_op<Scalar, true> {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
#if defined(SYCL_DEVICE_ONLY)
|
||||
return (numext::isfinite(a) ? ptrue(a) : pzero(a));
|
||||
#else
|
||||
@@ -1083,7 +1103,7 @@ struct scalar_boolean_not_op {
|
||||
using result_type = Scalar;
|
||||
// `false` any value `a` that satisfies `a == Scalar(0)`
|
||||
// `true` is the complement of `false`
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
return a == Scalar(0) ? Scalar(1) : Scalar(0);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -1102,7 +1122,7 @@ template <typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
|
||||
struct bitwise_unary_impl {
|
||||
static constexpr size_t Size = sizeof(Scalar);
|
||||
using uint_t = typename numext::get_integer_by_size<Size>::unsigned_type;
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_not(const Scalar& a) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar run_not(const Scalar& a) {
|
||||
uint_t a_as_uint = numext::bit_cast<uint_t, Scalar>(a);
|
||||
uint_t result = ~a_as_uint;
|
||||
return numext::bit_cast<Scalar, uint_t>(result);
|
||||
@@ -1112,7 +1132,7 @@ struct bitwise_unary_impl {
|
||||
template <typename Scalar>
|
||||
struct bitwise_unary_impl<Scalar, true> {
|
||||
using Real = typename NumTraits<Scalar>::Real;
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_not(const Scalar& a) {
|
||||
static EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar run_not(const Scalar& a) {
|
||||
Real real_result = bitwise_unary_impl<Real>::run_not(numext::real(a));
|
||||
Real imag_result = bitwise_unary_impl<Real>::run_not(numext::imag(a));
|
||||
return Scalar(real_result, imag_result);
|
||||
@@ -1130,7 +1150,7 @@ struct scalar_bitwise_not_op {
|
||||
BITWISE OPERATIONS MAY ONLY BE PERFORMED ON PLAIN DATA TYPES)
|
||||
EIGEN_STATIC_ASSERT((!internal::is_same<Scalar, bool>::value), DONT USE BITWISE OPS ON BOOLEAN TYPES)
|
||||
using result_type = Scalar;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
return bitwise_unary_impl<Scalar>::run_not(a);
|
||||
}
|
||||
template <typename Packet>
|
||||
@@ -1149,7 +1169,7 @@ struct functor_traits<scalar_bitwise_not_op<Scalar>> {
|
||||
*/
|
||||
template <typename Scalar>
|
||||
struct scalar_sign_op {
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator()(const Scalar& a) const { return numext::sign(a); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline Scalar operator()(const Scalar& a) const { return numext::sign(a); }
|
||||
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const {
|
||||
@@ -1184,7 +1204,7 @@ struct scalar_logistic_op_impl {
|
||||
// Complex-valud implementation.
|
||||
template <typename T>
|
||||
struct scalar_logistic_op_impl<T, std::enable_if_t<NumTraits<T>::IsComplex>> {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T operator()(const T& x) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE T operator()(const T& x) const {
|
||||
const T e = numext::exp(x);
|
||||
return (numext::isinf)(numext::real(e)) ? T(1) : e / (e + T(1));
|
||||
}
|
||||
@@ -1311,8 +1331,9 @@ struct scalar_unary_pow_op {
|
||||
internal::has_ReturnType<ScalarBinaryOpTraits<Scalar, ExponentScalar, scalar_unary_pow_op>>::value>::type
|
||||
PromotedExponent;
|
||||
typedef typename ScalarBinaryOpTraits<Scalar, PromotedExponent, scalar_unary_pow_op>::ReturnType result_type;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_unary_pow_op(const ExponentScalar& exponent) : m_exponent(exponent) {}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE scalar_unary_pow_op(const ExponentScalar& exponent)
|
||||
: m_exponent(exponent) {}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const {
|
||||
EIGEN_USING_STD(pow);
|
||||
return static_cast<result_type>(pow(a, m_exponent));
|
||||
}
|
||||
@@ -1350,7 +1371,7 @@ struct scalar_unary_pow_op<Scalar, ExponentScalar, false, false, false, false> {
|
||||
check_is_representable();
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
EIGEN_USING_STD(pow);
|
||||
return static_cast<Scalar>(pow(a, m_exponent));
|
||||
}
|
||||
@@ -1366,9 +1387,10 @@ struct scalar_unary_pow_op<Scalar, ExponentScalar, false, false, false, false> {
|
||||
|
||||
template <typename Scalar, typename ExponentScalar, bool BaseIsInteger>
|
||||
struct scalar_unary_pow_op<Scalar, ExponentScalar, BaseIsInteger, true, false, false> {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_unary_pow_op(const ExponentScalar& exponent) : m_exponent(exponent) {}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE scalar_unary_pow_op(const ExponentScalar& exponent)
|
||||
: m_exponent(exponent) {}
|
||||
// TODO: error handling logic for complex^real_integer
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const {
|
||||
return unary_pow_impl<Scalar, ExponentScalar>::run(a, m_exponent);
|
||||
}
|
||||
template <typename Packet>
|
||||
|
||||
@@ -43,12 +43,12 @@ struct general_matrix_vector_product;
|
||||
|
||||
template <typename From, typename To>
|
||||
struct get_factor {
|
||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE To run(const From& x) { return To(x); }
|
||||
EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE To run(const From& x) { return To(x); }
|
||||
};
|
||||
|
||||
template <typename Scalar>
|
||||
struct get_factor<Scalar, typename NumTraits<Scalar>::Real> {
|
||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE typename NumTraits<Scalar>::Real run(const Scalar& x) {
|
||||
EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE typename NumTraits<Scalar>::Real run(const Scalar& x) {
|
||||
return numext::real(x);
|
||||
}
|
||||
};
|
||||
@@ -56,9 +56,9 @@ struct get_factor<Scalar, typename NumTraits<Scalar>::Real> {
|
||||
template <typename Scalar, typename Index>
|
||||
class BlasVectorMapper {
|
||||
public:
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE BlasVectorMapper(Scalar* data) : m_data(data) {}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE BlasVectorMapper(Scalar* data) : m_data(data) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar operator()(Index i) const { return m_data[i]; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE Scalar operator()(Index i) const { return m_data[i]; }
|
||||
template <typename Packet, int AlignmentType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet load(Index i) const {
|
||||
return ploadt<Packet, AlignmentType>(m_data + i);
|
||||
@@ -79,14 +79,14 @@ class BlasLinearMapper;
|
||||
template <typename Scalar, typename Index, int AlignmentType>
|
||||
class BlasLinearMapper<Scalar, Index, AlignmentType> {
|
||||
public:
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE BlasLinearMapper(Scalar* data, Index incr = 1) : m_data(data) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE BlasLinearMapper(Scalar* data, Index incr = 1) : m_data(data) {
|
||||
EIGEN_ONLY_USED_FOR_DEBUG(incr);
|
||||
eigen_assert(incr == 1);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void prefetch(Index i) const { internal::prefetch(&operator()(i)); }
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar& operator()(Index i) const { return m_data[i]; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE Scalar& operator()(Index i) const { return m_data[i]; }
|
||||
|
||||
template <typename PacketType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketType loadPacket(Index i) const {
|
||||
@@ -178,27 +178,27 @@ class blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType, 1> {
|
||||
typedef blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType> SubMapper;
|
||||
typedef BlasVectorMapper<Scalar, Index> VectorMapper;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE blas_data_mapper(Scalar* data, Index stride, Index incr = 1)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE blas_data_mapper(Scalar* data, Index stride, Index incr = 1)
|
||||
: m_data(data), m_stride(stride) {
|
||||
EIGEN_ONLY_USED_FOR_DEBUG(incr);
|
||||
eigen_assert(incr == 1);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE SubMapper getSubMapper(Index i, Index j) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE SubMapper getSubMapper(Index i, Index j) const {
|
||||
return SubMapper(&operator()(i, j), m_stride);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE LinearMapper getLinearMapper(Index i, Index j) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE LinearMapper getLinearMapper(Index i, Index j) const {
|
||||
return LinearMapper(&operator()(i, j));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE VectorMapper getVectorMapper(Index i, Index j) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE VectorMapper getVectorMapper(Index i, Index j) const {
|
||||
return VectorMapper(&operator()(i, j));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void prefetch(Index i, Index j) const { internal::prefetch(&operator()(i, j)); }
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar& operator()(Index i, Index j) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE Scalar& operator()(Index i, Index j) const {
|
||||
return m_data[StorageOrder == RowMajor ? j + i * m_stride : i + j * m_stride];
|
||||
}
|
||||
|
||||
@@ -239,8 +239,8 @@ class blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType, 1> {
|
||||
return pgather<Scalar, SubPacket>(&operator()(i, j), m_stride);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC const Index stride() const { return m_stride; }
|
||||
EIGEN_DEVICE_FUNC const Index incr() const { return 1; }
|
||||
EIGEN_DEVICE_FUNC constexpr const Index stride() const { return m_stride; }
|
||||
EIGEN_DEVICE_FUNC constexpr const Index incr() const { return 1; }
|
||||
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_data; }
|
||||
|
||||
EIGEN_DEVICE_FUNC Index firstAligned(Index size) const {
|
||||
@@ -268,11 +268,14 @@ class blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType, 1> {
|
||||
template <typename Scalar, typename Index, int AlignmentType, int Incr>
|
||||
class BlasLinearMapper {
|
||||
public:
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE BlasLinearMapper(Scalar* data, Index incr) : m_data(data), m_incr(incr) {}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE BlasLinearMapper(Scalar* data, Index incr)
|
||||
: m_data(data), m_incr(incr) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void prefetch(int i) const { internal::prefetch(&operator()(i)); }
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar& operator()(Index i) const { return m_data[i * m_incr.value()]; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE Scalar& operator()(Index i) const {
|
||||
return m_data[i * m_incr.value()];
|
||||
}
|
||||
|
||||
template <typename PacketType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketType loadPacket(Index i) const {
|
||||
@@ -306,20 +309,20 @@ class blas_data_mapper {
|
||||
typedef BlasLinearMapper<Scalar, Index, AlignmentType, Incr> LinearMapper;
|
||||
typedef blas_data_mapper SubMapper;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE blas_data_mapper(Scalar* data, Index stride, Index incr)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE blas_data_mapper(Scalar* data, Index stride, Index incr)
|
||||
: m_data(data), m_stride(stride), m_incr(incr) {}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE SubMapper getSubMapper(Index i, Index j) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE SubMapper getSubMapper(Index i, Index j) const {
|
||||
return SubMapper(&operator()(i, j), m_stride, m_incr.value());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE LinearMapper getLinearMapper(Index i, Index j) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE LinearMapper getLinearMapper(Index i, Index j) const {
|
||||
return LinearMapper(&operator()(i, j), m_incr.value());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void prefetch(Index i, Index j) const { internal::prefetch(&operator()(i, j)); }
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar& operator()(Index i, Index j) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE Scalar& operator()(Index i, Index j) const {
|
||||
return m_data[StorageOrder == RowMajor ? j * m_incr.value() + i * m_stride : i * m_incr.value() + j * m_stride];
|
||||
}
|
||||
|
||||
@@ -428,8 +431,8 @@ class blas_data_mapper {
|
||||
spb.store(this, i, j, block);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC const Index stride() const { return m_stride; }
|
||||
EIGEN_DEVICE_FUNC const Index incr() const { return m_incr.value(); }
|
||||
EIGEN_DEVICE_FUNC constexpr const Index stride() const { return m_stride; }
|
||||
EIGEN_DEVICE_FUNC constexpr const Index incr() const { return m_incr.value(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Scalar* data() const { return m_data; }
|
||||
|
||||
protected:
|
||||
@@ -567,18 +570,18 @@ struct blas_traits<const T> : blas_traits<T> {};
|
||||
|
||||
template <typename T, bool HasUsableDirectAccess = blas_traits<T>::HasUsableDirectAccess>
|
||||
struct extract_data_selector {
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static const typename T::Scalar* run(const T& m) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE static const typename T::Scalar* run(const T& m) {
|
||||
return blas_traits<T>::extract(m).data();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct extract_data_selector<T, false> {
|
||||
EIGEN_DEVICE_FUNC static typename T::Scalar* run(const T&) { return 0; }
|
||||
EIGEN_DEVICE_FUNC constexpr static typename T::Scalar* run(const T&) { return 0; }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const typename T::Scalar* extract_data(const T& m) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE const typename T::Scalar* extract_data(const T& m) {
|
||||
return extract_data_selector<T>::run(m);
|
||||
}
|
||||
|
||||
@@ -588,30 +591,31 @@ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const typename T::Scalar* extract_data(con
|
||||
*/
|
||||
template <typename ResScalar, typename Lhs, typename Rhs>
|
||||
struct combine_scalar_factors_impl {
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static ResScalar run(const Lhs& lhs, const Rhs& rhs) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE static ResScalar run(const Lhs& lhs, const Rhs& rhs) {
|
||||
return blas_traits<Lhs>::extractScalarFactor(lhs) * blas_traits<Rhs>::extractScalarFactor(rhs);
|
||||
}
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static ResScalar run(const ResScalar& alpha, const Lhs& lhs, const Rhs& rhs) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE static ResScalar run(const ResScalar& alpha, const Lhs& lhs,
|
||||
const Rhs& rhs) {
|
||||
return alpha * blas_traits<Lhs>::extractScalarFactor(lhs) * blas_traits<Rhs>::extractScalarFactor(rhs);
|
||||
}
|
||||
};
|
||||
template <typename Lhs, typename Rhs>
|
||||
struct combine_scalar_factors_impl<bool, Lhs, Rhs> {
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static bool run(const Lhs& lhs, const Rhs& rhs) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE static bool run(const Lhs& lhs, const Rhs& rhs) {
|
||||
return blas_traits<Lhs>::extractScalarFactor(lhs) && blas_traits<Rhs>::extractScalarFactor(rhs);
|
||||
}
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static bool run(const bool& alpha, const Lhs& lhs, const Rhs& rhs) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE static bool run(const bool& alpha, const Lhs& lhs, const Rhs& rhs) {
|
||||
return alpha && blas_traits<Lhs>::extractScalarFactor(lhs) && blas_traits<Rhs>::extractScalarFactor(rhs);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename ResScalar, typename Lhs, typename Rhs>
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE ResScalar combine_scalar_factors(const ResScalar& alpha, const Lhs& lhs,
|
||||
const Rhs& rhs) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE ResScalar combine_scalar_factors(const ResScalar& alpha, const Lhs& lhs,
|
||||
const Rhs& rhs) {
|
||||
return combine_scalar_factors_impl<ResScalar, Lhs, Rhs>::run(alpha, lhs, rhs);
|
||||
}
|
||||
template <typename ResScalar, typename Lhs, typename Rhs>
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE ResScalar combine_scalar_factors(const Lhs& lhs, const Rhs& rhs) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE ResScalar combine_scalar_factors(const Lhs& lhs, const Rhs& rhs) {
|
||||
return combine_scalar_factors_impl<ResScalar, Lhs, Rhs>::run(lhs, rhs);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,21 +22,21 @@ namespace Eigen {
|
||||
*
|
||||
* Changing the value of Dynamic breaks the ABI, as Dynamic is often used as a template parameter for Matrix.
|
||||
*/
|
||||
const int Dynamic = -1;
|
||||
constexpr int Dynamic = -1;
|
||||
|
||||
/** This value means that a signed quantity (e.g., a signed index) is not known at compile-time, and that instead its
|
||||
* value has to be specified at runtime.
|
||||
*/
|
||||
const int DynamicIndex = 0xffffff;
|
||||
constexpr int DynamicIndex = 0xffffff;
|
||||
|
||||
/** This value means that the requested value is not defined.
|
||||
*/
|
||||
const int Undefined = 0xfffffe;
|
||||
constexpr int Undefined = 0xfffffe;
|
||||
|
||||
/** This value means +Infinity; it is currently used only as the p parameter to MatrixBase::lpNorm<int>().
|
||||
* The value Infinity there means the L-infinity norm.
|
||||
*/
|
||||
const int Infinity = -1;
|
||||
constexpr int Infinity = -1;
|
||||
|
||||
/** This value means that the cost to evaluate an expression coefficient is either very expensive or
|
||||
* cannot be known at compile time.
|
||||
@@ -45,7 +45,7 @@ const int Infinity = -1;
|
||||
* and very very expensive expressions. It thus must also be large enough to make sure unrolling won't happen and that
|
||||
* sub expressions will be evaluated, but not too large to avoid overflow.
|
||||
*/
|
||||
const int HugeCost = 10000;
|
||||
constexpr int HugeCost = 10000;
|
||||
|
||||
/** \defgroup flags Flags
|
||||
* \ingroup Core_Module
|
||||
@@ -67,16 +67,16 @@ const int HugeCost = 10000;
|
||||
* For an expression, this determines the storage order of
|
||||
* the matrix created by evaluation of that expression.
|
||||
* \sa \blank \ref TopicStorageOrders */
|
||||
const unsigned int RowMajorBit = 0x1;
|
||||
constexpr unsigned int RowMajorBit = 0x1;
|
||||
|
||||
/** \ingroup flags
|
||||
* means the expression should be evaluated by the calling expression */
|
||||
const unsigned int EvalBeforeNestingBit = 0x2;
|
||||
constexpr unsigned int EvalBeforeNestingBit = 0x2;
|
||||
|
||||
/** \ingroup flags
|
||||
* \deprecated
|
||||
* means the expression should be evaluated before any assignment */
|
||||
EIGEN_DEPRECATED const unsigned int EvalBeforeAssigningBit = 0x4; // FIXME deprecated
|
||||
EIGEN_DEPRECATED constexpr unsigned int EvalBeforeAssigningBit = 0x4; // FIXME deprecated
|
||||
|
||||
/** \ingroup flags
|
||||
*
|
||||
@@ -94,7 +94,7 @@ EIGEN_DEPRECATED const unsigned int EvalBeforeAssigningBit = 0x4; // FIXME depr
|
||||
* \note This bit can be set regardless of whether vectorization is actually enabled.
|
||||
* To check for actual vectorizability, see \a ActualPacketAccessBit.
|
||||
*/
|
||||
const unsigned int PacketAccessBit = 0x8;
|
||||
constexpr unsigned int PacketAccessBit = 0x8;
|
||||
|
||||
#ifdef EIGEN_VECTORIZE
|
||||
/** \ingroup flags
|
||||
@@ -105,9 +105,9 @@ const unsigned int PacketAccessBit = 0x8;
|
||||
* If vectorization is not enabled (EIGEN_VECTORIZE is not defined) this constant
|
||||
* is set to the value 0.
|
||||
*/
|
||||
const unsigned int ActualPacketAccessBit = PacketAccessBit;
|
||||
constexpr unsigned int ActualPacketAccessBit = PacketAccessBit;
|
||||
#else
|
||||
const unsigned int ActualPacketAccessBit = 0x0;
|
||||
constexpr unsigned int ActualPacketAccessBit = 0x0;
|
||||
#endif
|
||||
|
||||
/** \ingroup flags
|
||||
@@ -130,7 +130,7 @@ const unsigned int ActualPacketAccessBit = 0x0;
|
||||
* Product is a vector expression. Thus, vector Product expressions allow index-based coefficient access but
|
||||
* not index-based packet access, so they don't have the LinearAccessBit.
|
||||
*/
|
||||
const unsigned int LinearAccessBit = 0x10;
|
||||
constexpr unsigned int LinearAccessBit = 0x10;
|
||||
|
||||
/** \ingroup flags
|
||||
*
|
||||
@@ -145,7 +145,7 @@ const unsigned int LinearAccessBit = 0x10;
|
||||
* Expressions having LvalueBit also have their coeff() method returning a const reference instead of returning a new
|
||||
* value.
|
||||
*/
|
||||
const unsigned int LvalueBit = 0x20;
|
||||
constexpr unsigned int LvalueBit = 0x20;
|
||||
|
||||
/** \ingroup flags
|
||||
*
|
||||
@@ -156,7 +156,7 @@ const unsigned int LvalueBit = 0x20;
|
||||
*
|
||||
* See the comment on LvalueBit for an explanation of how LvalueBit and DirectAccessBit are mutually orthogonal.
|
||||
*/
|
||||
const unsigned int DirectAccessBit = 0x40;
|
||||
constexpr unsigned int DirectAccessBit = 0x40;
|
||||
|
||||
/** \deprecated \ingroup flags
|
||||
*
|
||||
@@ -168,9 +168,9 @@ const unsigned int DirectAccessBit = 0x40;
|
||||
* expression.packet<Aligned>(0);
|
||||
* \endcode
|
||||
*/
|
||||
EIGEN_DEPRECATED const unsigned int AlignedBit = 0x80;
|
||||
EIGEN_DEPRECATED constexpr unsigned int AlignedBit = 0x80;
|
||||
|
||||
const unsigned int NestByRefBit = 0x100;
|
||||
constexpr unsigned int NestByRefBit = 0x100;
|
||||
|
||||
/** \ingroup flags
|
||||
*
|
||||
@@ -179,7 +179,7 @@ const unsigned int NestByRefBit = 0x100;
|
||||
* The precise choice will be decided at evaluation time or when
|
||||
* combined with other expressions.
|
||||
* \sa \blank \ref RowMajorBit, \ref TopicStorageOrders */
|
||||
const unsigned int NoPreferredStorageOrderBit = 0x200;
|
||||
constexpr unsigned int NoPreferredStorageOrderBit = 0x200;
|
||||
|
||||
/** \ingroup flags
|
||||
*
|
||||
@@ -192,10 +192,10 @@ const unsigned int NoPreferredStorageOrderBit = 0x200;
|
||||
inline const Index* innerNonZeroPtr() const;
|
||||
\endcode
|
||||
*/
|
||||
const unsigned int CompressedAccessBit = 0x400;
|
||||
constexpr unsigned int CompressedAccessBit = 0x400;
|
||||
|
||||
// list of flags that are inherited by default
|
||||
const unsigned int HereditaryBits = RowMajorBit | EvalBeforeNestingBit;
|
||||
constexpr unsigned int HereditaryBits = RowMajorBit | EvalBeforeNestingBit;
|
||||
|
||||
/** \defgroup enums Enumerations
|
||||
* \ingroup Core_Module
|
||||
|
||||
@@ -144,8 +144,8 @@ template <int N>
|
||||
class VariableAndFixedInt {
|
||||
public:
|
||||
static const int value = N;
|
||||
operator int() const { return m_value; }
|
||||
VariableAndFixedInt(int val) { m_value = val; }
|
||||
constexpr operator int() const { return m_value; }
|
||||
constexpr VariableAndFixedInt(int val) : m_value(val) {}
|
||||
|
||||
protected:
|
||||
int m_value;
|
||||
@@ -172,7 +172,7 @@ struct get_fixed_value<variable_if_dynamic<T, N>, Default> {
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC Index get_runtime_value(const T &x) {
|
||||
EIGEN_DEVICE_FUNC constexpr Index get_runtime_value(const T &x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
@@ -1276,7 +1276,7 @@ EIGEN_DEVICE_FUNC constexpr void ignore_unused_variable(const T&) {}
|
||||
|
||||
#define EIGEN_MAKE_CWISE_BINARY_OP(METHOD, OPNAME) \
|
||||
template <typename OtherDerived> \
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE( \
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE( \
|
||||
Derived, OtherDerived, OPNAME)(METHOD)(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const { \
|
||||
return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, OPNAME)(derived(), other.derived()); \
|
||||
}
|
||||
@@ -1297,7 +1297,7 @@ EIGEN_DEVICE_FUNC constexpr void ignore_unused_variable(const T&) {}
|
||||
|
||||
#define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD, OPNAME) \
|
||||
template <typename T> \
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE( \
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE( \
|
||||
Derived, \
|
||||
typename internal::promote_scalar_arg<Scalar EIGEN_COMMA T EIGEN_COMMA EIGEN_SCALAR_BINARY_SUPPORTED( \
|
||||
OPNAME, Scalar, T)>::type, \
|
||||
@@ -1311,7 +1311,7 @@ EIGEN_DEVICE_FUNC constexpr void ignore_unused_variable(const T&) {}
|
||||
|
||||
#define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD, OPNAME) \
|
||||
template <typename T> \
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE friend const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE( \
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE friend const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE( \
|
||||
typename internal::promote_scalar_arg<Scalar EIGEN_COMMA T EIGEN_COMMA EIGEN_SCALAR_BINARY_SUPPORTED( \
|
||||
OPNAME, T, Scalar)>::type, \
|
||||
Derived, OPNAME)(METHOD)(const T& scalar, const StorageBaseType& matrix) { \
|
||||
@@ -1356,10 +1356,10 @@ EIGEN_DEVICE_FUNC constexpr void ignore_unused_variable(const T&) {}
|
||||
namespace Eigen {
|
||||
namespace internal {
|
||||
|
||||
EIGEN_DEVICE_FUNC inline bool all() { return true; }
|
||||
EIGEN_DEVICE_FUNC constexpr bool all() { return true; }
|
||||
|
||||
template <typename T, typename... Ts>
|
||||
EIGEN_DEVICE_FUNC bool all(T t, Ts... ts) {
|
||||
EIGEN_DEVICE_FUNC constexpr bool all(T t, Ts... ts) {
|
||||
return t && all(ts...);
|
||||
}
|
||||
|
||||
|
||||
@@ -444,14 +444,14 @@ namespace numext {
|
||||
|
||||
#if defined(EIGEN_GPU_COMPILE_PHASE)
|
||||
template <typename T>
|
||||
EIGEN_DEVICE_FUNC void swap(T& a, T& b) {
|
||||
EIGEN_DEVICE_FUNC constexpr void swap(T& a, T& b) {
|
||||
T tmp = b;
|
||||
b = a;
|
||||
a = tmp;
|
||||
}
|
||||
#else
|
||||
template <typename T>
|
||||
EIGEN_STRONG_INLINE void swap(T& a, T& b) {
|
||||
constexpr EIGEN_STRONG_INLINE void swap(T& a, T& b) {
|
||||
std::swap(a, b);
|
||||
}
|
||||
#endif
|
||||
@@ -462,7 +462,7 @@ using std::numeric_limits;
|
||||
template <typename X, typename Y, bool XIsInteger = NumTraits<X>::IsInteger, bool XIsSigned = NumTraits<X>::IsSigned,
|
||||
bool YIsInteger = NumTraits<Y>::IsInteger, bool YIsSigned = NumTraits<Y>::IsSigned>
|
||||
struct equal_strict_impl {
|
||||
static EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool run(const X& x, const Y& y) { return x == y; }
|
||||
static constexpr EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool run(const X& x, const Y& y) { return x == y; }
|
||||
};
|
||||
template <typename X, typename Y>
|
||||
struct equal_strict_impl<X, Y, true, false, true, true> {
|
||||
@@ -470,7 +470,7 @@ struct equal_strict_impl<X, Y, true, false, true, true> {
|
||||
// Y is a signed integer
|
||||
// if Y is non-negative, it may be represented exactly as its unsigned counterpart.
|
||||
using UnsignedY = typename internal::make_unsigned<Y>::type;
|
||||
static EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool run(const X& x, const Y& y) {
|
||||
static constexpr EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool run(const X& x, const Y& y) {
|
||||
return y < Y(0) ? false : (x == static_cast<UnsignedY>(y));
|
||||
}
|
||||
};
|
||||
@@ -478,7 +478,7 @@ template <typename X, typename Y>
|
||||
struct equal_strict_impl<X, Y, true, true, true, false> {
|
||||
// X is a signed integer
|
||||
// Y is an unsigned integer
|
||||
static EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool run(const X& x, const Y& y) {
|
||||
static constexpr EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool run(const X& x, const Y& y) {
|
||||
return equal_strict_impl<Y, X>::run(y, x);
|
||||
}
|
||||
};
|
||||
@@ -486,18 +486,18 @@ struct equal_strict_impl<X, Y, true, true, true, false> {
|
||||
// The aim of the following functions is to bypass -Wfloat-equal warnings
|
||||
// when we really want a strict equality comparison on floating points.
|
||||
template <typename X, typename Y>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool equal_strict(const X& x, const Y& y) {
|
||||
constexpr EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool equal_strict(const X& x, const Y& y) {
|
||||
return equal_strict_impl<X, Y>::run(x, y);
|
||||
}
|
||||
|
||||
#if !defined(EIGEN_GPU_COMPILE_PHASE) || (!defined(EIGEN_CUDA_ARCH) && defined(EIGEN_CONSTEXPR_ARE_DEVICE_FUNC))
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool equal_strict(const float& x, const float& y) {
|
||||
constexpr EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool equal_strict(const float& x, const float& y) {
|
||||
return std::equal_to<float>()(x, y);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool equal_strict(const double& x, const double& y) {
|
||||
constexpr EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool equal_strict(const double& x, const double& y) {
|
||||
return std::equal_to<double>()(x, y);
|
||||
}
|
||||
#endif
|
||||
@@ -507,7 +507,7 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool equal_strict(const double& x, const d
|
||||
* Use this to to bypass -Wfloat-equal warnings when exact zero is what needs to be tested.
|
||||
*/
|
||||
template <typename X>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool is_exactly_zero(const X& x) {
|
||||
constexpr EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool is_exactly_zero(const X& x) {
|
||||
return equal_strict(x, typename NumTraits<X>::Literal{0});
|
||||
}
|
||||
|
||||
@@ -516,23 +516,23 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool is_exactly_zero(const X& x) {
|
||||
* Use this to to bypass -Wfloat-equal warnings when exact one is what needs to be tested.
|
||||
*/
|
||||
template <typename X>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool is_exactly_one(const X& x) {
|
||||
constexpr EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool is_exactly_one(const X& x) {
|
||||
return equal_strict(x, typename NumTraits<X>::Literal{1});
|
||||
}
|
||||
|
||||
template <typename X, typename Y>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool not_equal_strict(const X& x, const Y& y) {
|
||||
constexpr EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool not_equal_strict(const X& x, const Y& y) {
|
||||
return !equal_strict_impl<X, Y>::run(x, y);
|
||||
}
|
||||
|
||||
#if !defined(EIGEN_GPU_COMPILE_PHASE) || (!defined(EIGEN_CUDA_ARCH) && defined(EIGEN_CONSTEXPR_ARE_DEVICE_FUNC))
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool not_equal_strict(const float& x, const float& y) {
|
||||
constexpr EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool not_equal_strict(const float& x, const float& y) {
|
||||
return std::not_equal_to<float>()(x, y);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool not_equal_strict(const double& x, const double& y) {
|
||||
constexpr EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool not_equal_strict(const double& x, const double& y) {
|
||||
return std::not_equal_to<double>()(x, y);
|
||||
}
|
||||
#endif
|
||||
@@ -543,11 +543,11 @@ namespace internal {
|
||||
|
||||
template <typename Scalar>
|
||||
struct is_identically_zero_impl {
|
||||
static inline bool run(const Scalar& s) { return numext::is_exactly_zero(s); }
|
||||
static constexpr bool run(const Scalar& s) { return numext::is_exactly_zero(s); }
|
||||
};
|
||||
|
||||
template <typename Scalar>
|
||||
EIGEN_STRONG_INLINE bool is_identically_zero(const Scalar& s) {
|
||||
constexpr EIGEN_STRONG_INLINE bool is_identically_zero(const Scalar& s) {
|
||||
return is_identically_zero_impl<Scalar>::run(s);
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ struct promote_index_type {
|
||||
template <typename T, int Value>
|
||||
class variable_if_dynamic {
|
||||
public:
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamic(T v) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit variable_if_dynamic(T v) {
|
||||
EIGEN_ONLY_USED_FOR_DEBUG(v);
|
||||
eigen_assert(v == T(Value));
|
||||
}
|
||||
@@ -169,9 +169,9 @@ class variable_if_dynamic<T, Dynamic> {
|
||||
T m_value;
|
||||
|
||||
public:
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamic(T value = 0) noexcept : m_value(value) {}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T value() const { return m_value; }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE operator T() const { return m_value; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit variable_if_dynamic(T value = 0) noexcept : m_value(value) {}
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE T value() const { return m_value; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE operator T() const { return m_value; }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T value) { m_value = value; }
|
||||
};
|
||||
|
||||
@@ -180,12 +180,12 @@ class variable_if_dynamic<T, Dynamic> {
|
||||
template <typename T, int Value>
|
||||
class variable_if_dynamicindex {
|
||||
public:
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamicindex(T v) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit variable_if_dynamicindex(T v) {
|
||||
EIGEN_ONLY_USED_FOR_DEBUG(v);
|
||||
eigen_assert(v == T(Value));
|
||||
}
|
||||
EIGEN_DEVICE_FUNC static constexpr T value() { return T(Value); }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T) {}
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void setValue(T) {}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
@@ -194,8 +194,8 @@ class variable_if_dynamicindex<T, DynamicIndex> {
|
||||
EIGEN_DEVICE_FUNC variable_if_dynamicindex() { eigen_assert(false); }
|
||||
|
||||
public:
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamicindex(T value) : m_value(value) {}
|
||||
EIGEN_DEVICE_FUNC T EIGEN_STRONG_INLINE value() const { return m_value; }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE explicit variable_if_dynamicindex(T value) : m_value(value) {}
|
||||
EIGEN_DEVICE_FUNC constexpr T EIGEN_STRONG_INLINE value() const { return m_value; }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T value) { m_value = value; }
|
||||
};
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* \sa MatrixBase::cwiseProduct
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product) operator*(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product)
|
||||
operator*(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const {
|
||||
return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product)(derived(), other.derived());
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Deriv
|
||||
* \sa MatrixBase::cwiseQuotient
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryOp<
|
||||
internal::scalar_quotient_op<Scalar, typename OtherDerived::Scalar>, const Derived, const OtherDerived>
|
||||
operator/(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const {
|
||||
return CwiseBinaryOp<internal::scalar_quotient_op<Scalar, typename OtherDerived::Scalar>, const Derived,
|
||||
@@ -29,7 +29,7 @@ operator/(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const {
|
||||
* \sa max()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
|
||||
CwiseBinaryOp<internal::scalar_min_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>
|
||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
||||
min
|
||||
@@ -46,7 +46,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
* \sa max()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
|
||||
CwiseBinaryOp<internal::scalar_min_op<Scalar, Scalar, NaNPropagation>, const Derived,
|
||||
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
|
||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
||||
@@ -66,7 +66,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
* \sa min()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
|
||||
CwiseBinaryOp<internal::scalar_max_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>
|
||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
||||
max
|
||||
@@ -83,7 +83,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
* \sa min()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
|
||||
CwiseBinaryOp<internal::scalar_max_op<Scalar, Scalar, NaNPropagation>, const Derived,
|
||||
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
|
||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
||||
@@ -105,7 +105,7 @@ EIGEN_MAKE_CWISE_BINARY_OP(absolute_difference, absolute_difference)
|
||||
*
|
||||
* \sa absolute_difference()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
|
||||
CwiseBinaryOp<internal::scalar_absolute_difference_op<Scalar, Scalar>, const Derived,
|
||||
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
|
||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
||||
@@ -136,7 +136,7 @@ EIGEN_MAKE_CWISE_BINARY_OP(atan2, atan2)
|
||||
// TODO: code generating macros could be moved to Macros.h and could include generation of documentation
|
||||
#define EIGEN_MAKE_CWISE_COMP_OP(OP, COMPARATOR) \
|
||||
template <typename OtherDerived> \
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const \
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const \
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, typename OtherDerived::Scalar, internal::cmp_##COMPARATOR>, \
|
||||
const Derived, const OtherDerived> \
|
||||
OP(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const { \
|
||||
@@ -149,24 +149,24 @@ EIGEN_MAKE_CWISE_BINARY_OP(atan2, atan2)
|
||||
typedef CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_##COMPARATOR>, \
|
||||
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject>, const Derived> \
|
||||
RCmp##COMPARATOR##ReturnType; \
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Cmp##COMPARATOR##ReturnType OP(const Scalar &s) const { \
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Cmp##COMPARATOR##ReturnType OP(const Scalar &s) const { \
|
||||
return this->OP(Derived::PlainObject::Constant(rows(), cols(), s)); \
|
||||
} \
|
||||
EIGEN_DEVICE_FUNC friend EIGEN_STRONG_INLINE const RCmp##COMPARATOR##ReturnType OP( \
|
||||
EIGEN_DEVICE_FUNC constexpr friend EIGEN_STRONG_INLINE const RCmp##COMPARATOR##ReturnType OP( \
|
||||
const Scalar &s, const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived> &d) { \
|
||||
return Derived::PlainObject::Constant(d.rows(), d.cols(), s).OP(d); \
|
||||
}
|
||||
|
||||
#define EIGEN_MAKE_CWISE_COMP_R_OP(OP, R_OP, RCOMPARATOR) \
|
||||
template <typename OtherDerived> \
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const \
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const \
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<typename OtherDerived::Scalar, Scalar, internal::cmp_##RCOMPARATOR>, \
|
||||
const OtherDerived, const Derived> \
|
||||
OP(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const { \
|
||||
return CwiseBinaryOp<internal::scalar_cmp_op<typename OtherDerived::Scalar, Scalar, internal::cmp_##RCOMPARATOR>, \
|
||||
const OtherDerived, const Derived>(other.derived(), derived()); \
|
||||
} \
|
||||
EIGEN_DEVICE_FUNC inline const RCmp##RCOMPARATOR##ReturnType OP(const Scalar &s) const { \
|
||||
EIGEN_DEVICE_FUNC constexpr inline const RCmp##RCOMPARATOR##ReturnType OP(const Scalar &s) const { \
|
||||
return Derived::PlainObject::Constant(rows(), cols(), s).R_OP(*this); \
|
||||
} \
|
||||
friend inline const Cmp##RCOMPARATOR##ReturnType OP(const Scalar &s, const Derived &d) { \
|
||||
|
||||
@@ -49,7 +49,7 @@ typedef CwiseUnaryOp<internal::scalar_isfinite_op<Scalar, true>, const Derived>
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_abs">Math functions</a>, abs2()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const AbsReturnType abs() const { return AbsReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const AbsReturnType abs() const { return AbsReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise phase angle of \c *this
|
||||
*
|
||||
@@ -58,9 +58,9 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const AbsReturnType abs() const { return A
|
||||
*
|
||||
* \sa abs()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArgReturnType arg() const { return ArgReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const ArgReturnType arg() const { return ArgReturnType(derived()); }
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CArgReturnType carg() const { return CArgReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CArgReturnType carg() const { return CArgReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise squared absolute value of \c *this
|
||||
*
|
||||
@@ -69,7 +69,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CArgReturnType carg() const { return
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_abs2">Math functions</a>, abs(), square()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Abs2ReturnType abs2() const { return Abs2ReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Abs2ReturnType abs2() const { return Abs2ReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise exponential of *this.
|
||||
*
|
||||
@@ -82,7 +82,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Abs2ReturnType abs2() const { return
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_exp">Math functions</a>, exp2(), pow(), log(), sin(),
|
||||
* cos()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const ExpReturnType exp() const { return ExpReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const ExpReturnType exp() const { return ExpReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise exponential of *this.
|
||||
*
|
||||
@@ -91,7 +91,7 @@ EIGEN_DEVICE_FUNC inline const ExpReturnType exp() const { return ExpReturnType(
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_exp">Math functions</a>, exp(), pow(), log(), sin(),
|
||||
* cos()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const Exp2ReturnType exp2() const { return Exp2ReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Exp2ReturnType exp2() const { return Exp2ReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise exponential of *this minus 1.
|
||||
*
|
||||
@@ -100,7 +100,7 @@ EIGEN_DEVICE_FUNC inline const Exp2ReturnType exp2() const { return Exp2ReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_expm1">Math functions</a>, exp()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const Expm1ReturnType expm1() const { return Expm1ReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Expm1ReturnType expm1() const { return Expm1ReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise logarithm of *this.
|
||||
*
|
||||
@@ -112,7 +112,7 @@ EIGEN_DEVICE_FUNC inline const Expm1ReturnType expm1() const { return Expm1Retur
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_log">Math functions</a>, log()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const LogReturnType log() const { return LogReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const LogReturnType log() const { return LogReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise logarithm of 1 plus \c *this.
|
||||
*
|
||||
@@ -121,7 +121,7 @@ EIGEN_DEVICE_FUNC inline const LogReturnType log() const { return LogReturnType(
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_log1p">Math functions</a>, log()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const Log1pReturnType log1p() const { return Log1pReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Log1pReturnType log1p() const { return Log1pReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise base-10 logarithm of *this.
|
||||
*
|
||||
@@ -132,14 +132,14 @@ EIGEN_DEVICE_FUNC inline const Log1pReturnType log1p() const { return Log1pRetur
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_log10">Math functions</a>, log()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const Log10ReturnType log10() const { return Log10ReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Log10ReturnType log10() const { return Log10ReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise base-2 logarithm of *this.
|
||||
*
|
||||
* This function computes the coefficient-wise base-2 logarithm.
|
||||
*
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const Log2ReturnType log2() const { return Log2ReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Log2ReturnType log2() const { return Log2ReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise square root of *this.
|
||||
*
|
||||
@@ -151,7 +151,7 @@ EIGEN_DEVICE_FUNC inline const Log2ReturnType log2() const { return Log2ReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_sqrt">Math functions</a>, pow(), square(), cbrt()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const SqrtReturnType sqrt() const { return SqrtReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const SqrtReturnType sqrt() const { return SqrtReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise cube root of *this.
|
||||
*
|
||||
@@ -162,7 +162,7 @@ EIGEN_DEVICE_FUNC inline const SqrtReturnType sqrt() const { return SqrtReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_cbrt">Math functions</a>, sqrt(), pow(), square()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const CbrtReturnType cbrt() const { return CbrtReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CbrtReturnType cbrt() const { return CbrtReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise inverse square root of *this.
|
||||
*
|
||||
@@ -173,7 +173,7 @@ EIGEN_DEVICE_FUNC inline const CbrtReturnType cbrt() const { return CbrtReturnTy
|
||||
*
|
||||
* \sa pow(), square()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const RsqrtReturnType rsqrt() const { return RsqrtReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const RsqrtReturnType rsqrt() const { return RsqrtReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise signum of *this.
|
||||
*
|
||||
@@ -184,7 +184,7 @@ EIGEN_DEVICE_FUNC inline const RsqrtReturnType rsqrt() const { return RsqrtRetur
|
||||
*
|
||||
* \sa pow(), square()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const SignReturnType sign() const { return SignReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const SignReturnType sign() const { return SignReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise cosine of *this.
|
||||
*
|
||||
@@ -196,7 +196,7 @@ EIGEN_DEVICE_FUNC inline const SignReturnType sign() const { return SignReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_cos">Math functions</a>, sin(), acos()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const CosReturnType cos() const { return CosReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CosReturnType cos() const { return CosReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise sine of *this.
|
||||
*
|
||||
@@ -208,7 +208,7 @@ EIGEN_DEVICE_FUNC inline const CosReturnType cos() const { return CosReturnType(
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_sin">Math functions</a>, cos(), asin()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const SinReturnType sin() const { return SinReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const SinReturnType sin() const { return SinReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise tan of *this.
|
||||
*
|
||||
@@ -217,7 +217,7 @@ EIGEN_DEVICE_FUNC inline const SinReturnType sin() const { return SinReturnType(
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_tan">Math functions</a>, cos(), sin()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const TanReturnType tan() const { return TanReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const TanReturnType tan() const { return TanReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise arc tan of *this.
|
||||
*
|
||||
@@ -226,7 +226,7 @@ EIGEN_DEVICE_FUNC inline const TanReturnType tan() const { return TanReturnType(
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_atan">Math functions</a>, tan(), asin(), acos()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const AtanReturnType atan() const { return AtanReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const AtanReturnType atan() const { return AtanReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise arc cosine of *this.
|
||||
*
|
||||
@@ -235,7 +235,7 @@ EIGEN_DEVICE_FUNC inline const AtanReturnType atan() const { return AtanReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_acos">Math functions</a>, cos(), asin()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const AcosReturnType acos() const { return AcosReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const AcosReturnType acos() const { return AcosReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise arc sine of *this.
|
||||
*
|
||||
@@ -244,7 +244,7 @@ EIGEN_DEVICE_FUNC inline const AcosReturnType acos() const { return AcosReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_asin">Math functions</a>, sin(), acos()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const AsinReturnType asin() const { return AsinReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const AsinReturnType asin() const { return AsinReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise hyperbolic tan of *this.
|
||||
*
|
||||
@@ -253,7 +253,7 @@ EIGEN_DEVICE_FUNC inline const AsinReturnType asin() const { return AsinReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_tanh">Math functions</a>, tan(), sinh(), cosh()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const TanhReturnType tanh() const { return TanhReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const TanhReturnType tanh() const { return TanhReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise hyperbolic sin of *this.
|
||||
*
|
||||
@@ -262,7 +262,7 @@ EIGEN_DEVICE_FUNC inline const TanhReturnType tanh() const { return TanhReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_sinh">Math functions</a>, sin(), tanh(), cosh()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const SinhReturnType sinh() const { return SinhReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const SinhReturnType sinh() const { return SinhReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise hyperbolic cos of *this.
|
||||
*
|
||||
@@ -271,29 +271,29 @@ EIGEN_DEVICE_FUNC inline const SinhReturnType sinh() const { return SinhReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_cosh">Math functions</a>, tanh(), sinh(), cosh()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const CoshReturnType cosh() const { return CoshReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CoshReturnType cosh() const { return CoshReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise inverse hyperbolic tan of *this.
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_atanh">Math functions</a>, atanh(), asinh(), acosh()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const AtanhReturnType atanh() const { return AtanhReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const AtanhReturnType atanh() const { return AtanhReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise inverse hyperbolic sin of *this.
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_asinh">Math functions</a>, atanh(), asinh(), acosh()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const AsinhReturnType asinh() const { return AsinhReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const AsinhReturnType asinh() const { return AsinhReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise inverse hyperbolic cos of *this.
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_acosh">Math functions</a>, atanh(), asinh(), acosh()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const AcoshReturnType acosh() const { return AcoshReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const AcoshReturnType acosh() const { return AcoshReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise logistic of *this.
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const LogisticReturnType logistic() const { return LogisticReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const LogisticReturnType logistic() const { return LogisticReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise inverse of *this.
|
||||
*
|
||||
@@ -302,7 +302,7 @@ EIGEN_DEVICE_FUNC inline const LogisticReturnType logistic() const { return Logi
|
||||
*
|
||||
* \sa operator/(), operator*()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const InverseReturnType inverse() const { return InverseReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const InverseReturnType inverse() const { return InverseReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise square of *this.
|
||||
*
|
||||
@@ -311,7 +311,7 @@ EIGEN_DEVICE_FUNC inline const InverseReturnType inverse() const { return Invers
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_squareE">Math functions</a>, abs2(), cube(), pow()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const SquareReturnType square() const { return SquareReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const SquareReturnType square() const { return SquareReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise cube of *this.
|
||||
*
|
||||
@@ -320,7 +320,7 @@ EIGEN_DEVICE_FUNC inline const SquareReturnType square() const { return SquareRe
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_cube">Math functions</a>, square(), pow()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const CubeReturnType cube() const { return CubeReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CubeReturnType cube() const { return CubeReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise rint of *this.
|
||||
*
|
||||
@@ -329,7 +329,7 @@ EIGEN_DEVICE_FUNC inline const CubeReturnType cube() const { return CubeReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_rint">Math functions</a>, ceil(), floor()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const RintReturnType rint() const { return RintReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const RintReturnType rint() const { return RintReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise round of *this.
|
||||
*
|
||||
@@ -338,7 +338,7 @@ EIGEN_DEVICE_FUNC inline const RintReturnType rint() const { return RintReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_round">Math functions</a>, ceil(), floor()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const RoundReturnType round() const { return RoundReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const RoundReturnType round() const { return RoundReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise floor of *this.
|
||||
*
|
||||
@@ -347,7 +347,7 @@ EIGEN_DEVICE_FUNC inline const RoundReturnType round() const { return RoundRetur
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_floor">Math functions</a>, ceil(), round()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const FloorReturnType floor() const { return FloorReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const FloorReturnType floor() const { return FloorReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise ceil of *this.
|
||||
*
|
||||
@@ -356,7 +356,7 @@ EIGEN_DEVICE_FUNC inline const FloorReturnType floor() const { return FloorRetur
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_ceil">Math functions</a>, floor(), round()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const CeilReturnType ceil() const { return CeilReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CeilReturnType ceil() const { return CeilReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise truncation of *this.
|
||||
*
|
||||
@@ -365,7 +365,7 @@ EIGEN_DEVICE_FUNC inline const CeilReturnType ceil() const { return CeilReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_trunc">Math functions</a>, floor(), round()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const TruncReturnType trunc() const { return TruncReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const TruncReturnType trunc() const { return TruncReturnType(derived()); }
|
||||
|
||||
template <int N>
|
||||
struct ShiftRightXpr {
|
||||
@@ -380,7 +380,7 @@ struct ShiftRightXpr {
|
||||
* \sa shiftLeft()
|
||||
*/
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC typename ShiftRightXpr<N>::Type shiftRight() const {
|
||||
EIGEN_DEVICE_FUNC constexpr typename ShiftRightXpr<N>::Type shiftRight() const {
|
||||
return typename ShiftRightXpr<N>::Type(derived());
|
||||
}
|
||||
|
||||
@@ -397,7 +397,7 @@ struct ShiftLeftXpr {
|
||||
* \sa shiftRight()
|
||||
*/
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC typename ShiftLeftXpr<N>::Type shiftLeft() const {
|
||||
EIGEN_DEVICE_FUNC constexpr typename ShiftLeftXpr<N>::Type shiftLeft() const {
|
||||
return typename ShiftLeftXpr<N>::Type(derived());
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ EIGEN_DEVICE_FUNC typename ShiftLeftXpr<N>::Type shiftLeft() const {
|
||||
*
|
||||
* \sa isfinite(), isinf()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const IsNaNReturnType isNaN() const { return IsNaNReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const IsNaNReturnType isNaN() const { return IsNaNReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise isinf of *this.
|
||||
*
|
||||
@@ -417,7 +417,7 @@ EIGEN_DEVICE_FUNC inline const IsNaNReturnType isNaN() const { return IsNaNRetur
|
||||
*
|
||||
* \sa isnan(), isfinite()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const IsInfReturnType isInf() const { return IsInfReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const IsInfReturnType isInf() const { return IsInfReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise isfinite of *this.
|
||||
*
|
||||
@@ -426,8 +426,8 @@ EIGEN_DEVICE_FUNC inline const IsInfReturnType isInf() const { return IsInfRetur
|
||||
*
|
||||
* \sa isnan(), isinf()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const IsFiniteReturnType isFinite() const { return IsFiniteReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC inline const IsFiniteTypedReturnType isFiniteTyped() const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const IsFiniteReturnType isFinite() const { return IsFiniteReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const IsFiniteTypedReturnType isFiniteTyped() const {
|
||||
return IsFiniteTypedReturnType(derived());
|
||||
}
|
||||
|
||||
@@ -438,11 +438,15 @@ EIGEN_DEVICE_FUNC inline const IsFiniteTypedReturnType isFiniteTyped() const {
|
||||
*
|
||||
* \sa operator!=()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const BooleanNotReturnType operator!() const { return BooleanNotReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const BooleanNotReturnType operator!() const {
|
||||
return BooleanNotReturnType(derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the bitwise ~ operator of *this
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const BitwiseNotReturnType operator~() const { return BitwiseNotReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const BitwiseNotReturnType operator~() const {
|
||||
return BitwiseNotReturnType(derived());
|
||||
}
|
||||
|
||||
// --- SpecialFunctions module ---
|
||||
|
||||
@@ -462,7 +466,7 @@ typedef CwiseUnaryOp<internal::scalar_ndtri_op<Scalar>, const Derived> NdtriRetu
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_lgamma">Math functions</a>, digamma()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const LgammaReturnType lgamma() const { return LgammaReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const LgammaReturnType lgamma() const { return LgammaReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise digamma (psi, derivative of lgamma).
|
||||
*
|
||||
@@ -475,7 +479,7 @@ EIGEN_DEVICE_FUNC inline const LgammaReturnType lgamma() const { return LgammaRe
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_digamma">Math functions</a>, Eigen::digamma(),
|
||||
* Eigen::polygamma(), lgamma()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const DigammaReturnType digamma() const { return DigammaReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const DigammaReturnType digamma() const { return DigammaReturnType(derived()); }
|
||||
|
||||
/** \cpp11 \returns an expression of the coefficient-wise Gauss error
|
||||
* function of *this.
|
||||
@@ -488,7 +492,7 @@ EIGEN_DEVICE_FUNC inline const DigammaReturnType digamma() const { return Digamm
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_erf">Math functions</a>, erfc()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const ErfReturnType erf() const { return ErfReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const ErfReturnType erf() const { return ErfReturnType(derived()); }
|
||||
|
||||
/** \cpp11 \returns an expression of the coefficient-wise Complementary error
|
||||
* function of *this.
|
||||
@@ -501,7 +505,7 @@ EIGEN_DEVICE_FUNC inline const ErfReturnType erf() const { return ErfReturnType(
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_erfc">Math functions</a>, erf()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const ErfcReturnType erfc() const { return ErfcReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const ErfcReturnType erfc() const { return ErfcReturnType(derived()); }
|
||||
|
||||
/** \returns an expression of the coefficient-wise inverse of the CDF of the Normal distribution function
|
||||
* function of *this.
|
||||
@@ -516,7 +520,7 @@ EIGEN_DEVICE_FUNC inline const ErfcReturnType erfc() const { return ErfcReturnTy
|
||||
*
|
||||
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_ndtri">Math functions</a>
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const NdtriReturnType ndtri() const { return NdtriReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const NdtriReturnType ndtri() const { return NdtriReturnType(derived()); }
|
||||
|
||||
template <typename ScalarExponent>
|
||||
using UnaryPowReturnType =
|
||||
@@ -538,7 +542,7 @@ using UnaryPowReturnType =
|
||||
* \sa ArrayBase::pow(ArrayBase), square(), cube(), exp(), log()
|
||||
*/
|
||||
template <typename ScalarExponent>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const UnaryPowReturnType<ScalarExponent> pow(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const UnaryPowReturnType<ScalarExponent> pow(
|
||||
const ScalarExponent& exponent) const {
|
||||
return UnaryPowReturnType<ScalarExponent>(derived(), internal::scalar_unary_pow_op<Scalar, ScalarExponent>(exponent));
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa class Block, fix, fix<N>(int)
|
||||
///
|
||||
template <typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
|
||||
internal::get_fixed_value<NColsType>::value>::Type
|
||||
@@ -128,7 +128,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of block(Index,Index,NRowsType,NColsType)
|
||||
template <typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
|
||||
internal::get_fixed_value<NColsType>::value>::Type
|
||||
@@ -163,7 +163,7 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
|
||||
internal::get_fixed_value<NColsType>::value>::Type
|
||||
@@ -181,7 +181,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of topRightCorner(NRowsType, NColsType).
|
||||
template <typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
|
||||
internal::get_fixed_value<NColsType>::value>::Type
|
||||
@@ -213,13 +213,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa class Block, block<int,int>(Index,Index)
|
||||
///
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topRightCorner() {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topRightCorner() {
|
||||
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - CCols);
|
||||
}
|
||||
|
||||
/// This is the const version of topRightCorner<int, int>().
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topRightCorner() const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topRightCorner()
|
||||
const {
|
||||
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - CCols);
|
||||
}
|
||||
|
||||
@@ -243,14 +244,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa class Block
|
||||
///
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topRightCorner(Index cRows,
|
||||
Index cCols) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topRightCorner(Index cRows,
|
||||
Index cCols) {
|
||||
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
|
||||
}
|
||||
|
||||
/// This is the const version of topRightCorner<int, int>(Index, Index).
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topRightCorner(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topRightCorner(
|
||||
Index cRows, Index cCols) const {
|
||||
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
|
||||
}
|
||||
@@ -274,7 +275,7 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
|
||||
internal::get_fixed_value<NColsType>::value>::Type
|
||||
@@ -290,7 +291,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of topLeftCorner(Index, Index).
|
||||
template <typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
|
||||
internal::get_fixed_value<NColsType>::value>::Type
|
||||
@@ -318,13 +319,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topLeftCorner() {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topLeftCorner() {
|
||||
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0);
|
||||
}
|
||||
|
||||
/// This is the const version of topLeftCorner<int, int>().
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topLeftCorner() const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topLeftCorner()
|
||||
const {
|
||||
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0);
|
||||
}
|
||||
|
||||
@@ -348,14 +350,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa class Block
|
||||
///
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topLeftCorner(Index cRows,
|
||||
Index cCols) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topLeftCorner(Index cRows,
|
||||
Index cCols) {
|
||||
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0, cRows, cCols);
|
||||
}
|
||||
|
||||
/// This is the const version of topLeftCorner<int, int>(Index, Index).
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topLeftCorner(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topLeftCorner(
|
||||
Index cRows, Index cCols) const {
|
||||
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0, cRows, cCols);
|
||||
}
|
||||
@@ -379,7 +381,7 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
|
||||
internal::get_fixed_value<NColsType>::value>::Type
|
||||
@@ -395,7 +397,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of bottomRightCorner(NRowsType, NColsType).
|
||||
template <typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
|
||||
internal::get_fixed_value<NColsType>::value>::Type
|
||||
@@ -423,13 +425,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomRightCorner() {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomRightCorner() {
|
||||
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, cols() - CCols);
|
||||
}
|
||||
|
||||
/// This is the const version of bottomRightCorner<int, int>().
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomRightCorner() const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type
|
||||
bottomRightCorner() const {
|
||||
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, cols() - CCols);
|
||||
}
|
||||
|
||||
@@ -453,14 +456,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa class Block
|
||||
///
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomRightCorner(Index cRows,
|
||||
Index cCols) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomRightCorner(
|
||||
Index cRows, Index cCols) {
|
||||
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
|
||||
}
|
||||
|
||||
/// This is the const version of bottomRightCorner<int, int>(Index, Index).
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomRightCorner(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomRightCorner(
|
||||
Index cRows, Index cCols) const {
|
||||
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
|
||||
}
|
||||
@@ -484,7 +487,7 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
|
||||
internal::get_fixed_value<NColsType>::value>::Type
|
||||
@@ -503,7 +506,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of bottomLeftCorner(NRowsType, NColsType).
|
||||
template <typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
|
||||
internal::get_fixed_value<NColsType>::value>::Type
|
||||
@@ -530,13 +533,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomLeftCorner() {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomLeftCorner() {
|
||||
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, 0);
|
||||
}
|
||||
|
||||
/// This is the const version of bottomLeftCorner<int, int>().
|
||||
template <int CRows, int CCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomLeftCorner() const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomLeftCorner()
|
||||
const {
|
||||
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, 0);
|
||||
}
|
||||
|
||||
@@ -588,7 +592,7 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <typename NRowsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
|
||||
#else
|
||||
@@ -601,7 +605,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of topRows(NRowsType).
|
||||
template <typename NRowsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
|
||||
#else
|
||||
@@ -628,13 +632,13 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type topRows(Index n = N) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type topRows(Index n = N) {
|
||||
return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
|
||||
}
|
||||
|
||||
/// This is the const version of topRows<int>().
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N) const {
|
||||
return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
|
||||
}
|
||||
|
||||
@@ -655,7 +659,7 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <typename NRowsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
|
||||
#else
|
||||
@@ -668,7 +672,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of bottomRows(NRowsType).
|
||||
template <typename NRowsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
|
||||
#else
|
||||
@@ -695,13 +699,13 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type bottomRows(Index n = N) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type bottomRows(Index n = N) {
|
||||
return typename NRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
|
||||
}
|
||||
|
||||
/// This is the const version of bottomRows<int>().
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N) const {
|
||||
return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
|
||||
}
|
||||
|
||||
@@ -723,7 +727,7 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <typename NRowsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
|
||||
#else
|
||||
@@ -736,7 +740,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of middleRows(Index,NRowsType).
|
||||
template <typename NRowsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
|
||||
#else
|
||||
@@ -764,14 +768,15 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type middleRows(Index startRow,
|
||||
Index n = N) {
|
||||
return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
|
||||
}
|
||||
|
||||
/// This is the const version of middleRows<int>().
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow,
|
||||
Index n = N) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow,
|
||||
Index n = N) const {
|
||||
return typename ConstNRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
|
||||
}
|
||||
|
||||
@@ -792,7 +797,7 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
|
||||
#else
|
||||
@@ -805,7 +810,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of leftCols(NColsType).
|
||||
template <typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
|
||||
#else
|
||||
@@ -832,13 +837,13 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type leftCols(Index n = N) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type leftCols(Index n = N) {
|
||||
return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
|
||||
}
|
||||
|
||||
/// This is the const version of leftCols<int>().
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N) const {
|
||||
return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
|
||||
}
|
||||
|
||||
@@ -859,7 +864,7 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
|
||||
#else
|
||||
@@ -872,7 +877,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of rightCols(NColsType).
|
||||
template <typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
|
||||
#else
|
||||
@@ -899,13 +904,13 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type rightCols(Index n = N) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type rightCols(Index n = N) {
|
||||
return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
|
||||
}
|
||||
|
||||
/// This is the const version of rightCols<int>().
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N) const {
|
||||
return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
|
||||
}
|
||||
|
||||
@@ -927,7 +932,7 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
|
||||
#else
|
||||
@@ -940,7 +945,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of middleCols(Index,NColsType).
|
||||
template <typename NColsType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
|
||||
#else
|
||||
@@ -968,14 +973,15 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type middleCols(Index startCol,
|
||||
Index n = N) {
|
||||
return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
|
||||
}
|
||||
|
||||
/// This is the const version of middleCols<int>().
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol,
|
||||
Index n = N) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol,
|
||||
Index n = N) const {
|
||||
return typename ConstNColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
|
||||
}
|
||||
|
||||
@@ -1004,13 +1010,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <int NRows, int NCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<NRows, NCols>::Type block(Index startRow, Index startCol) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<NRows, NCols>::Type block(Index startRow,
|
||||
Index startCol) {
|
||||
return typename FixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol);
|
||||
}
|
||||
|
||||
/// This is the const version of block<>(Index, Index). */
|
||||
template <int NRows, int NCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<NRows, NCols>::Type block(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<NRows, NCols>::Type block(
|
||||
Index startRow, Index startCol) const {
|
||||
return typename ConstFixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol);
|
||||
}
|
||||
@@ -1047,15 +1054,16 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), class Block
|
||||
///
|
||||
template <int NRows, int NCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<NRows, NCols>::Type block(Index startRow, Index startCol,
|
||||
Index blockRows,
|
||||
Index blockCols) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<NRows, NCols>::Type block(Index startRow,
|
||||
Index startCol,
|
||||
Index blockRows,
|
||||
Index blockCols) {
|
||||
return typename FixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
|
||||
}
|
||||
|
||||
/// This is the const version of block<>(Index, Index, Index, Index).
|
||||
template <int NRows, int NCols>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<NRows, NCols>::Type block(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<NRows, NCols>::Type block(
|
||||
Index startRow, Index startCol, Index blockRows, Index blockCols) const {
|
||||
return typename ConstFixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
|
||||
}
|
||||
@@ -1068,10 +1076,10 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<NRows, N
|
||||
EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
|
||||
/**
|
||||
* \sa row(), class Block */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ColXpr col(Index i) { return ColXpr(derived(), i); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ColXpr col(Index i) { return ColXpr(derived(), i); }
|
||||
|
||||
/// This is the const version of col().
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstColXpr col(Index i) const { return ConstColXpr(derived(), i); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ConstColXpr col(Index i) const { return ConstColXpr(derived(), i); }
|
||||
|
||||
/// \returns an expression of the \a i-th row of \c *this. Note that the numbering starts at 0.
|
||||
///
|
||||
@@ -1081,10 +1089,10 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstColXpr col(Index i) const { return Co
|
||||
EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
|
||||
/**
|
||||
* \sa col(), class Block */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RowXpr row(Index i) { return RowXpr(derived(), i); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE RowXpr row(Index i) { return RowXpr(derived(), i); }
|
||||
|
||||
/// This is the const version of row(). */
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstRowXpr row(Index i) const { return ConstRowXpr(derived(), i); }
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ConstRowXpr row(Index i) const { return ConstRowXpr(derived(), i); }
|
||||
|
||||
/// \returns an expression of a segment (i.e. a vector block) in \c *this with either dynamic or fixed sizes.
|
||||
///
|
||||
@@ -1108,7 +1116,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstRowXpr row(Index i) const { return Co
|
||||
/// \sa block(Index,Index,NRowsType,NColsType), fix<N>, fix<N>(int), class Block
|
||||
///
|
||||
template <typename NType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
|
||||
#else
|
||||
@@ -1122,7 +1130,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of segment(Index,NType).
|
||||
template <typename NType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
|
||||
#else
|
||||
@@ -1155,7 +1163,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
/// \sa class Block, block(Index,Index)
|
||||
///
|
||||
template <typename NType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
|
||||
#else
|
||||
@@ -1169,7 +1177,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of head(NType).
|
||||
template <typename NType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
|
||||
#else
|
||||
@@ -1202,7 +1210,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
/// \sa class Block, block(Index,Index)
|
||||
///
|
||||
template <typename NType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
|
||||
#else
|
||||
@@ -1216,7 +1224,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
|
||||
/// This is the const version of tail(Index).
|
||||
template <typename NType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
|
||||
#else
|
||||
@@ -1245,15 +1253,16 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
/// \sa segment(Index,NType), class Block
|
||||
///
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type segment(Index start, Index n = N) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type segment(Index start,
|
||||
Index n = N) {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||
return typename FixedSegmentReturnType<N>::Type(derived(), start, n);
|
||||
}
|
||||
|
||||
/// This is the const version of segment<int>(Index).
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type segment(Index start,
|
||||
Index n = N) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type segment(
|
||||
Index start, Index n = N) const {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||
return typename ConstFixedSegmentReturnType<N>::Type(derived(), start, n);
|
||||
}
|
||||
@@ -1274,14 +1283,14 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::T
|
||||
/// \sa head(NType), class Block
|
||||
///
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type head(Index n = N) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type head(Index n = N) {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||
return typename FixedSegmentReturnType<N>::Type(derived(), 0, n);
|
||||
}
|
||||
|
||||
/// This is the const version of head<int>().
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type head(Index n = N) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type head(Index n = N) const {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||
return typename ConstFixedSegmentReturnType<N>::Type(derived(), 0, n);
|
||||
}
|
||||
@@ -1302,14 +1311,14 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::T
|
||||
/// \sa tail(NType), class Block
|
||||
///
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type tail(Index n = N) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type tail(Index n = N) {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||
return typename FixedSegmentReturnType<N>::Type(derived(), size() - n, n);
|
||||
}
|
||||
|
||||
/// This is the const version of tail<int>.
|
||||
template <int N>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||
return typename ConstFixedSegmentReturnType<N>::Type(derived(), size() - n, n);
|
||||
}
|
||||
@@ -1317,21 +1326,21 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::T
|
||||
/// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
|
||||
/// is col-major (resp. row-major).
|
||||
///
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE InnerVectorReturnType innerVector(Index outer) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE InnerVectorReturnType innerVector(Index outer) {
|
||||
return InnerVectorReturnType(derived(), outer);
|
||||
}
|
||||
|
||||
/// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
|
||||
/// is col-major (resp. row-major). Read-only.
|
||||
///
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ConstInnerVectorReturnType innerVector(Index outer) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const ConstInnerVectorReturnType innerVector(Index outer) const {
|
||||
return ConstInnerVectorReturnType(derived(), outer);
|
||||
}
|
||||
|
||||
/// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
|
||||
/// is col-major (resp. row-major).
|
||||
///
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE InnerVectorsReturnType innerVectors(Index outerStart, Index outerSize) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE InnerVectorsReturnType innerVectors(Index outerStart, Index outerSize) {
|
||||
return Block<Derived, Dynamic, Dynamic, true>(derived(), IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
|
||||
IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
|
||||
}
|
||||
@@ -1339,8 +1348,8 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE InnerVectorsReturnType innerVectors(Index
|
||||
/// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
|
||||
/// is col-major (resp. row-major). Read-only.
|
||||
///
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ConstInnerVectorsReturnType innerVectors(Index outerStart,
|
||||
Index outerSize) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const ConstInnerVectorsReturnType innerVectors(Index outerStart,
|
||||
Index outerSize) const {
|
||||
return Block<const Derived, Dynamic, Dynamic, true>(derived(), IsRowMajor ? outerStart : 0,
|
||||
IsRowMajor ? 0 : outerStart, IsRowMajor ? outerSize : rows(),
|
||||
IsRowMajor ? cols() : outerSize);
|
||||
@@ -1350,14 +1359,15 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ConstInnerVectorsReturnType innerVec
|
||||
* \sa subVectors()
|
||||
*/
|
||||
template <DirectionType Direction>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical, ColXpr, RowXpr> subVector(Index i) {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical, ColXpr, RowXpr> subVector(
|
||||
Index i) {
|
||||
return std::conditional_t<Direction == Vertical, ColXpr, RowXpr>(derived(), i);
|
||||
}
|
||||
|
||||
/** This is the const version of subVector(Index) */
|
||||
template <DirectionType Direction>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical, ConstColXpr, ConstRowXpr> subVector(
|
||||
Index i) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical, ConstColXpr, ConstRowXpr>
|
||||
subVector(Index i) const {
|
||||
return std::conditional_t<Direction == Vertical, ConstColXpr, ConstRowXpr>(derived(), i);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,9 @@ EIGEN_MAKE_CWISE_BINARY_OP(operator+, sum)
|
||||
* \sa class CwiseBinaryOp, operator+(), operator-(), cwiseProduct()
|
||||
*/
|
||||
template <typename CustomBinaryOp, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived> binaryExpr(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other, const CustomBinaryOp& func = CustomBinaryOp()) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived>
|
||||
binaryExpr(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other,
|
||||
const CustomBinaryOp& func = CustomBinaryOp()) const {
|
||||
return CwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived>(derived(), other.derived(), func);
|
||||
}
|
||||
|
||||
@@ -63,7 +64,8 @@ EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(operator/, quotient)
|
||||
* \sa operator||(), select()
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryOp<internal::scalar_boolean_and_op<Scalar>, const Derived, const OtherDerived>
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryOp<internal::scalar_boolean_and_op<Scalar>, const Derived,
|
||||
const OtherDerived>
|
||||
operator&&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryOp<internal::scalar_boolean_and_op<Scalar>, const Derived, const OtherDerived>(derived(),
|
||||
other.derived());
|
||||
@@ -77,7 +79,8 @@ operator&&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
* \sa operator&&(), select()
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryOp<internal::scalar_boolean_or_op<Scalar>, const Derived, const OtherDerived>
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryOp<internal::scalar_boolean_or_op<Scalar>, const Derived,
|
||||
const OtherDerived>
|
||||
operator||(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryOp<internal::scalar_boolean_or_op<Scalar>, const Derived, const OtherDerived>(derived(),
|
||||
other.derived());
|
||||
@@ -88,7 +91,8 @@ operator||(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
* \sa operator|(), operator^()
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryOp<internal::scalar_bitwise_and_op<Scalar>, const Derived, const OtherDerived>
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryOp<internal::scalar_bitwise_and_op<Scalar>, const Derived,
|
||||
const OtherDerived>
|
||||
operator&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryOp<internal::scalar_bitwise_and_op<Scalar>, const Derived, const OtherDerived>(derived(),
|
||||
other.derived());
|
||||
@@ -99,7 +103,8 @@ operator&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
* \sa operator&(), operator^()
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryOp<internal::scalar_bitwise_or_op<Scalar>, const Derived, const OtherDerived>
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryOp<internal::scalar_bitwise_or_op<Scalar>, const Derived,
|
||||
const OtherDerived>
|
||||
operator|(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryOp<internal::scalar_bitwise_or_op<Scalar>, const Derived, const OtherDerived>(derived(),
|
||||
other.derived());
|
||||
@@ -109,7 +114,8 @@ operator|(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
* \sa operator&(), operator|()
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryOp<internal::scalar_bitwise_xor_op<Scalar>, const Derived, const OtherDerived>
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryOp<internal::scalar_bitwise_xor_op<Scalar>, const Derived,
|
||||
const OtherDerived>
|
||||
operator^(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryOp<internal::scalar_bitwise_xor_op<Scalar>, const Derived, const OtherDerived>(derived(),
|
||||
other.derived());
|
||||
|
||||
@@ -37,7 +37,7 @@ typedef CwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const Derived> Negati
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(operator-, opposite)
|
||||
///
|
||||
EIGEN_DEVICE_FUNC inline const NegativeReturnType operator-() const { return NegativeReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const NegativeReturnType operator-() const { return NegativeReturnType(derived()); }
|
||||
|
||||
template <class NewType>
|
||||
struct CastXpr {
|
||||
@@ -55,7 +55,7 @@ EIGEN_DOC_UNARY_ADDONS(cast, conversion function)
|
||||
/// \sa class CwiseUnaryOp
|
||||
///
|
||||
template <typename NewType>
|
||||
EIGEN_DEVICE_FUNC typename CastXpr<NewType>::Type cast() const {
|
||||
EIGEN_DEVICE_FUNC constexpr typename CastXpr<NewType>::Type cast() const {
|
||||
return typename CastXpr<NewType>::Type(derived());
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ EIGEN_DEVICE_FUNC typename CastXpr<NewType>::Type cast() const {
|
||||
EIGEN_DOC_UNARY_ADDONS(conjugate, complex conjugate)
|
||||
///
|
||||
/// \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_conj">Math functions</a>, MatrixBase::adjoint()
|
||||
EIGEN_DEVICE_FUNC inline ConjugateReturnType conjugate() const { return ConjugateReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline ConjugateReturnType conjugate() const { return ConjugateReturnType(derived()); }
|
||||
|
||||
/// \returns an expression of the complex conjugate of \c *this if Cond==true, returns derived() otherwise.
|
||||
///
|
||||
@@ -72,7 +72,7 @@ EIGEN_DOC_UNARY_ADDONS(conjugate, complex conjugate)
|
||||
///
|
||||
/// \sa conjugate()
|
||||
template <bool Cond>
|
||||
EIGEN_DEVICE_FUNC inline std::conditional_t<Cond, ConjugateReturnType, const Derived&> conjugateIf() const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline std::conditional_t<Cond, ConjugateReturnType, const Derived&> conjugateIf() const {
|
||||
typedef std::conditional_t<Cond, ConjugateReturnType, const Derived&> ReturnType;
|
||||
return ReturnType(derived());
|
||||
}
|
||||
@@ -82,14 +82,14 @@ EIGEN_DEVICE_FUNC inline std::conditional_t<Cond, ConjugateReturnType, const Der
|
||||
EIGEN_DOC_UNARY_ADDONS(real, real part function)
|
||||
///
|
||||
/// \sa imag()
|
||||
EIGEN_DEVICE_FUNC inline RealReturnType real() const { return RealReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline RealReturnType real() const { return RealReturnType(derived()); }
|
||||
|
||||
/// \returns an read-only expression of the imaginary part of \c *this.
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(imag, imaginary part function)
|
||||
///
|
||||
/// \sa real()
|
||||
EIGEN_DEVICE_FUNC inline const ImagReturnType imag() const { return ImagReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const ImagReturnType imag() const { return ImagReturnType(derived()); }
|
||||
|
||||
/// \brief Apply a unary operator coefficient-wise
|
||||
/// \param[in] func Functor implementing the unary operator
|
||||
@@ -113,7 +113,7 @@ EIGEN_DOC_UNARY_ADDONS(unaryExpr, unary function)
|
||||
/// \sa unaryViewExpr, binaryExpr, class CwiseUnaryOp
|
||||
///
|
||||
template <typename CustomUnaryOp>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseUnaryOp<CustomUnaryOp, const Derived> unaryExpr(
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseUnaryOp<CustomUnaryOp, const Derived> unaryExpr(
|
||||
const CustomUnaryOp& func = CustomUnaryOp()) const {
|
||||
return CwiseUnaryOp<CustomUnaryOp, const Derived>(derived(), func);
|
||||
}
|
||||
@@ -132,7 +132,7 @@ EIGEN_DOC_UNARY_ADDONS(unaryViewExpr, unary function)
|
||||
/// \sa unaryExpr, binaryExpr class CwiseUnaryOp
|
||||
///
|
||||
template <typename CustomViewOp>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseUnaryView<CustomViewOp, const Derived> unaryViewExpr(
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseUnaryView<CustomViewOp, const Derived> unaryViewExpr(
|
||||
const CustomViewOp& func = CustomViewOp()) const {
|
||||
return CwiseUnaryView<CustomViewOp, const Derived>(derived(), func);
|
||||
}
|
||||
@@ -147,7 +147,7 @@ EIGEN_DOC_UNARY_ADDONS(unaryViewExpr, unary function)
|
||||
/// \sa unaryExpr, binaryExpr class CwiseUnaryOp
|
||||
///
|
||||
template <typename CustomViewOp>
|
||||
EIGEN_DEVICE_FUNC inline CwiseUnaryView<CustomViewOp, Derived> unaryViewExpr(
|
||||
EIGEN_DEVICE_FUNC constexpr inline CwiseUnaryView<CustomViewOp, Derived> unaryViewExpr(
|
||||
const CustomViewOp& func = CustomViewOp()) {
|
||||
return CwiseUnaryView<CustomViewOp, Derived>(derived(), func);
|
||||
}
|
||||
@@ -157,11 +157,11 @@ EIGEN_DEVICE_FUNC inline CwiseUnaryView<CustomViewOp, Derived> unaryViewExpr(
|
||||
EIGEN_DOC_UNARY_ADDONS(real, real part function)
|
||||
///
|
||||
/// \sa imag()
|
||||
EIGEN_DEVICE_FUNC inline NonConstRealReturnType real() { return NonConstRealReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline NonConstRealReturnType real() { return NonConstRealReturnType(derived()); }
|
||||
|
||||
/// \returns a non const expression of the imaginary part of \c *this.
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(imag, imaginary part function)
|
||||
///
|
||||
/// \sa real()
|
||||
EIGEN_DEVICE_FUNC inline NonConstImagReturnType imag() { return NonConstImagReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline NonConstImagReturnType imag() { return NonConstImagReturnType(derived()); }
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* \sa class CwiseBinaryOp, cwiseAbs2
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product)
|
||||
cwiseProduct(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product)(derived(), other.derived());
|
||||
}
|
||||
@@ -55,7 +55,7 @@ using CwiseBinaryGreaterOrEqualReturnType =
|
||||
* \sa cwiseNotEqual(), isApprox(), isMuchSmallerThan()
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryEqualReturnType<OtherDerived> cwiseEqual(
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryEqualReturnType<OtherDerived> cwiseEqual(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryEqualReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
@@ -73,35 +73,35 @@ EIGEN_DEVICE_FUNC inline const CwiseBinaryEqualReturnType<OtherDerived> cwiseEqu
|
||||
* \sa cwiseEqual(), isApprox(), isMuchSmallerThan()
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryNotEqualReturnType<OtherDerived> cwiseNotEqual(
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryNotEqualReturnType<OtherDerived> cwiseNotEqual(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryNotEqualReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise < operator of *this and \a other */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryLessReturnType<OtherDerived> cwiseLess(
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryLessReturnType<OtherDerived> cwiseLess(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryLessReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise > operator of *this and \a other */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryGreaterReturnType<OtherDerived> cwiseGreater(
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryGreaterReturnType<OtherDerived> cwiseGreater(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryGreaterReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise <= operator of *this and \a other */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryLessOrEqualReturnType<OtherDerived> cwiseLessOrEqual(
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryLessOrEqualReturnType<OtherDerived> cwiseLessOrEqual(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryLessOrEqualReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise >= operator of *this and \a other */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryGreaterOrEqualReturnType<OtherDerived> cwiseGreaterOrEqual(
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryGreaterOrEqualReturnType<OtherDerived> cwiseGreaterOrEqual(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryGreaterOrEqualReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
@@ -114,7 +114,7 @@ EIGEN_DEVICE_FUNC inline const CwiseBinaryGreaterOrEqualReturnType<OtherDerived>
|
||||
* \sa class CwiseBinaryOp, max()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
|
||||
CwiseBinaryOp<internal::scalar_min_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>
|
||||
cwiseMin(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryOp<internal::scalar_min_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>(
|
||||
@@ -126,7 +126,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
* \sa class CwiseBinaryOp, min()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
|
||||
CwiseBinaryOp<internal::scalar_min_op<Scalar, Scalar, NaNPropagation>, const Derived, const ConstantReturnType>
|
||||
cwiseMin(const Scalar& other) const {
|
||||
return cwiseMin<NaNPropagation>(Derived::Constant(rows(), cols(), other));
|
||||
@@ -140,7 +140,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
* \sa class CwiseBinaryOp, min()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
|
||||
CwiseBinaryOp<internal::scalar_max_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>
|
||||
cwiseMax(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryOp<internal::scalar_max_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>(
|
||||
@@ -152,7 +152,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
* \sa class CwiseBinaryOp, min()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
|
||||
CwiseBinaryOp<internal::scalar_max_op<Scalar, Scalar, NaNPropagation>, const Derived, const ConstantReturnType>
|
||||
cwiseMax(const Scalar& other) const {
|
||||
return cwiseMax<NaNPropagation>(Derived::Constant(rows(), cols(), other));
|
||||
@@ -166,7 +166,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
* \sa class CwiseBinaryOp, cwiseProduct(), cwiseInverse()
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
|
||||
CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>
|
||||
cwiseQuotient(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>(derived(),
|
||||
@@ -195,7 +195,7 @@ using CwiseScalarGreaterOrEqualReturnType =
|
||||
*
|
||||
* \sa cwiseEqual(const MatrixBase<OtherDerived> &) const
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const CwiseScalarEqualReturnType cwiseEqual(const Scalar& s) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseScalarEqualReturnType cwiseEqual(const Scalar& s) const {
|
||||
return CwiseScalarEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
|
||||
}
|
||||
|
||||
@@ -208,27 +208,28 @@ EIGEN_DEVICE_FUNC inline const CwiseScalarEqualReturnType cwiseEqual(const Scala
|
||||
*
|
||||
* \sa cwiseEqual(const MatrixBase<OtherDerived> &) const
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const CwiseScalarNotEqualReturnType cwiseNotEqual(const Scalar& s) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseScalarNotEqualReturnType cwiseNotEqual(const Scalar& s) const {
|
||||
return CwiseScalarNotEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise < operator of \c *this and a scalar \a s */
|
||||
EIGEN_DEVICE_FUNC inline const CwiseScalarLessReturnType cwiseLess(const Scalar& s) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseScalarLessReturnType cwiseLess(const Scalar& s) const {
|
||||
return CwiseScalarLessReturnType(derived(), Derived::Constant(rows(), cols(), s));
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise > operator of \c *this and a scalar \a s */
|
||||
EIGEN_DEVICE_FUNC inline const CwiseScalarGreaterReturnType cwiseGreater(const Scalar& s) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseScalarGreaterReturnType cwiseGreater(const Scalar& s) const {
|
||||
return CwiseScalarGreaterReturnType(derived(), Derived::Constant(rows(), cols(), s));
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise <= operator of \c *this and a scalar \a s */
|
||||
EIGEN_DEVICE_FUNC inline const CwiseScalarLessOrEqualReturnType cwiseLessOrEqual(const Scalar& s) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseScalarLessOrEqualReturnType cwiseLessOrEqual(const Scalar& s) const {
|
||||
return CwiseScalarLessOrEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise >= operator of \c *this and a scalar \a s */
|
||||
EIGEN_DEVICE_FUNC inline const CwiseScalarGreaterOrEqualReturnType cwiseGreaterOrEqual(const Scalar& s) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseScalarGreaterOrEqualReturnType cwiseGreaterOrEqual(
|
||||
const Scalar& s) const {
|
||||
return CwiseScalarGreaterOrEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
|
||||
}
|
||||
|
||||
@@ -252,37 +253,37 @@ using CwiseBinaryTypedGreaterOrEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE, true>, const Derived, const OtherDerived>;
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryTypedEqualReturnType<OtherDerived> cwiseTypedEqual(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryTypedEqualReturnType<OtherDerived> cwiseTypedEqual(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryTypedEqualReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryTypedNotEqualReturnType<OtherDerived> cwiseTypedNotEqual(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryTypedNotEqualReturnType<OtherDerived>
|
||||
cwiseTypedNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryTypedNotEqualReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryTypedLessReturnType<OtherDerived> cwiseTypedLess(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryTypedLessReturnType<OtherDerived> cwiseTypedLess(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryTypedLessReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryTypedGreaterReturnType<OtherDerived> cwiseTypedGreater(
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryTypedGreaterReturnType<OtherDerived> cwiseTypedGreater(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryTypedGreaterReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryTypedLessOrEqualReturnType<OtherDerived> cwiseTypedLessOrEqual(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryTypedLessOrEqualReturnType<OtherDerived>
|
||||
cwiseTypedLessOrEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryTypedLessOrEqualReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryTypedGreaterOrEqualReturnType<OtherDerived>
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryTypedGreaterOrEqualReturnType<OtherDerived>
|
||||
cwiseTypedGreaterOrEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryTypedGreaterOrEqualReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
@@ -303,29 +304,32 @@ using CwiseScalarTypedGreaterOrEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE, true>, const Derived,
|
||||
const ConstantReturnType>;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedEqualReturnType cwiseTypedEqual(const Scalar& s) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseScalarTypedEqualReturnType
|
||||
cwiseTypedEqual(const Scalar& s) const {
|
||||
return CwiseScalarTypedEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedNotEqualReturnType
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseScalarTypedNotEqualReturnType
|
||||
cwiseTypedNotEqual(const Scalar& s) const {
|
||||
return CwiseScalarTypedNotEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedLessReturnType cwiseTypedLess(const Scalar& s) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseScalarTypedLessReturnType
|
||||
cwiseTypedLess(const Scalar& s) const {
|
||||
return CwiseScalarTypedLessReturnType(derived(), ConstantReturnType(rows(), cols(), s));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedGreaterReturnType cwiseTypedGreater(const Scalar& s) const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseScalarTypedGreaterReturnType
|
||||
cwiseTypedGreater(const Scalar& s) const {
|
||||
return CwiseScalarTypedGreaterReturnType(derived(), ConstantReturnType(rows(), cols(), s));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedLessOrEqualReturnType
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseScalarTypedLessOrEqualReturnType
|
||||
cwiseTypedLessOrEqual(const Scalar& s) const {
|
||||
return CwiseScalarTypedLessOrEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedGreaterOrEqualReturnType
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseScalarTypedGreaterOrEqualReturnType
|
||||
cwiseTypedGreaterOrEqual(const Scalar& s) const {
|
||||
return CwiseScalarTypedGreaterOrEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s));
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ EIGEN_DOC_UNARY_ADDONS(cwiseAbs, absolute value)
|
||||
///
|
||||
/// \sa cwiseAbs2()
|
||||
///
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbsReturnType cwiseAbs() const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseAbsReturnType cwiseAbs() const {
|
||||
return CwiseAbsReturnType(derived());
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ EIGEN_DOC_UNARY_ADDONS(cwiseAbs2, squared absolute value)
|
||||
///
|
||||
/// \sa cwiseAbs()
|
||||
///
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbs2ReturnType cwiseAbs2() const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseAbs2ReturnType cwiseAbs2() const {
|
||||
return CwiseAbs2ReturnType(derived());
|
||||
}
|
||||
|
||||
@@ -56,7 +56,9 @@ EIGEN_DOC_UNARY_ADDONS(cwiseSqrt, square - root)
|
||||
///
|
||||
/// \sa cwisePow(), cwiseSquare(), cwiseCbrt()
|
||||
///
|
||||
EIGEN_DEVICE_FUNC inline const CwiseSqrtReturnType cwiseSqrt() const { return CwiseSqrtReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseSqrtReturnType cwiseSqrt() const {
|
||||
return CwiseSqrtReturnType(derived());
|
||||
}
|
||||
|
||||
/// \returns an expression of the coefficient-wise cube root of *this.
|
||||
///
|
||||
@@ -64,7 +66,9 @@ EIGEN_DOC_UNARY_ADDONS(cwiseCbrt, cube - root)
|
||||
///
|
||||
/// \sa cwiseSqrt(), cwiseSquare(), cwisePow()
|
||||
///
|
||||
EIGEN_DEVICE_FUNC inline const CwiseCbrtReturnType cwiseCbrt() const { return CwiseCbrtReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseCbrtReturnType cwiseCbrt() const {
|
||||
return CwiseCbrtReturnType(derived());
|
||||
}
|
||||
|
||||
/// \returns an expression of the coefficient-wise square of *this.
|
||||
///
|
||||
@@ -72,7 +76,9 @@ EIGEN_DOC_UNARY_ADDONS(cwiseSquare, square)
|
||||
///
|
||||
/// \sa cwisePow(), cwiseSqrt(), cwiseCbrt()
|
||||
///
|
||||
EIGEN_DEVICE_FUNC inline const CwiseSquareReturnType cwiseSquare() const { return CwiseSquareReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseSquareReturnType cwiseSquare() const {
|
||||
return CwiseSquareReturnType(derived());
|
||||
}
|
||||
|
||||
/// \returns an expression of the coefficient-wise signum of *this.
|
||||
///
|
||||
@@ -81,7 +87,9 @@ EIGEN_DEVICE_FUNC inline const CwiseSquareReturnType cwiseSquare() const { retur
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseSign, sign function)
|
||||
///
|
||||
EIGEN_DEVICE_FUNC inline const CwiseSignReturnType cwiseSign() const { return CwiseSignReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseSignReturnType cwiseSign() const {
|
||||
return CwiseSignReturnType(derived());
|
||||
}
|
||||
|
||||
/// \returns an expression of the coefficient-wise inverse of *this.
|
||||
///
|
||||
@@ -92,7 +100,9 @@ EIGEN_DOC_UNARY_ADDONS(cwiseInverse, inverse)
|
||||
///
|
||||
/// \sa cwiseProduct()
|
||||
///
|
||||
EIGEN_DEVICE_FUNC inline const CwiseInverseReturnType cwiseInverse() const { return CwiseInverseReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseInverseReturnType cwiseInverse() const {
|
||||
return CwiseInverseReturnType(derived());
|
||||
}
|
||||
|
||||
/// \returns an expression of the coefficient-wise phase angle of \c *this
|
||||
///
|
||||
@@ -101,9 +111,9 @@ EIGEN_DEVICE_FUNC inline const CwiseInverseReturnType cwiseInverse() const { ret
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseArg, arg)
|
||||
|
||||
EIGEN_DEVICE_FUNC inline const CwiseArgReturnType cwiseArg() const { return CwiseArgReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwiseArgReturnType cwiseArg() const { return CwiseArgReturnType(derived()); }
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseCArgReturnType cwiseCArg() const {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseCArgReturnType cwiseCArg() const {
|
||||
return CwiseCArgReturnType(derived());
|
||||
}
|
||||
|
||||
@@ -113,6 +123,7 @@ using CwisePowReturnType =
|
||||
CwiseUnaryOp<internal::scalar_unary_pow_op<Scalar, ScalarExponent>, const Derived>>;
|
||||
|
||||
template <typename ScalarExponent>
|
||||
EIGEN_DEVICE_FUNC inline const CwisePowReturnType<ScalarExponent> cwisePow(const ScalarExponent& exponent) const {
|
||||
EIGEN_DEVICE_FUNC constexpr inline const CwisePowReturnType<ScalarExponent> cwisePow(
|
||||
const ScalarExponent& exponent) const {
|
||||
return CwisePowReturnType<ScalarExponent>(derived(), internal::scalar_unary_pow_op<Scalar, ScalarExponent>(exponent));
|
||||
}
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
/// \sa class Reshaped, fix, fix<N>(int)
|
||||
///
|
||||
template <int Order = ColMajor, typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC inline Reshaped<Derived, ...> reshaped(NRowsType nRows, NColsType nCols);
|
||||
EIGEN_DEVICE_FUNC constexpr inline Reshaped<Derived, ...> reshaped(NRowsType nRows, NColsType nCols);
|
||||
|
||||
/// This is the const version of reshaped(NRowsType,NColsType).
|
||||
template <int Order = ColMajor, typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC inline const Reshaped<const Derived, ...> reshaped(NRowsType nRows, NColsType nCols) const;
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Reshaped<const Derived, ...> reshaped(NRowsType nRows, NColsType nCols) const;
|
||||
|
||||
/// \returns an expression of \c *this with columns (or rows) stacked to a linear column vector
|
||||
///
|
||||
@@ -56,11 +56,11 @@ EIGEN_DEVICE_FUNC inline const Reshaped<const Derived, ...> reshaped(NRowsType n
|
||||
/// \sa reshaped(NRowsType,NColsType), class Reshaped
|
||||
///
|
||||
template <int Order = ColMajor>
|
||||
EIGEN_DEVICE_FUNC inline Reshaped<Derived, ...> reshaped();
|
||||
EIGEN_DEVICE_FUNC constexpr inline Reshaped<Derived, ...> reshaped();
|
||||
|
||||
/// This is the const version of reshaped().
|
||||
template <int Order = ColMajor>
|
||||
EIGEN_DEVICE_FUNC inline const Reshaped<const Derived, ...> reshaped() const;
|
||||
EIGEN_DEVICE_FUNC constexpr inline const Reshaped<const Derived, ...> reshaped() const;
|
||||
|
||||
#else
|
||||
|
||||
@@ -79,7 +79,7 @@ EIGEN_DEVICE_FUNC inline const Reshaped<const Derived, ...> reshaped() const;
|
||||
#endif
|
||||
|
||||
template <typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC inline Reshaped<
|
||||
EIGEN_DEVICE_FUNC constexpr inline Reshaped<
|
||||
EIGEN_RESHAPED_METHOD_CONST Derived,
|
||||
internal::get_compiletime_reshape_size<NRowsType, NColsType, SizeAtCompileTime>::value,
|
||||
internal::get_compiletime_reshape_size<NColsType, NRowsType, SizeAtCompileTime>::value>
|
||||
@@ -92,7 +92,7 @@ reshaped(NRowsType nRows, NColsType nCols) EIGEN_RESHAPED_METHOD_CONST {
|
||||
}
|
||||
|
||||
template <int Order, typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC inline Reshaped<
|
||||
EIGEN_DEVICE_FUNC constexpr inline Reshaped<
|
||||
EIGEN_RESHAPED_METHOD_CONST Derived,
|
||||
internal::get_compiletime_reshape_size<NRowsType, NColsType, SizeAtCompileTime>::value,
|
||||
internal::get_compiletime_reshape_size<NColsType, NRowsType, SizeAtCompileTime>::value,
|
||||
@@ -108,14 +108,14 @@ reshaped(NRowsType nRows, NColsType nCols) EIGEN_RESHAPED_METHOD_CONST {
|
||||
|
||||
// Views as linear vectors
|
||||
|
||||
EIGEN_DEVICE_FUNC inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1> reshaped()
|
||||
EIGEN_DEVICE_FUNC constexpr inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1> reshaped()
|
||||
EIGEN_RESHAPED_METHOD_CONST {
|
||||
return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1>(derived(), size(), 1);
|
||||
}
|
||||
|
||||
template <int Order>
|
||||
EIGEN_DEVICE_FUNC inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1,
|
||||
internal::get_compiletime_reshape_order(Flags, Order)>
|
||||
EIGEN_DEVICE_FUNC constexpr inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1,
|
||||
internal::get_compiletime_reshape_order(Flags, Order)>
|
||||
reshaped() EIGEN_RESHAPED_METHOD_CONST {
|
||||
EIGEN_STATIC_ASSERT(Order == RowMajor || Order == ColMajor || Order == AutoOrder, INVALID_TEMPLATE_PARAMETER);
|
||||
return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1,
|
||||
|
||||
@@ -64,6 +64,27 @@ EIGEN_DECLARE_TEST(constexpr) {
|
||||
static_assert(dyn_arr(0) == 1);
|
||||
VERIFY_IS_EQUAL(dyn_arr.size(), 9);
|
||||
static_assert(dyn_arr.coeff(0, 1) == 2);
|
||||
|
||||
// Test matrix addition.
|
||||
constexpr Matrix3i mat_a({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}});
|
||||
constexpr Matrix3i mat_b({{9, 8, 7}, {6, 5, 4}, {3, 2, 1}});
|
||||
constexpr Matrix3i mat_sum = mat_a + mat_b;
|
||||
static_assert(mat_sum(0, 0) == 10);
|
||||
static_assert(mat_sum(1, 1) == 10);
|
||||
static_assert(mat_sum(2, 2) == 10);
|
||||
|
||||
// Test matrix subtraction.
|
||||
constexpr Matrix3i mat_diff = mat_a - mat_b;
|
||||
static_assert(mat_diff(0, 0) == -8);
|
||||
static_assert(mat_diff(1, 1) == 0);
|
||||
static_assert(mat_diff(2, 2) == 8);
|
||||
|
||||
// Test scalar multiplication.
|
||||
constexpr Matrix3i mat_scaled = mat_a * 2;
|
||||
static_assert(mat_scaled(0, 0) == 2);
|
||||
static_assert(mat_scaled(1, 1) == 10);
|
||||
static_assert(mat_scaled(2, 2) == 18);
|
||||
|
||||
#endif // __cpp_constexpr >= 201907L
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user