SynAPSE  0.6.0
Synergistic Analysis of Phase Space Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
DecompQR.hh
1 // C++ incQRdes
2 #include <iostream>
3 #include <cmath>
4 #include <climits>
5 #include <vector>
6 #include <queue>
7 #include <algorithm>
8 
15 template<typename T> class DecompQR {
16  public:
18  DecompQR();
19 
21  DecompQR(const std::vector<std::vector<T>>& mat);
22 
24  DecompQR(const DecompQR& decQR);
25 
27  DecompQR& operator=(const DecompQR& decQR);
28 
30  ~DecompQR();
31 
39  void DecomposeGramSchmidt(const std::vector<std::vector<T>>& mat);
40 
44  T Determinant();
45 
53  std::vector<std::vector<T>> NewMatrix(size_t m, size_t n);
54 
62  T DotProduct(const std::vector<T>& a, const std::vector<T>& b);
63 
65  const std::vector<std::vector<T>>& Q() { return _Q; }
66 
68  const std::vector<std::vector<T>>& R() { return _R; }
69 
70  private:
71 
72  std::vector<std::vector<T>> _Q;
73  std::vector<std::vector<T>> _R;
74 };
75 
76 #include "DecompQR-inl.hh"
void DecomposeGramSchmidt(const std::vector< std::vector< T >> &mat)
Decomposes a square matrix into a parity matrix P, an orthogonal matrix Q and a right triangular matr...
Definition: DecompQR-inl.hh:31
std::vector< std::vector< T > > _R
R Matrix.
Definition: DecompQR.hh:73
std::vector< std::vector< T > > _Q
Q Matrix.
Definition: DecompQR.hh:72
std::vector< std::vector< T > > NewMatrix(size_t m, size_t n)
Returns a matrix of m rows and n columns.
Definition: DecompQR-inl.hh:89
Defines the QR decomposition algorithm of a square matrix.
Definition: DecompQR.hh:15
T Determinant()
Returns the determinant of the decomposed matrix.
DecompQR & operator=(const DecompQR &decQR)
Equality operator.
Definition: DecompQR-inl.hh:20
const std::vector< std::vector< T > > & R()
Gets and returns the upper triangular matrix.
Definition: DecompQR.hh:68
const std::vector< std::vector< T > > & Q()
Gets and returns the lower triangular matrix.
Definition: DecompQR.hh:65
DecompQR()
Default constructor, initilizes an empty matrix of dimension 0x0.
Definition: DecompQR-inl.hh:1
T DotProduct(const std::vector< T > &a, const std::vector< T > &b)
Returns the dot produt of two vectors.
Definition: DecompQR-inl.hh:99
~DecompQR()
Destructor.
Definition: DecompQR-inl.hh:29