命名空间
变体
操作

std::sph_neumann, std::sph_neumannf, std::sph_neumannl

来自 cppreference.cn
 
 
 
 
定义于头文件 <cmath>
(1)
float       sph_neumann ( unsigned n, float x );

double      sph_neumann ( unsigned n, double x );

long double sph_neumann ( unsigned n, long double x );
(C++17 起)
(C++23 前)
/* floating-point-type */ sph_neumann( unsigned n,
                                       /* floating-point-type */ x );
(C++23 起)
float       sph_neumannf( unsigned n, float x );
(2) (C++17 起)
long double sph_neumannl( unsigned n, long double x );
(3) (C++17 起)
定义于头文件 <cmath>
template< class Integer >
double      sph_neumann ( unsigned n, Integer x );
(A) (C++17 起)
1-3) 计算第二类球贝塞尔函数,也称为阶数为 n 和自变量为 x 的球诺伊曼函数。 库为所有 cv 限定的浮点类型提供 std::sph_neumann 的重载,作为参数 x 的类型。(C++23 起)
A) 为所有整数类型提供了额外的重载,它们被视为 double

目录

[编辑] 参数

n - 函数的阶数
x - 函数的自变量

[编辑] 返回值

如果没有错误发生,则返回第二类球贝塞尔函数(球诺伊曼函数)的值,阶数为 n,自变量为 x,即 nn(x) = (π/2x)1/2
Nn+1/2(x)
,其中 Nn(x)std::cyl_neumann(n, x)x≥0

[编辑] 错误处理

错误可能按照 math_errhandling 中指定的进行报告

  • 如果参数是 NaN,则返回 NaN,且不报告域错误
  • 如果 n≥128,则行为是实现定义的

[编辑] 注解

不支持 C++17 但支持 ISO 29124:2010 的实现,如果实现将 __STDCPP_MATH_SPEC_FUNCS__ 定义为至少 201003L 的值,并且用户在包含任何标准库头文件之前定义了 __STDCPP_WANT_MATH_SPEC_FUNCS__,则会提供此函数。

不支持 ISO 29124:2010 但支持 TR 19768:2007 (TR1) 的实现,在头文件 tr1/cmath 和命名空间 std::tr1 中提供此函数。

boost.math 中也提供了此函数的实现。

额外的重载不需要完全按照 (A) 的形式提供。它们只需要足以确保对于整数类型的参数 numstd::sph_neumann(int_num, num) 具有与 std::sph_neumann(int_num, static_cast<double>(num)) 相同的效果。

[编辑] 示例

#include <cmath>
#include <iostream>
 
int main()
{
    // spot check for n == 1
    double x = 1.2345;
    std::cout << "n_1(" << x << ") = " << std::sph_neumann(1, x) << '\n';
 
    // exact solution for n_1
    std::cout << "-cos(x)/x² - sin(x)/x = "
              << -std::cos(x) / (x * x) - std::sin(x) / x << '\n';
}

输出

n_1(1.2345) = -0.981201
-cos(x)/x² - sin(x)/x = -0.981201

[编辑] 参见

柱诺伊曼函数
(函数) [编辑]
球贝塞尔函数(第一类)
(函数) [编辑]

[编辑] 外部链接

Weisstein, Eric W. "第二类球贝塞尔函数。" 来自 MathWorld — Wolfram Web 资源。