std:: laguerre, std:: laguerref, std:: laguerrel
|
ヘッダーで定義
<cmath>
|
||
| (1) | ||
|
float
laguerre
(
unsigned
int
n,
float
x
)
;
double
laguerre
(
unsigned
int
n,
double
x
)
;
|
(C++17以降)
(C++23まで) |
|
|
/* floating-point-type */
laguerre
(
unsigned
int
n,
/* floating-point-type */ x ) ; |
(C++23以降) | |
|
float
laguerref
(
unsigned
int
n,
float
x
)
;
|
(2) | (C++17以降) |
|
long
double
laguerrel
(
unsigned
int
n,
long
double
x
)
;
|
(3) | (C++17以降) |
|
ヘッダーで定義
<cmath>
|
||
|
template
<
class
Integer
>
double laguerre ( unsigned int n, Integer x ) ; |
(A) | (C++17以降) |
std::laguerre
のオーバーロードを提供する。
(C++23以降)
目次 |
パラメータ
| n | - | 多項式の次数、符号なし整数値 |
| x | - | 引数、浮動小数点または整数値 |
戻り値
If no errors occur, value of the nonassociated Laguerre polynomial of x , that is| e x |
| n! |
|
d
n
|
|
dx
n
|
e -x ) , is returned.
エラー処理
エラーは以下のように指定された方法で報告されることがあります math_errhandling
- 引数がNaNの場合、NaNが返され、定義域エラーは報告されません
- x が負数の場合、定義域エラーが発生する可能性があります
- 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 でも利用可能です。
ラゲール多項式は、次の方程式の多項式解です 。
最初のいくつかは以下の通りです:
| 関数 | 多項式 | ||
|---|---|---|---|
| laguerre ( 0 , x ) | 1 | ||
| laguerre ( 1 , x ) | -x + 1 | ||
| laguerre ( 2 , x ) |
- 4x + 2) |
||
| laguerre ( 3 , x ) |
- 9x 2 - 18x + 6) |
追加のオーバーロードは (A) と完全に同一である必要はありません。それらは、整数型の引数 num に対して、 std :: laguerre ( int_num, num ) が std :: laguerre ( int_num, static_cast < double > ( num ) ) と同じ効果を持つことを保証するのに十分であればよいのです。
例
#include <cmath> #include <iostream> double L1(double x) { return -x + 1; } double L2(double x) { return 0.5 * (x * x - 4 * x + 2); } int main() { // スポットチェック std::cout << std::laguerre(1, 0.5) << '=' << L1(0.5) << '\n' << std::laguerre(2, 0.5) << '=' << L2(0.5) << '\n' << std::laguerre(3, 0.0) << '=' << 1.0 << '\n'; }
出力:
0.5=0.5 0.125=0.125 1=1
関連項目
|
(C++17)
(C++17)
(C++17)
|
関連ラゲール多項式
(関数) |
外部リンク
| Weisstein, Eric W. "Laguerre Polynomial." From MathWorld — A Wolfram Web Resource. |
| Weisstein, Eric W. "Laguerre Polynomial." MathWorld — Wolfram Web リソースより。 |