product_quantization
Class ResidualVectorComputation
java.lang.Object
product_quantization.ResidualVectorComputation
public class ResidualVectorComputation
- extends java.lang.Object
This class is used for computing residual vectors, given a coarse quantizer.
- Author:
- Eleftherios Spyromitros-Xioufis
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
coarseQuantizer
private double[][] coarseQuantizer
vectorLength
private int vectorLength
numCentroids
private int numCentroids
ResidualVectorComputation
public ResidualVectorComputation(double[][] coarseQuantizer,
int vectorLength,
int numCentroids)
throws java.lang.Exception
- Throws:
java.lang.Exception
ComputeResidualVector
public double[] ComputeResidualVector(double[] vector)
throws java.lang.Exception
- Throws:
java.lang.Exception
computeNearestCentroid
private int computeNearestCentroid(double[] vector)
- Finds and returns the index of the coarse quantizer's centroid which is closer to the given vector.
- Parameters:
vector
-
- Returns: