00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __matrix_hpp__
00022 #define __matrix_hpp__
00023
00024 #include <list>
00025 #include <string>
00026 #include <vector>
00027
00029 class LinearSystem
00030 {
00031 public:
00034 LinearSystem (size_t n, size_t k = 1);
00035 ~LinearSystem ();
00036
00038 bool solveGJ ();
00039
00041 bool solveGBS ();
00042
00044 prec_t *getRow (size_t i) { return rows[i]; }
00045 prec_t **getRows() { return &rows[0]; }
00046 size_t getN() const { return n; }
00047 size_t getK() const { return k; }
00048
00049 const prec_t *getResults (size_t i = 0) const { return results + i * n; }
00050
00051 void print();
00052
00054 void clear();
00055
00056 private:
00057 size_t n, k, npk;
00058 prec_t *data;
00059 prec_t *results;
00060 std::vector<prec_t *> rows;
00061
00062 LinearSystem (const LinearSystem& copy);
00063 LinearSystem& operator= (const LinearSystem& copy);
00064 };
00065
00066 #endif // !__potential_hpp__
00067