|
vSMC
vSMC: Scalable Monte Carlo
|
Display a progress bar while algorithm proceed. More...
#include <vsmc/utility/progress.hpp>
Public Member Functions | |
| Progress (std::ostream &os=std::cout) | |
| Construct a Progress with an output stream. More... | |
| ~Progress () | |
| void | increment (std::size_t step=1) |
| Increment the iteration count. More... | |
| void | message (const std::string &msg) |
| Set a new message for display. More... | |
| void | start (std::size_t total, const std::string &msg=std::string(), std::size_t length=0, bool show_iter=true, double interval_s=0.1) |
| Start to print the progress. More... | |
| void | stop (bool finished=true) |
| Stop to print the progress. More... | |
Display a progress bar while algorithm proceed.
Definition at line 43 of file progress.hpp.
|
inline |
Construct a Progress with an output stream.
Definition at line 47 of file progress.hpp.
|
inline |
Definition at line 68 of file progress.hpp.
|
inline |
Increment the iteration count.
This member function is thread-safe, and can be called from multiple threads.
Definition at line 113 of file progress.hpp.
|
inline |
Set a new message for display.
Definition at line 116 of file progress.hpp.
|
inline |
Start to print the progress.
| total | Total amount of work represented by an integer, for example file size or SMC algorithm total number of iterations |
| msg | A (short) discreptive message |
| length | The length of the progress bar between brackets. If it is zero, then no bar is displayed at all |
| show_iter | Shall the iteration count be displayed. |
| interval_s | The sleep interval in seconds |
Definition at line 79 of file progress.hpp.
|
inline |
Stop to print the progress.
| finished | If true, then it is assumed that all work has been finished, and at the end the progress will be shown as 100% and total/total, where total is the first parameter of start. Otherwise, whatever progress has been made will be shown. |
Definition at line 99 of file progress.hpp.
1.8.11