aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/plugins/ArrayCwiseUnaryOps.h
diff options
context:
space:
mode:
authorGravatar Eugene Brevdo <ebrevdo@gmail.com>2015-12-24 21:15:38 -0800
committerGravatar Eugene Brevdo <ebrevdo@gmail.com>2015-12-24 21:15:38 -0800
commitf7362772e3236cdb8ae4d9be175f83a0b19902a0 (patch)
treebc37d8bf30c8ad5621c5c2479e74e98e8daeb57e /Eigen/src/plugins/ArrayCwiseUnaryOps.h
parentbdcbc66a5cca656e1cbdfa97668f3e400a7cb08d (diff)
Add digamma for CPU + CUDA. Includes tests.
Diffstat (limited to 'Eigen/src/plugins/ArrayCwiseUnaryOps.h')
-rw-r--r--Eigen/src/plugins/ArrayCwiseUnaryOps.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/Eigen/src/plugins/ArrayCwiseUnaryOps.h b/Eigen/src/plugins/ArrayCwiseUnaryOps.h
index 01432e2f3..e818ac588 100644
--- a/Eigen/src/plugins/ArrayCwiseUnaryOps.h
+++ b/Eigen/src/plugins/ArrayCwiseUnaryOps.h
@@ -22,6 +22,7 @@ typedef CwiseUnaryOp<internal::scalar_tanh_op<Scalar>, const Derived> TanhReturn
typedef CwiseUnaryOp<internal::scalar_sinh_op<Scalar>, const Derived> SinhReturnType;
typedef CwiseUnaryOp<internal::scalar_cosh_op<Scalar>, const Derived> CoshReturnType;
typedef CwiseUnaryOp<internal::scalar_lgamma_op<Scalar>, const Derived> LgammaReturnType;
+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_pow_op<Scalar>, const Derived> PowReturnType;
@@ -318,6 +319,19 @@ lgamma() const
return LgammaReturnType(derived());
}
+/** \returns an expression of the coefficient-wise digamma (psi, derivative of lgamma).
+ *
+ * Example: \include Cwise_digamma.cpp
+ * Output: \verbinclude Cwise_digamma.out
+ *
+ * \sa cos(), sin(), tan()
+ */
+inline const DigammaReturnType
+digamma() const
+{
+ return DigammaReturnType(derived());
+}
+
/** \returns an expression of the coefficient-wise Gauss error
* function of *this.
*