From 331ce442c4b8879af41332eebfae14bf29b74fba Mon Sep 17 00:00:00 2001 From: jaseg Date: Mon, 2 Mar 2020 19:45:39 +0100 Subject: foo --- controller/fw/git_sucks/levmarq.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 controller/fw/git_sucks/levmarq.h (limited to 'controller/fw/git_sucks/levmarq.h') diff --git a/controller/fw/git_sucks/levmarq.h b/controller/fw/git_sucks/levmarq.h new file mode 100644 index 0000000..dff13ab --- /dev/null +++ b/controller/fw/git_sucks/levmarq.h @@ -0,0 +1,30 @@ + +#ifndef __LEVMARQ_H__ +#define __LEVMARQ_H__ + +typedef struct { + int max_it; + float init_lambda; + float up_factor; + float down_factor; + float target_derr; + int final_it; + float final_err; + float final_derr; +} LMstat; + +void levmarq_init(LMstat *lmstat); + +int levmarq(int npar, float *par, int ny, float *y, float *dysq, + float (*func)(float *, int, void *), + void (*grad)(float *, float *, int, void *), + void *fdata, LMstat *lmstat); + +float error_func(float *par, int ny, float *y, float *dysq, + float (*func)(float *, int, void *), void *fdata); + +void solve_axb_cholesky(int n, float l[n][n], float x[n], float b[n]); + +int cholesky_decomp(int n, float l[n][n], float a[n][n]); + +#endif /* __LEVMARQ_H__ */ -- cgit