A container of options for equality comparisons
| 38 | |
| 39 | /// A container of options for equality comparisons |
| 40 | class 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); |
no outgoing calls