Package org.apache.arrow.vector.compare
Class ApproxEqualsVisitor
java.lang.Object
org.apache.arrow.vector.compare.RangeEqualsVisitor
org.apache.arrow.vector.compare.ApproxEqualsVisitor
- All Implemented Interfaces:
VectorVisitor<Boolean,
Range>
Visitor to compare floating point vectors approximately.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
static final float
Default epsilons for diff functions.Fields inherited from class org.apache.arrow.vector.compare.RangeEqualsVisitor
DEFAULT_TYPE_COMPARATOR
-
Constructor Summary
ConstructorDescriptionApproxEqualsVisitor
(ValueVector left, ValueVector right) Constructs a new instance with default tolerances.ApproxEqualsVisitor
(ValueVector left, ValueVector right, float floatEpsilon, double doubleEpsilon) Constructs a new instance.ApproxEqualsVisitor
(ValueVector left, ValueVector right, VectorValueEqualizer<Float4Vector> floatDiffFunction, VectorValueEqualizer<Float8Vector> doubleDiffFunction) Constructs a new instance.ApproxEqualsVisitor
(ValueVector left, ValueVector right, VectorValueEqualizer<Float4Vector> floatDiffFunction, VectorValueEqualizer<Float8Vector> doubleDiffFunction, BiFunction<ValueVector, ValueVector, Boolean> typeComparator) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected ApproxEqualsVisitor
createInnerVisitor
(ValueVector left, ValueVector right, BiFunction<ValueVector, ValueVector, Boolean> typeComparator) visit
(BaseFixedWidthVector left, Range range) Methods inherited from class org.apache.arrow.vector.compare.RangeEqualsVisitor
compareBaseFixedWidthVectors, compareBaseLargeVariableWidthVectors, compareBaseVariableWidthVectors, compareBaseVariableWidthViewVectors, compareDenseUnionVectors, compareFixedSizeListVectors, compareLargeListVectors, compareListVectors, compareStructVectors, compareUnionVectors, getLeft, getRight, rangeEquals, validate, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Field Details
-
DEFAULT_FLOAT_EPSILON
public static final float DEFAULT_FLOAT_EPSILONDefault epsilons for diff functions.- See Also:
-
DEFAULT_DOUBLE_EPSILON
public static final double DEFAULT_DOUBLE_EPSILON- See Also:
-
-
Constructor Details
-
ApproxEqualsVisitor
Constructs a new instance with default tolerances.- Parameters:
left
- left vectorright
- right vector
-
ApproxEqualsVisitor
public ApproxEqualsVisitor(ValueVector left, ValueVector right, float floatEpsilon, double doubleEpsilon) Constructs a new instance.- Parameters:
left
- left vectorright
- right vectorfloatEpsilon
- difference for float valuesdoubleEpsilon
- difference for double values
-
ApproxEqualsVisitor
public ApproxEqualsVisitor(ValueVector left, ValueVector right, VectorValueEqualizer<Float4Vector> floatDiffFunction, VectorValueEqualizer<Float8Vector> doubleDiffFunction) Constructs a new instance. -
ApproxEqualsVisitor
public ApproxEqualsVisitor(ValueVector left, ValueVector right, VectorValueEqualizer<Float4Vector> floatDiffFunction, VectorValueEqualizer<Float8Vector> doubleDiffFunction, BiFunction<ValueVector, ValueVector, Boolean> typeComparator) Constructs a new instance.- Parameters:
left
- the left vector.right
- the right vector.floatDiffFunction
- the equalizer for float values.doubleDiffFunction
- the equalizer for double values.typeComparator
- type comparator to compare vector type.
-
-
Method Details
-
visit
- Specified by:
visit
in interfaceVectorVisitor<Boolean,
Range> - Overrides:
visit
in classRangeEqualsVisitor
-
createInnerVisitor
protected ApproxEqualsVisitor createInnerVisitor(ValueVector left, ValueVector right, BiFunction<ValueVector, ValueVector, Boolean> typeComparator) - Overrides:
createInnerVisitor
in classRangeEqualsVisitor
-