-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestMatrix.cpp.old
More file actions
36 lines (29 loc) · 1023 Bytes
/
testMatrix.cpp.old
File metadata and controls
36 lines (29 loc) · 1023 Bytes
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
#include "Matrix.h"
#include "utils.h"
#include <iostream>
int main()
{
srand(time(nullptr));
Matrix m1{{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}};
Matrix m2{{{1, 2}, {3, 4}, {5, 6}}};
std::cout << "m1: " << m1.getRowCount() << "x" << m1.getColCount() << '\n';
std::cout << m1;
std::cout << "------------------" << '\n';
std::cout << "m2: " << m2.getRowCount() << "x" << m2.getColCount() << '\n';
std::cout << m2;
std::cout << "------------------" << '\n';
Matrix ret = m1 * m2;
std::cout << "result: " << ret.getRowCount() << "x" << ret.getColCount() << '\n';
std::cout << ret;
std::cout << "------------------" << '\n';
// TEST INVALID ADDROW
// ret.addRow({1, 2, 3});
// std::cout << ret;
// std::cout << "------------------" << '\n';
// TEST INVALID ADDCOL
// ret.addCol({1, 2, 3, 4, 5});
// std::cout << ret;
Matrix ret2 = ret + Matrix{{{1, 2}, {3, 4}, {5, 6}}};
std::cout << ret2;
std::cout << "------------------" << '\n';
}