mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-09 22:51:51 +08:00
fix compilation with m.array().min/max(scalar)
This commit is contained in:
parent
28528519e9
commit
0c584dcf4d
@ -33,7 +33,8 @@ EIGEN_MAKE_CWISE_BINARY_OP(min,internal::scalar_min_op)
|
|||||||
*
|
*
|
||||||
* \sa max()
|
* \sa max()
|
||||||
*/
|
*/
|
||||||
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_min_op<Scalar>, const Derived, const ConstantReturnType>
|
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_min_op<Scalar>, const Derived,
|
||||||
|
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
|
||||||
(min)(const Scalar &other) const
|
(min)(const Scalar &other) const
|
||||||
{
|
{
|
||||||
return (min)(Derived::PlainObject::Constant(rows(), cols(), other));
|
return (min)(Derived::PlainObject::Constant(rows(), cols(), other));
|
||||||
@ -52,7 +53,8 @@ EIGEN_MAKE_CWISE_BINARY_OP(max,internal::scalar_max_op)
|
|||||||
*
|
*
|
||||||
* \sa min()
|
* \sa min()
|
||||||
*/
|
*/
|
||||||
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar>, const Derived, const ConstantReturnType>
|
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar>, const Derived,
|
||||||
|
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
|
||||||
(max)(const Scalar &other) const
|
(max)(const Scalar &other) const
|
||||||
{
|
{
|
||||||
return (max)(Derived::PlainObject::Constant(rows(), cols(), other));
|
return (max)(Derived::PlainObject::Constant(rows(), cols(), other));
|
||||||
|
@ -200,3 +200,4 @@ EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator<=, std::less_equal)
|
|||||||
EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator>, std::greater)
|
EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator>, std::greater)
|
||||||
EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator>=, std::greater_equal)
|
EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator>=, std::greater_equal)
|
||||||
|
|
||||||
|
|
||||||
|
@ -168,6 +168,12 @@ template<typename MatrixType> void cwise_min_max(const MatrixType& m)
|
|||||||
VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1), m1.cwiseMax( maxM1));
|
VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1), m1.cwiseMax( maxM1));
|
||||||
VERIFY_IS_APPROX(m1, m1.cwiseMax( minM1));
|
VERIFY_IS_APPROX(m1, m1.cwiseMax( minM1));
|
||||||
|
|
||||||
|
VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1).array(), (m1.array().min)( minM1));
|
||||||
|
VERIFY_IS_APPROX(m1.array(), (m1.array().min)( maxM1));
|
||||||
|
|
||||||
|
VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1).array(), (m1.array().max)( maxM1));
|
||||||
|
VERIFY_IS_APPROX(m1.array(), (m1.array().max)( minM1));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename MatrixTraits> void resize(const MatrixTraits& t)
|
template<typename MatrixTraits> void resize(const MatrixTraits& t)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user