FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
xtensor/test/test_xmultiindex_iterator.cpp at master · xtensor-stack/xtensor · GitHub
xtensor-stack
xtensor
Repository navigation
Code
Issues
381
(381)
Pull requests
43
(43)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
xtensor
/
test
/
test_xmultiindex_iterator.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (32 loc) · 1.07 KB
Breadcrumbs
xtensor
/
test
/
test_xmultiindex_iterator.cpp
Copy path
File metadata and controls
41 lines (32 loc) · 1.07 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
include
<
vector
>
#
include
"
xtensor/core/xmultiindex_iterator.hpp
"
#
include
"
test_common.hpp
"
namespace
xt
{
TEST_SUITE
(
"
xmultiindex_iterator
"
)
{
TEST_CASE
(
"
sum
"
)
{
using
shape_type = std::vector<std::
size_t
>;
using
iter_type = xmultiindex_iterator<shape_type>;
shape_type roi_begin{
2
,
3
,
4
};
shape_type roi_end{
3
,
5
,
6
};
shape_type current{
2
,
3
,
4
};
iter_type
iter
(roi_begin, roi_end, current,
0
);
iter_type
end
(roi_begin, roi_end, roi_end,
4
);
shape_type
should
(
3
);
for
(should[
0
] = roi_begin[
0
]; should[
0
] < roi_end[
0
]; ++should[
0
])
{
for
(should[
1
] = roi_begin[
1
]; should[
1
] < roi_end[
1
]; ++should[
1
])
{
for
(should[
2
] = roi_begin[
2
]; should[
2
] < roi_end[
2
]; ++should[
2
])
{
EXPECT_EQ
(*iter, should);
++iter;
}
}
}
EXPECT_TRUE
(iter == end);
}
}
}
Back
|
FazBrowse Home
|
New Git URL