-
Notifications
You must be signed in to change notification settings - Fork 0
/
matrixLib.h
53 lines (45 loc) · 1.4 KB
/
matrixLib.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
44
45
46
47
48
49
50
51
52
53
//
// Created by arashHaratian on 11/16/18.
//
#ifndef MATRIXLIBFINAL_LIBRARY_H
#define MATRIXLIBFINAL_LIBRARY_H
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Matrix {
private:
//----------Field
int column_;
int row_;
vector<vector<double> > matrix_;
//-----------Methods
void getCofactor_(Matrix matrix1, Matrix &tempMatrix, int p, int q, int n);
void openFile_ (string address, char delim);
double determinant_ (int n);
void adjoint_ (Matrix &adjoint);
public:
//----------Constructor
Matrix (string address , char delim);
Matrix (int row, int column);
//---------Friends Methods-----------
friend istream &operator >> (istream &in , Matrix &matrix1);
friend ostream &operator << (ostream &out , const Matrix &matrix1);
friend Matrix operator * (int const coefficient, Matrix const matrix) ;
//--------Public Methods------------------
void show(char delim);
void show();
Matrix operator + (Matrix const &matrix);
Matrix operator - (Matrix const matrix);
Matrix operator * (int const coefficient);
Matrix operator * (Matrix const &matrix);
bool operator == (Matrix const matrix);
Matrix transpose();
double determinant ();
void save (string name, char delim);
int getRow();
int getColumn();
string showSize();
Matrix inverse();
};
#endif //MATRIXLIBFINAL_LIBRARY_H