33 double points[] = { 1.0, 3.0, 5.0 };
37 == PCOMP_STAT_SUCCESS);
39 assert(fabs(coeffs[0] - (-1.0)) < 1.0e-7);
40 assert(fabs(coeffs[1] - (+2.0)) < 1.0e-7);
int pcomp_run_poly_fit(pcomp_poly_fit_data_t *poly_fit, double *coeffs, const double *points)
Calculates a polynomial least-squares fit.
pcomp_poly_fit_data_t * pcomp_init_poly_fit(size_t num_of_samples, size_t num_of_coeffs)
Allocate a new instance of the pcomp_poly_fit_data_t structure on the heap.
void pcomp_free_poly_fit(pcomp_poly_fit_data_t *poly_fit)
Free an instance of the pcomp_poly_fit_data_t that has been allocated via a call to pcomp_init_poly_f...
Header file for Libpolycomp.