Package org.umlg.sqlg.predicate
Record Class PGVectorPredicate
java.lang.Object
java.lang.Record
org.umlg.sqlg.predicate.PGVectorPredicate
- All Implemented Interfaces:
BiPredicate<Double,,Double> org.apache.tinkerpop.gremlin.process.traversal.PBiPredicate<Double,Double>
public record PGVectorPredicate(PGVectorPredicate.QueryType queryType, String operator, float[] vector, boolean[] bitVector, double distance)
extends Record
implements org.apache.tinkerpop.gremlin.process.traversal.PBiPredicate<Double,Double>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPGVectorPredicate(PGVectorPredicate.QueryType queryType, String operator, float[] vector, boolean[] bitVector, double distance) Creates an instance of aPGVectorPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionboolean[]Returns the value of thebitVectorrecord component.static org.apache.tinkerpop.gremlin.process.traversal.P<Double>cosineDistance(float[] vector, double distance) doubledistance()Returns the value of thedistancerecord component.final booleanIndicates whether some other object is "equal to" this one.static org.apache.tinkerpop.gremlin.process.traversal.P<Double>hammingDistance(boolean[] vector, double distance) final inthashCode()Returns a hash code value for this object.static org.apache.tinkerpop.gremlin.process.traversal.P<Double>innerProduct(float[] vector, double distance) static org.apache.tinkerpop.gremlin.process.traversal.P<Double>jaccardDistance(boolean[] vector, double distance) static org.apache.tinkerpop.gremlin.process.traversal.P<Double>l1Distance(float[] vector, double distance) static org.apache.tinkerpop.gremlin.process.traversal.P<Double>l2Distance(float[] vector, double distance) operator()Returns the value of theoperatorrecord component.Returns the value of thequeryTyperecord component.booleanfinal StringtoString()Returns a string representation of this record class.float[]vector()Returns the value of thevectorrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.function.BiPredicate
and, orMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.PBiPredicate
getPredicateName, negate
-
Constructor Details
-
PGVectorPredicate
public PGVectorPredicate(PGVectorPredicate.QueryType queryType, String operator, float[] vector, boolean[] bitVector, double distance) Creates an instance of aPGVectorPredicaterecord class.- Parameters:
queryType- the value for thequeryTyperecord componentoperator- the value for theoperatorrecord componentvector- the value for thevectorrecord componentbitVector- the value for thebitVectorrecord componentdistance- the value for thedistancerecord component
-
-
Method Details
-
l2Distance
public static org.apache.tinkerpop.gremlin.process.traversal.P<Double> l2Distance(float[] vector, double distance) -
l1Distance
public static org.apache.tinkerpop.gremlin.process.traversal.P<Double> l1Distance(float[] vector, double distance) -
innerProduct
public static org.apache.tinkerpop.gremlin.process.traversal.P<Double> innerProduct(float[] vector, double distance) -
cosineDistance
public static org.apache.tinkerpop.gremlin.process.traversal.P<Double> cosineDistance(float[] vector, double distance) -
hammingDistance
public static org.apache.tinkerpop.gremlin.process.traversal.P<Double> hammingDistance(boolean[] vector, double distance) -
jaccardDistance
public static org.apache.tinkerpop.gremlin.process.traversal.P<Double> jaccardDistance(boolean[] vector, double distance) -
test
- Specified by:
testin interfaceBiPredicate<Double,Double>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
queryType
Returns the value of thequeryTyperecord component.- Returns:
- the value of the
queryTyperecord component
-
operator
Returns the value of theoperatorrecord component.- Returns:
- the value of the
operatorrecord component
-
vector
public float[] vector()Returns the value of thevectorrecord component.- Returns:
- the value of the
vectorrecord component
-
bitVector
public boolean[] bitVector()Returns the value of thebitVectorrecord component.- Returns:
- the value of the
bitVectorrecord component
-
distance
public double distance()Returns the value of thedistancerecord component.- Returns:
- the value of the
distancerecord component
-