kspread

stats.h
1/*
2 $Id: stats.h 466447 2005-10-02 17:54:10Z zander $
3
4 KCalc, a scientific calculator for the X window system using the
5 TQt widget libraries, available at no cost at http://www.troll.no
6
7 Copyright (C) 1996 Bernd Johannes Wuebben
8 wuebben@math.cornell.edu
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
24
25*/
26
27#ifndef KSTATS_H
28#define KSTATS_H
29
30#include <tqptrlist.h>
31#include <math.h>
32#include "kcalctype.h"
33
34class KStats
35{
36
37public:
38
39 KStats();
40 ~KStats();
41
42public:
43
44 void clearAll();
45 void enterData(CALCAMNT data);
46 void clearLast();
47 CALCAMNT min();
48 CALCAMNT max();
49 CALCAMNT sum();
50 CALCAMNT mul();
51 CALCAMNT sum_of_squares();
52 CALCAMNT mean();
53 CALCAMNT median();
54 CALCAMNT std_kernel();
55 CALCAMNT std();
56 CALCAMNT sample_std();
57 int count();
58 bool error();
59
60private:
61
62 TQPtrList<CALCAMNT> data;
63 bool error_flag;
64
65};
66
67class MyList : public TQPtrList<CALCAMNT>
68{
69
70public:
71
72 MyList() : TQPtrList<CALCAMNT>() {};
73
74protected:
75 int compareItems(Item item1,Item item2);
76};
77
78
79#endif /*KSTATS_H*/
80