-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
52 lines (43 loc) · 1.51 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
#include <iostream>
#include "MatrixOps.h"
#include "MatrixFileIO.h"
int main() {
MatrixOps<int> A1({{1,5,3},{9,5,6},{1,5,6}});
MatrixOps<int> A2({{1,5,3},{9,5,6},{1,5,6}});
MatrixOps<int> A3(3,3);
MatrixOps<int> B({{1,5},{9,5}});
MatrixOps<int> C({{7,5},{2,5}});
MatrixOps<int> D(2,2);
std::cout << "Addition of 3x3 Matricies A1 and A2 to A3"<<std::endl;
std::cout << "A1: "<<std::endl;
A1.printMatrix();
std::cout << "A2: "<<std::endl;
A2.printMatrix();
A3 = A1+A2;
std::cout << "A3: "<<std::endl;
A3.printMatrix();
std::cout << "====================================================="<<std::endl;
std::cout << "Subtraction of 3x3 Matricies A1 and A2 to A3"<<std::endl;
std::cout << "A1: "<<std::endl;
A1.printMatrix();
std::cout << "A2: "<<std::endl;
A2.printMatrix();
A3 = A1-A2;
std::cout << "A3: "<<std::endl;
A3.printMatrix();
std::cout << "====================================================="<<std::endl;
std::cout << "Multiplication of 3x3 Matricies A1 and A2 to A3"<<std::endl;
std::cout << "A1: "<<std::endl;
A1.printMatrix();
std::cout << "A2: "<<std::endl;
A2.printMatrix();
A3 = A1*A2;
std::cout << "A3: "<<std::endl;
A3.printMatrix();
std::cout << "====================================================="<<std::endl;
std::cout << "Determinant of Matrix A1"<<std::endl;
std::cout << "A1: "<<std::endl;
A1.printMatrix();
std::cout << A1.determinant();
return 0;
}