-
Notifications
You must be signed in to change notification settings - Fork 0
/
Matrix.h
39 lines (33 loc) · 862 Bytes
/
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
35
36
37
38
39
#pragma once
#include <vector>
#include <string>
class Matrix
{
private:
int m_rows;
int m_cols;
std::vector < std::vector < double > > m_matrix;
void initZeros(int, int);
void initOnes(int, int);
public:
Matrix(int, int, std::vector<double>);
Matrix(int, int, std::string);
Matrix operator+( const Matrix&);
Matrix operator*( const Matrix&);
Matrix operator=( const Matrix&);
Matrix operator-( const Matrix&);
Matrix transpose();
Matrix choleskyDecomposition();
void gaussianElimination(std::string);
std::vector<double> backwardSubstitution();
std::vector<double> forwardSubstitution();
int getHeight();
int getLength();
void setValue(int,int,double);
double getValue(int,int);
void sumValue(int,int,double);
void swapRows(int, int);
void swapCols(int,int);
void substituteCol(int, std::vector<double>);
void Print() const;
};