Cute Chess 0.1
elo.h
1/*
2 This file is part of Cute Chess.
3 Copyright (C) 2008-2018 Cute Chess authors
4
5 Cute Chess is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Cute Chess is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef ELO_H
20#define ELO_H
21
22#include <QtGlobal>
23
33class LIB_EXPORT Elo
34{
35 public:
37 Elo(int wins, int losses, int draws);
38
40 qreal diff() const;
42 qreal errorMargin() const;
44 qreal pointRatio() const;
46 qreal drawRatio() const;
48 qreal LOS() const;
49
50 private:
51 int m_wins;
52 int m_losses;
53 int m_draws;
54 qreal m_mu;
55 qreal m_stdev;
56
57 // Elo difference
58 static qreal diff(qreal p);
59 // Inverted error function
60 static qreal erfInv(qreal x);
61 // Quantile function for the standard Gaussian law:
62 // probability -> quantile
63 static qreal phiInv(qreal p);
64};
65
66#endif // ELO_H
qreal errorMargin() const
Definition elo.cpp:44
qreal drawRatio() const
Definition elo.cpp:28
Elo(int wins, int losses, int draws)
Definition elo.cpp:4
qreal pointRatio() const
Definition elo.cpp:22
qreal LOS() const
Definition elo.cpp:71
qreal diff() const
Definition elo.cpp:34