-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
66 lines (47 loc) · 1.41 KB
/
main.cpp
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
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <iostream>
#include "MatrixCalculator.h"
#include "Matrix.h"
using namespace std;
/*
template<typename t>
istream & operator>>( istream& input , Matrix<t> &mat ){
t value ;
for( int i = 0 ; i < mat.getrow() ; i++){
for( int j = 0 ; j < mat.getcol() ; j++){
input >> value ;
mat.setvalue(i,j,value) ;
}
}
return input ;
}
template<typename t>
ostream& operator<<( ostream& output , Matrix<t> &mat ){
t value ;
for( int i = 0 ; i < mat.getrow() ; i++){
for( int j = 0 ; j < mat.getcol() ; j++){
value = mat.getvalue(i,j) ;
output << value << " " ;
}
cout << endl ;
}
return output ;
}
*/
int main()
{
/*Matrix matrix1(2,2) , matrix2(2,2) ;
cin >> matrix1 >> matrix2 ;
Matrix matrixSum ;
matrixSum = matrix1 + matrix2 ;
Matrix matrixSub ;
matrixSub = matrix1 - matrix2 ;
Matrix matrixTransprose , multimatrix ;
matrixTransprose = matrix1.transpose() ;
multimatrix = matrix1 * matrix2 ;
cout <<"\n The sum of 2 matrices : \n" << matrixSum << "\n" ;
cout <<"\n The sub of 2 matrices : \n" << matrixSub << "\n" ;
cout <<"\n The transpose of matrix 1 is : \n" << matrixTransprose << "\n" ;
cout << "\n The multiplication of matrix 1 and matrix 2 is : \n" << multimatrix ;*/
MatrixCalculator Mat;
Mat.menu() ;
}