IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseCostFunction.h
1 // BaseCostFunction.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKMATH_BASECOSTFUNCTION_H__
16 #define __IPSDKMATH_BASECOSTFUNCTION_H__
17 
18 // suppression warnings
19 // warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'ipsdk::math::BaseCostFunction'
20 #pragma warning (push)
21 #pragma warning (disable : 4275)
22 
25 #include <boost/noncopyable.hpp>
26 
27 namespace ipsdk {
28 namespace math {
29 
32 
33 class IPSDKMATH_API BaseCostFunction : public boost::noncopyable
34 {
35 public:
39  virtual ~BaseCostFunction() = 0;
41 
42 // methods
43 public:
45  bool isInit() const;
46 
49  ipUInt32 getNbParameters() const;
50 
53  ipUInt32 getNbEquations() const;
54 
61  BoolResult computeEquations(const Vector& parameters,
62  Vector& equations) const;
63 
71  BoolResult computeJacobian(const Vector& parameters,
72  Matrix& jacobian) const;
73 
75  void clear();
76 
77 protected:
83  void initBase(const ipUInt32 nbParameters,
84  const ipUInt32 nbEquations);
85 
87  virtual BoolResult processEquations(const Vector& parameters,
88  Vector& equations) const = 0;
89 
92  virtual BoolResult processJacobian(const Vector& parameters,
93  Matrix& jacobian) const;
94 
96  virtual void clearDerived() {}
97 
98 // attributes
99 protected:
102 
105 
107  bool _bInit;
108 };
109 
112 
113 inline bool
115 {
116  return _bInit;
117 }
118 
121 
122 } // end of namespace math
123 } // end of namespace ipsdk
124 
125 #pragma warning (pop)
126 
127 #endif // __IPSDKMATH_BASECOSTFUNCTION_H__
Definition of import/export macro for library.
boost::numeric::ublas::matrix< ipReal64 > Matrix
matrix type associated to library
Definition: LinearAlgebraTypes.h:48
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
virtual void clearDerived()
clear of object data in derived class
Definition: BaseCostFunction.h:96
bool _bInit
object flag initialization
Definition: BaseCostFunction.h:107
Base class for cost functions used during optimization process.
Definition: BaseCostFunction.h:33
boost::numeric::ublas::vector< ipReal64 > Vector
vector type associated to library
Definition: LinearAlgebraTypes.h:36
#define IPSDKMATH_API
Import/Export macro for library IPSDKMath.
Definition: IPSDKMathExports.h:27
Predefined types for optimization framework.
ipUInt32 _nbEquations
number of equations associated to cost function
Definition: BaseCostFunction.h:104
ipUInt32 _nbParameters
number of parameters associated to cost function
Definition: BaseCostFunction.h:101
bool isInit() const
check for object initialization
Definition: BaseCostFunction.h:114
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53