File indexing completed on 2021-12-21 14:36:21

0001 /*
0002     SPDX-FileCopyrightText: 2001-2013 Evan Teran <evan.teran@gmail.com>
0003     SPDX-FileCopyrightText: 1996-2000 Bernd Johannes Wuebben <wuebben@kde.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include "knumber.h"
0011 #include <QVector>
0012 
0013 class KStats
0014 {
0015 public:
0016     KStats();
0017     ~KStats();
0018 
0019 public:
0020     void clearAll();
0021     void enterData(const KNumber &data);
0022     void clearLast();
0023     KNumber sum() const;
0024     KNumber sum_of_squares() const;
0025     KNumber mean();
0026     KNumber median();
0027     KNumber std_kernel();
0028     KNumber std();
0029     KNumber sample_std();
0030     int count() const;
0031     bool error();
0032 
0033 private:
0034     QVector<KNumber> data_;
0035     bool error_flag_ = false;
0036 };
0037