Integer points in a cuboid

template <bool left_to_right=true> class MultiDimCounter;

The MultiDimCounter is a bidirectional iterator, yielding all integer points of a d-dimensional cuboid. The points are represented by Array<int> objects.

The template parameter left_to_right determines whether the 0-entry or the (d-1)-entry is the least significant. Default is true, where the counter is read from left to right and the 0-entry is the least significant.

MultiDimCounter implements the resettable and end-sensitive interfaces, as well as several special methods described further.

Prerequisits

#include <MultiDimCounter.h>

using namespace polymake; 

Construction

MultiDimCounter(const Array<int>& limits);
limits determines the number of integer points in each dimension.

Modification

MultiDimCounter::operator++ ();
MultiDimCounter::operator-- ();
Moves to the next integer point. The least significant digit (as specified by left_to_right) changes first.
void set(const Array<int>& values);
Moves the iterator to the given integer point. Validation of the input can be activated.
void set_digit(int digit, int value);
Sets the specified digit to the given value. Validation of the input can be activated.

Facets of a cube

template <typename E> class CubeFacets;

This is a collection of all facets of a d-dimensional cube. The facets are represented combinatorially as sets of vertex indices, the vertices are enumerated contiguously (usually from 0 to 2d-1.) During the iteration the facets do not appear in lexicographical order.

Template parameter E specifies the type of the vertex indices. For dimensions less than the machine word size (for example, 32 on an usual PC), it can be safely chosen as int.

CubeFacets implements the forward container interface; it is a virtual container, producing its elements "on the fly" just when they are needed.

Prerequisits

#include <CubeFacets.h>

using namespace polymake; 

Construction

CubeFacets(int dim, E start=0);
dim is the cube dimension, start is the index of the first vertex.