summaryrefslogtreecommitdiff
path: root/controller/fw/levmarq/levmarq.h
diff options
context:
space:
mode:
Diffstat (limited to 'controller/fw/levmarq/levmarq.h')
-rw-r--r--controller/fw/levmarq/levmarq.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/controller/fw/levmarq/levmarq.h b/controller/fw/levmarq/levmarq.h
new file mode 100644
index 0000000..dff13ab
--- /dev/null
+++ b/controller/fw/levmarq/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__ */