Namespaces
Variants

std:: laguerre, std:: laguerref, std:: laguerrel

From cppreference.net
double laguerre ( unsigned int n, double x ) ;

double laguerre ( unsigned int n, float x ) ;
double laguerre ( unsigned int n, long double x ) ;
float laguerref ( unsigned int n, float x ) ;

long double laguerrel ( unsigned int n, long double x ) ;
(1)
double laguerre ( unsigned int n, IntegralType x ) ;
(2)
1) 次数 n と引数 x の非随伴 Laguerre多項式 を計算します。
2) 任意の 整数型 の引数を受け入れるオーバーロードのセット、または関数テンプレート。引数を double にキャストした後、 (1) と等価です。

すべての特殊関数と同様に、 laguerre は実装によって __STDCPP_MATH_SPEC_FUNCS__ が少なくとも201003Lの値に定義され、かつユーザーが標準ライブラリヘッダーを含める前に __STDCPP_WANT_MATH_SPEC_FUNCS__ を定義した場合にのみ、 <cmath> で利用可能であることが保証されます。

目次

翻訳の説明: - 「Contents」を「目次」に翻訳しました - C++関連の専門用語(Parameters、Return value、Error handling、Notes、Example、See also、External links)は原文のまま保持しました - HTMLタグ、属性、クラス名は一切変更していません - 番号部分の書式も完全に保持しています

パラメータ

n - 多項式の次数、符号なし整数型の値
x - 引数、浮動小数点型または整数型の値

戻り値

If no errors occur, value of the nonassociated Laguerre polynomial of x , that is
e x
n!
d n
dx n
(x n
e -x )
, is returned.

エラーハンドリング

エラーは math_errhandling で指定される方法で報告される場合があります。

  • 引数がNaNの場合、NaNが返され、定義域エラーは報告されません。
  • x が負数の場合、定義域エラーが発生する可能性があります。
  • n が128以上の場合、その動作は処理系定義となります。

注記

TR 29124をサポートせず、TR 19768をサポートする実装では、この関数はヘッダー tr1/cmath および名前空間 std::tr1 で提供されます。

この関数の実装は boost.math でも利用可能です。

ラゲール多項式は、方程式 xy ,,
+ (1 - x)y ,
+ ny = 0
の多項式解です。

最初のいくつかは以下の通りです:

  • laguerre(0, x) = 1.
  • laguerre(1, x) = -x + 1 .
  • laguerre(2, x) =
    1
    2
    [x 2
    - 4x + 2]
    .
  • laguerre(3, x) =
    1
    6
    [-x 3
    - 9x 2
    - 18x + 6]
    .

(gcc 6.0で示された通り動作します)

#define __STDCPP_WANT_MATH_SPEC_FUNCS__ 1
#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()
{
    // spot-checks
    std::cout << std::laguerre(1, 0.5) << '=' << L1(0.5) << '\n'
              << std::laguerre(2, 0.5) << '=' << L2(0.5) << '\n';
}

出力:

0.5=0.5
0.125=0.125

関連項目

関連ラゲール多項式
(関数)

外部リンク

Weisstein, Eric W. "Laguerre Polynomial." MathWorld -- Wolfram Web リソースより。