liba 0.1.15
An algorithm library based on C/C++
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
Loading...
Searching...
No Matches
Collaboration diagram for polynomial:

Functions

void a_poly_swap (a_real *a, a_size n)
 swap between i=0naixi and i=0naixni
 
void a_poly_swap_ (a_real *a, a_real *b)
 
a_real a_poly_eval (a_real const *a, a_size n, a_real x)
 horner function for polynomial i=0naixi
 
a_real a_poly_eval_ (a_real const *a, a_real const *b, a_real x)
 
a_real a_poly_evar (a_real const *a, a_size n, a_real x)
 horner function for polynomial i=0naixni
 
a_real a_poly_evar_ (a_real const *a, a_real const *b, a_real x)
 
void a_poly_xTx (a_uint m, a_real const *x, a_uint n, a_real *A)
 compute the matrix A^T * A for polynomial fitting.
 
void a_poly_xTy (a_uint m, a_real const *x, a_real const *y, a_uint n, a_real *b)
 compute the vector A^T * y for polynomial fitting.
 

Detailed Description

Function Documentation

◆ a_poly_eval()

a_real a_poly_eval ( a_real const * a,
a_size n,
a_real x )

horner function for polynomial i=0naixi

{Sn=anSi=xSi+1+ai,(i=n1,n2,,1,0)P(x)=S0

◆ a_poly_evar()

a_real a_poly_evar ( a_real const * a,
a_size n,
a_real x )

horner function for polynomial i=0naixni

{S0=a0Si=xSi1+ai,(i=1,2,,n1,n)P(x)=Sn

◆ a_poly_xTx()

void a_poly_xTx ( a_uint m,
a_real const * x,
a_uint n,
a_real * A )

compute the matrix A^T * A for polynomial fitting.

This function computes the product of the transpose of a design matrix A with itself (A^T * A), which is used in the normal equations for polynomial fitting using least squares method. The matrix A is implicitly defined by the input vector x, where each element of x corresponds to a data point.

Parameters
[in]mnumber of data points (rows in matrix A).
[in]xpoints to an array of size m containing the data points.
[in]ndegree of the polynomial plus one (columns in matrix A).
[out]Apoints to an array of size n*n where the result A^T * A will be stored.

◆ a_poly_xTy()

void a_poly_xTy ( a_uint m,
a_real const * x,
a_real const * y,
a_uint n,
a_real * b )

compute the vector A^T * y for polynomial fitting.

This function computes the product of the transpose of a design matrix A with a vector y (A^T * y), which is used in the normal equations for polynomial fitting using least squares method. The matrix A is implicitly defined by the input vector x, where each element of x corresponds to a data point.

Parameters
[in]mnumber of data points (rows in matrix A).
[in]xpoints to an array of size m containing the data points.
[in]ypoints to an array of size m containing the target values.
[in]ndegree of the polynomial plus one (columns in matrix A).
[out]bpoints to an array of size n where the result A^T * y will be stored.