net.obsearch.index.bucket.impl
Class BucketObjectDouble<O extends OBDouble>

java.lang.Object
  extended by net.obsearch.index.bucket.BucketObject<O>
      extended by net.obsearch.index.bucket.impl.BucketObjectDouble<O>
All Implemented Interfaces:
Comparable<BucketObjectDouble>

public class BucketObjectDouble<O extends OBDouble>
extends net.obsearch.index.bucket.BucketObject<O>
implements Comparable<BucketObjectDouble>

BucketObjectDouble extends BucketObject by adding an SMAP vector used to minimize the number of distance computations required per object.

Author:
Arnoldo Jose Muller Molina

Constructor Summary
BucketObjectDouble()
           
BucketObjectDouble(double[] smapVector, long id)
          Creates a new bucket double with
BucketObjectDouble(double[] smapVector, long id, O object)
          Creates a new bucket double with
 
Method Summary
 int compareTo(BucketObjectDouble o)
           
static double[] convertTuple(OBDouble object, OBDouble[] pivots)
           
 boolean equals(Object other)
           
 int getPivotSize()
           
 double[] getSmapVector()
           
 double lInf(BucketObjectDouble b)
          Execute l-inf between this object and b.
static double lInf(double[] smapVector, double[] other)
           
 void read(ByteBuffer in, int pivots)
          Reads the given # of pivots from the given bytebuffer.
 void setSmapVector(double[] smapVector)
           
 String toString()
           
 void write(ByteBuffer out)
          Writes itself into the given data buffer.
 
Methods inherited from class net.obsearch.index.bucket.BucketObject
getId, getObject, setId, setObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BucketObjectDouble

public BucketObjectDouble()

BucketObjectDouble

public BucketObjectDouble(double[] smapVector,
                          long id)
Creates a new bucket double with

Parameters:
bucket - Bucket number.
level - Level within the hash table.
smapVector - The distances of the corresponding object and the pivots for the given level.
exclusionBucket - If true, the corresponding object is in the exclusion zone.
id - Optional id of the given object. Not always used.

BucketObjectDouble

public BucketObjectDouble(double[] smapVector,
                          long id,
                          O object)
Creates a new bucket double with

Parameters:
bucket - Bucket number.
level - Level within the hash table.
smapVector - The distances of the corresponding object and the pivots for the given level.
exclusionBucket - If true, the corresponding object is in the exclusion zone.
id - Optional id of the given object. Not always used.
Method Detail

equals

public boolean equals(Object other)
Overrides:
equals in class Object

lInf

public double lInf(BucketObjectDouble b)
Execute l-inf between this object and b.

Parameters:
b -
Returns:
l-inf

lInf

public static double lInf(double[] smapVector,
                          double[] other)

convertTuple

public static double[] convertTuple(OBDouble object,
                                    OBDouble[] pivots)
                             throws net.obsearch.exception.OBException
Throws:
net.obsearch.exception.OBException

getSmapVector

public double[] getSmapVector()
Returns:
the smapVector

write

public void write(ByteBuffer out)
Writes itself into the given data buffer.

Parameters:
data - The ByteBuffer that will be modified.

read

public void read(ByteBuffer in,
                 int pivots)
Reads the given # of pivots from the given bytebuffer.

Specified by:
read in class net.obsearch.index.bucket.BucketObject<O extends OBDouble>
Parameters:
out -
pivots -

setSmapVector

public void setSmapVector(double[] smapVector)
Parameters:
smapVector - the smapVector to set

getPivotSize

public int getPivotSize()
Specified by:
getPivotSize in class net.obsearch.index.bucket.BucketObject<O extends OBDouble>

compareTo

public int compareTo(BucketObjectDouble o)
Specified by:
compareTo in interface Comparable<BucketObjectDouble>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2011 Arnoldo Jose Muller Molina. All Rights Reserved.