CycloPos Header version 1.0.0
ToolTech Software · C++ library reference
Loading...
Searching...
No Matches
cyLevenbergMarquardt.h
Go to the documentation of this file.
1//*****************************************************************************
2// File : cyLevenbergMarquardt.h
3// Module : CycloPos
4// Description : LevenbergMarquardt base class
5// Author : Anders Modén
6// Product : CycloPos 1.0.0
7//
8// Copyright © 2011- ToolTech Software, Sweden
9//
10// NOTE: CycloPos is a generic VR and Tool positioning library for a mono camera
11//
12//
13// Revision History...
14//
15// Who Date Description
16//
17// AMO 110901 Created file
18//
19//******************************************************************************
20#ifndef __CY_LEVENBERG_MARQUARDT_H__
21#define __CY_LEVENBERG_MARQUARDT_H__
22
27
28#include "cyBase.h" // CycloPos generic include
29
30typedef gzFloat (*cyDefLevenbergMarquardtFunction) (gzFloat t_value, gzFloat *parameters);
31
33{
34 cyDefLevenbergMarquardtData(gzFloat *t_vals,gzFloat *y_vals):t_values(t_vals),y_values(y_vals){}
35
36 gzFloat *t_values;
37 gzFloat *y_values;
38
39};
40
42{
43public:
44
46
48
49
50 CY_EXPORT gzBool minimize(gzInt32 sample_count, gzInt32 parameter_count, gzFloat *parameters , void *data);
51
52 CY_EXPORT gzBool solve(gzInt32 sample_count, gzInt32 parameter_count, gzFloat *parameters, gzFloat *fvec, gzFloat ftol, gzFloat xtol, gzFloat gtol, int maxfev, gzFloat epsfcn,gzFloat *diag, int mode, gzFloat factor, int *info, int *nfev, gzFloat *fjac, int *ipvt, gzFloat *qtf, gzFloat *wa1,gzFloat *wa2, gzFloat *wa3, gzFloat *wa4, void *data);
53
54 CY_EXPORT virtual gzVoid onEvaluate(gzFloat *parameters, gzInt32 sample_count, gzFloat *fvec, void *data, int *info);
55
56 CY_EXPORT gzVoid setGeneralPrecision(gzFloat precision);
57
58 CY_EXPORT gzVoid setMaxCall(gzUInt32 maxcall);
59
60 CY_EXPORT gzVoid setStepBound(gzFloat stepBound);
61
62 CY_EXPORT gzVoid setMode(gzInt32 mode);
63
65
66private:
67
68 CY_EXPORT virtual gzFloat getDiagScale(gzUInt32 parameter);
69
71
72 gzFloat m_ftol; /* relative error desired in the sum of squares. */
73 gzFloat m_xtol; /* relative error between last two approximations. */
74 gzFloat m_gtol; /* orthogonality desired between fvec and its derivs. */
75 gzFloat m_epsilon; /* step used to calculate the jacobian. */
76 gzFloat m_stepbound; /* initial bound to steps in the outer loop. */
77 gzFloat m_fnorm; /* norm of the residue vector fvec. */
78 gzInt32 m_mode;
79 gzInt32 m_maxcall; /* maximum number of iterations. */
80 gzInt32 m_nfev; /* actual number of iterations. */
81 gzInt32 m_info; /* status of minimization. */
82
83};
84
85#endif // __CY_LEVENBERG_MARQUARDT_H__
86
87
88
89
90
91
gzBool solve(gzInt32 sample_count, gzInt32 parameter_count, gzFloat *parameters, gzFloat *fvec, gzFloat ftol, gzFloat xtol, gzFloat gtol, int maxfev, gzFloat epsfcn, gzFloat *diag, int mode, gzFloat factor, int *info, int *nfev, gzFloat *fjac, int *ipvt, gzFloat *qtf, gzFloat *wa1, gzFloat *wa2, gzFloat *wa3, gzFloat *wa4, void *data)
virtual gzVoid onEvaluate(gzFloat *parameters, gzInt32 sample_count, gzFloat *fvec, void *data, int *info)
gzVoid setStepBound(gzFloat stepBound)
cyLevenbergMarquardtSolver(cyDefLevenbergMarquardtFunction function=NULL)
gzVoid setMode(gzInt32 mode)
gzBool minimize(gzInt32 sample_count, gzInt32 parameter_count, gzFloat *parameters, void *data)
gzVoid setMaxCall(gzUInt32 maxcall)
virtual ~cyLevenbergMarquardtSolver()
gzVoid setGeneralPrecision(gzFloat precision)
Basic include for all CycloPos files. Defines export structures and basic flags and builtin compiled ...
#define CY_EXPORT
Export control of dll functions.
Definition cyBase.h:50
gzFloat(*) cyDefLevenbergMarquardtFunction(gzFloat t_value, gzFloat *parameters)
cyDefLevenbergMarquardtData(gzFloat *t_vals, gzFloat *y_vals)