NumCpp  2.8.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
erfc.hpp
Go to the documentation of this file.
1 #pragma once
29 
30 #ifndef NUMCPP_NO_USE_BOOST
31 
32 #include "boost/math/special_functions/erf.hpp"
33 
36 #include "NumCpp/NdArray.hpp"
37 
38 namespace nc
39 {
40  namespace special
41  {
42  //============================================================================
43  // Method Description:
50  template<typename dtype>
51  auto erfc(dtype inValue)
52  {
54 
55  return boost::math::erfc(inValue);
56  }
57 
58  //============================================================================
59  // Method Description:
67  template<typename dtype>
68  auto erfc(const NdArray<dtype>& inArray)
69  {
70  NdArray<decltype(erfc(dtype{ 0 }))> returnArray(inArray.shape());
71 
73  inArray.cbegin(),
74  inArray.cend(),
75  returnArray.begin(),
76  [](dtype inValue) -> auto{ return erfc(inValue); });
77 
78  return returnArray;
79  }
80  } // namespace special
81 } // namespace nc
82 
83 #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:1221
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4276
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1529
iterator begin() noexcept
Definition: NdArrayCore.hpp:1171
auto erfc(dtype inValue)
Definition: erfc.hpp:51
auto erfc(const NdArray< dtype > &inArray)
Definition: erfc.hpp:68
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:784
Definition: Coordinate.hpp:45