NumCpp  2.7.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
gamma1pm1.hpp
Go to the documentation of this file.
1 #pragma once
29 
30 #ifndef NUMCPP_NO_USE_BOOST
31 
34 #include "NumCpp/NdArray.hpp"
35 
36 #include "boost/math/special_functions/gamma.hpp"
37 
38 namespace nc
39 {
40  namespace special
41  {
42  //============================================================================
43  // Method Description:
50  template<typename dtype>
51  auto gamma1pm1(dtype inValue)
52  {
54 
55  return boost::math::tgamma1pm1(inValue);
56  }
57 
58  //============================================================================
59  // Method Description:
66  template<typename dtype>
67  auto gamma1pm1(const NdArray<dtype>& inArray)
68  {
69  NdArray<decltype(gamma1pm1(dtype{0}))> returnArray(inArray.shape());
70 
71  stl_algorithms::transform(inArray.cbegin(), inArray.cend(), returnArray.begin(),
72  [](dtype inValue) -> auto
73  {
74  return gamma1pm1(inValue);
75  });
76 
77  return returnArray;
78  }
79  } // namespace special
80 } // namespace nc
81 
82 #endif // #ifndef NUMCPP_NO_USE_BOOST
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:37
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1216
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4283
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1524
iterator begin() noexcept
Definition: NdArrayCore.hpp:1166
auto gamma1pm1(dtype inValue)
Definition: gamma1pm1.hpp:51
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:702
Definition: Coordinate.hpp:45