Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.algorithm.result
Class PointerRepresentation<O extends DatabaseObject,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.algorithm.result.AbstractResult<O>
          extended by de.lmu.ifi.dbs.elki.algorithm.result.PointerRepresentation<O,D>
Type Parameters:
O - the type of DatabaseObjects handled by this Result
D - the type of Distance used by this Result
All Implemented Interfaces:
Result<O>, Loggable

public class PointerRepresentation<O extends DatabaseObject,D extends Distance<D>>
extends AbstractResult<O>

Provides the result of the single link algorithm SLINK.

Author:
Elke Achtert

Field Summary
private  DistanceFunction<O,D> distanceFunction
          The distance function this pointer representation was computed with.
private  HashMap<Integer,SLINK.SLinkDistance> lambda
          The values of the function Lambda of the pointer representation.
private  HashMap<Integer,Integer> pi
          The values of the function Pi of the pointer representation.
 
Fields inherited from class de.lmu.ifi.dbs.elki.algorithm.result.AbstractResult
db, FILE_EXTENSION
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Fields inherited from interface de.lmu.ifi.dbs.elki.algorithm.result.Result
SEPARATOR
 
Constructor Summary
PointerRepresentation(HashMap<Integer,Integer> pi, HashMap<Integer,SLINK.SLinkDistance> lambda, DistanceFunction<O,D> distanceFunction, Database<O> database)
          Creates a new pointer representation.
 
Method Summary
 Collection<List<Integer>> getClusters(String distancePattern)
          Returns the clustering result for a given distance threshold.
 void output(File out, Normalization<O> normalization, List<AttributeSettings> settings)
          Writes the clustering result to the given file.
 void output(PrintStream outStream, Normalization<O> normalization, List<AttributeSettings> settings)
          Writes the clustering result to the given stream.
 String toString()
          Returns a string representation of this pointer representation.
 
Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.result.AbstractResult
getDatabase, writeHeader
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pi

private HashMap<Integer,Integer> pi
The values of the function Pi of the pointer representation.


lambda

private HashMap<Integer,SLINK.SLinkDistance> lambda
The values of the function Lambda of the pointer representation.


distanceFunction

private DistanceFunction<O extends DatabaseObject,D extends Distance<D>> distanceFunction
The distance function this pointer representation was computed with.

Constructor Detail

PointerRepresentation

public PointerRepresentation(HashMap<Integer,Integer> pi,
                             HashMap<Integer,SLINK.SLinkDistance> lambda,
                             DistanceFunction<O,D> distanceFunction,
                             Database<O> database)
Creates a new pointer representation.

Parameters:
pi - the values of the function Pi of the pointer representation
lambda - the values of the function Lambda of the pointer representation
distanceFunction - the distance function this pointer representation was computed with
database - the database containing the objects
Method Detail

output

public void output(File out,
                   Normalization<O> normalization,
                   List<AttributeSettings> settings)
            throws UnableToComplyException
Description copied from interface: Result
Writes the clustering result to the given file. Clustering result implementations, which are likely to provide several clusters are supposed to use the filename as prefix for every file to create and to append a proper suffix. In case of occuring IOExceptions the output is expected to be given at the standard-out. Therefore this behaviour should be also achievable by giving a null-Object as parameter.

Specified by:
output in interface Result<O extends DatabaseObject>
Overrides:
output in class AbstractResult<O extends DatabaseObject>
Parameters:
out - file, which designates the location to write the results, or which's name designates the prefix of any locations to write the results, or which could remain null to designate the standard-out as location for output.
normalization - Normalization to restore original values according to, if this action is supported - may remain null.
settings - the settings to be written into the header, if this parameter is null, no header will be written
Throws:
UnableToComplyException - if any feature vector is not compatible with values initialized during normalization
See Also:
Result.output(File,Normalization,List)

output

public void output(PrintStream outStream,
                   Normalization<O> normalization,
                   List<AttributeSettings> settings)
            throws UnableToComplyException
Description copied from interface: Result
Writes the clustering result to the given stream.

Parameters:
outStream - the stream to write to
normalization - Normalization to restore original values according to, if this action is supported - may remain null.
settings - the settings to be written into the header, if this parameter is null, no header will be written
Throws:
UnableToComplyException - if any feature vector is not compatible with values initialized during normalization

toString

public String toString()
Returns a string representation of this pointer representation.

Overrides:
toString in class Object
Returns:
a string representation of this pointer representation

getClusters

public Collection<List<Integer>> getClusters(String distancePattern)
Returns the clustering result for a given distance threshold.

Parameters:
distancePattern - the pattern of the threshold
Returns:
the clustering result: each element of the returned collection is a list of ids representing one cluster

Release 0.1 (2008-07-10_1838)