NumCpp  2.6.2
A Templatized Header Only C++ Implementation of the Python NumPy Library
erf_inv.hpp
Go to the documentation of this file.
1 
28 #pragma once
29 
30 #ifndef NUMCPP_NO_USE_BOOST
31 
34 #include "NumCpp/NdArray.hpp"
35 
36 #include "boost/math/special_functions/erf.hpp"
37 
38 namespace nc
39 {
40  namespace special
41  {
42  //============================================================================
43  // Method Description:
53  template<typename dtype>
54  auto erf_inv(dtype inValue)
55  {
57 
58  return boost::math::erf_inv(inValue);
59  }
60 
61  //============================================================================
62  // Method Description:
72  template<typename dtype>
73  auto erf_inv(const NdArray<dtype>& inArray)
74  {
75  NdArray<decltype(erf_inv(dtype{0}))> returnArray(inArray.shape());
76 
77  stl_algorithms::transform(inArray.cbegin(), inArray.cend(), returnArray.begin(),
78  [](dtype inValue) -> auto
79  {
80  return erf_inv(inValue);
81  });
82 
83  return returnArray;
84  }
85  } // namespace special
86 } // namespace nc
87 
88 #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:1270
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4483
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1614
iterator begin() noexcept
Definition: NdArrayCore.hpp:1214
auto erf_inv(dtype inValue)
Definition: erf_inv.hpp:54
auto erf_inv(const NdArray< dtype > &inArray)
Definition: erf_inv.hpp:73
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:702
Definition: Coordinate.hpp:45