Add absolute_difference coefficient-wise binary Array function

This commit is contained in:
Joel Holdsworth
2020-03-19 17:45:20 +00:00
committed by Rasmus Munk Larsen
parent 6ff5a14091
commit d5c665742b
8 changed files with 143 additions and 0 deletions

View File

@@ -75,6 +75,32 @@ max
return (max)(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)
/** \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> >
#ifdef EIGEN_PARSED_BY_DOXYGEN
absolute_difference
#else
(absolute_difference)
#endif
(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.