Flow123d
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