12 Orientation(double probF = 0.5) {
14 prob[1] = 1.0 - probF;
17 Orientation& operator= (const Orientation& rv) {
18 if (this == &rv) return *this;
19 memcpy(prob, rv.prob, sizeof(rv.prob));
24 double getProb(int dir) { return prob[dir]; }
27 assert(fscanf(fi, "%lf", &prob[0]) == 1);
28 prob[1] = 1.0 - prob[0];
31 void write(FILE* fo) {
32 fprintf(fo, "%.10g\n", prob[0]);
36 int simulate(simul* sampler) { return (sampler->random() < prob[0] ? 0 : 1); }
39 double prob[2]; //0 + 1 -
42 #endif /* ORIENTATION_H_ */