-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMatrixAlgebra.h
43 lines (36 loc) · 1.24 KB
/
MatrixAlgebra.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
35
36
37
38
39
40
41
42
43
//Author: AndreasKel
//---------------------------------------------------------------------------------------------
//license: MIT
//file name: MatrixAlgebra.h
//language: C++
//environment: Mingw-w64
//functionality: matrix creation and algebra computation
//==============================================================================================
#include <stdio.h>
#include <iostream>
#include <vector>
#include <math.h>
using std::vector;
class cMatrixAlgebra {
private:
short _rowSize;
short _colSize;
public:
vector<vector<float> > _matrix;
cMatrixAlgebra(short, short, float**);
cMatrixAlgebra(short, short, float);
cMatrixAlgebra(const vector<vector<float> > &initial);
cMatrixAlgebra(const cMatrixAlgebra &mat);
cMatrixAlgebra() :_rowSize(0), _colSize(0) {};
~cMatrixAlgebra();
short getRows() const;
short getCols() const;
// Matrix Operations
cMatrixAlgebra operator+(const cMatrixAlgebra &);
cMatrixAlgebra operator-(const cMatrixAlgebra &);
cMatrixAlgebra operator*(const cMatrixAlgebra &);
cMatrixAlgebra Transpose();
float Determinant(float size);
cMatrixAlgebra Inverse(int size);
cMatrixAlgebra Identity(int size);
};