]> git.treefish.org Git - phys/latlib.git/blob - progress.cpp
refined exceptions.
[phys/latlib.git] / progress.cpp
1 #include "progress.h"
2
3 progress::progress(int a_realsteps, int a_progsteps)
4 {
5   laststep = 0;
6   realsteps = a_realsteps;
7   progsteps = a_progsteps;
8 }
9
10 bool progress::madeStep(int realStep)
11 {
12   if( (double)(realStep+1)*progsteps/realsteps >= laststep+1 ) {
13     laststep++;
14     return true;
15   }
16   else
17     return false;
18 }
19
20 double progress::done()
21 {
22   return (double)laststep/progsteps;
23 }