-
Notifications
You must be signed in to change notification settings - Fork 549
Expand file tree
/
Copy pathset.cpp
More file actions
49 lines (40 loc) · 1.4 KB
/
set.cpp
File metadata and controls
49 lines (40 loc) · 1.4 KB
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
/*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <af/algorithm.h>
#include <af/array.h>
#include <af/compatible.h>
#include "error.hpp"
namespace af {
array setunique(const array &in, const bool is_sorted) {
return setUnique(in, is_sorted);
}
array setUnique(const array &in, const bool is_sorted) {
af_array out = 0;
AF_THROW(af_set_unique(&out, in.get(), is_sorted));
return array(out);
}
array setunion(const array &first, const array &second, const bool is_unique) {
return setUnion(first, second, is_unique);
}
array setUnion(const array &first, const array &second, const bool is_unique) {
af_array out = 0;
AF_THROW(af_set_union(&out, first.get(), second.get(), is_unique));
return array(out);
}
array setintersect(const array &first, const array &second,
const bool is_unique) {
return setIntersect(first, second, is_unique);
}
array setIntersect(const array &first, const array &second,
const bool is_unique) {
af_array out = 0;
AF_THROW(af_set_intersect(&out, first.get(), second.get(), is_unique));
return array(out);
}
} // namespace af