ArraySampleGenerator.h

Go to the documentation of this file.
00001 #ifndef ARRAYSAMPLEGENERATOR_H_
00002 #define ARRAYSAMPLEGENERATOR_H_
00003 #include "VecMat.h"
00004 
00005 namespace gplib
00006   {
00007 
00008     /** \addtogroup statistics Statistical methods */
00009     /* @{ */
00010     //! Sequentially returns the elements of an array
00011     class ArraySampleGenerator
00012       {
00013     private:
00014       int index;
00015       gplib::rvec samples;
00016     public:
00017       double operator()()
00018         {
00019           index = (index + 1) % samples.size();
00020           return samples(index);
00021         }
00022       ArraySampleGenerator(const gplib::rvec &s) :
00023         index(-1), samples(s)
00024         {
00025         }
00026       ;
00027       virtual ~ArraySampleGenerator()
00028         {
00029         }
00030       ;
00031       };
00032   /* @} */
00033   }
00034 #endif /*ARRAYSAMPLEGENERATOR_H_*/

Generated on Tue May 4 16:52:14 2010 for GPLIB++ by  doxygen 1.5.8