SHOGUN  6.1.3
List of all members | Classes | Public Member Functions
PRange< T > Class Template Reference

Detailed Description

template<typename T>
class shogun::PRange< T >

Definition at line 449 of file progress.h.

Classes

class  PIterator
 

Public Member Functions

 PRange (Range< T > range, const SGIO &io, const std::string prefix, const SG_PRG_MODE mode, std::function< bool()> condition)
 
PIterator begin () const
 
PIterator end () const
 
float64_t get_current_progress () const
 
void print_progress () const
 
void print_absolute (float64_t current_val, float64_t val, float64_t min_value, float64_t max_value) const
 
void complete () const
 
void complete_absolute () const
 

Constructor & Destructor Documentation

◆ PRange()

PRange ( Range< T >  range,
const SGIO io,
const std::string  prefix,
const SG_PRG_MODE  mode,
std::function< bool()>  condition 
)

Constructor, initialize the progress bar manager.

Parameters
rangethe range to loop over
iothe SGIO object which will be used to print the progress bar
prefixthe string prefix which will be printed before the progress bar
modethe char mode used to print the progress bar (ASCII, UTF8 etc.)
conditionpremature stop condition for the loop

Definition at line 464 of file progress.h.

Member Function Documentation

◆ begin()

PIterator begin ( ) const

Create the iterator that corresponds to the start of the range. Used within the range-based loop version of the progress bar.

for (auto i: progress(range(0, 10), io, ASCII))
{
//Do stuff
}
Returns
PIterator that represents the start of the range

Definition at line 572 of file progress.h.

◆ complete()

void complete ( ) const

Print the progress bar end. This method must be called one time, after the loop.

auto pr = progress(range(0,10), ASCII);
for (int i=0; i<10; i++)
{
// Do stuff
pr.print_progress();
}
pr.complete();

Definition at line 652 of file progress.h.

◆ complete_absolute()

void complete_absolute ( ) const

Print the progress bar end. This method must be called one time, after the loop.

auto pr = progress(range(0,10), ASCII);
for (int i=0; i<10; i++)
{
// Do stuff
pr.print_absolute();
}
pr.complete_absolute();

Definition at line 671 of file progress.h.

◆ end()

PIterator end ( ) const

Create the iterator that corresponds to the end of the range. Used within the range-based loop version of the progress bar.

for (auto i: progress(range(0, 10), io, ASCII))
{
//Do stuff
}
Returns
PIterator that represent the end of the range.

Definition at line 589 of file progress.h.

◆ get_current_progress()

float64_t get_current_progress ( ) const

Return the current progress bar value. Used for testing purposes.

Returns
current progress bar value.

Definition at line 599 of file progress.h.

◆ print_absolute()

void print_absolute ( float64_t  current_val,
float64_t  val,
float64_t  min_value,
float64_t  max_value 
) const

Print the absolute progress bar. This method must be called each time we want the progress bar to be updated.

Parameters
current_valcurrent value
valvalue
min_valminimum value
max_valmaximum value

Definition at line 631 of file progress.h.

◆ print_progress()

void print_progress ( ) const

Print the progress bar. This method must be called each time we want the progress bar to be updated.

auto pr = progress(range(0,10), ASCII);
for (int i=0; i<10; i++)
{
// Do stuff
pr.print_progress();
}
pr.complete();

Definition at line 617 of file progress.h.


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

SHOGUN Machine Learning Toolbox - Documentation