MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / TEST

Function TEST

test/set.cpp:161–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159
160// Documentation examples for setUnique
161TEST(Set, SNIPPET_setUniqueSorted) {
162 //! [ex_set_unique_sorted]
163
164 // input data
165 int h_set[6] = {1, 2, 2, 3, 3, 3};
166 af::array set(6, h_set);
167
168 // is_sorted flag specifies if input is sorted,
169 // allows algorithm to skip internal sorting step
170 const bool is_sorted = true;
171 af::array unique = setUnique(set, is_sorted);
172 // unique == { 1, 2, 3 };
173
174 //! [ex_set_unique_sorted]
175
176 vector<int> unique_gold = {1, 2, 3};
177 dim4 gold_dim(3, 1, 1, 1);
178 ASSERT_VEC_ARRAY_EQ(unique_gold, gold_dim, unique);
179}
180
181TEST(Set, SNIPPET_setUniqueSortedDesc) {
182 //! [ex_set_unique_desc]

Callers

nothing calls this directly

Calls 3

setUniqueFunction · 0.50
setUnionFunction · 0.50
setIntersectFunction · 0.50

Tested by

no test coverage detected