-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
34 lines (28 loc) · 711 Bytes
/
test.cpp
File metadata and controls
34 lines (28 loc) · 711 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
#include <iostream>
#include "GenericMatrix3D.h"
int main()
{
using size = std::size_t;
size layer = 4;
size row = 4;
size col = 4;
int v = 1;
GenericMatrix3D<int> matrix(layer, row, col);
for (size l = 0; l < layer; ++l)
{
for (size r = 0; r < row; ++r)
{
for (size c = 0; c < col; ++c)
{
matrix(l, r, c) = v++;
}
}
}
std::cout << matrix << std::endl;
auto matrix_roi = matrix.roi(0, 1, 0, 2, 3, 3);
std::cout << matrix_roi << std::endl;
matrix.swap(matrix_roi);
std::cout << "after swap: " << matrix << std::endl;
std::cout << matrix_roi << std::endl;
return 0;
}