std::cyl_bessel_k, std::cyl_bessel_kf, std::cyl_bessel_kl
定义于头文件 <cmath> |
||
(1) | ||
float cyl_bessel_k ( float nu, float x ); double cyl_bessel_k ( double nu, double x ); |
(自 C++17 起) (直到 C++23) |
|
/* floating-point-type */ cyl_bessel_k( /* floating-point-type */ nu, /* floating-point-type */ x ); |
(自 C++23 起) | |
float cyl_bessel_kf( float nu, float x ); |
(2) | (自 C++17 起) |
long double cyl_bessel_kl( long double nu, long double x ); |
(3) | (自 C++17 起) |
定义于头文件 <cmath> |
||
template< class Arithmetic1, class Arithmetic2 > /* common-floating-point-type */ |
(A) | (自 C++17 起) |
std::cyl_bessel_k
的重载,作为参数 nu 和 x 的类型。(自 C++23 起)内容 |
[编辑] 参数
nu | - | 函数的阶数 |
x | - | 函数的自变量 |
[编辑] 返回值
如果没有错误发生,则返回 nu 和 x 的不规则修正柱贝塞尔函数 (第二类修正贝塞尔函数) 的值,即 Knu(x) =π |
2 |
I-nu(x)-Inu(x) |
sin(nuπ) |
[编辑] 错误处理
错误可能按照 math_errhandling 中的规定报告。
- 如果参数是 NaN,则返回 NaN 且不报告域错误。
- 如果 nu≥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) 的方式提供。它们只需要足以确保对于它们的第一个参数 num1 和第二个参数 num2
|
(直到 C++23) |
如果 num1 和 num2 具有算术类型,则 std::cyl_bessel_k(num1, num2) 具有与 std::cyl_bessel_k(static_cast</* common-floating-point-type */>(num1), 如果不存在此类具有最大等级和子等级的浮点类型,则重载解析不会从提供的重载中产生可用的候选者。 |
(自 C++23 起) |
[编辑] 示例
#include <cmath> #include <iostream> #include <numbers> int main() { double pi = std::numbers::pi; const double x = 1.2345; // spot check for nu == 0.5 std::cout << "K_.5(" << x << ") = " << std::cyl_bessel_k(.5, x) << '\n' << "calculated via I = " << (pi / 2) * (std::cyl_bessel_i(-.5, x) - std::cyl_bessel_i(.5, x)) / std::sin(.5 * pi) << '\n'; }
输出
K_.5(1.2345) = 0.32823 calculated via I = 0.32823
[编辑] 参见
(C++17)(C++17)(C++17) |
规则修正柱贝塞尔函数 (函数) |
(C++17)(C++17)(C++17) |
柱贝塞尔函数 (第一类) (函数) |
[编辑] 外部链接
Weisstein, Eric W. "第二类修正贝塞尔函数。" 来自 MathWorld — Wolfram Web Resource. |