-//
-// Computes the integral
-//
-// +inf
-// /
-// |
-// | ProbScore[a] (r1-r2) Gaussian[mu2, sigma2] (r2) dr2
-// |
-// /
-// -inf
-//
-// For practical reasons, -inf and +inf are replaced by 0 and 3000, which
-// is reasonable in the this context.
-//
-// The Gaussian is not normalized.
-//
-// Set the last parameter to 1.0 if player 1 won, or -1.0 if player 2 won.
-// In the latter case, ProbScore will be given (r2-r1) instead of (r1-r2).
-//
-class ProbScoreEvaluator {
-private:
- int k;
- double a;
- double binomial_precompute, r1, mu2, sigma2, winfac;
-
-public:
- ProbScoreEvaluator(int k, double a, double binomial_precompute, double r1, double mu2, double sigma2, double winfac)
- : k(k), a(a), binomial_precompute(binomial_precompute), r1(r1), mu2(mu2), sigma2(sigma2), winfac(winfac) {}
- inline double operator() (double x) const
- {
- double probscore = prob_score_real(k, a, binomial_precompute, (r1 - x)*winfac);
- double z = (x - mu2)/sigma2;
- double gaussian = exp(-(z*z/2.0));
- return probscore * gaussian;
- }
-};
-
-void convolve(int size)
-{
-}
-
-void compute_opponent_rating_pdf(int k, double a, double mu2, double sigma2, double winfac, vector<pair<double, double> > &result)