Flow123d  jenkins-Flow123d-linux-release-multijob-282
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:44
double * elm
Definition: matrix.h:19
TNSolutions
Definition: matrix.h:6
int NCols() const
Definition: matrix.cpp:128
TMVector(int)
Definition: matrix.cpp:32
void Set(int, double)
Definition: matrix.cpp:117
int NRows() const
Definition: matrix.cpp:124
double Get(int)
Definition: matrix.cpp:108
friend std::ostream & operator<<(std::ostream &, const TMVector &)
Definition: matrix.cpp:58
double Get(int, int) const
Definition: matrix.cpp:74
~TMatrix()
Definition: matrix.cpp:28
void SwapElements(int, int)
Definition: matrix.cpp:96
void SwapRows(int, int)
Definition: matrix.cpp:82
Definition: matrix.h:14
TMatrix(int)
Definition: matrix.cpp:8
void Set(int, int, double)
Definition: matrix.cpp:65
int nc
Definition: matrix.h:16
double * elm
Definition: matrix.h:42
friend std::ostream & operator<<(std::ostream &, const TMatrix &)
Definition: matrix.cpp:48
int nr
Definition: matrix.h:17
TNSolutions Gauss(const TMatrix &, TMVector *, const TMVector &)
Definition: matrix.cpp:132
int size
Definition: matrix.h:40