eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // LeastSquares.h Math.Component package 00003 //============================================================================ 00004 // Usage : least squares solver (HFTI method implementation) 00005 //---------------------------------------------------------------------------- 00006 // Copyright (C) 2006 by eLynx project 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Library General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2 of the License, or (at your option) any later version. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 // See the GNU Library General Public License for more details. 00017 //---------------------------------------------------------------------------- 00018 #ifndef __LeastSquares_h__ 00019 #define __LeastSquares_h__ 00020 00021 #include "Matrix.h" 00022 #include "Vector.h" 00023 00024 namespace eLynx { 00025 namespace Math { 00026 00045 class ExportedByMath LeastSquares { 00046 00047 public: 00048 00059 static void Solve(const IMatrix &iA, const IVector &iB, 00060 IVector &oX, double iTau = 1e-9); 00061 00062 private: 00063 00066 static void H1(uint32 iP, uint32 iL, uint32 iM, IVector &ioV, double &oH, 00067 IMatrix &ioC, double iTau); 00068 00071 static void H2(uint32 iP, uint32 iL, uint32 iM, IVector &iV, double &iH, 00072 IMatrix &ioC, double iTau); 00073 00077 static void HFTI(IMatrix &iA, IVector &iB, IVector &oX, double iTau); 00078 00084 static uint32 FindMaxPos(IVector &iV, uint32 from, uint32 to); 00085 00086 }; 00087 00088 } // namespace Math 00089 } // namespace eLynx 00090 00091 #endif //__LeastSquares_h__