CycloPos
Header version 1.0.0
ToolTech Software · C++ library reference
ToolTech
Class reference
Change history
CorTeX ↗
Toggle main menu visibility
Loading...
Searching...
No Matches
include
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
30
typedef
gzFloat (*
cyDefLevenbergMarquardtFunction
) (gzFloat t_value, gzFloat *parameters);
31
32
struct
cyDefLevenbergMarquardtData
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
41
class
cyLevenbergMarquardtSolver
42
{
43
public
:
44
45
CY_EXPORT
cyLevenbergMarquardtSolver
(
cyDefLevenbergMarquardtFunction
function=NULL);
46
47
CY_EXPORT
virtual
~cyLevenbergMarquardtSolver
();
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
64
CY_EXPORT
gzInt32
getStatus
();
65
66
private
:
67
68
CY_EXPORT
virtual
gzFloat getDiagScale(gzUInt32 parameter);
69
70
cyDefLevenbergMarquardtFunction
m_function;
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
cyLevenbergMarquardtSolver::solve
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)
cyLevenbergMarquardtSolver::onEvaluate
virtual gzVoid onEvaluate(gzFloat *parameters, gzInt32 sample_count, gzFloat *fvec, void *data, int *info)
cyLevenbergMarquardtSolver::setStepBound
gzVoid setStepBound(gzFloat stepBound)
cyLevenbergMarquardtSolver::getStatus
gzInt32 getStatus()
cyLevenbergMarquardtSolver::cyLevenbergMarquardtSolver
cyLevenbergMarquardtSolver(cyDefLevenbergMarquardtFunction function=NULL)
cyLevenbergMarquardtSolver::setMode
gzVoid setMode(gzInt32 mode)
cyLevenbergMarquardtSolver::minimize
gzBool minimize(gzInt32 sample_count, gzInt32 parameter_count, gzFloat *parameters, void *data)
cyLevenbergMarquardtSolver::setMaxCall
gzVoid setMaxCall(gzUInt32 maxcall)
cyLevenbergMarquardtSolver::~cyLevenbergMarquardtSolver
virtual ~cyLevenbergMarquardtSolver()
cyLevenbergMarquardtSolver::setGeneralPrecision
gzVoid setGeneralPrecision(gzFloat precision)
cyBase.h
Basic include for all CycloPos files. Defines export structures and basic flags and builtin compiled ...
CY_EXPORT
#define CY_EXPORT
Export control of dll functions.
Definition
cyBase.h:50
cyDefLevenbergMarquardtFunction
gzFloat(*) cyDefLevenbergMarquardtFunction(gzFloat t_value, gzFloat *parameters)
Definition
cyLevenbergMarquardt.h:30
cyDefLevenbergMarquardtData::cyDefLevenbergMarquardtData
cyDefLevenbergMarquardtData(gzFloat *t_vals, gzFloat *y_vals)
Definition
cyLevenbergMarquardt.h:34
cyDefLevenbergMarquardtData::t_values
gzFloat * t_values
Definition
cyLevenbergMarquardt.h:36
cyDefLevenbergMarquardtData::y_values
gzFloat * y_values
Definition
cyLevenbergMarquardt.h:37
Generated by
1.18.0