public interface DenseSparseMetric extends DistanceMetric
DistanceMetric
that implements
this interface indicates that it supports more efficient computation of the
distances in these scenarios. Modifier and Type | Method and Description |
---|---|
double |
dist(double summaryConst,
Vec main,
Vec target)
Efficiently computes the distance from one main vector that is used many
times, to some sparse target vector.
|
double |
getVectorConstant(Vec vec)
Computes a summary constant value for the vector that is based on the
distance metric in use.
|
clone, dist, dist, dist, dist, getAccelerationCache, getAccelerationCache, getQueryInfo, isIndiscemible, isSubadditive, isSymmetric, metricBound, supportsAcceleration, toString
double getVectorConstant(Vec vec)
vec
- the vector that will be used in many distance computationsdouble dist(double summaryConst, Vec main, Vec target)
Vec.isSparse()
, the distance will be calculated using
DistanceMetric.dist(jsat.linear.Vec, jsat.linear.Vec)
instead.summaryConst
- the summary constant for the main vector obtained
with getVectorConstant(jsat.linear.Vec)
main
- the main vector the summary constant is fortarget
- the target vector to compute the distance toCopyright © 2017. All rights reserved.