PR 681: Add ndtri function, the inverse of the normal distribution function.

This commit is contained in:
Srinivas Vasudevan
2019-08-12 19:26:29 -04:00
parent f59bed7a13
commit e38dd48a27
20 changed files with 498 additions and 70 deletions

View File

@@ -536,14 +536,12 @@ typedef CwiseUnaryOp<internal::scalar_lgamma_op<Scalar>, const Derived> LgammaRe
typedef CwiseUnaryOp<internal::scalar_digamma_op<Scalar>, const Derived> DigammaReturnType;
typedef CwiseUnaryOp<internal::scalar_erf_op<Scalar>, const Derived> ErfReturnType;
typedef CwiseUnaryOp<internal::scalar_erfc_op<Scalar>, const Derived> ErfcReturnType;
typedef CwiseUnaryOp<internal::scalar_ndtri_op<Scalar>, const Derived> NdtriReturnType;
/** \cpp11 \returns an expression of the coefficient-wise ln(|gamma(*this)|).
*
* \specialfunctions_module
*
* Example: \include Cwise_lgamma.cpp
* Output: \verbinclude Cwise_lgamma.out
*
* \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.
@@ -579,9 +577,6 @@ digamma() const
*
* \specialfunctions_module
*
* Example: \include Cwise_erf.cpp
* Output: \verbinclude Cwise_erf.out
*
* \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.
@@ -600,9 +595,6 @@ erf() const
*
* \specialfunctions_module
*
* Example: \include Cwise_erfc.cpp
* Output: \verbinclude Cwise_erfc.out
*
* \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.
@@ -615,3 +607,21 @@ erfc() const
{
return ErfcReturnType(derived());
}
/** \cpp11 \returns an expression of the coefficient-wise Complementary error
* function of *this.
*
* \specialfunctions_module
*
* \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 ndtri(T) for any scalar
* type T to be supported.
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_ndtri">Math functions</a>, erf()
*/
EIGEN_DEVICE_FUNC
inline const NdtriReturnType
ndtri() const
{
return NdtriReturnType(derived());
}