• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2016 Eugene Brevdo <ebrevdo@gmail.com>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_GLOBAL_FUNCTIONS_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_GLOBAL_FUNCTIONS_H
12 
13 namespace Eigen {
14 
15 /** \cpp11 \returns an expression of the coefficient-wise betainc(\a x, \a a, \a b) to the given tensors.
16  *
17  * This function computes the regularized incomplete beta function (integral).
18  *
19  */
20 template <typename ADerived, typename BDerived, typename XDerived>
21 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
22     TensorCwiseTernaryOp<internal::scalar_betainc_op<typename XDerived::Scalar>,
23                          const ADerived, const BDerived, const XDerived>
betainc(const ADerived & a,const BDerived & b,const XDerived & x)24     betainc(const ADerived& a, const BDerived& b, const XDerived& x) {
25   return TensorCwiseTernaryOp<
26       internal::scalar_betainc_op<typename XDerived::Scalar>, const ADerived,
27       const BDerived, const XDerived>(
28       a, b, x, internal::scalar_betainc_op<typename XDerived::Scalar>());
29 }
30 
31 } // end namespace Eigen
32 
33 #endif // EIGEN_CXX11_TENSOR_TENSOR_GLOBAL_FUNCTIONS_H
34