mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Apply clang-format
This commit is contained in:
@@ -1,310 +1,307 @@
|
||||
|
||||
/** \returns an expression of the coefficient wise product of \c *this and \a other
|
||||
*
|
||||
* \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
|
||||
{
|
||||
return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,product)(derived(), other.derived());
|
||||
*
|
||||
* \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 {
|
||||
return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product)(derived(), other.derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient wise quotient of \c *this and \a other
|
||||
*
|
||||
* \sa MatrixBase::cwiseQuotient
|
||||
*/
|
||||
template<typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC
|
||||
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, const OtherDerived>(derived(), other.derived());
|
||||
*
|
||||
* \sa MatrixBase::cwiseQuotient
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC 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,
|
||||
const OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise min of \c *this and \a other
|
||||
*
|
||||
* Example: \include Cwise_min.cpp
|
||||
* Output: \verbinclude Cwise_min.out
|
||||
*
|
||||
* \sa max()
|
||||
*/
|
||||
template <int NaNPropagation=PropagateFast, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_min_op<Scalar,Scalar,NaNPropagation>, const Derived, const OtherDerived>
|
||||
*
|
||||
* Example: \include Cwise_min.cpp
|
||||
* Output: \verbinclude Cwise_min.out
|
||||
*
|
||||
* \sa max()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
CwiseBinaryOp<internal::scalar_min_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>
|
||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
||||
min
|
||||
min
|
||||
#else
|
||||
(min)
|
||||
(min)
|
||||
#endif
|
||||
(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
|
||||
{
|
||||
return CwiseBinaryOp<internal::scalar_min_op<Scalar,Scalar,NaNPropagation>, const Derived, const OtherDerived>(derived(), other.derived());
|
||||
(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const {
|
||||
return CwiseBinaryOp<internal::scalar_min_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>(
|
||||
derived(), other.derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise min of \c *this and scalar \a other
|
||||
*
|
||||
* \sa max()
|
||||
*/
|
||||
template <int NaNPropagation=PropagateFast>
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_min_op<Scalar,Scalar,NaNPropagation>, const Derived,
|
||||
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
|
||||
*
|
||||
* \sa max()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast>
|
||||
EIGEN_DEVICE_FUNC 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
|
||||
min
|
||||
min
|
||||
#else
|
||||
(min)
|
||||
(min)
|
||||
#endif
|
||||
(const Scalar &other) const
|
||||
{
|
||||
(const Scalar &other) const {
|
||||
return (min<NaNPropagation>)(Derived::PlainObject::Constant(rows(), cols(), other));
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise max of \c *this and \a other
|
||||
*
|
||||
* Example: \include Cwise_max.cpp
|
||||
* Output: \verbinclude Cwise_max.out
|
||||
*
|
||||
* \sa min()
|
||||
*/
|
||||
template <int NaNPropagation=PropagateFast, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar,Scalar,NaNPropagation>, const Derived, const OtherDerived>
|
||||
*
|
||||
* Example: \include Cwise_max.cpp
|
||||
* Output: \verbinclude Cwise_max.out
|
||||
*
|
||||
* \sa min()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
|
||||
CwiseBinaryOp<internal::scalar_max_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>
|
||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
||||
max
|
||||
max
|
||||
#else
|
||||
(max)
|
||||
(max)
|
||||
#endif
|
||||
(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
|
||||
{
|
||||
return CwiseBinaryOp<internal::scalar_max_op<Scalar,Scalar,NaNPropagation>, const Derived, const OtherDerived>(derived(), other.derived());
|
||||
(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const {
|
||||
return CwiseBinaryOp<internal::scalar_max_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>(
|
||||
derived(), other.derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise max of \c *this and scalar \a other
|
||||
*
|
||||
* \sa min()
|
||||
*/
|
||||
template <int NaNPropagation=PropagateFast>
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar,Scalar,NaNPropagation>, const Derived,
|
||||
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
|
||||
*
|
||||
* \sa min()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast>
|
||||
EIGEN_DEVICE_FUNC 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
|
||||
max
|
||||
max
|
||||
#else
|
||||
(max)
|
||||
(max)
|
||||
#endif
|
||||
(const Scalar &other) const
|
||||
{
|
||||
(const Scalar &other) const {
|
||||
return (max<NaNPropagation>)(Derived::PlainObject::Constant(rows(), cols(), other));
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise absdiff of \c *this and \a other
|
||||
*
|
||||
* Example: \include Cwise_absolute_difference.cpp
|
||||
* Output: \verbinclude Cwise_absolute_difference.out
|
||||
*
|
||||
* \sa absolute_difference()
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_BINARY_OP(absolute_difference,absolute_difference)
|
||||
*
|
||||
* Example: \include Cwise_absolute_difference.cpp
|
||||
* Output: \verbinclude Cwise_absolute_difference.out
|
||||
*
|
||||
* \sa absolute_difference()
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_BINARY_OP(absolute_difference, absolute_difference)
|
||||
|
||||
/** \returns an expression of the coefficient-wise absolute_difference of \c *this and scalar \a other
|
||||
*
|
||||
* \sa absolute_difference()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_absolute_difference_op<Scalar,Scalar>, const Derived,
|
||||
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
|
||||
*
|
||||
* \sa absolute_difference()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC 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
|
||||
absolute_difference
|
||||
absolute_difference
|
||||
#else
|
||||
(absolute_difference)
|
||||
(absolute_difference)
|
||||
#endif
|
||||
(const Scalar &other) const
|
||||
{
|
||||
(const Scalar &other) const {
|
||||
return (absolute_difference)(Derived::PlainObject::Constant(rows(), cols(), other));
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise power of \c *this to the given array of \a exponents.
|
||||
*
|
||||
* This function computes the coefficient-wise power.
|
||||
*
|
||||
* Example: \include Cwise_array_power_array.cpp
|
||||
* Output: \verbinclude Cwise_array_power_array.out
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_BINARY_OP(pow,pow)
|
||||
*
|
||||
* This function computes the coefficient-wise power.
|
||||
*
|
||||
* Example: \include Cwise_array_power_array.cpp
|
||||
* Output: \verbinclude Cwise_array_power_array.out
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_BINARY_OP(pow, pow)
|
||||
|
||||
/** \returns an expression of the coefficient-wise atan2(\c *this, \a y), where \a y is the given array argument.
|
||||
*
|
||||
* This function computes the coefficient-wise atan2.
|
||||
*
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_BINARY_OP(atan2,atan2)
|
||||
|
||||
*
|
||||
* This function computes the coefficient-wise atan2.
|
||||
*
|
||||
*/
|
||||
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 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 \
|
||||
{ \
|
||||
return CwiseBinaryOp<internal::scalar_cmp_op<Scalar, typename OtherDerived::Scalar, internal::cmp_ ## COMPARATOR>, const Derived, const OtherDerived>(derived(), other.derived()); \
|
||||
}\
|
||||
typedef CwiseBinaryOp<internal::scalar_cmp_op<Scalar,Scalar, internal::cmp_ ## COMPARATOR>, const Derived, const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> > Cmp ## COMPARATOR ## ReturnType; \
|
||||
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 { \
|
||||
return this->OP(Derived::PlainObject::Constant(rows(), cols(), s)); \
|
||||
} \
|
||||
EIGEN_DEVICE_FUNC 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 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 { \
|
||||
return Derived::PlainObject::Constant(rows(), cols(), s).R_OP(*this); \
|
||||
} \
|
||||
friend inline const Cmp ## RCOMPARATOR ## ReturnType \
|
||||
OP(const Scalar& s, const Derived& d) { \
|
||||
return d.R_OP(Derived::PlainObject::Constant(d.rows(), d.cols(), s)); \
|
||||
}
|
||||
|
||||
#define EIGEN_MAKE_CWISE_COMP_OP(OP, COMPARATOR) \
|
||||
template <typename OtherDerived> \
|
||||
EIGEN_DEVICE_FUNC 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 { \
|
||||
return CwiseBinaryOp<internal::scalar_cmp_op<Scalar, typename OtherDerived::Scalar, internal::cmp_##COMPARATOR>, \
|
||||
const Derived, const OtherDerived>(derived(), other.derived()); \
|
||||
} \
|
||||
typedef CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_##COMPARATOR>, const Derived, \
|
||||
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> > \
|
||||
Cmp##COMPARATOR##ReturnType; \
|
||||
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 { \
|
||||
return this->OP(Derived::PlainObject::Constant(rows(), cols(), s)); \
|
||||
} \
|
||||
EIGEN_DEVICE_FUNC 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 \
|
||||
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 { \
|
||||
return Derived::PlainObject::Constant(rows(), cols(), s).R_OP(*this); \
|
||||
} \
|
||||
friend inline const Cmp##RCOMPARATOR##ReturnType OP(const Scalar &s, const Derived &d) { \
|
||||
return d.R_OP(Derived::PlainObject::Constant(d.rows(), d.cols(), s)); \
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise \< operator of *this and \a other
|
||||
*
|
||||
* Example: \include Cwise_less.cpp
|
||||
* Output: \verbinclude Cwise_less.out
|
||||
*
|
||||
* \sa all(), any(), operator>(), operator<=()
|
||||
*/
|
||||
*
|
||||
* Example: \include Cwise_less.cpp
|
||||
* Output: \verbinclude Cwise_less.out
|
||||
*
|
||||
* \sa all(), any(), operator>(), operator<=()
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_COMP_OP(operator<, LT)
|
||||
|
||||
/** \returns an expression of the coefficient-wise \<= operator of *this and \a other
|
||||
*
|
||||
* Example: \include Cwise_less_equal.cpp
|
||||
* Output: \verbinclude Cwise_less_equal.out
|
||||
*
|
||||
* \sa all(), any(), operator>=(), operator<()
|
||||
*/
|
||||
*
|
||||
* Example: \include Cwise_less_equal.cpp
|
||||
* Output: \verbinclude Cwise_less_equal.out
|
||||
*
|
||||
* \sa all(), any(), operator>=(), operator<()
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_COMP_OP(operator<=, LE)
|
||||
|
||||
/** \returns an expression of the coefficient-wise \> operator of *this and \a other
|
||||
*
|
||||
* Example: \include Cwise_greater.cpp
|
||||
* Output: \verbinclude Cwise_greater.out
|
||||
*
|
||||
* \sa all(), any(), operator>=(), operator<()
|
||||
*/
|
||||
*
|
||||
* Example: \include Cwise_greater.cpp
|
||||
* Output: \verbinclude Cwise_greater.out
|
||||
*
|
||||
* \sa all(), any(), operator>=(), operator<()
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_COMP_R_OP(operator>, operator<, LT)
|
||||
|
||||
/** \returns an expression of the coefficient-wise \>= operator of *this and \a other
|
||||
*
|
||||
* Example: \include Cwise_greater_equal.cpp
|
||||
* Output: \verbinclude Cwise_greater_equal.out
|
||||
*
|
||||
* \sa all(), any(), operator>(), operator<=()
|
||||
*/
|
||||
*
|
||||
* Example: \include Cwise_greater_equal.cpp
|
||||
* Output: \verbinclude Cwise_greater_equal.out
|
||||
*
|
||||
* \sa all(), any(), operator>(), operator<=()
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_COMP_R_OP(operator>=, operator<=, LE)
|
||||
|
||||
/** \returns an expression of the coefficient-wise == operator of *this and \a other
|
||||
*
|
||||
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
||||
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
||||
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
||||
* isMuchSmallerThan().
|
||||
*
|
||||
* Example: \include Cwise_equal_equal.cpp
|
||||
* Output: \verbinclude Cwise_equal_equal.out
|
||||
*
|
||||
* \sa all(), any(), isApprox(), isMuchSmallerThan()
|
||||
*/
|
||||
*
|
||||
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
||||
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
||||
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
||||
* isMuchSmallerThan().
|
||||
*
|
||||
* Example: \include Cwise_equal_equal.cpp
|
||||
* Output: \verbinclude Cwise_equal_equal.out
|
||||
*
|
||||
* \sa all(), any(), isApprox(), isMuchSmallerThan()
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_COMP_OP(operator==, EQ)
|
||||
|
||||
/** \returns an expression of the coefficient-wise != operator of *this and \a other
|
||||
*
|
||||
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
||||
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
||||
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
||||
* isMuchSmallerThan().
|
||||
*
|
||||
* Example: \include Cwise_not_equal.cpp
|
||||
* Output: \verbinclude Cwise_not_equal.out
|
||||
*
|
||||
* \sa all(), any(), isApprox(), isMuchSmallerThan()
|
||||
*/
|
||||
*
|
||||
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
||||
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
||||
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
||||
* isMuchSmallerThan().
|
||||
*
|
||||
* Example: \include Cwise_not_equal.cpp
|
||||
* Output: \verbinclude Cwise_not_equal.out
|
||||
*
|
||||
* \sa all(), any(), isApprox(), isMuchSmallerThan()
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_COMP_OP(operator!=, NEQ)
|
||||
|
||||
|
||||
#undef EIGEN_MAKE_CWISE_COMP_OP
|
||||
#undef EIGEN_MAKE_CWISE_COMP_R_OP
|
||||
|
||||
// scalar addition
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
EIGEN_MAKE_SCALAR_BINARY_OP(operator+,sum)
|
||||
EIGEN_MAKE_SCALAR_BINARY_OP(operator+, sum)
|
||||
#else
|
||||
/** \returns an expression of \c *this with each coeff incremented by the constant \a scalar
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*
|
||||
* Example: \include Cwise_plus.cpp
|
||||
* Output: \verbinclude Cwise_plus.out
|
||||
*
|
||||
* \sa operator+=(), operator-()
|
||||
*/
|
||||
template<typename T>
|
||||
const CwiseBinaryOp<internal::scalar_sum_op<Scalar,T>,Derived,Constant<T> > operator+(const T& scalar) const;
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*
|
||||
* Example: \include Cwise_plus.cpp
|
||||
* Output: \verbinclude Cwise_plus.out
|
||||
*
|
||||
* \sa operator+=(), operator-()
|
||||
*/
|
||||
template <typename T>
|
||||
const CwiseBinaryOp<internal::scalar_sum_op<Scalar, T>, Derived, Constant<T> > operator+(const T &scalar) const;
|
||||
/** \returns an expression of \a expr with each coeff incremented by the constant \a scalar
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*/
|
||||
template<typename T> friend
|
||||
const CwiseBinaryOp<internal::scalar_sum_op<T,Scalar>,Constant<T>,Derived> operator+(const T& scalar, const StorageBaseType& expr);
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*/
|
||||
template <typename T>
|
||||
friend const CwiseBinaryOp<internal::scalar_sum_op<T, Scalar>, Constant<T>, Derived> operator+(
|
||||
const T &scalar, const StorageBaseType &expr);
|
||||
#endif
|
||||
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
EIGEN_MAKE_SCALAR_BINARY_OP(operator-,difference)
|
||||
EIGEN_MAKE_SCALAR_BINARY_OP(operator-, difference)
|
||||
#else
|
||||
/** \returns an expression of \c *this with each coeff decremented by the constant \a scalar
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*
|
||||
* Example: \include Cwise_minus.cpp
|
||||
* Output: \verbinclude Cwise_minus.out
|
||||
*
|
||||
* \sa operator+=(), operator-()
|
||||
*/
|
||||
template<typename T>
|
||||
const CwiseBinaryOp<internal::scalar_difference_op<Scalar,T>,Derived,Constant<T> > operator-(const T& scalar) const;
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*
|
||||
* Example: \include Cwise_minus.cpp
|
||||
* Output: \verbinclude Cwise_minus.out
|
||||
*
|
||||
* \sa operator+=(), operator-()
|
||||
*/
|
||||
template <typename T>
|
||||
const CwiseBinaryOp<internal::scalar_difference_op<Scalar, T>, Derived, Constant<T> > operator-(const T &scalar) const;
|
||||
/** \returns an expression of the constant matrix of value \a scalar decremented by the coefficients of \a expr
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*/
|
||||
template<typename T> friend
|
||||
const CwiseBinaryOp<internal::scalar_difference_op<T,Scalar>,Constant<T>,Derived> operator-(const T& scalar, const StorageBaseType& expr);
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*/
|
||||
template <typename T>
|
||||
friend const CwiseBinaryOp<internal::scalar_difference_op<T, Scalar>, Constant<T>, Derived> operator-(
|
||||
const T &scalar, const StorageBaseType &expr);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(operator/,quotient)
|
||||
EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(operator/, quotient)
|
||||
#else
|
||||
/**
|
||||
* \brief Component-wise division of the scalar \a s by array elements of \a a.
|
||||
*
|
||||
* \tparam Scalar is the scalar type of \a x. It must be compatible with the scalar type of the given array expression (\c Derived::Scalar).
|
||||
*/
|
||||
template<typename T> friend
|
||||
inline const CwiseBinaryOp<internal::scalar_quotient_op<T,Scalar>,Constant<T>,Derived>
|
||||
operator/(const T& s,const StorageBaseType& a);
|
||||
/**
|
||||
* \brief Component-wise division of the scalar \a s by array elements of \a a.
|
||||
*
|
||||
* \tparam Scalar is the scalar type of \a x. It must be compatible with the scalar type of the given array expression
|
||||
* (\c Derived::Scalar).
|
||||
*/
|
||||
template <typename T>
|
||||
friend inline const CwiseBinaryOp<internal::scalar_quotient_op<T, Scalar>, Constant<T>, Derived> operator/(
|
||||
const T &s, const StorageBaseType &a);
|
||||
#endif
|
||||
|
||||
// NOTE disabled until we agree on argument order
|
||||
@@ -328,24 +325,23 @@ polygamma(const EIGEN_CURRENT_STORAGE_BASE_CLASS<DerivedN> &n) const
|
||||
#endif
|
||||
|
||||
/** \returns an expression of the coefficient-wise zeta function.
|
||||
*
|
||||
* \specialfunctions_module
|
||||
*
|
||||
* It returns the Riemann zeta function of two arguments \c *this and \a q:
|
||||
*
|
||||
* \param q is the shift, it must be > 0
|
||||
*
|
||||
* \note *this is the exponent, it must be > 1.
|
||||
* \note This function supports only float and double scalar types. To support other scalar types, the user has
|
||||
* to provide implementations of zeta(T,T) for any scalar type T to be supported.
|
||||
*
|
||||
* This method is an alias for zeta(*this,q);
|
||||
*
|
||||
* \sa Eigen::zeta()
|
||||
*/
|
||||
template<typename DerivedQ>
|
||||
inline const CwiseBinaryOp<internal::scalar_zeta_op<Scalar>, const Derived, const DerivedQ>
|
||||
zeta(const EIGEN_CURRENT_STORAGE_BASE_CLASS<DerivedQ> &q) const
|
||||
{
|
||||
*
|
||||
* \specialfunctions_module
|
||||
*
|
||||
* It returns the Riemann zeta function of two arguments \c *this and \a q:
|
||||
*
|
||||
* \param q is the shift, it must be > 0
|
||||
*
|
||||
* \note *this is the exponent, it must be > 1.
|
||||
* \note This function supports only float and double scalar types. To support other scalar types, the user has
|
||||
* to provide implementations of zeta(T,T) for any scalar type T to be supported.
|
||||
*
|
||||
* This method is an alias for zeta(*this,q);
|
||||
*
|
||||
* \sa Eigen::zeta()
|
||||
*/
|
||||
template <typename DerivedQ>
|
||||
inline const CwiseBinaryOp<internal::scalar_zeta_op<Scalar>, const Derived, const DerivedQ> zeta(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<DerivedQ> &q) const {
|
||||
return CwiseBinaryOp<internal::scalar_zeta_op<Scalar>, const Derived, const DerivedQ>(this->derived(), q.derived());
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -11,69 +11,65 @@
|
||||
// This file is a base class plugin containing common coefficient wise functions.
|
||||
|
||||
/** \returns an expression of the difference of \c *this and \a other
|
||||
*
|
||||
* \note If you want to subtract a given scalar from all coefficients, see Cwise::operator-().
|
||||
*
|
||||
* \sa class CwiseBinaryOp, operator-=()
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_BINARY_OP(operator-,difference)
|
||||
*
|
||||
* \note If you want to subtract a given scalar from all coefficients, see Cwise::operator-().
|
||||
*
|
||||
* \sa class CwiseBinaryOp, operator-=()
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_BINARY_OP(operator-, difference)
|
||||
|
||||
/** \returns an expression of the sum of \c *this and \a other
|
||||
*
|
||||
* \note If you want to add a given scalar to all coefficients, see Cwise::operator+().
|
||||
*
|
||||
* \sa class CwiseBinaryOp, operator+=()
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_BINARY_OP(operator+,sum)
|
||||
*
|
||||
* \note If you want to add a given scalar to all coefficients, see Cwise::operator+().
|
||||
*
|
||||
* \sa class CwiseBinaryOp, operator+=()
|
||||
*/
|
||||
EIGEN_MAKE_CWISE_BINARY_OP(operator+, sum)
|
||||
|
||||
/** \returns an expression of a custom coefficient-wise operator \a func of *this and \a other
|
||||
*
|
||||
* The template parameter \a CustomBinaryOp is the type of the functor
|
||||
* of the custom operator (see class CwiseBinaryOp for an example)
|
||||
*
|
||||
* Here is an example illustrating the use of custom functors:
|
||||
* \include class_CwiseBinaryOp.cpp
|
||||
* Output: \verbinclude class_CwiseBinaryOp.out
|
||||
*
|
||||
* \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
|
||||
{
|
||||
*
|
||||
* The template parameter \a CustomBinaryOp is the type of the functor
|
||||
* of the custom operator (see class CwiseBinaryOp for an example)
|
||||
*
|
||||
* Here is an example illustrating the use of custom functors:
|
||||
* \include class_CwiseBinaryOp.cpp
|
||||
* Output: \verbinclude class_CwiseBinaryOp.out
|
||||
*
|
||||
* \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 {
|
||||
return CwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived>(derived(), other.derived(), func);
|
||||
}
|
||||
|
||||
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
EIGEN_MAKE_SCALAR_BINARY_OP(operator*,product)
|
||||
EIGEN_MAKE_SCALAR_BINARY_OP(operator*, product)
|
||||
#else
|
||||
/** \returns an expression of \c *this scaled by the scalar factor \a scalar
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*/
|
||||
template<typename T>
|
||||
const CwiseBinaryOp<internal::scalar_product_op<Scalar,T>,Derived,Constant<T> > operator*(const T& scalar) const;
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*/
|
||||
template <typename T>
|
||||
const CwiseBinaryOp<internal::scalar_product_op<Scalar, T>, Derived, Constant<T> > operator*(const T& scalar) const;
|
||||
/** \returns an expression of \a expr scaled by the scalar factor \a scalar
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*/
|
||||
template<typename T> friend
|
||||
const CwiseBinaryOp<internal::scalar_product_op<T,Scalar>,Constant<T>,Derived> operator*(const T& scalar, const StorageBaseType& expr);
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*/
|
||||
template <typename T>
|
||||
friend const CwiseBinaryOp<internal::scalar_product_op<T, Scalar>, Constant<T>, Derived> operator*(
|
||||
const T& scalar, const StorageBaseType& expr);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(operator/,quotient)
|
||||
EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(operator/, quotient)
|
||||
#else
|
||||
/** \returns an expression of \c *this divided by the scalar value \a scalar
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*/
|
||||
template<typename T>
|
||||
const CwiseBinaryOp<internal::scalar_quotient_op<Scalar,T>,Derived,Constant<T> > operator/(const T& scalar) const;
|
||||
*
|
||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||
*/
|
||||
template <typename T>
|
||||
const CwiseBinaryOp<internal::scalar_quotient_op<Scalar, T>, Derived, Constant<T> > operator/(const T& scalar) const;
|
||||
#endif
|
||||
|
||||
/** \returns an expression of the coefficient-wise boolean \b and operator of \c *this and \a other
|
||||
|
||||
@@ -14,19 +14,16 @@
|
||||
|
||||
/** \internal the return type of conjugate() */
|
||||
typedef std::conditional_t<NumTraits<Scalar>::IsComplex,
|
||||
const CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, const Derived>,
|
||||
const Derived&
|
||||
> ConjugateReturnType;
|
||||
const CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, const Derived>, const Derived&>
|
||||
ConjugateReturnType;
|
||||
/** \internal the return type of real() const */
|
||||
typedef std::conditional_t<NumTraits<Scalar>::IsComplex,
|
||||
const CwiseUnaryOp<internal::scalar_real_op<Scalar>, const Derived>,
|
||||
const Derived&
|
||||
> RealReturnType;
|
||||
const CwiseUnaryOp<internal::scalar_real_op<Scalar>, const Derived>, const Derived&>
|
||||
RealReturnType;
|
||||
/** \internal the return type of real() */
|
||||
typedef std::conditional_t<NumTraits<Scalar>::IsComplex,
|
||||
CwiseUnaryView<internal::scalar_real_ref_op<Scalar>, Derived>,
|
||||
Derived&
|
||||
> NonConstRealReturnType;
|
||||
typedef std::conditional_t<NumTraits<Scalar>::IsComplex, CwiseUnaryView<internal::scalar_real_ref_op<Scalar>, Derived>,
|
||||
Derived&>
|
||||
NonConstRealReturnType;
|
||||
/** \internal the return type of imag() const */
|
||||
typedef CwiseUnaryOp<internal::scalar_imag_op<Scalar>, const Derived> ImagReturnType;
|
||||
/** \internal the return type of imag() */
|
||||
@@ -34,79 +31,65 @@ typedef CwiseUnaryView<internal::scalar_imag_ref_op<Scalar>, Derived> NonConstIm
|
||||
|
||||
typedef CwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const Derived> NegativeReturnType;
|
||||
|
||||
#endif // not EIGEN_PARSED_BY_DOXYGEN
|
||||
#endif // not EIGEN_PARSED_BY_DOXYGEN
|
||||
|
||||
/// \returns an expression of the opposite of \c *this
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(operator-,opposite)
|
||||
EIGEN_DOC_UNARY_ADDONS(operator-, opposite)
|
||||
///
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline const NegativeReturnType
|
||||
operator-() const { return NegativeReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC inline const NegativeReturnType operator-() const { return NegativeReturnType(derived()); }
|
||||
|
||||
|
||||
template<class NewType> struct CastXpr { typedef typename internal::cast_return_type<Derived,const CwiseUnaryOp<internal::core_cast_op<Scalar, NewType>, const Derived> >::type Type; };
|
||||
template <class NewType>
|
||||
struct CastXpr {
|
||||
typedef typename internal::cast_return_type<
|
||||
Derived, const CwiseUnaryOp<internal::core_cast_op<Scalar, NewType>, const Derived> >::type Type;
|
||||
};
|
||||
|
||||
/// \returns an expression of \c *this with the \a Scalar type casted to
|
||||
/// \a NewScalar.
|
||||
///
|
||||
/// The template parameter \a NewScalar is the type we are casting the scalars to.
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(cast,conversion function)
|
||||
EIGEN_DOC_UNARY_ADDONS(cast, conversion function)
|
||||
///
|
||||
/// \sa class CwiseUnaryOp
|
||||
///
|
||||
template<typename NewType>
|
||||
EIGEN_DEVICE_FUNC
|
||||
typename CastXpr<NewType>::Type
|
||||
cast() const
|
||||
{
|
||||
template <typename NewType>
|
||||
EIGEN_DEVICE_FUNC typename CastXpr<NewType>::Type cast() const {
|
||||
return typename CastXpr<NewType>::Type(derived());
|
||||
}
|
||||
|
||||
/// \returns an expression of the complex conjugate of \c *this.
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(conjugate,complex conjugate)
|
||||
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 inline ConjugateReturnType conjugate() const { return ConjugateReturnType(derived()); }
|
||||
|
||||
/// \returns an expression of the complex conjugate of \c *this if Cond==true, returns derived() otherwise.
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(conjugate,complex conjugate)
|
||||
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
|
||||
{
|
||||
typedef std::conditional_t<Cond,ConjugateReturnType,const Derived&> ReturnType;
|
||||
template <bool Cond>
|
||||
EIGEN_DEVICE_FUNC inline std::conditional_t<Cond, ConjugateReturnType, const Derived&> conjugateIf() const {
|
||||
typedef std::conditional_t<Cond, ConjugateReturnType, const Derived&> ReturnType;
|
||||
return ReturnType(derived());
|
||||
}
|
||||
|
||||
/// \returns a read-only expression of the real part of \c *this.
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(real,real part function)
|
||||
EIGEN_DOC_UNARY_ADDONS(real, real part function)
|
||||
///
|
||||
/// \sa imag()
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline RealReturnType
|
||||
real() const { return RealReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC 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)
|
||||
EIGEN_DOC_UNARY_ADDONS(imag, imaginary part function)
|
||||
///
|
||||
/// \sa real()
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline const ImagReturnType
|
||||
imag() const { return ImagReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC inline const ImagReturnType imag() const { return ImagReturnType(derived()); }
|
||||
|
||||
/// \brief Apply a unary operator coefficient-wise
|
||||
/// \param[in] func Functor implementing the unary operator
|
||||
@@ -125,15 +108,13 @@ imag() const { return ImagReturnType(derived()); }
|
||||
/// \include class_CwiseUnaryOp.cpp
|
||||
/// Output: \verbinclude class_CwiseUnaryOp.out
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(unaryExpr,unary function)
|
||||
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(const CustomUnaryOp& func = CustomUnaryOp()) const
|
||||
{
|
||||
template <typename CustomUnaryOp>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseUnaryOp<CustomUnaryOp, const Derived> unaryExpr(
|
||||
const CustomUnaryOp& func = CustomUnaryOp()) const {
|
||||
return CwiseUnaryOp<CustomUnaryOp, const Derived>(derived(), func);
|
||||
}
|
||||
|
||||
@@ -146,32 +127,26 @@ unaryExpr(const CustomUnaryOp& func = CustomUnaryOp()) const
|
||||
/// \include class_CwiseUnaryOp.cpp
|
||||
/// Output: \verbinclude class_CwiseUnaryOp.out
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(unaryViewExpr,unary function)
|
||||
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(const CustomViewOp& func = CustomViewOp()) const
|
||||
{
|
||||
template <typename CustomViewOp>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseUnaryView<CustomViewOp, const Derived> unaryViewExpr(
|
||||
const CustomViewOp& func = CustomViewOp()) const {
|
||||
return CwiseUnaryView<CustomViewOp, const Derived>(derived(), func);
|
||||
}
|
||||
|
||||
/// \returns a non const expression of the real part of \c *this.
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(real,real part function)
|
||||
EIGEN_DOC_UNARY_ADDONS(real, real part function)
|
||||
///
|
||||
/// \sa imag()
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline NonConstRealReturnType
|
||||
real() { return NonConstRealReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC 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)
|
||||
EIGEN_DOC_UNARY_ADDONS(imag, imaginary part function)
|
||||
///
|
||||
/// \sa real()
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline NonConstImagReturnType
|
||||
imag() { return NonConstImagReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC inline NonConstImagReturnType imag() { return NonConstImagReturnType(derived()); }
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
|
||||
#if !defined(EIGEN_PARSED_BY_DOXYGEN)
|
||||
|
||||
protected:
|
||||
@@ -44,9 +43,12 @@ inline IvcType<Indices> ivcSize(const Indices& indices) const {
|
||||
|
||||
// this helper class assumes internal::valid_indexed_view_overload<RowIndices, ColIndices>::value == true
|
||||
template <typename RowIndices, typename ColIndices,
|
||||
bool UseSymbolic = internal::traits<IndexedView<Derived, IvcRowType<RowIndices>, IvcColType<ColIndices>>>::ReturnAsScalar,
|
||||
bool UseBlock = internal::traits<IndexedView<Derived, IvcRowType<RowIndices>, IvcColType<ColIndices>>>::ReturnAsBlock,
|
||||
bool UseGeneric = internal::traits<IndexedView<Derived, IvcRowType<RowIndices>, IvcColType<ColIndices>>>::ReturnAsIndexedView>
|
||||
bool UseSymbolic =
|
||||
internal::traits<IndexedView<Derived, IvcRowType<RowIndices>, IvcColType<ColIndices>>>::ReturnAsScalar,
|
||||
bool UseBlock =
|
||||
internal::traits<IndexedView<Derived, IvcRowType<RowIndices>, IvcColType<ColIndices>>>::ReturnAsBlock,
|
||||
bool UseGeneric = internal::traits<
|
||||
IndexedView<Derived, IvcRowType<RowIndices>, IvcColType<ColIndices>>>::ReturnAsIndexedView>
|
||||
struct IndexedViewSelector;
|
||||
|
||||
// Generic
|
||||
@@ -105,8 +107,7 @@ struct IndexedViewSelector<RowIndices, ColIndices, true, false, false> {
|
||||
};
|
||||
|
||||
// this helper class assumes internal::is_valid_index_type<Indices>::value == false
|
||||
template <typename Indices,
|
||||
bool UseSymbolic = symbolic::is_symbolic<Indices>::value,
|
||||
template <typename Indices, bool UseSymbolic = symbolic::is_symbolic<Indices>::value,
|
||||
bool UseBlock = !UseSymbolic && internal::get_compile_time_incr<IvcType<Indices>>::value == 1,
|
||||
bool UseGeneric = !UseSymbolic && !UseBlock>
|
||||
struct VectorIndexedViewSelector;
|
||||
@@ -114,7 +115,6 @@ struct VectorIndexedViewSelector;
|
||||
// Generic
|
||||
template <typename Indices>
|
||||
struct VectorIndexedViewSelector<Indices, false, false, true> {
|
||||
|
||||
static constexpr bool IsRowMajor = DenseBase<Derived>::IsRowMajor;
|
||||
|
||||
using RowMajorReturnType = IndexedView<Derived, IvcIndex, IvcType<Indices>>;
|
||||
@@ -148,7 +148,6 @@ struct VectorIndexedViewSelector<Indices, false, false, true> {
|
||||
// Block
|
||||
template <typename Indices>
|
||||
struct VectorIndexedViewSelector<Indices, false, true, false> {
|
||||
|
||||
using ReturnType = VectorBlock<Derived, internal::array_size<Indices>::value>;
|
||||
using ConstReturnType = VectorBlock<const Derived, internal::array_size<Indices>::value>;
|
||||
|
||||
@@ -165,7 +164,6 @@ struct VectorIndexedViewSelector<Indices, false, true, false> {
|
||||
// Symbolic
|
||||
template <typename Indices>
|
||||
struct VectorIndexedViewSelector<Indices, true, false, false> {
|
||||
|
||||
using ReturnType = typename DenseBase<Derived>::Scalar&;
|
||||
using ConstReturnType = typename DenseBase<Derived>::CoeffReturnType;
|
||||
|
||||
@@ -195,7 +193,6 @@ template <typename Indices>
|
||||
using EnableConstVectorOverload = std::enable_if_t<!internal::is_valid_index_type<Indices>::value, bool>;
|
||||
|
||||
public:
|
||||
|
||||
// Public API for 2D matrices/arrays
|
||||
|
||||
// non-const versions
|
||||
@@ -299,52 +296,56 @@ ConstVectorIndexedViewType<Indices> operator()(const IndexType (&indices)[Size])
|
||||
return VectorIndexedViewSelector<Indices>::run(derived(), Indices{indices});
|
||||
}
|
||||
|
||||
#else // EIGEN_PARSED_BY_DOXYGEN
|
||||
#else // EIGEN_PARSED_BY_DOXYGEN
|
||||
|
||||
/**
|
||||
* \returns a generic submatrix view defined by the rows and columns indexed \a rowIndices and \a colIndices respectively.
|
||||
*
|
||||
* Each parameter must either be:
|
||||
* - An integer indexing a single row or column
|
||||
* - Eigen::placeholders::all indexing the full set of respective rows or columns in increasing order
|
||||
* - An ArithmeticSequence as returned by the Eigen::seq and Eigen::seqN functions
|
||||
* - Any %Eigen's vector/array of integers or expressions
|
||||
* - Plain C arrays: \c int[N]
|
||||
* - And more generally any type exposing the following two member functions:
|
||||
* \code
|
||||
* <integral type> operator[](<integral type>) const;
|
||||
* <integral type> size() const;
|
||||
* \endcode
|
||||
* where \c <integral \c type> stands for any integer type compatible with Eigen::Index (i.e. \c std::ptrdiff_t).
|
||||
*
|
||||
* The last statement implies compatibility with \c std::vector, \c std::valarray, \c std::array, many of the Range-v3's ranges, etc.
|
||||
*
|
||||
* If the submatrix can be represented using a starting position \c (i,j) and positive sizes \c (rows,columns), then this
|
||||
* method will returns a Block object after extraction of the relevant information from the passed arguments. This is the case
|
||||
* when all arguments are either:
|
||||
* - An integer
|
||||
* - Eigen::placeholders::all
|
||||
* - An ArithmeticSequence with compile-time increment strictly equal to 1, as returned by Eigen::seq(a,b), and Eigen::seqN(a,N).
|
||||
*
|
||||
* Otherwise a more general IndexedView<Derived,RowIndices',ColIndices'> object will be returned, after conversion of the inputs
|
||||
* to more suitable types \c RowIndices' and \c ColIndices'.
|
||||
*
|
||||
* For 1D vectors and arrays, you better use the operator()(const Indices&) overload, which behave the same way but taking a single parameter.
|
||||
*
|
||||
* See also this <a href="https://stackoverflow.com/questions/46110917/eigen-replicate-items-along-one-dimension-without-useless-allocations">question</a> and its answer for an example of how to duplicate coefficients.
|
||||
*
|
||||
* \sa operator()(const Indices&), class Block, class IndexedView, DenseBase::block(Index,Index,Index,Index)
|
||||
*/
|
||||
template<typename RowIndices, typename ColIndices>
|
||||
IndexedView_or_Block
|
||||
operator()(const RowIndices& rowIndices, const ColIndices& colIndices);
|
||||
* \returns a generic submatrix view defined by the rows and columns indexed \a rowIndices and \a colIndices
|
||||
* respectively.
|
||||
*
|
||||
* Each parameter must either be:
|
||||
* - An integer indexing a single row or column
|
||||
* - Eigen::placeholders::all indexing the full set of respective rows or columns in increasing order
|
||||
* - An ArithmeticSequence as returned by the Eigen::seq and Eigen::seqN functions
|
||||
* - Any %Eigen's vector/array of integers or expressions
|
||||
* - Plain C arrays: \c int[N]
|
||||
* - And more generally any type exposing the following two member functions:
|
||||
* \code
|
||||
* <integral type> operator[](<integral type>) const;
|
||||
* <integral type> size() const;
|
||||
* \endcode
|
||||
* where \c <integral \c type> stands for any integer type compatible with Eigen::Index (i.e. \c std::ptrdiff_t).
|
||||
*
|
||||
* The last statement implies compatibility with \c std::vector, \c std::valarray, \c std::array, many of the Range-v3's
|
||||
* ranges, etc.
|
||||
*
|
||||
* If the submatrix can be represented using a starting position \c (i,j) and positive sizes \c (rows,columns), then
|
||||
* this method will returns a Block object after extraction of the relevant information from the passed arguments. This
|
||||
* is the case when all arguments are either:
|
||||
* - An integer
|
||||
* - Eigen::placeholders::all
|
||||
* - An ArithmeticSequence with compile-time increment strictly equal to 1, as returned by Eigen::seq(a,b), and
|
||||
* Eigen::seqN(a,N).
|
||||
*
|
||||
* Otherwise a more general IndexedView<Derived,RowIndices',ColIndices'> object will be returned, after conversion of
|
||||
* the inputs to more suitable types \c RowIndices' and \c ColIndices'.
|
||||
*
|
||||
* For 1D vectors and arrays, you better use the operator()(const Indices&) overload, which behave the same way but
|
||||
* taking a single parameter.
|
||||
*
|
||||
* See also this <a
|
||||
* href="https://stackoverflow.com/questions/46110917/eigen-replicate-items-along-one-dimension-without-useless-allocations">question</a>
|
||||
* and its answer for an example of how to duplicate coefficients.
|
||||
*
|
||||
* \sa operator()(const Indices&), class Block, class IndexedView, DenseBase::block(Index,Index,Index,Index)
|
||||
*/
|
||||
template <typename RowIndices, typename ColIndices>
|
||||
IndexedView_or_Block operator()(const RowIndices& rowIndices, const ColIndices& colIndices);
|
||||
|
||||
/** This is an overload of operator()(const RowIndices&, const ColIndices&) for 1D vectors or arrays
|
||||
*
|
||||
* \only_for_vectors
|
||||
*/
|
||||
template<typename Indices>
|
||||
IndexedView_or_VectorBlock
|
||||
operator()(const Indices& indices);
|
||||
*
|
||||
* \only_for_vectors
|
||||
*/
|
||||
template <typename Indices>
|
||||
IndexedView_or_VectorBlock operator()(const Indices& indices);
|
||||
|
||||
#endif // EIGEN_PARSED_BY_DOXYGEN
|
||||
|
||||
@@ -11,297 +11,321 @@
|
||||
// This file is a base class plugin containing matrix specifics coefficient wise functions.
|
||||
|
||||
/** \returns an expression of the Schur product (coefficient wise product) of *this and \a other
|
||||
*
|
||||
* Example: \include MatrixBase_cwiseProduct.cpp
|
||||
* Output: \verbinclude MatrixBase_cwiseProduct.out
|
||||
*
|
||||
* \sa class CwiseBinaryOp, cwiseAbs2
|
||||
*/
|
||||
template<typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC
|
||||
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());
|
||||
*
|
||||
* Example: \include MatrixBase_cwiseProduct.cpp
|
||||
* Output: \verbinclude MatrixBase_cwiseProduct.out
|
||||
*
|
||||
* \sa class CwiseBinaryOp, cwiseAbs2
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC 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());
|
||||
}
|
||||
|
||||
template<typename OtherDerived> using CwiseBinaryEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ>, const Derived, const OtherDerived>;
|
||||
template<typename OtherDerived> using CwiseBinaryNotEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ>, const Derived, const OtherDerived>;
|
||||
template<typename OtherDerived> using CwiseBinaryLessReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT>, const Derived, const OtherDerived>;
|
||||
template<typename OtherDerived> using CwiseBinaryGreaterReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT>, const Derived, const OtherDerived>;
|
||||
template<typename OtherDerived> using CwiseBinaryLessOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE>, const Derived, const OtherDerived>;
|
||||
template<typename OtherDerived> using CwiseBinaryGreaterOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE>, const Derived, const OtherDerived>;
|
||||
template <typename OtherDerived>
|
||||
using CwiseBinaryEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ>, const Derived, const OtherDerived>;
|
||||
template <typename OtherDerived>
|
||||
using CwiseBinaryNotEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ>, const Derived, const OtherDerived>;
|
||||
template <typename OtherDerived>
|
||||
using CwiseBinaryLessReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT>, const Derived, const OtherDerived>;
|
||||
template <typename OtherDerived>
|
||||
using CwiseBinaryGreaterReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT>, const Derived, const OtherDerived>;
|
||||
template <typename OtherDerived>
|
||||
using CwiseBinaryLessOrEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE>, const Derived, const OtherDerived>;
|
||||
template <typename OtherDerived>
|
||||
using CwiseBinaryGreaterOrEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE>, const Derived, const OtherDerived>;
|
||||
|
||||
/** \returns an expression of the coefficient-wise == operator of *this and \a other
|
||||
*
|
||||
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
||||
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
||||
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
||||
* isMuchSmallerThan().
|
||||
*
|
||||
* Example: \include MatrixBase_cwiseEqual.cpp
|
||||
* Output: \verbinclude MatrixBase_cwiseEqual.out
|
||||
*
|
||||
* \sa cwiseNotEqual(), isApprox(), isMuchSmallerThan()
|
||||
*/
|
||||
template<typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline const CwiseBinaryEqualReturnType<OtherDerived>
|
||||
cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
|
||||
{
|
||||
*
|
||||
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
||||
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
||||
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
||||
* isMuchSmallerThan().
|
||||
*
|
||||
* Example: \include MatrixBase_cwiseEqual.cpp
|
||||
* Output: \verbinclude MatrixBase_cwiseEqual.out
|
||||
*
|
||||
* \sa cwiseNotEqual(), isApprox(), isMuchSmallerThan()
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryEqualReturnType<OtherDerived> cwiseEqual(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryEqualReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise != operator of *this and \a other
|
||||
*
|
||||
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
||||
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
||||
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
||||
* isMuchSmallerThan().
|
||||
*
|
||||
* Example: \include MatrixBase_cwiseNotEqual.cpp
|
||||
* Output: \verbinclude MatrixBase_cwiseNotEqual.out
|
||||
*
|
||||
* \sa cwiseEqual(), isApprox(), isMuchSmallerThan()
|
||||
*/
|
||||
template<typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline const CwiseBinaryNotEqualReturnType<OtherDerived>
|
||||
cwiseNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
|
||||
{
|
||||
*
|
||||
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
||||
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
||||
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
||||
* isMuchSmallerThan().
|
||||
*
|
||||
* Example: \include MatrixBase_cwiseNotEqual.cpp
|
||||
* Output: \verbinclude MatrixBase_cwiseNotEqual.out
|
||||
*
|
||||
* \sa cwiseEqual(), isApprox(), isMuchSmallerThan()
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC 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(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const
|
||||
{
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC 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(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const
|
||||
{
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC 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(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const
|
||||
{
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC 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(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const
|
||||
{
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC inline const CwiseBinaryGreaterOrEqualReturnType<OtherDerived> cwiseGreaterOrEqual(
|
||||
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryGreaterOrEqualReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise min of *this and \a other
|
||||
*
|
||||
* Example: \include MatrixBase_cwiseMin.cpp
|
||||
* Output: \verbinclude MatrixBase_cwiseMin.out
|
||||
*
|
||||
* \sa class CwiseBinaryOp, max()
|
||||
*/
|
||||
template<int NaNPropagation=PropagateFast, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC
|
||||
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>(derived(), other.derived());
|
||||
*
|
||||
* Example: \include MatrixBase_cwiseMin.cpp
|
||||
* Output: \verbinclude MatrixBase_cwiseMin.out
|
||||
*
|
||||
* \sa class CwiseBinaryOp, max()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC 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>(
|
||||
derived(), other.derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise min of *this and scalar \a other
|
||||
*
|
||||
* \sa class CwiseBinaryOp, min()
|
||||
*/
|
||||
template<int NaNPropagation=PropagateFast>
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_min_op<Scalar,Scalar,NaNPropagation>, const Derived, const ConstantReturnType>
|
||||
cwiseMin(const Scalar &other) const
|
||||
{
|
||||
*
|
||||
* \sa class CwiseBinaryOp, min()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast>
|
||||
EIGEN_DEVICE_FUNC 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));
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise max of *this and \a other
|
||||
*
|
||||
* Example: \include MatrixBase_cwiseMax.cpp
|
||||
* Output: \verbinclude MatrixBase_cwiseMax.out
|
||||
*
|
||||
* \sa class CwiseBinaryOp, min()
|
||||
*/
|
||||
template<int NaNPropagation=PropagateFast, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC
|
||||
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>(derived(), other.derived());
|
||||
*
|
||||
* Example: \include MatrixBase_cwiseMax.cpp
|
||||
* Output: \verbinclude MatrixBase_cwiseMax.out
|
||||
*
|
||||
* \sa class CwiseBinaryOp, min()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast, typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC 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>(
|
||||
derived(), other.derived());
|
||||
}
|
||||
|
||||
/** \returns an expression of the coefficient-wise max of *this and scalar \a other
|
||||
*
|
||||
* \sa class CwiseBinaryOp, min()
|
||||
*/
|
||||
template<int NaNPropagation=PropagateFast>
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar,Scalar,NaNPropagation>, const Derived, const ConstantReturnType>
|
||||
cwiseMax(const Scalar &other) const
|
||||
{
|
||||
*
|
||||
* \sa class CwiseBinaryOp, min()
|
||||
*/
|
||||
template <int NaNPropagation = PropagateFast>
|
||||
EIGEN_DEVICE_FUNC 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));
|
||||
}
|
||||
|
||||
|
||||
/** \returns an expression of the coefficient-wise quotient of *this and \a other
|
||||
*
|
||||
* Example: \include MatrixBase_cwiseQuotient.cpp
|
||||
* Output: \verbinclude MatrixBase_cwiseQuotient.out
|
||||
*
|
||||
* \sa class CwiseBinaryOp, cwiseProduct(), cwiseInverse()
|
||||
*/
|
||||
template<typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC
|
||||
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(), other.derived());
|
||||
*
|
||||
* Example: \include MatrixBase_cwiseQuotient.cpp
|
||||
* Output: \verbinclude MatrixBase_cwiseQuotient.out
|
||||
*
|
||||
* \sa class CwiseBinaryOp, cwiseProduct(), cwiseInverse()
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC 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(),
|
||||
other.derived());
|
||||
}
|
||||
|
||||
using CwiseScalarEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar,Scalar,internal::cmp_EQ>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarNotEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarLessReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarGreaterReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarLessOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarGreaterOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarNotEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarLessReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarGreaterReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarLessOrEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarGreaterOrEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE>, const Derived, const ConstantReturnType>;
|
||||
|
||||
/** \returns an expression of the coefficient-wise == operator of \c *this and a scalar \a s
|
||||
*
|
||||
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
||||
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
||||
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
||||
* isMuchSmallerThan().
|
||||
*
|
||||
* \sa cwiseEqual(const MatrixBase<OtherDerived> &) const
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline const CwiseScalarEqualReturnType
|
||||
cwiseEqual(const Scalar& s) const
|
||||
{
|
||||
*
|
||||
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
||||
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
||||
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
||||
* isMuchSmallerThan().
|
||||
*
|
||||
* \sa cwiseEqual(const MatrixBase<OtherDerived> &) const
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC inline const CwiseScalarEqualReturnType cwiseEqual(const Scalar& s) const {
|
||||
return CwiseScalarEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
|
||||
}
|
||||
|
||||
|
||||
/** \returns an expression of the coefficient-wise == operator of \c *this and a scalar \a s
|
||||
*
|
||||
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
||||
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
||||
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
||||
* isMuchSmallerThan().
|
||||
*
|
||||
* \sa cwiseEqual(const MatrixBase<OtherDerived> &) const
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline const CwiseScalarNotEqualReturnType
|
||||
cwiseNotEqual(const Scalar& s) const
|
||||
{
|
||||
*
|
||||
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.
|
||||
* In order to check for equality between two vectors or matrices with floating-point coefficients, it is
|
||||
* generally a far better idea to use a fuzzy comparison as provided by isApprox() and
|
||||
* isMuchSmallerThan().
|
||||
*
|
||||
* \sa cwiseEqual(const MatrixBase<OtherDerived> &) const
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC 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 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 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 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 inline const CwiseScalarGreaterOrEqualReturnType cwiseGreaterOrEqual(const Scalar& s) const {
|
||||
return CwiseScalarGreaterOrEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
|
||||
}
|
||||
|
||||
template<typename OtherDerived> using CwiseBinaryTypedEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ, true>, const Derived, const OtherDerived>;
|
||||
template<typename OtherDerived> using CwiseBinaryTypedNotEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ, true>, const Derived, const OtherDerived>;
|
||||
template<typename OtherDerived> using CwiseBinaryTypedLessReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT, true>, const Derived, const OtherDerived>;
|
||||
template<typename OtherDerived> using CwiseBinaryTypedGreaterReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT, true>, const Derived, const OtherDerived>;
|
||||
template<typename OtherDerived> using CwiseBinaryTypedLessOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE, true>, const Derived, const OtherDerived>;
|
||||
template<typename OtherDerived> using CwiseBinaryTypedGreaterOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE, true>, const Derived, const OtherDerived>;
|
||||
template <typename OtherDerived>
|
||||
using CwiseBinaryTypedEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ, true>, const Derived, const OtherDerived>;
|
||||
template <typename OtherDerived>
|
||||
using CwiseBinaryTypedNotEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ, true>, const Derived, const OtherDerived>;
|
||||
template <typename OtherDerived>
|
||||
using CwiseBinaryTypedLessReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT, true>, const Derived, const OtherDerived>;
|
||||
template <typename OtherDerived>
|
||||
using CwiseBinaryTypedGreaterReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT, true>, const Derived, const OtherDerived>;
|
||||
template <typename OtherDerived>
|
||||
using CwiseBinaryTypedLessOrEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE, true>, const Derived, const OtherDerived>;
|
||||
template <typename OtherDerived>
|
||||
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(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const { return CwiseBinaryTypedEqualReturnType<OtherDerived>(derived(), other.derived()); }
|
||||
EIGEN_DEVICE_FUNC 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 { return CwiseBinaryTypedNotEqualReturnType<OtherDerived>(derived(), other.derived()); }
|
||||
EIGEN_DEVICE_FUNC 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(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const { return CwiseBinaryTypedLessReturnType<OtherDerived>(derived(), other.derived()); }
|
||||
EIGEN_DEVICE_FUNC 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(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const { return CwiseBinaryTypedGreaterReturnType<OtherDerived>(derived(), other.derived()); }
|
||||
EIGEN_DEVICE_FUNC 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 { return CwiseBinaryTypedLessOrEqualReturnType<OtherDerived>(derived(), other.derived()); }
|
||||
EIGEN_DEVICE_FUNC 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>
|
||||
cwiseTypedGreaterOrEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const { return CwiseBinaryTypedGreaterOrEqualReturnType<OtherDerived>(derived(), other.derived()); }
|
||||
cwiseTypedGreaterOrEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
|
||||
return CwiseBinaryTypedGreaterOrEqualReturnType<OtherDerived>(derived(), other.derived());
|
||||
}
|
||||
|
||||
using CwiseScalarTypedEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ, true>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarTypedNotEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ, true>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarTypedLessReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT, true>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarTypedGreaterReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT, true>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarTypedLessOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE, true>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarTypedGreaterOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE, true>, const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarTypedEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ, true>,
|
||||
const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarTypedNotEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ, true>, const Derived,
|
||||
const ConstantReturnType>;
|
||||
using CwiseScalarTypedLessReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT, true>,
|
||||
const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarTypedGreaterReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT, true>,
|
||||
const Derived, const ConstantReturnType>;
|
||||
using CwiseScalarTypedLessOrEqualReturnType =
|
||||
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE, true>, const Derived,
|
||||
const ConstantReturnType>;
|
||||
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 { return CwiseScalarTypedEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s)); }
|
||||
EIGEN_DEVICE_FUNC 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
|
||||
cwiseTypedNotEqual(const Scalar& s) const { return CwiseScalarTypedNotEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s)); }
|
||||
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 { return CwiseScalarTypedLessReturnType(derived(), ConstantReturnType(rows(), cols(), s)); }
|
||||
EIGEN_DEVICE_FUNC 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 { return CwiseScalarTypedGreaterReturnType(derived(), ConstantReturnType(rows(), cols(), s)); }
|
||||
EIGEN_DEVICE_FUNC 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
|
||||
cwiseTypedLessOrEqual(const Scalar& s) const { return CwiseScalarTypedLessOrEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s)); }
|
||||
cwiseTypedLessOrEqual(const Scalar& s) const {
|
||||
return CwiseScalarTypedLessOrEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s));
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedGreaterOrEqualReturnType
|
||||
cwiseTypedGreaterOrEqual(const Scalar& s) const { return CwiseScalarTypedGreaterOrEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s)); }
|
||||
cwiseTypedGreaterOrEqual(const Scalar& s) const {
|
||||
return CwiseScalarTypedGreaterOrEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s));
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
// This file is included into the body of the base classes supporting matrix specific coefficient-wise functions.
|
||||
// This include MatrixBase and SparseMatrixBase.
|
||||
|
||||
|
||||
typedef CwiseUnaryOp<internal::scalar_abs_op<Scalar>, const Derived> CwiseAbsReturnType;
|
||||
typedef CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const Derived> CwiseAbs2ReturnType;
|
||||
typedef CwiseUnaryOp<internal::scalar_arg_op<Scalar>, const Derived> CwiseArgReturnType;
|
||||
@@ -26,92 +25,81 @@ typedef CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const Derived> CwiseIn
|
||||
/// Example: \include MatrixBase_cwiseAbs.cpp
|
||||
/// Output: \verbinclude MatrixBase_cwiseAbs.out
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseAbs,absolute value)
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseAbs, absolute value)
|
||||
///
|
||||
/// \sa cwiseAbs2()
|
||||
///
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const CwiseAbsReturnType
|
||||
cwiseAbs() const { return CwiseAbsReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbsReturnType cwiseAbs() const {
|
||||
return CwiseAbsReturnType(derived());
|
||||
}
|
||||
|
||||
/// \returns an expression of the coefficient-wise squared absolute value of \c *this
|
||||
///
|
||||
/// Example: \include MatrixBase_cwiseAbs2.cpp
|
||||
/// Output: \verbinclude MatrixBase_cwiseAbs2.out
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseAbs2,squared absolute value)
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseAbs2, squared absolute value)
|
||||
///
|
||||
/// \sa cwiseAbs()
|
||||
///
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const CwiseAbs2ReturnType
|
||||
cwiseAbs2() const { return CwiseAbs2ReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbs2ReturnType cwiseAbs2() const {
|
||||
return CwiseAbs2ReturnType(derived());
|
||||
}
|
||||
|
||||
/// \returns an expression of the coefficient-wise square root of *this.
|
||||
///
|
||||
/// Example: \include MatrixBase_cwiseSqrt.cpp
|
||||
/// Output: \verbinclude MatrixBase_cwiseSqrt.out
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseSqrt,square-root)
|
||||
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 inline const CwiseSqrtReturnType cwiseSqrt() const { return CwiseSqrtReturnType(derived()); }
|
||||
|
||||
/// \returns an expression of the coefficient-wise cube root of *this.
|
||||
///
|
||||
/// Example: \include MatrixBase_cwiseCbrt.cpp
|
||||
/// Output: \verbinclude MatrixBase_cwiseCbrt.out
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseCbrt,cube-root)
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseCbrt, cube - root)
|
||||
///
|
||||
/// \sa cwiseSqrt(), cwiseSquare(), cwisePow()
|
||||
///
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline const CwiseCbrtReturnType
|
||||
cwiseCbrt() const { return CwiseSCbrtReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC inline const CwiseCbrtReturnType cwiseCbrt() const { return CwiseSCbrtReturnType(derived()); }
|
||||
|
||||
/// \returns an expression of the coefficient-wise signum of *this.
|
||||
///
|
||||
/// Example: \include MatrixBase_cwiseSign.cpp
|
||||
/// Output: \verbinclude MatrixBase_cwiseSign.out
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseSign,sign function)
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseSign, sign function)
|
||||
///
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline const CwiseSignReturnType
|
||||
cwiseSign() const { return CwiseSignReturnType(derived()); }
|
||||
|
||||
EIGEN_DEVICE_FUNC inline const CwiseSignReturnType cwiseSign() const { return CwiseSignReturnType(derived()); }
|
||||
|
||||
/// \returns an expression of the coefficient-wise inverse of *this.
|
||||
///
|
||||
/// Example: \include MatrixBase_cwiseInverse.cpp
|
||||
/// Output: \verbinclude MatrixBase_cwiseInverse.out
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseInverse,inverse)
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseInverse, inverse)
|
||||
///
|
||||
/// \sa cwiseProduct()
|
||||
///
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline const CwiseInverseReturnType
|
||||
cwiseInverse() const { return CwiseInverseReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC inline const CwiseInverseReturnType cwiseInverse() const { return CwiseInverseReturnType(derived()); }
|
||||
|
||||
/// \returns an expression of the coefficient-wise phase angle of \c *this
|
||||
///
|
||||
/// Example: \include MatrixBase_cwiseArg.cpp
|
||||
/// Output: \verbinclude MatrixBase_cwiseArg.out
|
||||
///
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseArg,arg)
|
||||
EIGEN_DOC_UNARY_ADDONS(cwiseArg, arg)
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline const CwiseArgReturnType
|
||||
cwiseArg() const { return CwiseArgReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC inline const CwiseArgReturnType cwiseArg() const { return CwiseArgReturnType(derived()); }
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const CwiseCArgReturnType
|
||||
cwiseCArg() const { return CwiseCArgReturnType(derived()); }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseCArgReturnType cwiseCArg() const {
|
||||
return CwiseCArgReturnType(derived());
|
||||
}
|
||||
|
||||
template <typename ScalarExponent>
|
||||
using CwisePowReturnType =
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
|
||||
/// \returns an expression of \c *this with reshaped sizes.
|
||||
///
|
||||
/// \param nRows the number of rows in the reshaped expression, specified at either run-time or compile-time, or AutoSize
|
||||
/// \param nCols the number of columns in the reshaped expression, specified at either run-time or compile-time, or AutoSize
|
||||
/// \tparam Order specifies whether the coefficients should be processed in column-major-order (ColMajor), in row-major-order (RowMajor),
|
||||
/// \param nRows the number of rows in the reshaped expression, specified at either run-time or compile-time, or
|
||||
/// AutoSize \param nCols the number of columns in the reshaped expression, specified at either run-time or
|
||||
/// compile-time, or AutoSize \tparam Order specifies whether the coefficients should be processed in column-major-order
|
||||
/// (ColMajor), in row-major-order (RowMajor),
|
||||
/// or follows the \em natural order of the nested expression (AutoOrder). The default is ColMajor.
|
||||
/// \tparam NRowsType the type of the value handling the number of rows, typically Index.
|
||||
/// \tparam NColsType the type of the value handling the number of columns, typically Index.
|
||||
@@ -14,40 +15,36 @@
|
||||
/// Output: \verbinclude MatrixBase_reshaped_int_int.out
|
||||
///
|
||||
/// The number of rows \a nRows and columns \a nCols can also be specified at compile-time by passing Eigen::fix<N>,
|
||||
/// or Eigen::fix<N>(n) as arguments. In the later case, \c n plays the role of a runtime fallback value in case \c N equals Eigen::Dynamic.
|
||||
/// Here is an example with a fixed number of rows and columns:
|
||||
/// \include MatrixBase_reshaped_fixed.cpp
|
||||
/// Output: \verbinclude MatrixBase_reshaped_fixed.out
|
||||
/// or Eigen::fix<N>(n) as arguments. In the later case, \c n plays the role of a runtime fallback value in case \c N
|
||||
/// equals Eigen::Dynamic. Here is an example with a fixed number of rows and columns: \include
|
||||
/// MatrixBase_reshaped_fixed.cpp Output: \verbinclude MatrixBase_reshaped_fixed.out
|
||||
///
|
||||
/// Finally, one of the sizes parameter can be automatically deduced from the other one by passing AutoSize as in the following example:
|
||||
/// \include MatrixBase_reshaped_auto.cpp
|
||||
/// Output: \verbinclude MatrixBase_reshaped_auto.out
|
||||
/// AutoSize does preserve compile-time sizes when possible, i.e., when the sizes of the input are known at compile time \b and
|
||||
/// Finally, one of the sizes parameter can be automatically deduced from the other one by passing AutoSize as in the
|
||||
/// following example: \include MatrixBase_reshaped_auto.cpp Output: \verbinclude MatrixBase_reshaped_auto.out AutoSize
|
||||
/// does preserve compile-time sizes when possible, i.e., when the sizes of the input are known at compile time \b and
|
||||
/// that the other size is passed at compile-time using Eigen::fix<N> as above.
|
||||
///
|
||||
/// \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);
|
||||
template <int Order = ColMajor, typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC 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;
|
||||
template <int Order = ColMajor, typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC 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
|
||||
///
|
||||
/// \tparam Order specifies whether the coefficients should be processed in column-major-order (ColMajor), in row-major-order (RowMajor),
|
||||
/// \tparam Order specifies whether the coefficients should be processed in column-major-order (ColMajor), in
|
||||
/// row-major-order (RowMajor),
|
||||
/// or follows the \em natural order of the nested expression (AutoOrder). The default is ColMajor.
|
||||
///
|
||||
/// This overloads is essentially a shortcut for `A.reshaped<Order>(AutoSize,fix<1>)`.
|
||||
///
|
||||
/// - If `Order==ColMajor` (the default), then it returns a column-vector from the stacked columns of \c *this.
|
||||
/// - If `Order==RowMajor`, then it returns a column-vector from the stacked rows of \c *this.
|
||||
/// - If `Order==AutoOrder`, then it returns a column-vector with elements stacked following the storage order of \c *this.
|
||||
/// - If `Order==AutoOrder`, then it returns a column-vector with elements stacked following the storage order of \c
|
||||
/// *this.
|
||||
/// This mode is the recommended one when the particular ordering of the element is not relevant.
|
||||
///
|
||||
/// Example:
|
||||
@@ -58,16 +55,12 @@ reshaped(NRowsType nRows, NColsType nCols) const;
|
||||
///
|
||||
/// \sa reshaped(NRowsType,NColsType), class Reshaped
|
||||
///
|
||||
template<int Order = ColMajor>
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline Reshaped<Derived,...>
|
||||
reshaped();
|
||||
template <int Order = ColMajor>
|
||||
EIGEN_DEVICE_FUNC 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;
|
||||
template <int Order = ColMajor>
|
||||
EIGEN_DEVICE_FUNC inline const Reshaped<const Derived, ...> reshaped() const;
|
||||
|
||||
#else
|
||||
|
||||
@@ -85,57 +78,48 @@ reshaped() const;
|
||||
|
||||
#endif
|
||||
|
||||
template<typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC
|
||||
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>
|
||||
reshaped(NRowsType nRows, NColsType nCols) EIGEN_RESHAPED_METHOD_CONST
|
||||
{
|
||||
template <typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC 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>
|
||||
reshaped(NRowsType nRows, NColsType nCols) EIGEN_RESHAPED_METHOD_CONST {
|
||||
return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,
|
||||
internal::get_compiletime_reshape_size<NRowsType,NColsType,SizeAtCompileTime>::value,
|
||||
internal::get_compiletime_reshape_size<NColsType,NRowsType,SizeAtCompileTime>::value>
|
||||
(derived(),
|
||||
internal::get_runtime_reshape_size(nRows,internal::get_runtime_value(nCols),size()),
|
||||
internal::get_runtime_reshape_size(nCols,internal::get_runtime_value(nRows),size()));
|
||||
internal::get_compiletime_reshape_size<NRowsType, NColsType, SizeAtCompileTime>::value,
|
||||
internal::get_compiletime_reshape_size<NColsType, NRowsType, SizeAtCompileTime>::value>(
|
||||
derived(), internal::get_runtime_reshape_size(nRows, internal::get_runtime_value(nCols), size()),
|
||||
internal::get_runtime_reshape_size(nCols, internal::get_runtime_value(nRows), size()));
|
||||
}
|
||||
|
||||
template<int Order, typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC
|
||||
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,
|
||||
internal::get_compiletime_reshape_order(Flags, Order)>
|
||||
reshaped(NRowsType nRows, NColsType nCols) EIGEN_RESHAPED_METHOD_CONST
|
||||
{
|
||||
template <int Order, typename NRowsType, typename NColsType>
|
||||
EIGEN_DEVICE_FUNC 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,
|
||||
internal::get_compiletime_reshape_order(Flags, Order)>
|
||||
reshaped(NRowsType nRows, NColsType nCols) EIGEN_RESHAPED_METHOD_CONST {
|
||||
return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,
|
||||
internal::get_compiletime_reshape_size<NRowsType,NColsType,SizeAtCompileTime>::value,
|
||||
internal::get_compiletime_reshape_size<NColsType,NRowsType,SizeAtCompileTime>::value,
|
||||
internal::get_compiletime_reshape_order(Flags, Order)>
|
||||
(derived(),
|
||||
internal::get_runtime_reshape_size(nRows,internal::get_runtime_value(nCols),size()),
|
||||
internal::get_runtime_reshape_size(nCols,internal::get_runtime_value(nRows),size()));
|
||||
internal::get_compiletime_reshape_size<NRowsType, NColsType, SizeAtCompileTime>::value,
|
||||
internal::get_compiletime_reshape_size<NColsType, NRowsType, SizeAtCompileTime>::value,
|
||||
internal::get_compiletime_reshape_order(Flags, Order)>(
|
||||
derived(), internal::get_runtime_reshape_size(nRows, internal::get_runtime_value(nCols), size()),
|
||||
internal::get_runtime_reshape_size(nCols, internal::get_runtime_value(nRows), size()));
|
||||
}
|
||||
|
||||
// Views as linear vectors
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
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);
|
||||
EIGEN_DEVICE_FUNC 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)>
|
||||
reshaped() EIGEN_RESHAPED_METHOD_CONST
|
||||
{
|
||||
EIGEN_STATIC_ASSERT(Order==RowMajor || Order==ColMajor || Order==AutoOrder, INVALID_TEMPLATE_PARAMETER);
|
||||
template <int Order>
|
||||
EIGEN_DEVICE_FUNC 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,
|
||||
internal::get_compiletime_reshape_order(Flags, Order)>
|
||||
(derived(), size(), 1);
|
||||
internal::get_compiletime_reshape_order(Flags, Order)>(derived(), size(), 1);
|
||||
}
|
||||
|
||||
#undef EIGEN_RESHAPED_METHOD_CONST
|
||||
@@ -146,4 +130,4 @@ reshaped() EIGEN_RESHAPED_METHOD_CONST
|
||||
#undef EIGEN_RESHAPED_METHOD_2ND_PASS
|
||||
#endif
|
||||
|
||||
#endif // EIGEN_PARSED_BY_DOXYGEN
|
||||
#endif // EIGEN_PARSED_BY_DOXYGEN
|
||||
|
||||
Reference in New Issue
Block a user