Flow123d  jenkins-Flow123d-windows32-release-multijob-28
matrix.h
Go to the documentation of this file.
1 #ifndef matrixH
2 #define matrixH
3 
4 #include <iostream>
5 
6 typedef enum {
12 } TNSolutions;
13 
14 class TMatrix {
15 private:
16  int nc;
17  int nr;
18 
19  double* elm;
20 
21 public:
22  TMatrix(int);
23  TMatrix(const TMatrix &);
24  TMatrix(int, int);
25  ~TMatrix();
26 
27  int NRows() const;
28  int NCols() const;
29 
30  void Set(int, int, double);
31  double Get(int, int) const;
32 
33  void SwapRows(int, int);
34 
35  friend std::ostream & operator <<(std::ostream&, const TMatrix&);
36 };
37 
38 class TMVector {
39 private:
40  int size;
41 
42  double* elm;
43 
44 public:
45  TMVector(int);
46  TMVector(const TMVector &);
47  ~TMVector();
48 
49  void Set(int, double);
50  double Get(int);
51  void SwapElements(int, int);
52 
53  friend std::ostream & operator <<(std::ostream&, const TMVector&);
54 };
55 
56 TNSolutions Gauss(const TMatrix&, TMVector*, const TMVector&);
57 
58 #endif
~TMVector()
Definition: matrix.cpp:47
double * elm
Definition: matrix.h:19
TNSolutions
Definition: matrix.h:6
int NCols() const
Definition: matrix.cpp:131
TMVector(int)
Definition: matrix.cpp:35
void Set(int, double)
Definition: matrix.cpp:120
int NRows() const
Definition: matrix.cpp:127
double Get(int)
Definition: matrix.cpp:111
friend std::ostream & operator<<(std::ostream &, const TMVector &)
Definition: matrix.cpp:61
double Get(int, int) const
Definition: matrix.cpp:77
~TMatrix()
Definition: matrix.cpp:31
void SwapElements(int, int)
Definition: matrix.cpp:99
void SwapRows(int, int)
Definition: matrix.cpp:85
Definition: matrix.h:14
TMatrix(int)
Definition: matrix.cpp:11
void Set(int, int, double)
Definition: matrix.cpp:68
int nc
Definition: matrix.h:16
double * elm
Definition: matrix.h:42
friend std::ostream & operator<<(std::ostream &, const TMatrix &)
Definition: matrix.cpp:51
int nr
Definition: matrix.h:17
TNSolutions Gauss(const TMatrix &, TMVector *, const TMVector &)
Definition: matrix.cpp:135
int size
Definition: matrix.h:40