-
Notifications
You must be signed in to change notification settings - Fork 0
/
Matrix.hpp
46 lines (44 loc) · 1.17 KB
/
Matrix.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef MATRIX_HPP
# define MATRIX_HPP
#include "utils.hpp"
#include "Symbol.hpp"
#include "Rational.hpp"
class Matrix : public Symbol
{
public:
class BadMatrixException : public exception
{
virtual const char *what() const throw();
};
class BadMatrixOperationException : public exception
{
virtual const char *what() const throw();
};
class NegativePowerException : public exception
{
virtual const char *what() const throw();
};
Matrix();
Matrix(string const &input);
Matrix(int row, int colomn, vector<Rational> &inp);
Matrix(int row, int colomn);
Matrix(Matrix const &src);
~Matrix();
Matrix& operator=(Matrix const &rhs);
Matrix operator+(Matrix const &rhs);
Matrix operator-(Matrix const &rhs);
Matrix operator*(Matrix const &rhs);
Matrix operator^(Matrix const &rhs);
Matrix operator^(Number power);
Matrix getIdentity();
void multiplyBy(Rational rational);
int getRow() const;
int getCol() const;
vector<Rational> getMatrix() const;
private:
int _row;
int _col;
vector<Rational> _matrix;
};
ostream& operator<<(ostream &o, Matrix const &rhs);
#endif