it.unimi.di.mg4j.index.cluster
Class DocumentalStrategies

java.lang.Object
  extended by it.unimi.di.mg4j.index.cluster.DocumentalStrategies

public class DocumentalStrategies
extends Object

Static utility methods for documental strategies.

Author:
Alessandro Arabito, Sebastiano Vigna

Constructor Summary
protected DocumentalStrategies()
           
 
Method Summary
static DocumentalPartitioningStrategy interleaved(int numberOfLocalIndices, int numberOfDocuments)
          Creates an interleaved partitioning strategy.
static ContiguousDocumentalStrategy uniform(int numberOfLocalIndices, int numberOfDocuments)
          Creates an equally spaced contiguous documental strategy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentalStrategies

protected DocumentalStrategies()
Method Detail

uniform

public static ContiguousDocumentalStrategy uniform(int numberOfLocalIndices,
                                                   int numberOfDocuments)
Creates an equally spaced contiguous documental strategy.

Parameters:
numberOfLocalIndices - the number of local indices.
numberOfDocuments - the global number of documents.
Returns:
a ContiguousDocumentalStrategy that will partition in index in numberOfLocalIndices local indices of approximately equal size.

interleaved

public static DocumentalPartitioningStrategy interleaved(int numberOfLocalIndices,
                                                         int numberOfDocuments)
Creates an interleaved partitioning strategy.

Parameters:
numberOfLocalIndices - the number of local indices.
numberOfDocuments - the global number of documents.
Returns:
a strategy that will partition in index in numberOfLocalIndices local indices of approximately equal size by picking one every numberOfLocalIndices documents in a round-robin fashion.