namespace std {
double
assoc_laguerre(unsigned int n,
unsigned int m,
double x); // (1) C++17
floating-point-type
assoc_laguerre(unsigned int n,
unsigned int m,
floating-point-type x); // (1) C++23
Promoted
assoc_laguerre(unsigned int n,
unsigned int m,
Arithmetic x); // (2) C++17
float
assoc_laguerref(unsigned int n,
unsigned int m,
float x); // (3) C++17
long double
assoc_laguerrel(unsigned int n,
unsigned int m,
long double x); // (4) C++17
}
概要
ラゲール陪多項式 (associated Laguerre polynomials) を計算する。
- (1) :
- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される)
- (3) :
float
型規定 - (4) :
long double
型規定
戻り値
引数 n
, m
, x
のラゲール陪多項式
laguerre
)。
備考
例
#include <cmath>
#include <iostream>
void p(unsigned n, unsigned m) {
for (double x : {0., 1., 2.})
std::cout << "assoc_laguerre(" << n << ", " << m << ", " << x << ") = " << std::assoc_laguerre(n, m, x) << "\n";
std::cout << "\n";
}
int main() {
p(0, 0); // L_0^0(x) = 1
p(0, 1); // L_0^1(x) = 1
p(1, 0); // L_1^0(x) = - x + 1
p(1, 1); // L_1^1(x) = - x + 2
p(2, 0); // L_2^0(x) = (x^2 - 4x + 2) / 2
p(2, 1); // L_2^1(x) = (x^2 - 6x + 6) / 2
}
18
#include <cmath>
#include <iostream>
void p(unsigned n, unsigned m) {
for (double x : {0., 1., 2.})
std::cout << "assoc_laguerre(" << n << ", " << m << ", " << x << ") = " << std::assoc_laguerre(n, m, x) << "\n";
std::cout << "\n";
}
int main() {
p(0, 0); // L_0^0(x) = 1
p(0, 1); // L_0^1(x) = 1
p(1, 0); // L_1^0(x) = - x + 1
p(1, 1); // L_1^1(x) = - x + 2
p(2, 0); // L_2^0(x) = (x^2 - 4x + 2) / 2
p(2, 1); // L_2^1(x) = (x^2 - 6x + 6) / 2
}
出力例
assoc_laguerre(0, 0, 0) = 1
assoc_laguerre(0, 0, 1) = 1
assoc_laguerre(0, 0, 2) = 1
assoc_laguerre(0, 1, 0) = 1
assoc_laguerre(0, 1, 1) = 1
assoc_laguerre(0, 1, 2) = 1
assoc_laguerre(1, 0, 0) = 1
assoc_laguerre(1, 0, 1) = 0
assoc_laguerre(1, 0, 2) = -1
assoc_laguerre(1, 1, 0) = 2
assoc_laguerre(1, 1, 1) = 1
assoc_laguerre(1, 1, 2) = 0
assoc_laguerre(2, 0, 0) = 1
assoc_laguerre(2, 0, 1) = -0.5
assoc_laguerre(2, 0, 2) = -1
assoc_laguerre(2, 1, 0) = 3
assoc_laguerre(2, 1, 1) = 0.5
assoc_laguerre(2, 1, 2) = -1
バージョン
言語
- C++17
処理系
- Clang: ??
- GCC: 7.1.0 ✅
- ICC: ??
- Visual C++: ??
実装例
閉形式
漸化式
関連項目
- ラゲール多項式
laguerre
参照
- N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions
- WG21 P0226R1 Mathematical Special Functions for C++17, v5
- ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions
- P1467R9 Extended floating-point types and standard names