comparison lls.h @ 76:8c75234388b5 libavutil

linear least squares solver using cholesky factorization
author michael
date Fri, 14 Jul 2006 10:03:09 +0000
parents
children adbb5540fa47
comparison
equal deleted inserted replaced
75:09ed77540442 76:8c75234388b5
1 /*
2 * linear least squares model
3 *
4 * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #ifndef LLS_H
22 #define LLS_H
23
24 #define MAX_VARS 32
25
26 //FIXME avoid direct access to LLSModel from outside
27
28 /**
29 * Linear least squares model.
30 */
31 typedef struct LLSModel{
32 double covariance[MAX_VARS+1][MAX_VARS+1];
33 double coeff[MAX_VARS];
34 int indep_count;
35 }LLSModel;
36
37 void av_init_lls(LLSModel *m, int indep_count);
38 void av_update_lls(LLSModel *m, double *param, double decay);
39 double av_solve_lls(LLSModel *m, double threshold);
40 double av_evaluate_lls(LLSModel *m, double *param);
41
42 #endif