Improve doc of special math functions

This commit is contained in:
Gael Guennebaud 2016-05-20 14:18:48 +02:00
parent 0ba32f99bd
commit c028d96089
4 changed files with 51 additions and 12 deletions

View File

@ -117,8 +117,8 @@ namespace Eigen
} }
/** /**
* \brief Component-wise division of a scalar by array elements. * \brief Component-wise division of a scalar by array elements.
**/ **/
template <typename Derived> template <typename Derived>
inline const Eigen::CwiseUnaryOp<Eigen::internal::scalar_inverse_mult_op<typename Derived::Scalar>, const Derived> inline const Eigen::CwiseUnaryOp<Eigen::internal::scalar_inverse_mult_op<typename Derived::Scalar>, const Derived>
operator/(const typename Derived::Scalar& s, const Eigen::ArrayBase<Derived>& a) operator/(const typename Derived::Scalar& s, const Eigen::ArrayBase<Derived>& a)
@ -129,10 +129,15 @@ namespace Eigen
); );
} }
/** \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.
* *
* \note This function supports only float and double scalar types in c++11 mode. To support other scalar types,
* or float/double in non c++11 mode, the user has to provide implementations of igammac(T,T) for any scalar
* type T to be supported.
*
* \sa Eigen::igammac(), Eigen::lgamma()
*/ */
template<typename Derived,typename ExponentDerived> template<typename Derived,typename ExponentDerived>
inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_igamma_op<typename Derived::Scalar>, const Derived, const ExponentDerived> inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_igamma_op<typename Derived::Scalar>, const Derived, const ExponentDerived>
@ -144,10 +149,15 @@ namespace Eigen
); );
} }
/** \returns an expression of the coefficient-wise igammac(\a a, \a x) to the given arrays. /** \cpp11 \returns an expression of the coefficient-wise igammac(\a a, \a x) to the given arrays.
* *
* This function computes the coefficient-wise complementary incomplete gamma function. * This function computes the coefficient-wise complementary incomplete gamma function.
* *
* \note This function supports only float and double scalar types in c++11 mode. To support other scalar types,
* or float/double in non c++11 mode, the user has to provide implementations of igammac(T,T) for any scalar
* type T to be supported.
*
* \sa Eigen::igamma(), Eigen::lgamma()
*/ */
template<typename Derived,typename ExponentDerived> template<typename Derived,typename ExponentDerived>
inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_igammac_op<typename Derived::Scalar>, const Derived, const ExponentDerived> inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_igammac_op<typename Derived::Scalar>, const Derived, const ExponentDerived>
@ -163,6 +173,11 @@ namespace Eigen
* *
* It returns the \a n -th derivative of the digamma(psi) evaluated at \c x. * It returns the \a n -th derivative of the digamma(psi) evaluated at \c x.
* *
* \note This function supports only float and double scalar types in c++11 mode. To support other scalar types,
* or float/double in non c++11 mode, the user has to provide implementations of polygamma(T,T) for any scalar
* type T to be supported.
*
* \sa Eigen::digamma()
*/ */
// * \warning Be careful with the order of the parameters: x.polygamma(n) is equivalent to polygamma(n,x) // * \warning Be careful with the order of the parameters: x.polygamma(n) is equivalent to polygamma(n,x)
// * \sa ArrayBase::polygamma() // * \sa ArrayBase::polygamma()
@ -183,6 +198,9 @@ namespace Eigen
* \param x is the exposent, it must be > 1 * \param x is the exposent, it must be > 1
* \param q is the shift, it must be > 0 * \param q is the shift, it must be > 0
* *
* \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.
*
* \sa ArrayBase::zeta() * \sa ArrayBase::zeta()
*/ */
template<typename DerivedX,typename DerivedQ> template<typename DerivedX,typename DerivedQ>

View File

@ -755,9 +755,9 @@ struct igamma_impl {
#endif // EIGEN_HAS_C99_MATH #endif // EIGEN_HAS_C99_MATH
/**************************************************************************** /*****************************************************************************
* Implementation of Riemann zeta function of two arguments * * Implementation of Riemann zeta function of two arguments, based on Cephes *
****************************************************************************/ *****************************************************************************/
template <typename Scalar> template <typename Scalar>
struct zeta_retval { struct zeta_retval {

View File

@ -317,13 +317,18 @@ polygamma(const EIGEN_CURRENT_STORAGE_BASE_CLASS<DerivedN> &n) const
} }
#endif #endif
/** \cpp11 \returns an expression of the coefficient-wise zeta function. /** \returns an expression of the coefficient-wise zeta function.
* *
* It returns the Riemann zeta function of two arguments \c *this and \a q: * It returns the Riemann zeta function of two arguments \c *this and \a q:
* *
* \param *this is the exposent, it must be > 1 * \param *this is the exposent, it must be > 1
* \param q is the shift, it must be > 0 * \param q is the shift, it must be > 0
* *
* \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() * \sa Eigen::zeta()
*/ */
template<typename DerivedQ> template<typename DerivedQ>

View File

@ -311,7 +311,11 @@ cosh() const
* Example: \include Cwise_lgamma.cpp * Example: \include Cwise_lgamma.cpp
* Output: \verbinclude Cwise_lgamma.out * Output: \verbinclude Cwise_lgamma.out
* *
* \sa cos(), sin(), tan() * \note This function supports only float and double scalar types in c++11 mode. To support other scalar types,
* or float/double in non c++11 mode, the user has to provide implementations of lgamma(T) for any scalar
* type T to be supported.
*
* \sa digamma()
*/ */
inline const LgammaReturnType inline const LgammaReturnType
lgamma() const lgamma() const
@ -321,7 +325,11 @@ lgamma() const
/** \returns an expression of the coefficient-wise digamma (psi, derivative of lgamma). /** \returns an expression of the coefficient-wise digamma (psi, derivative of lgamma).
* *
* \sa cos(), sin(), tan() * \note This function supports only float and double scalar types. To support other scalar types,
* the user has to provide implementations of digamma(T) for any scalar
* type T to be supported.
*
* \sa Eigen::digamma(), Eigen::polygamma(), lgamma()
*/ */
inline const DigammaReturnType inline const DigammaReturnType
digamma() const digamma() const
@ -335,7 +343,11 @@ digamma() const
* Example: \include Cwise_erf.cpp * Example: \include Cwise_erf.cpp
* Output: \verbinclude Cwise_erf.out * Output: \verbinclude Cwise_erf.out
* *
* \sa cos(), sin(), tan() * \note This function supports only float and double scalar types in c++11 mode. To support other scalar types,
* or float/double in non c++11 mode, the user has to provide implementations of erf(T) for any scalar
* type T to be supported.
*
* \sa erfc()
*/ */
inline const ErfReturnType inline const ErfReturnType
erf() const erf() const
@ -349,7 +361,11 @@ erf() const
* Example: \include Cwise_erfc.cpp * Example: \include Cwise_erfc.cpp
* Output: \verbinclude Cwise_erfc.out * Output: \verbinclude Cwise_erfc.out
* *
* \sa cos(), sin(), tan() * \note This function supports only float and double scalar types in c++11 mode. To support other scalar types,
* or float/double in non c++11 mode, the user has to provide implementations of erfc(T) for any scalar
* type T to be supported.
*
* \sa erf()
*/ */
inline const ErfcReturnType inline const ErfcReturnType
erfc() const erfc() const