SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
CoordinateSetLong Class Reference

Implementation of CoordinateSet using a long bit-mask internal representation. More...

Inheritance diagram for CoordinateSetLong:
[legend]
Collaboration diagram for CoordinateSetLong:
[legend]

Public Member Functions

 CoordinateSetLong (long mask)
 Constructs a coordinate set with corresponding bit mask mask.
 
long getMask ()
 Returns the bit-mask representation of the current coordinate set.
 
boolean equals (Object o)
 
List< Integer > asList ()
 
boolean contains (int coord)
 
boolean containsAll (CoordinateSet cs)
 
int cardinality ()
 
int maxCoordinate ()
 Returns the maximum coordinate index, starting at 0 for the first coordinate.
 
List< CoordinateSetsubsets (boolean includeEmptySet, int maxOrder)
 Returns all subsets of the current coordinate set, whose cardinality is at most maxOrder. More...
 
- Public Member Functions inherited from CoordinateSet
abstract List< Integer > asList ()
 
abstract int maxCoordinate ()
 Returns the maximum coordinate index, starting at 0 for the first coordinate.
 
abstract List< CoordinateSetsubsets (boolean includeEmptySet, int maxOrder)
 Returns all subsets of the current coordinate set, whose cardinality is at most maxOrder.
 
boolean equals (Object o)
 
boolean contains (int coord)
 Returns true if the current set contains coordinate coord. More...
 
boolean containsAll (CoordinateSet cs)
 Returns true if the current set contains all coordinates in cs. More...
 
int cardinality ()
 Returns the cardinality of the current coordinate set. More...
 
boolean isSubset (CoordinateSet cs)
 Returns true if cs is a subset of the current coordinate set.
 
List< CoordinateSetsubsets ()
 Returns all subsets of the current coordinate set, whose cardinality is at most maxOrder. More...
 
List< CoordinateSetsubsetsNotEmpty ()
 Returns all subsets of the current coordinate set, whose cardinality is at most maxOrder. More...
 
List< CoordinateSetsubsets (int maxOrder)
 Returns all subsets of the current coordinate set, whose cardinality is at most maxOrder. More...
 
List< CoordinateSetsubsetsNotEmpty (int maxOrder)
 Returns all subsets of the current coordinate set, whose cardinality is at most maxOrder. More...
 
String toString ()
 

Static Public Member Functions

static CoordinateSet allCoordinates (int dimension)
 Returns a set of all coordinates in a space of dimension dimension.
 

Protected Attributes

long mask
 

Detailed Description

Implementation of CoordinateSet using a long bit-mask internal representation.

Member Function Documentation

◆ subsets()

List<CoordinateSet> subsets ( boolean  includeEmptySet,
int  maxOrder 
)

Returns all subsets of the current coordinate set, whose cardinality is at most maxOrder.

// inefficient exhaustive enumeration long maskMin = includeEmptySet ? 0 : 1; for (long mask = maskMin; mask < maskMax; mask++) { CoordinateSet cs = new CoordinateSetLong(mask); if (cs.cardinality() <= maxOrder && containsAll(cs)) list.add(cs); }


The documentation for this class was generated from the following file: