NumCpp  1.0
A C++ implementation of the Python Numpy library
spherical_bessel_yn.hpp
Go to the documentation of this file.
1 #pragma once
30 
31 #include "NumCpp/NdArray.hpp"
34 
35 #include "boost/math/special_functions/bessel.hpp"
36 
37 namespace nc
38 {
39  namespace special
40  {
41  //============================================================================
42  // Method Description:
50  template<typename dtype>
51  auto spherical_bessel_yn(uint32 inV, dtype inX)
52  {
54 
55  return boost::math::sph_neumann(inV, inX);
56  }
57 
58  //============================================================================
59  // Method Description:
67  template<typename dtype>
68  auto spherical_bessel_yn(uint32 inV, const NdArray<dtype>& inArrayX)
69  {
70  NdArray<decltype(arccos(dtype{0}))> returnArray(inArrayX.shape());
71 
72  stl_algorithms::transform(inArrayX.cbegin(), inArrayX.cend(), returnArray.begin(),
73  [inV](dtype inX) -> auto
74  {
75  return spherical_bessel_yn(inV, inX);
76  });
77 
78  return returnArray;
79  }
80  }
81 }
StaticAsserts.hpp
nc::arccos
auto arccos(dtype inValue) noexcept
Definition: arccos.hpp:52
nc::NdArray::shape
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4296
STATIC_ASSERT_ARITHMETIC
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:38
nc::NdArray< dtype >
nc::uint32
std::uint32_t uint32
Definition: Types.hpp:41
NdArray.hpp
nc::NdArray::cend
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1491
nc
Definition: Coordinate.hpp:45
nc::special::spherical_bessel_yn
auto spherical_bessel_yn(uint32 inV, dtype inX)
Definition: spherical_bessel_yn.hpp:51
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