Helios++
Helios software for LiDAR simulations
SurfaceInspector::maths::permuters::CNRIndexPermuter< T > Class Template Reference

Permuter of Combinations with No Repetition (CNR) for indices. More...

#include <CNRIndexPermuter.hpp>

Inheritance diagram for SurfaceInspector::maths::permuters::CNRIndexPermuter< T >:
Collaboration diagram for SurfaceInspector::maths::permuters::CNRIndexPermuter< T >:

Public Member Functions

 CNRIndexPermuter (T n, T k)
 Build a permuter for combinations with no repetitions of \(n\) indices selecting \(k\). More...
 
void start ()
 
bool hasNext ()
 
vector< T > next ()
 
vector< T > get ()
 

Protected Attributes

n
 How many indices there are, so it defines a range \([0, n)\).
 
k
 How many indices are selected for each permutation.
 
max
 How many combinations without repetitions, \({{n}{\choose{k}}\), there exist.
 
current
 Index of current permutation.
 
vector< T > indices
 Current indices permutation.
 
stopIndex
 Index to be used as stop condition.
 

Detailed Description

template<typename T>
class SurfaceInspector::maths::permuters::CNRIndexPermuter< T >

Permuter of Combinations with No Repetition (CNR) for indices.

Template Parameters
TMust be an integer type (int, long, size_t, ...) because it is going to be used to represent an index

Constructor & Destructor Documentation

◆ CNRIndexPermuter()

template<typename T >
SurfaceInspector::maths::permuters::CNRIndexPermuter< T >::CNRIndexPermuter ( n,
k 
)

Build a permuter for combinations with no repetitions of \(n\) indices selecting \(k\).

Parameters
nHow many indices, so they will range in interval \([0, n)\)
kHow many selections

Member Function Documentation

◆ get()

template<typename T >
vector<T> SurfaceInspector::maths::permuters::CNRIndexPermuter< T >::get ( )
inlinevirtual

◆ hasNext()

template<typename T >
bool SurfaceInspector::maths::permuters::CNRIndexPermuter< T >::hasNext ( )
inlinevirtual

◆ next()

template<typename T >
vector<T> SurfaceInspector::maths::permuters::CNRIndexPermuter< T >::next ( )
virtual

◆ start()

template<typename T >
void SurfaceInspector::maths::permuters::CNRIndexPermuter< T >::start ( )
inlinevirtual

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