product_quantization
Class ResidualVectorComputation

java.lang.Object
  extended by 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

Field Summary
private  double[][] coarseQuantizer
           
private  int numCentroids
           
private  int vectorLength
           
 
Constructor Summary
ResidualVectorComputation(double[][] coarseQuantizer, int vectorLength, int numCentroids)
           
 
Method Summary
private  int computeNearestCentroid(double[] vector)
          Finds and returns the index of the coarse quantizer's centroid which is closer to the given vector.
 double[] ComputeResidualVector(double[] vector)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

coarseQuantizer

private double[][] coarseQuantizer

vectorLength

private int vectorLength

numCentroids

private int numCentroids
Constructor Detail

ResidualVectorComputation

public ResidualVectorComputation(double[][] coarseQuantizer,
                                 int vectorLength,
                                 int numCentroids)
                          throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

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: