The ChainCon Software (Release 0.03)
Public Member Functions | Private Attributes | List of all members
STuples Class Reference

An auxiliary class for iterating all the possible disjoint subsets A and B of integers in [0, ..., range - 1], both of the given length. More...

#include <ssquarescub.h>

Public Member Functions

 STuples (int length, int range)
 The only constructor allowed. More...
 
template<class ArrayA , class ArrayB >
bool get (ArrayA &A, ArrayB &B)
 Gets a pair of sets A and B. More...
 

Private Attributes

int _length
 The length of each tuple: A and B. More...
 
int _range
 The range of numbers that may appear in the tuples. More...
 
Shuffles sA
 The shuffle iterator that defines the current choice of A. More...
 
bool nextA
 Remembers if the next choice of A is available. More...
 
std::vector< int > curA
 The current choice of A. More...
 
std::vector< int > curAcompl
 The current choice of the complement of A. More...
 
Shuffles sB
 The shuffle iterator that defines the current choice of B. More...
 
bool nextB
 Remembers if the next choice of B is available. More...
 
std::vector< int > curB
 The current choice of B. More...
 
std::vector< int > curBcompl
 The current choice of the complement of B. More...
 

Detailed Description

An auxiliary class for iterating all the possible disjoint subsets A and B of integers in [0, ..., range - 1], both of the given length.

Definition at line 57 of file ssquarescub.h.

Constructor & Destructor Documentation

◆ STuples()

STuples::STuples ( int  length,
int  range 
)
inline

The only constructor allowed.

Definition at line 105 of file ssquarescub.h.

References curA, curAcompl, curB, curBcompl, nextA, nextB, sA, and sB.

Member Function Documentation

◆ get()

template<class ArrayA , class ArrayB >
bool STuples::get ( ArrayA &  A,
ArrayB &  B 
)
inline

Gets a pair of sets A and B.

Returns true if more pairs are available, or false if this was the last one (and rewinds the iterator).

Definition at line 120 of file ssquarescub.h.

References curA, curAcompl, curB, curBcompl, nextA, nextB, sA, and sB.

Member Data Documentation

◆ _length

int STuples::_length
private

The length of each tuple: A and B.

Definition at line 71 of file ssquarescub.h.

◆ _range

int STuples::_range
private

The range of numbers that may appear in the tuples.

The actual numbers are between 0 to _range - 1, inclusive.

Definition at line 75 of file ssquarescub.h.

◆ curA

std::vector<int> STuples::curA
private

The current choice of A.

Definition at line 84 of file ssquarescub.h.

Referenced by get(), and STuples().

◆ curAcompl

std::vector<int> STuples::curAcompl
private

The current choice of the complement of A.

Definition at line 87 of file ssquarescub.h.

Referenced by get(), and STuples().

◆ curB

std::vector<int> STuples::curB
private

The current choice of B.

Definition at line 96 of file ssquarescub.h.

Referenced by get(), and STuples().

◆ curBcompl

std::vector<int> STuples::curBcompl
private

The current choice of the complement of B.

Definition at line 99 of file ssquarescub.h.

Referenced by get(), and STuples().

◆ nextA

bool STuples::nextA
private

Remembers if the next choice of A is available.

Definition at line 81 of file ssquarescub.h.

Referenced by get(), and STuples().

◆ nextB

bool STuples::nextB
private

Remembers if the next choice of B is available.

Definition at line 93 of file ssquarescub.h.

Referenced by get(), and STuples().

◆ sA

Shuffles STuples::sA
private

The shuffle iterator that defines the current choice of A.

Definition at line 78 of file ssquarescub.h.

Referenced by get(), and STuples().

◆ sB

Shuffles STuples::sB
private

The shuffle iterator that defines the current choice of B.

Definition at line 90 of file ssquarescub.h.

Referenced by get(), and STuples().


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