11 Orientation(double probF = 0.5) {
13 prob[1] = 1.0 - probF;
16 Orientation& operator= (const Orientation& rv) {
17 if (this == &rv) return *this;
18 memcpy(prob, rv.prob, sizeof(rv.prob));
23 double getProb(int dir) { return prob[dir]; }
26 fscanf(fi, "%lf", &prob[0]);
27 prob[1] = 1.0 - prob[0];
30 void write(FILE* fo) {
31 fprintf(fo, "%.10g\n", prob[0]);
35 int simulate(simul* sampler) { return (sampler->random() < prob[0] ? 0 : 1); }
38 double prob[2]; //0 + 1 -
41 #endif /* ORIENTATION_H_ */