GPLIB++
ArraySampleGenerator.h
Go to the documentation of this file.
1 #ifndef ARRAYSAMPLEGENERATOR_H_
2 #define ARRAYSAMPLEGENERATOR_H_
3 #include "VecMat.h"
4 
5 namespace gplib
6  {
7 
8  /** \addtogroup statistics Statistical methods */
9  /* @{ */
10  //! Sequentially returns the elements of an array
12  {
13  private:
14  int index;
15  gplib::rvec samples;
16  public:
17  double operator()()
18  {
19  index = (index + 1) % samples.size();
20  return samples(index);
21  }
22  ArraySampleGenerator(const gplib::rvec &s) :
23  index(-1), samples(s)
24  {
25  }
26  ;
28  {
29  }
30  ;
31  };
32  /* @} */
33  }
34 #endif /*ARRAYSAMPLEGENERATOR_H_*/
ArraySampleGenerator(const gplib::rvec &s)
Sequentially returns the elements of an array.