📄 legendre.h
字号:
/** \file Legendre.h
* \brief Legendre多项式逼近
*/
#include <vector>
/** \brief 计算n次Legendre多项式在x点的值
*
* \param x 要获取其值的点
* \param n Legendre多项式的阶数
* \attention
*(1)-1 <= x <= 1;
*(2)为了使Legendre(x,n)*Legendre(x,n)=1,作了归一化处理
*/
float Legendre(float x, int n);
/** \brief 对(x, y)作Legendre多项式拟合,最高阶次为n
*
* \param x 所要逼近的函数的横坐标点集合
* \param y 所要逼近的函数的纵坐标点集合
* \param size (x,y)点的个数
* \param n 所使用的Legendre多项式的最高阶数
* \attention
*(1)返回值是一个大小为n+1的向量组(包括零阶多项式系数)
*/
std::vector<float> BestLegendre(float* x, float* y, int size, int n);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -