NumCpp  1.0
A C++ implementation of the Python Numpy library
erfc.hpp
Go to the documentation of this file.
1 #pragma once
30 
31 #include "NumCpp/NdArray.hpp"
34 
35 #include "boost/math/special_functions/erf.hpp"
36 
37 namespace nc
38 {
39  namespace special
40  {
41  //============================================================================
42  // 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:
68  template<typename dtype>
69  auto erfc(const NdArray<dtype>& inArray)
70  {
71  NdArray<decltype(erfc(dtype{0}))> returnArray(inArray.shape());
72 
73  stl_algorithms::transform(inArray.cbegin(), inArray.cend(), returnArray.begin(),
74  [](dtype inValue) -> auto
75  {
76  return erfc(inValue);
77  });
78 
79  return returnArray;
80  }
81  }
82 }
StaticAsserts.hpp
nc::NdArray::shape
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4296
nc::special::erfc
auto erfc(const NdArray< dtype > &inArray)
Definition: erfc.hpp:69
STATIC_ASSERT_ARITHMETIC
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:38
nc::NdArray< dtype >
NdArray.hpp
nc::NdArray::cend
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1491
nc
Definition: Coordinate.hpp:45
nc::stl_algorithms::transform
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction) noexcept
Definition: StlAlgorithms.hpp:703
nc::NdArray::cbegin
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1147
StlAlgorithms.hpp
nc::NdArray::begin
iterator begin() noexcept
Definition: NdArrayCore.hpp:1091
nc::special::erfc
auto erfc(dtype inValue)
Definition: erfc.hpp:51