NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
spherical_hankel_2.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#ifndef NUMCPP_NO_USE_BOOST
31
32#include <complex>
33#include <type_traits>
34
35#include "boost/math/special_functions/hankel.hpp"
36
38#include "NumCpp/NdArray.hpp"
39
40namespace nc::special
41{
42 //============================================================================
43 // Method Description:
51 template<typename dtype1, typename dtype2>
52 std::complex<double> spherical_hankel_2(dtype1 inV, dtype2 inX)
53 {
56
57 return boost::math::sph_hankel_2(inV, inX);
58 }
59
60 //============================================================================
61 // Method Description:
69 template<typename dtype1, typename dtype2>
70 auto spherical_hankel_2(dtype1 inV, const NdArray<dtype2>& inArray)
71 {
72 NdArray<decltype(spherical_hankel_2(dtype1{ 0 }, dtype2{ 0 }))> returnArray(inArray.shape());
73
75 inArray.cend(),
76 returnArray.begin(),
77 [inV](dtype2 inValue) -> auto { return spherical_hankel_2(inV, inValue); });
78
79 return returnArray;
80 }
81} // namespace nc::special
82
83#endif // #ifndef NUMCPP_NO_USE_BOOST
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:39
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:139
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1365
const Shape & shape() const noexcept
Definition: NdArrayCore.hpp:4511
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1673
Definition: airy_ai.hpp:39
std::complex< double > spherical_hankel_2(dtype1 inV, dtype2 inX)
Definition: spherical_hankel_2.hpp:52
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:775