名稱空間
變體
操作

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

來自 cppreference.com
< cpp‎ | 數值‎ | 特殊函式
 
 
 
 
定義於標頭檔案 <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,
                                       /* 浮點型別 */ 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) 計算第二類球貝塞爾函式,也稱為球諾依曼函式,引數為 nx 庫為所有無cv限定的浮點型別提供了 std::sph_neumann 的過載,作為引數 x 的型別。(C++23 起)
A) 為所有整數型別提供了額外的過載,它們被視為 double

目錄

[編輯] 引數

n - 函式的階數
x - 函式的自變數

[編輯] 返回值

如果沒有錯誤發生,返回引數 nx 的第二類球貝塞爾函式(球諾依曼函式)的值,即 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 資源。