LMMC
Lamina Mathematic core
载入中...
搜索中...
未找到
quadrature_weighted.c 文件参考
quadrature_weighted.c 的引用(Include)关系图:

浏览该文件的源代码.

宏定义

#define LMMC_GH_MAX_ORDER   20
 Gauss-Hermite 求积,权函数 exp(-x^2),积分域 (-inf, +inf)。
#define LMMC_GL_LAG_MAX_ORDER   20
 Gauss-Laguerre 求积,权函数 exp(-x),积分域 [0, +inf)。

函数

lmmc_status_t lmmc_quad_gauss_hermite (lmmc_quad_func_t f, void *ud, size_t order, lmmc_real_t *out)
 Gauss-Hermite 求积:权函数 \(\exp(-x^2)\) ,积分域 \((-\infty, +\infty)\) 。
lmmc_status_t lmmc_quad_gauss_laguerre (lmmc_quad_func_t f, void *ud, size_t order, lmmc_real_t *out)
 Gauss-Laguerre 求积:权函数 \(\exp(-x)\) ,积分域 \([0, +\infty)\) 。

宏定义说明

◆ LMMC_GH_MAX_ORDER

#define LMMC_GH_MAX_ORDER   20

Gauss-Hermite 求积,权函数 exp(-x^2),积分域 (-inf, +inf)。

Golub-Welsch 算法以 Hermite 多项式的对称三对角 Jacobi 矩阵特征值为节点, 以特征向量的首分量计算权重。 物理学家形式的 Hermite 多项式满足 x H_n = H_{n+1}/2 + n H_{n-1}; Jacobi 系数为 a_i = 0、b_i = sqrt(i/2),i=1..n-1。

在文件 quadrature_weighted.c 第 12 行定义.

◆ LMMC_GL_LAG_MAX_ORDER

#define LMMC_GL_LAG_MAX_ORDER   20

Gauss-Laguerre 求积,权函数 exp(-x),积分域 [0, +inf)。

Golub-Welsch 算法使用首一 Laguerre 多项式的三项递推: x L_n(x) = L_{n+1}(x) + (2n+1) L_n(x) - n^2 L_{n-1}(x)。 Jacobi 系数为 alpha_i = 2*i + 1、beta_i = i(i=1..n-1); mu_0 为 exp(-x) 在 [0, inf) 上的积分,等于 1。

在文件 quadrature_weighted.c 第 172 行定义.

被这些函数引用 lmmc_quad_gauss_laguerre().

函数说明

◆ lmmc_quad_gauss_hermite()

lmmc_status_t lmmc_quad_gauss_hermite ( lmmc_quad_func_t f,
void * ud,
size_t order,
lmmc_real_t * out )

Gauss-Hermite 求积:权函数 \(\exp(-x^2)\) ,积分域 \((-\infty, +\infty)\) 。

计算 \(\int_{-\infty}^{+\infty} f(x) \exp(-x^2) dx\) 。

参数
[in]f被积函数(不含权函数部分)。
[in]ud用户数据指针。
[in]order节点数(阶数),范围 [1, 20]。
[out]out积分结果值。
返回
LMMC_STATUS_OK 成功; LMMC_STATUS_NUMERICAL_FAILURE 回调或累加结果为非有限值; LMMC_STATUS_INVALID_ARGUMENT 若 order 超出范围或指针为 NULL。
副作用
  • 回调 f 被调用恰好 order 次。
  • 不分配堆内存。

在文件 quadrature_weighted.c 第 155 行定义.

引用了 lmmc_quad_gauss_hermite().

被这些函数引用 lmmc_quad_gauss_hermite().

函数调用图:
这是这个函数的调用关系图:

◆ lmmc_quad_gauss_laguerre()

lmmc_status_t lmmc_quad_gauss_laguerre ( lmmc_quad_func_t f,
void * ud,
size_t order,
lmmc_real_t * out )

Gauss-Laguerre 求积:权函数 \(\exp(-x)\) ,积分域 \([0, +\infty)\) 。

计算 \(\int_0^{+\infty} f(x) \exp(-x) dx\) 。

参数
[in]f被积函数(不含权函数部分)。
[in]ud用户数据指针。
[in]order节点数(阶数),范围 [1, 20]。
[out]out积分结果值。
返回
LMMC_STATUS_OK 成功; LMMC_STATUS_NUMERICAL_FAILURE 回调或累加结果为非有限值; LMMC_STATUS_INVALID_ARGUMENT 若 order 超出范围或指针为 NULL。
副作用
  • 回调 f 被调用恰好 order 次。
  • 不分配堆内存。

在文件 quadrature_weighted.c 第 174 行定义.

引用了 LMMC_GL_LAG_MAX_ORDER, lmmc_quad_gauss_laguerre(), LMMC_STATUS_INVALID_ARGUMENT, LMMC_STATUS_NUMERICAL_FAILURE , 以及 LMMC_STATUS_OK.

被这些函数引用 lmmc_quad_gauss_laguerre().

函数调用图:
这是这个函数的调用关系图: