MCPcopy Create free account
hub / github.com/apache/arrow / EqualOptions

Class EqualOptions

cpp/src/arrow/compare.h:40–142  ·  view source on GitHub ↗

A container of options for equality comparisons

Source from the content-addressed store, hash-verified

38
39/// A container of options for equality comparisons
40class EqualOptions {
41 public:
42 /// Whether or not NaNs are considered equal.
43 bool nans_equal() const { return nans_equal_; }
44
45 /// Return a new EqualOptions object with the "nans_equal" property changed.
46 EqualOptions nans_equal(bool v) const {
47 auto res = EqualOptions(*this);
48 res.nans_equal_ = v;
49 return res;
50 }
51
52 /// Whether or not zeros with differing signs are considered equal.
53 bool signed_zeros_equal() const { return signed_zeros_equal_; }
54
55 /// Return a new EqualOptions object with the "signed_zeros_equal" property changed.
56 EqualOptions signed_zeros_equal(bool v) const {
57 auto res = EqualOptions(*this);
58 res.signed_zeros_equal_ = v;
59 return res;
60 }
61
62 /// Whether the "atol" property is used in the comparison.
63 ///
64 /// This option only affects the Equals methods
65 /// and has no effect on ApproxEquals methods.
66 bool use_atol() const { return use_atol_; }
67
68 /// Return a new EqualOptions object with the "use_atol" property changed.
69 EqualOptions use_atol(bool v) const {
70 auto res = EqualOptions(*this);
71 res.use_atol_ = v;
72 return res;
73 }
74
75 /// The absolute tolerance for approximate comparisons of floating-point values.
76 /// Note that this option is ignored if "use_atol" is set to false.
77 double atol() const { return atol_; }
78
79 /// Return a new EqualOptions object with the "atol" property changed.
80 EqualOptions atol(double v) const {
81 auto res = EqualOptions(*this);
82 res.atol_ = v;
83 return res;
84 }
85
86 /// Whether the \ref arrow::Schema property is used in the comparison.
87 ///
88 /// This option only affects the Equals methods
89 /// and has no effect on ApproxEquals methods.
90 bool use_schema() const { return use_schema_; }
91
92 /// Return a new EqualOptions object with the "use_schema_" property changed.
93 ///
94 /// Setting this option is false making the value of \ref EqualOptions::use_metadata
95 /// is ignored.
96 EqualOptions use_schema(bool v) const {
97 auto res = EqualOptions(*this);

Callers 15

TYPED_TEST_PFunction · 0.70
nans_equalMethod · 0.70
signed_zeros_equalMethod · 0.70
use_atolMethod · 0.70
atolMethod · 0.70
use_schemaMethod · 0.70
use_metadataMethod · 0.70
diff_sinkMethod · 0.70
TYPED_TEST_PFunction · 0.70
TEST_FFunction · 0.70
AssertDiffAndFormatMethod · 0.50

Calls

no outgoing calls

Tested by 12

TYPED_TEST_PFunction · 0.56
TYPED_TEST_PFunction · 0.56
TEST_FFunction · 0.56
AssertDiffAndFormatMethod · 0.40
TEST_FFunction · 0.40
CheckApproxEqualsFunction · 0.40
CheckFloatingNanEqualityFunction · 0.40
PrintArrayDiffFunction · 0.40
TEST_FFunction · 0.40
ValidateConsumeMethod · 0.40