-
Notifications
You must be signed in to change notification settings - Fork 0
/
Matrix.h
34 lines (27 loc) · 1.03 KB
/
Matrix.h
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
#pragma once
#include <string>
#include <vector>
class Matrix {
public:
typedef std::vector<std::vector<double>> matrix_t;
Matrix(matrix_t matrix);
uint32_t getRow() const;
uint32_t getColumn() const;
matrix_t getMatrix() const;
bool isSquare() const;
std::string getElement(uint32_t row, uint32_t column) const;
void setElement(double value, uint32_t row, uint32_t column);
Matrix multiplyWith(const Matrix& matrix);
Matrix plusWith(const Matrix& matrix);
Matrix subtractWith(const Matrix& matrix);
static Matrix multiply(const Matrix& matrixA, const Matrix& matrixB);
static Matrix plus(const Matrix& matrixA, const Matrix& matrixB);
static Matrix subtract(const Matrix& matrixA, const Matrix& matrixB);
std::string toString() const;
private:
uint32_t m_row, m_column;
matrix_t m_matrix;
static matrix_t mul(const matrix_t& matrixA, const matrix_t& matrixB);
static matrix_t add(const matrix_t& matrixA, const matrix_t& matrixB);
static matrix_t minus(const matrix_t& matrixA, const matrix_t& matrixB);
};