16 #ifndef EVT_PRED_GEN_HH
17 #define EVT_PRED_GEN_HH
21 template <
class Generator,
class Predicate>
26 typedef typename Generator::result_type result_type;
29 : itsTried(0), itsPassed(0)
33 : itsGen(gen), itsPred(pred), itsTried(0), itsPassed(0)
37 : itsGen(other.itsGen), itsPred(other.itsPred),
38 itsTried(other.itsTried), itsPassed(other.itsPassed)
44 result_type operator()() {
51 result_type point = itsGen();
58 printf(
"No random point generated after %d attempts\n",MAX);
59 printf(
"Sharp peak? Consider using pole compensation.\n");
60 printf(
"I will now pick a point at random to return.\n");
64 inline int getTried()
const {
return itsTried; }
65 inline int getPassed()
const {
return itsPassed; }