Tree Compression with Top Trees Revisited
Public Member Functions | Public Attributes | List of all members
RandomLabels< RNG > Struct Template Reference

Uniformly random labels. More...

#include <Labels.h>

Inheritance diagram for RandomLabels< RNG >:
Inheritance graph
[legend]
Collaboration diagram for RandomLabels< RNG >:
Collaboration graph
[legend]

Public Member Functions

 RandomLabels (uint numLabels, uint maxLabel, RNG &generator)
 
const int & operator[] (uint index) const
 
void set (uint id, const int &value)
 

Public Attributes

std::vector< int > labels
 

Detailed Description

template<typename RNG>
struct RandomLabels< RNG >

Uniformly random labels.

Definition at line 76 of file Labels.h.

Constructor & Destructor Documentation

template<typename RNG>
RandomLabels< RNG >::RandomLabels ( uint  numLabels,
uint  maxLabel,
RNG &  generator 
)
inline

Create a new set of labels, distributed uniformly at random

Parameters
numLabelsthe number of labels to generate
maxLabelthe range of labels to generate (e.g., for 0 to 9, specify 10)
generatorthe random generator to use

Definition at line 81 of file Labels.h.

Member Function Documentation

template<typename RNG>
const int& RandomLabels< RNG >::operator[] ( uint  index) const
inlinevirtual

Access operator

Parameters
indexthe index of the label to look up
Returns
the label value for the given index

Implements LabelsT< int >.

Definition at line 88 of file Labels.h.

template<typename RNG>
void RandomLabels< RNG >::set ( uint  id,
const int &  value 
)
inlinevirtual

Set a label

Parameters
idthe index of the label to set
valuethe value to set the label to

Implements LabelsT< int >.

Definition at line 93 of file Labels.h.

Member Data Documentation

template<typename RNG>
std::vector<int> RandomLabels< RNG >::labels

Definition at line 98 of file Labels.h.


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