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 aPGVectorPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean[]
Returns the value of thebitVector
record component.static org.apache.tinkerpop.gremlin.process.traversal.P<Double>
cosineDistance
(float[] vector, double distance) double
distance()
Returns the value of thedistance
record component.final boolean
Indicates whether some other object is "equal to" this one.static org.apache.tinkerpop.gremlin.process.traversal.P<Double>
hammingDistance
(boolean[] vector, double distance) final int
hashCode()
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 theoperator
record component.Returns the value of thequeryType
record component.boolean
final String
toString()
Returns a string representation of this record class.float[]
vector()
Returns the value of thevector
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.function.BiPredicate
and, or
Methods 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 aPGVectorPredicate
record class.- Parameters:
queryType
- the value for thequeryType
record componentoperator
- the value for theoperator
record componentvector
- the value for thevector
record componentbitVector
- the value for thebitVector
record componentdistance
- the value for thedistance
record 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:
test
in 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 thequeryType
record component.- Returns:
- the value of the
queryType
record component
-
operator
Returns the value of theoperator
record component.- Returns:
- the value of the
operator
record component
-
vector
public float[] vector()Returns the value of thevector
record component.- Returns:
- the value of the
vector
record component
-
bitVector
public boolean[] bitVector()Returns the value of thebitVector
record component.- Returns:
- the value of the
bitVector
record component
-
distance
public double distance()Returns the value of thedistance
record component.- Returns:
- the value of the
distance
record component
-