kspread

stats.h

00001 /*
00002     $Id: stats.h 466447 2005-10-02 17:54:10Z zander $
00003 
00004     KCalc, a scientific calculator for the X window system using the
00005     Qt widget libraries, available at no cost at http://www.troll.no
00006 
00007     Copyright (C) 1996 Bernd Johannes Wuebben
00008                        wuebben@math.cornell.edu
00009 
00010     This program is free software; you can redistribute it and/or modify
00011     it under the terms of the GNU General Public License as published by
00012     the Free Software Foundation; either version 2 of the License, or
00013     (at your option) any later version.
00014 
00015     This program is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018     GNU General Public License for more details.
00019 
00020     You should have received a copy of the GNU General Public License
00021     along with this program; if not, write to the Free Software
00022     Foundation, Inc., 51 Franklin Street, Fifth Floor,
00023  * Boston, MA 02110-1301, USA.
00024 
00025 */
00026 
00027 #ifndef KSTATS_H
00028 #define KSTATS_H
00029 
00030 #include <qptrlist.h>
00031 #include <math.h>
00032 #include "kcalctype.h"
00033 
00034 class KStats
00035 {
00036 
00037 public:
00038 
00039     KStats();
00040     ~KStats();
00041 
00042 public:
00043 
00044     void clearAll();
00045     void enterData(CALCAMNT data);
00046     void clearLast();
00047     CALCAMNT min();
00048     CALCAMNT max();
00049     CALCAMNT sum();
00050     CALCAMNT mul();
00051     CALCAMNT sum_of_squares();
00052     CALCAMNT mean();
00053     CALCAMNT median();
00054     CALCAMNT std_kernel();
00055     CALCAMNT std();
00056     CALCAMNT sample_std();
00057     int      count();
00058     bool     error();
00059 
00060 private:
00061 
00062     QPtrList<CALCAMNT> data;
00063     bool error_flag;
00064 
00065 };
00066 
00067 class MyList : public  QPtrList<CALCAMNT>
00068 {
00069 
00070 public:
00071 
00072   MyList() : QPtrList<CALCAMNT>() {};
00073 
00074 protected:
00075   int compareItems(Item item1,Item item2);
00076 };
00077 
00078 
00079 #endif /*KSTATS_H*/
00080 
KDE Home | KDE Accessibility Home | Description of Access Keys