00001 00007 #ifndef RANDOMSAMPLEGENERATOR_H 00008 #define RANDOMSAMPLEGENERATOR_H RANDOMSAMPLEGENERATOR_H 00009 00010 #include "SampleGenerator.h" 00011 00016 class RandomSampleGenerator : public SampleGenerator 00017 { 00018 public: 00019 00028 void GetSamples(int n, float* u, float* v, float* weight) const 00029 { 00030 for (int i=0 ; i < n; i++) 00031 { 00032 u[i] = frand(); 00033 v[i] = frand(); 00034 weight[i] = 1.0 / float(n); 00035 } 00036 } 00037 00038 }; 00039 00040 #endif