std::assoc_laguerre, std::assoc_laguerref, std::assoc_laguerrel
来自cppreference.com
< cpp | experimental | special functions
double assoc_laguerre ( unsigned int n, unsigned int m, double x ); double assoc_laguerre ( unsigned int n, unsigned int m, float x ); |
(1) | |
double assoc_laguerre ( unsigned int n, unsigned int m, IntegralType x ); |
(2) | |
Template:cpp/experimental/special math/macro note
参数
n | - | 多项式的度数,无符号整数类型的值 |
m | - | 多项式的阶数,无符号整数类型的值 |
x | - | 实参,浮点或整数类型的值 |
返回值
如果未发生错误,则返回 x 的连带拉盖尔多项式的值,即 (-1)mdm |
dxm |
n + m(x)(其中 L
n + m(x) 为非连带拉盖尔多项式,std::laguerre(n + m, x))。
错误处理
根据 math_errhandling 的规定进行错误报告。
- 如果实参为 NaN,则返回 NaN 但不报告定义域错误。
- 如果 x 为负数,则发生定义域错误。
- 如果 n 或 m 大于或等于 128,则其行为由实现定义。
注解
不支持 TR 29124 但支持 TR 19768 的实现,在头文件 tr1/cmath
和命名空间 std::tr1
中提供此函数。
此函数的实现也在 boost.math 中可用。
连带的拉盖尔多项式是方程 xy,,
+ (m + 1 - x)y,
+ ny = 0 的多项式解。
前几个为:
-
assoc_laguerre(0, m, x)
= 1。 -
assoc_laguerre(1, m, x)
= -x + m + 1。 -
assoc_laguerre(2, m, x)
=
[x21 2
- 2(m + 2)x + (m + 1)(m + 2)]。 -
assoc_laguerre(3, m, x)
=
[-x31 6
- 3(m + 3)x2
- 3(m + 2)(m + 3)x + (m + 1)(m + 2)(m + 3)]。
示例
运行此代码
#define __STDCPP_WANT_MATH_SPEC_FUNCS__ 1 #include <cmath> #include <iostream> double L1(unsigned m, double x) { return -x + m + 1; } double L2(unsigned m, double x) { return 0.5 * (x * x - 2 * (m + 2) * x + (m + 1) * (m + 2)); } int main() { // spot-checks std::cout << std::assoc_laguerre(1, 10, 0.5) << '=' << L1(10, 0.5) << '\n' << std::assoc_laguerre(2, 10, 0.5) << '=' << L2(10, 0.5) << '\n'; }
输出:
10.5=10.5 60.125=60.125
参阅
拉盖尔多项式 (函数) |
外部链接
Weisstein, Eric W. "Associated Laguerre Polynomial." From MathWorld — A Wolfram Web Resource. |