gov.sandia.cognition.statistics.distribution
Class MultinomialDistribution.Domain

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<Vector>
          extended by gov.sandia.cognition.statistics.distribution.MultinomialDistribution.Domain
All Implemented Interfaces:
Iterable<Vector>, Collection<Vector>, Set<Vector>
Enclosing class:
MultinomialDistribution

public static class MultinomialDistribution.Domain
extends AbstractSet<Vector>

Allows the iteration through the set of subsets. That is, how many ways can we label "numTrials" objects with "numClasses" labels. BE CAREFUL, before iterating through all members of a Domain, as this grows as a factorial!!! (See the size() method for the exact size.)


Nested Class Summary
protected static class MultinomialDistribution.Domain.MultinomialIterator
          An Iterator over a Domain
 
Constructor Summary
MultinomialDistribution.Domain(int numClasses, int numTrials)
          Creates a new instance of Domain
 
Method Summary
 Iterator<Vector> iterator()
           
 double logSize()
          The log of the size.
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray
 

Constructor Detail

MultinomialDistribution.Domain

public MultinomialDistribution.Domain(int numClasses,
                                      int numTrials)
Creates a new instance of Domain

Parameters:
numClasses - Number of classes to sample from.
numTrials - Number of times to sample from the classes.
Method Detail

iterator

public Iterator<Vector> iterator()
Specified by:
iterator in interface Iterable<Vector>
Specified by:
iterator in interface Collection<Vector>
Specified by:
iterator in interface Set<Vector>
Specified by:
iterator in class AbstractCollection<Vector>

size

public int size()
Specified by:
size in interface Collection<Vector>
Specified by:
size in interface Set<Vector>
Specified by:
size in class AbstractCollection<Vector>

logSize

public double logSize()
The log of the size.

Returns:
The log of the size.