eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // GaussNewton.h Math.Component package 00003 //============================================================================ 00004 // Usage : Non-linear iterative function fitter, implemented using 00005 // Gauss-Newton method 00006 //---------------------------------------------------------------------------- 00007 // Copyright (C) 2006 by eLynx project 00008 // 00009 // This library is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU Library General Public 00011 // License as published by the Free Software Foundation; either 00012 // version 2 of the License, or (at your option) any later version. 00013 // 00014 // This library is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00017 // See the GNU Library General Public License for more details. 00018 //---------------------------------------------------------------------------- 00019 #ifndef __GaussNewton_h__ 00020 #define __GaussNewton_h__ 00021 00022 #include "MathLib.h" 00023 #include <elx/math/IVector.h> 00024 #include <elx/math/IMatrix.h> 00025 #include <elx/math/IFunctionNL.h> 00026 00027 namespace eLynx { 00028 namespace Math { 00029 00044 class ExportedByMath GaussNewton { 00045 00046 public: 00047 00066 static void FitParams(const IFunctionNL &iFunction, const IMatrix &iSamples, 00067 const IVector &iInitialGuess, IVector &oParams, double iEpsilon = 1e-5, 00068 uint32 iMaxIterations = 0); 00069 00070 private: 00071 00077 static void CheckInputs(const IFunctionNL &iFunction, const IMatrix &iSamples, 00078 const IVector &iInitialGuess, IVector &oParams); 00079 00087 static void ComputeDeltaVector(const IFunctionNL &iFunction, 00088 const IMatrix &iSamples, const IVector &iParams, IVector &oDelta); 00089 00100 static void ComputeJacobianAndDiffs(const IFunctionNL &iFunction, 00101 const IMatrix &iSamples, const IVector &iParams, IMatrix &oJacobian, 00102 IVector &oDiffs); 00103 00104 }; 00105 00106 } // namespace Math 00107 } // namespace eLynx 00108 00109 #endif //__GaussNewton_h__