70 auto w2 = b2.
cursor<Distances>();
72 auto w3 = b3.
cursor<Flags>();
74 auto w4 = b4.
cursor<Categorys>();
76 for (
auto i = 0;
i < 10; ++
i) {
77 w1(0,
i * 2.,
i * 3.,
i * 4.);
80 std::array<int, 7> d{0, 1, 2, 4, 7, 8, 9};
81 std::array<int, 5>
f{0, 1, 2, 5, 8};
82 std::array<int, 7>
c{0, 1, 2, 3, 5, 7, 8};
89 w3(0,
i,
static_cast<bool>(
i % 2));
96 auto t1 =
b1.finalize();
98 auto t2 = b2.finalize();
100 auto t3 = b3.finalize();
102 auto t4 = b4.finalize();
107 REQUIRE(t5->num_rows() == 4);
109 idxt.bindExternalIndices(&st1, &st2, &st3, &st4);
110 for (
auto&
row : idxt) {
111 REQUIRE(
row.distance().pointId() ==
row.pointId());
112 REQUIRE(
row.flag().pointId() ==
row.pointId());
113 REQUIRE(
row.category().pointId() ==
row.pointId());
118 REQUIRE(t6->num_rows() == st2.size());
120 std::array<int, 7> fs{0, 1, 2, -1, -1, 4, -1};
121 std::array<int, 7> cs{0, 1, 2, -1, 5, 6, -1};
122 idxs.bindExternalIndices(&st1, &st2, &st3, &st4);
124 for (
auto const&
row : idxs) {
125 REQUIRE(
row.has_distance());
126 REQUIRE(
row.has_point());
127 if (
row.has_flag()) {
128 REQUIRE(
row.flag().pointId() ==
row.pointId());
130 if (
row.has_category()) {
131 REQUIRE(
row.category().pointId() ==
row.pointId());
133 REQUIRE(
row.flagId() == fs[
i]);
134 REQUIRE(
row.categoryId() == cs[
i]);
163 for (
auto i = 0;
i < 10; ++
i) {
164 w1(0,
i * 2.,
i * 3.,
i * 4.);
166 auto t1 =
b1.finalize();
170 auto w2 = b2.
cursor<BinnedPoints>();
171 std::array<int, 3> skipPoints = {2, 6, 9};
172 std::array<int, 10>
sizes = {5, 3, 0, 12, 4, 1, 0, 8, 2, 0};
174 for (
auto i = 0;
i < 10; ++
i) {
175 if (
i == skipPoints[
count]) {
184 BinnedPoints st2{t2};
187 auto w3 = b3.
cursor<ColoredPoints>();
188 std::array<int, 20> pointIds1 = {19, 2, 10, 5, 7, 17, 1, 3, 9, 12, 17, 6, 4, 13, 8, 5, 16, 15, 18, 0};
189 std::array<int, 20> pointIds2 = {3, 19, 2, 6, 4, 13, 11, 5, 7, 11, 1, 9, 12, 17, 8, 14, 16, 2, 18, 0};
190 std::array<int, 20> pointIds3 = {19, 2, 9, 15, 1, 3, 9, 12, 17, 18, 0, 10, 5, 7, 11, 6, 4, 13, 9, 14};
191 for (
int i = 0;
i < 20; ++
i) {
192 w3(0,
i, pointIds1[
i]);
194 for (
int i = 0;
i < 20; ++
i) {
195 w3(0,
i + 20, pointIds2[
i]);
197 for (
int i = 0;
i < 20; ++
i) {
198 w3(0,
i + 40, pointIds3[
i]);
201 ColoredPoints st3{tc};
203 std::array<int, 10> colorsizes = {3, 3, 4, 3, 3, 4, 3, 3, 2, 5};
204 std::array<std::vector<int>, 10> colorvalues = {{{19, 39, 50},
213 {8, 31, 42, 46, 58}}};
217 REQUIRE(t3->num_rows() == st1.size());
219 idxs.bindExternalIndices(&st1, &st2, &st3);
221 for (
auto const&
row : idxs) {
222 REQUIRE(
row.has_point());
223 if (
row.has_binsSlice()) {
224 auto slice =
row.binsSlice();
226 for (
auto const& bin : slice) {
227 REQUIRE(bin.pointId() ==
row.pointId());
230 auto colors =
row.colorsList();
231 REQUIRE(colors.size() == (
size_t)colorsizes[
count]);
232 for (
auto j = 0U;
j < colors.size(); ++
j) {