首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::assoc_legendref

double assoc_legendre( unsigned int n, unsigned int m, double x ); double assoc_legendre( unsigned int n, unsigned int m, float x ); double assoc_legendre( unsigned int n, unsigned int m, long double x ); float assoc_legendref( unsigned int n, unsigned int m, float x ); long double assoc_legendrel( unsigned int n, unsigned int m, long double x );

(1)

(since C++17)

double assoc_legendre( unsigned int n, unsigned int m, Integral x );

(2)

(since C++17)

1%29计算关联Legendre多项式程度n,秩序m,以及争论x

4%29一组过载或接受任意参数的函数模板积分型将参数转换为double...

参数

n

-

the degree of the polynomial, a value of unsigned integer type

m

-

the order of the polynomial, a value of unsigned integer type

x

-

the argument, a value of a floating-point or integral type

返回值

如果没有错误发生,则相关的Legendre多项式pm的值。

n...Nx,即%281-x2

%2900万/2

糖尿病

*。

DXM

P

N%28x%29,返回%28其中P

N%28x%29是不相关的Legendre多项式,std::legendre(n, x)29%。

注意,康顿-肖特利相项%28-1%2900万

在此定义中省略。

错误处理

错误可以按数学[医]错误处理...

  • 如果参数为nan,则返回nan,并且不报告域错误。
  • 如果x>1时,可能会发生域错误。
  • 如果n大于或等于128,则行为是实现定义的。

注记

不支持C++17但支持的实现ISO 29124:2010,则提供此功能__STDCPP_MATH_SPEC_FUNCS__由实现定义为值至少为201003L,且用户定义__STDCPP_WANT_MATH_SPEC_FUNCS__在包含任何标准库头之前。

不支持iso 29124:2010但支持tr 19768:2007%28TR1%29的实现,在标头中提供此功能。tr1/cmath和命名空间std::tr1...

此功能的实现也是可以在中学里找到。boost::math::legendre_p数学定义包含Condon-Shtley阶段项。

前几个相关的Legendre多项式是:

  • 阿索克[医]Legendre%280,0,x%29=1
  • 阿索克[医]Legendre%281,0,x%29=x
  • 阿索克[医]Legendre%281,1,x%29=-%281-x2

%291/2

  • 阿索克[医]Legendre%282,0,x%29=1 2%283 x2 -1%29
  • 阿索克[医]Legendre%282,1,x%29=-3x%281-x2

%291/2

  • 阿索克[医]Legendre%282,2,x%29=3%281-x2

%29

二次

代码语言:javascript
复制
#include <cmath>
#include <iostream>
double P20(double x) { return 0.5*(3*x*x-1); }
double P21(double x) { return -3.0*x*std::sqrt(1-x*x); }
double P22(double x) { return 3*(1-x*x); }
int main()
{
    // spot-checks
    std::cout << std::assoc_legendre(2, 0, 0.5) << '=' << P20(0.5) << '\n'
              << std::assoc_legendre(2, 1, 0.5) << '=' << P21(0.5) << '\n'
              << std::assoc_legendre(2, 2, 0.5) << '=' << P22(0.5) << '\n';
}

二次

产出:

二次

代码语言:javascript
复制
-0.125=-0.125
-1.29904=-1.29904
2.25=2.25

二次

另见

legendrelegendreflegendrel (C++17)(C++17)(C++17)

Legendre polynomials (function)

外部链接

关联勒让德多项式。来自MathWorld的一个Wolfram Web资源。

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com