1 | // Licensed to the Apache Software Foundation (ASF) under one |
2 | // or more contributor license agreements. See the NOTICE file |
3 | // distributed with this work for additional information |
4 | // regarding copyright ownership. The ASF licenses this file |
5 | // to you under the Apache License, Version 2.0 (the |
6 | // "License"); you may not use this file except in compliance |
7 | // with the License. You may obtain a copy of the License at |
8 | // |
9 | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | // |
11 | // Unless required by applicable law or agreed to in writing, |
12 | // software distributed under the License is distributed on an |
13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | // KIND, either express or implied. See the License for the |
15 | // specific language governing permissions and limitations |
16 | // under the License. |
17 | |
18 | // Functions for comparing Arrow data structures |
19 | |
20 | #ifndef ARROW_COMPARE_H |
21 | #define ARROW_COMPARE_H |
22 | |
23 | #include <cstdint> |
24 | |
25 | #include "arrow/util/visibility.h" |
26 | |
27 | namespace arrow { |
28 | |
29 | class Array; |
30 | class DataType; |
31 | class Tensor; |
32 | class SparseTensor; |
33 | |
34 | /// Returns true if the arrays are exactly equal |
35 | bool ARROW_EXPORT ArrayEquals(const Array& left, const Array& right); |
36 | |
37 | bool ARROW_EXPORT TensorEquals(const Tensor& left, const Tensor& right); |
38 | |
39 | /// EXPERIMENTAL: Returns true if the given sparse tensors are exactly equal |
40 | bool ARROW_EXPORT SparseTensorEquals(const SparseTensor& left, const SparseTensor& right); |
41 | |
42 | /// Returns true if the arrays are approximately equal. For non-floating point |
43 | /// types, this is equivalent to ArrayEquals(left, right) |
44 | bool ARROW_EXPORT ArrayApproxEquals(const Array& left, const Array& right); |
45 | |
46 | /// Returns true if indicated equal-length segment of arrays is exactly equal |
47 | bool ARROW_EXPORT ArrayRangeEquals(const Array& left, const Array& right, |
48 | int64_t start_idx, int64_t end_idx, |
49 | int64_t other_start_idx); |
50 | |
51 | /// Returns true if the type metadata are exactly equal |
52 | bool ARROW_EXPORT TypeEquals(const DataType& left, const DataType& right); |
53 | |
54 | } // namespace arrow |
55 | |
56 | #endif // ARROW_COMPARE_H |
57 | |