Lattice Tester Online Documentation 0.1.0-861
Software Package For Testing The Uniformity Of Integral Lattices In The Real Space
Loading...
Searching...
No Matches
LatticeTester::CoordinateSets::FromRanges Class Reference

A CoordinateSets for coordinates within a given range. More...

#include <latticetester/CoordinateSets.h>

Classes

class  const_iterator
 An iterator class used internaly by the FromRange class. More...
 

Public Member Functions

 FromRanges (Coordinates::size_type minOrder, Coordinates::size_type maxOrder, Coordinates::value_type minCoord, Coordinates::value_type maxCoord, const bool includeFirst=false)
 Constructs a set of all subsets of \(\{\mathtt{minCoord}, \dots, \mathtt{maxCoord}\}\) with minimum and maximum cardinality specified by minOrder and maxOrder.
 
 FromRanges ()
 Constructs an empty set of coordinate sets.
 
void includeOrder (Coordinates::size_type order, Coordinates::value_type minCoord, Coordinates::value_type maxCoord, const bool includeFirst=false)
 Include all subsets \(\mathfrak u\) of \(\{\mathtt{minCoord}, \dots, \mathtt{maxCoord}\}\) of order \(|\mathfrak u| = \mathtt{order}\).
 
void excludeOrder (Coordinates::size_type order)
 Removes the element associated with order from the list of of intervals to generate from.
 
const_iterator begin () const
 Returns a const_iterator pointing to the first element in the sequence of coordinates sets that the object contains.
 
const_iterator end () const
 Returns a const_iterator pointing past the last element in the seq.
 

Detailed Description

A CoordinateSets for coordinates within a given range.

This contains ways to build all subsets of coordinates of a given size in an interval \(\{\mathtt{minCoord}, \dots, \mathtt{maxCoord}\}\). The intended usage of this class is to generate subsets of different orders for a single interval.

This class keeps a map of intervals indexed with the order that will be used to generate subsets from them. This means that this class only keeps one interval for each order.

When you iterate through this class, it generates the next subset of coordinates in the interval associated with the current order. If there is none left, it moves on to the next order and starts generating subsets from the interval associated with it. It is not possible to generate coordinate sets of the same order for different intervals with the same instance of this class.

Constructor & Destructor Documentation

◆ FromRanges() [1/2]

LatticeTester::CoordinateSets::FromRanges::FromRanges ( Coordinates::size_type minOrder,
Coordinates::size_type maxOrder,
Coordinates::value_type minCoord,
Coordinates::value_type maxCoord,
const bool includeFirst = false )

Constructs a set of all subsets of \(\{\mathtt{minCoord}, \dots, \mathtt{maxCoord}\}\) with minimum and maximum cardinality specified by minOrder and maxOrder.

For example, to select all 1, 2, and 3-tuples over coordinates 2, 3, 4, one may use the declaration FromRanges range(1, 3, 2, 4). This gives the sets range = {{2}, {3}, {4}, {2, 3}, {2, 4}, {3, 4}, {2, 3, 4}}.

The boolean variable includeFirst indicates if coordinate 1 is always included and added to each projection. In the previous example, includeFirst = false by default. If we put includeFirst = true in the same example, we obtain range = {{1, 2}, {1, 3}, {1, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {1, 2, 3, 4}}. Note that includeFirst can be set to true only if minorder > 1. Otherwise an error message is given.

◆ FromRanges() [2/2]

LatticeTester::CoordinateSets::FromRanges::FromRanges ( )

Constructs an empty set of coordinate sets.

When using this constructor, it is possible to handpick coordinate sets with the includeOrder() method.

Member Function Documentation

◆ begin()

const_iterator LatticeTester::CoordinateSets::FromRanges::begin ( ) const
inline

Returns a const_iterator pointing to the first element in the sequence of coordinates sets that the object contains.

It can then be used to cycle through all the sets with ++.

◆ end()

const_iterator LatticeTester::CoordinateSets::FromRanges::end ( ) const
inline

Returns a const_iterator pointing past the last element in the seq.

This iterator cannot be used to cycle through the sets, but it can be used as a point of comparison to know when you reached the end of an iterator obtained with begin().

◆ excludeOrder()

void LatticeTester::CoordinateSets::FromRanges::excludeOrder ( Coordinates::size_type order)

Removes the element associated with order from the list of of intervals to generate from.

This means that no coordinate set \(\mathfrak u\) of order \(|\mathfrak u| = \mathtt{order}\) will be returned by the iterator until a new interval is given to the object for this order.

◆ includeOrder()

void LatticeTester::CoordinateSets::FromRanges::includeOrder ( Coordinates::size_type order,
Coordinates::value_type minCoord,
Coordinates::value_type maxCoord,
const bool includeFirst = false )

Include all subsets \(\mathfrak u\) of \(\{\mathtt{minCoord}, \dots, \mathtt{maxCoord}\}\) of order \(|\mathfrak u| = \mathtt{order}\).

For example, calling includeOrder(3, 1, 5) causes all 3-tuples over coordinates \(1, \dots, 5\) to be included. If order = 0 (corresponding to the empty set), minCoord and maxCoord are ignored.

Except for the case where order = 0, an exception is thrown if \(\mathtt{maxCoord} < \mathtt{minCoord} + \mathtt{order} - 1\).

If the object already contains an interval for size order, this interval is overwritten by the new one.


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