-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.cpp
More file actions
57 lines (47 loc) · 1004 Bytes
/
test.cpp
File metadata and controls
57 lines (47 loc) · 1004 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "matrix.hpp"
#include <iostream>
#include <time.h>
int main() {
std::vector<int> {};
std::cout << "initial:\n";
auto a = la::matrix<3, 3>({ 1,2,3,4,5,6,7,8,9 });
auto b = la::matrix<3, 3>({ 6,5,7,6,1,3,5,9,4 });
std::cout << a;
std::cout << b;
std::cout << "transposition:\n";
a = ~a;
std::cout << a;
std::cout << "matrix product:\n";
a %= b;
std::cout << a;
std::cout << "negtive:\n";
a = -a;
std::cout << a;
std::cout << "plus\n";
b += a;
std::cout << b;
std::cout << "minus\n";
b -= a;
std::cout << b;
std::cout << "multiply:\n";
a *= 5;
std::cout << a;
std::cout << "divide:\n";
a /= 10;
std::cout << a;
std::cout << "usage of itorator:\n";
for (auto i = a.cbegin(); i != a.cend(); ++i) {
std::cout << *i << "\t";
}
std::cout << "\n";
for (auto i = a.crbegin(); i != a.crend(); --i) {
std::cout << *i << "\t";
}
std::cout << "\n";
for (auto i = a.begin(); i != a.end(); ++i) {
*i =1;
}
std::cout << a;
//system("pause");
return 0;
}