mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 01:29:35 +08:00
Move scalar/expr to ArrayBase and fix documentation
This commit is contained in:
parent
4794834397
commit
eb91345d64
@ -174,37 +174,6 @@ namespace Eigen
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* \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).
|
|
||||||
*
|
|
||||||
* \relates ArrayBase
|
|
||||||
**/
|
|
||||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
|
||||||
template<typename Scalar,typename Derived>
|
|
||||||
inline const CwiseBinaryOp<internal::scalar_quotient_op<Scalar,Derived::Scalar>,Constant<Scalar>,Derived>
|
|
||||||
operator/(const Scalar& s,const Eigen::ArrayBase<Derived>& a);
|
|
||||||
#else
|
|
||||||
template<typename Scalar, typename Derived>
|
|
||||||
inline typename internal::enable_if< !(internal::is_same<typename Derived::Scalar,Scalar>::value)
|
|
||||||
&& ScalarBinaryOpTraits<Scalar,typename Derived::Scalar,internal::scalar_pow_op<Scalar,typename Derived::Scalar> >::Defined,
|
|
||||||
const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(Scalar,Derived,quotient) >::type
|
|
||||||
operator/(const Scalar& s, const Eigen::ArrayBase<Derived>& a)
|
|
||||||
{
|
|
||||||
return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(Scalar,Derived,quotient)(
|
|
||||||
typename internal::plain_constant_type<Derived,Scalar>::type(a.rows(), a.cols(), s), a.derived() );
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Derived>
|
|
||||||
inline const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(typename Derived::Scalar,Derived,quotient)
|
|
||||||
operator/(const typename Derived::Scalar& s, const Eigen::ArrayBase<Derived>& a)
|
|
||||||
{
|
|
||||||
return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(typename Derived::Scalar,Derived,quotient)(
|
|
||||||
typename internal::plain_constant_type<Derived,typename Derived::Scalar>::type(a.rows(), a.cols(), s), a.derived() );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** \cpp11 \returns an expression of the coefficient-wise igamma(\a a, \a x) to the given arrays.
|
/** \cpp11 \returns an expression of the coefficient-wise igamma(\a a, \a x) to the given arrays.
|
||||||
*
|
*
|
||||||
* This function computes the coefficient-wise incomplete gamma function.
|
* This function computes the coefficient-wise incomplete gamma function.
|
||||||
|
@ -100,7 +100,7 @@ EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(pow,pow);
|
|||||||
* \sa ArrayBase::pow(ArrayBase), square(), cube(), exp(), log()
|
* \sa ArrayBase::pow(ArrayBase), square(), cube(), exp(), log()
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
const CwiseBinaryOp<internal::scalar_pow_op<Scalar,T>,Derived,Constant<Scalar> > pow(const T& exponent) const;
|
const CwiseBinaryOp<internal::scalar_pow_op<Scalar,T>,Derived,Constant<T> > pow(const T& exponent) const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -224,13 +224,13 @@ EIGEN_MAKE_SCALAR_BINARY_OP(operator+,sum);
|
|||||||
* \sa operator+=(), operator-()
|
* \sa operator+=(), operator-()
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
const CwiseBinaryOp<internal::scalar_sum_op<Scalar,T>,Derived,Constant<Scalar> > operator+(const T& scalar) const;
|
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
|
/** \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.
|
* \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
|
template<typename T> friend
|
||||||
const CwiseBinaryOp<internal::scalar_sum_op<T,Scalar>,Constant<Scalar>,Derived> operator+(const T& scalar, const StorageBaseType& expr);
|
const CwiseBinaryOp<internal::scalar_sum_op<T,Scalar>,Constant<T>,Derived> operator+(const T& scalar, const StorageBaseType& expr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||||
@ -246,13 +246,27 @@ EIGEN_MAKE_SCALAR_BINARY_OP(operator-,difference);
|
|||||||
* \sa operator+=(), operator-()
|
* \sa operator+=(), operator-()
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
const CwiseBinaryOp<internal::scalar_difference_op<Scalar,T>,Derived,Constant<Scalar> > operator-(const T& scalar) const;
|
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
|
/** \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.
|
* \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
|
template<typename T> friend
|
||||||
const CwiseBinaryOp<internal::scalar_difference_op<T,Scalar>,Constant<Scalar>,Derived> operator-(const T& scalar, const StorageBaseType& expr);
|
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)
|
||||||
|
#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);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** \returns an expression of the coefficient-wise && operator of *this and \a other
|
/** \returns an expression of the coefficient-wise && operator of *this and \a other
|
||||||
|
@ -54,13 +54,13 @@ EIGEN_MAKE_SCALAR_BINARY_OP(operator*,product);
|
|||||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
const CwiseBinaryOp<internal::scalar_product_op<Scalar,T>,Derived,Constant<Scalar> > operator*(const T& scalar) const;
|
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
|
/** \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.
|
* \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
|
template<typename T> friend
|
||||||
const CwiseBinaryOp<internal::scalar_product_op<T,Scalar>,Constant<Scalar>,Derived> operator*(const T& scalar, const StorageBaseType& expr);
|
const CwiseBinaryOp<internal::scalar_product_op<T,Scalar>,Constant<T>,Derived> operator*(const T& scalar, const StorageBaseType& expr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -73,5 +73,5 @@ EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(operator/,quotient);
|
|||||||
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
* \tparam T is the scalar type of \a scalar. It must be compatible with the scalar type of the given expression.
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
const CwiseBinaryOp<internal::scalar_quotient_op<Scalar,T>,Derived,Constant<Scalar> > operator/(const T& scalar) const;
|
const CwiseBinaryOp<internal::scalar_quotient_op<Scalar,T>,Derived,Constant<T> > operator/(const T& scalar) const;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user