net.obsearch.index
Class OBVectorDouble

java.lang.Object
  extended by net.obsearch.index.OBVectorDouble
All Implemented Interfaces:
net.obsearch.OB, OBDouble, net.obsearch.Storable

public class OBVectorDouble
extends Object
implements OBDouble

L1 distance implementation for doubles.

Author:
Arnoldo Jose Muller Molina

Constructor Summary
OBVectorDouble()
          Default constructor must be provided by every object that implements the interface OB.
OBVectorDouble(double[] data)
           
OBVectorDouble(Random r, int dim)
          Creates a new vector with dim dimensions created by Random.nextDouble()
 
Method Summary
 double distance(OBDouble object)
          Calculates the similarity of "this" and "object".
 boolean equals(Object o)
           
 void load(byte[] input)
           
 byte[] store()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OBVectorDouble

public OBVectorDouble()
Default constructor must be provided by every object that implements the interface OB.


OBVectorDouble

public OBVectorDouble(double[] data)

OBVectorDouble

public OBVectorDouble(Random r,
                      int dim)
Creates a new vector with dim dimensions created by Random.nextDouble()

Method Detail

equals

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

distance

public double distance(OBDouble object)
                throws net.obsearch.exception.OBException
Description copied from interface: OBDouble
Calculates the similarity of "this" and "object". The function must satisfy the triangular inequality and return a double.

Specified by:
distance in interface OBDouble
Parameters:
object - The object of type OBDouble to be compared
Throws:
net.obsearch.exception.OBException - User generated exception

load

public void load(byte[] input)
          throws net.obsearch.exception.OBException,
                 IOException
Specified by:
load in interface net.obsearch.Storable
Throws:
net.obsearch.exception.OBException
IOException

store

public byte[] store()
             throws net.obsearch.exception.OBException,
                    IOException
Specified by:
store in interface net.obsearch.Storable
Throws:
net.obsearch.exception.OBException
IOException


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