GestureRecognitionToolkit  Version: 0.2.5
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
LUDecomposition.h
1 /*
2  GRT MIT License
3  Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>
4 
5  Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6  and associated documentation files (the "Software"), to deal in the Software without restriction,
7  including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
9  subject to the following conditions:
10 
11  The above copyright notice and this permission notice shall be included in all copies or substantial
12  portions of the Software.
13 
14  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15  LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 
20  This code is based on the LU Decomposition code from Numerical Recipes (3rd Edition).
21 
22  */
23 #ifndef GRT_LUDCMP_HEADER
24 #define GRT_LUDCMP_HEADER
25 
26 #include "../DataStructures/VectorFloat.h"
27 #include "../DataStructures/MatrixFloat.h"
28 
29 GRT_BEGIN_NAMESPACE
30 
31 class GRT_API LUDecomposition{
32 
33 public:
34  LUDecomposition(const MatrixFloat &a);
35  ~LUDecomposition();
36  bool solve_vector(const VectorFloat &b,VectorFloat &x);
37  bool solve(const MatrixFloat &b,MatrixFloat &x);
38  bool inverse(MatrixFloat &ainv);
39  Float det();
40  bool mprove(const VectorFloat &b,VectorFloat &x);
41  bool getIsSingular();
42  MatrixFloat getLU();
43 
44 protected:
45  unsigned int N;
46  Float d;
47  bool sing;
48  Vector< int > indx;
49  MatrixFloat aref;
50  MatrixFloat lu;
51 
52  ErrorLog errorLog;
53  WarningLog warningLog;
54 };
55 
56 GRT_END_NAMESPACE
57 
58 #endif //GRT_LUDCMP_HEADER