*/
/**
- * @file lls.c
+ * @file libavutil/lls.c
* linear least squares model
*/
#include "lls.h"
-#ifdef TEST
-#define av_log(a,b,...) printf(__VA_ARGS__)
-#endif
-
void av_init_lls(LLSModel *m, int indep_count){
memset(m, 0, sizeof(LLSModel));
void av_solve_lls(LLSModel *m, double threshold, int min_order){
int i,j,k;
- double (*factor)[MAX_VARS+1]= &m->covariance[1][0];
- double (*covar )[MAX_VARS+1]= &m->covariance[1][1];
+ double (*factor)[MAX_VARS+1]= (void*)&m->covariance[1][0];
+ double (*covar )[MAX_VARS+1]= (void*)&m->covariance[1][1];
double *covar_y = m->covariance[0];
int count= m->indep_count;
av_solve_lls(&m, 0.001, 0);
for(order=0; order<3; order++){
eval= av_evaluate_lls(&m, var+1, order);
- av_log(NULL, AV_LOG_DEBUG, "real:%f order:%d pred:%f var:%f coeffs:%f %f %f\n",
+ printf("real:%9f order:%d pred:%9f var:%f coeffs:%f %9f %9f\n",
var[0], order, eval, sqrt(m.variance[order] / (i+1)),
m.coeff[order][0], m.coeff[order][1], m.coeff[order][2]);
}