00001 /*************************************************************************** 00002 bin.h - description 00003 ------------------- 00004 begin : Tue Jul 25 2000 00005 copyright : (C) 2000 by Michael Peeters 00006 email : Michael.Peeters@vub.ac.be 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef BIN_H 00019 #define BIN_H 00020 00021 #include "numerictypes.h" 00022 #include "utility.h" 00023 #include <vector> 00024 00029 namespace MODEL { 00030 00031 using namespace std; 00032 00037 // define the binning: 00038 // 0 : < start 00039 // 1 : >= start, <start + inc 00040 // 2 : >= start+inc, <start + 2*inc 00041 // ... 00042 // N : >= start+(N-1)*inc, <end 00043 // N+1:>= end 00044 00045 class Bin { 00046 public: 00047 00051 Bin(number start, number end, counter nobins=16); 00052 ~Bin(); 00053 00055 void add_value(number added); 00056 00058 vector<counter> get_histo( ); 00059 00061 vector<number> get_bins(void); 00062 00063 NO_COPY(Bin); 00064 00065 private: 00066 number x0; 00067 number x1; 00068 number dx; 00069 counter N; 00070 00071 vector<counter>* histogram; 00072 }; 00073 00074 } // end MODEL 00075 00076 #endif 00077 00078 /********************************************************************* 00079 $Id: bin.h,v 1.1 2001/05/22 10:54:55 mpeeters Exp $ 00080 ********************************************************************** 00081 00082 $Log: bin.h,v $ 00083 Revision 1.1 2001/05/22 10:54:55 mpeeters 00084 Moved sources and headers for libModel to model/ subdirectory, in an attempt to rationalize the source tree. This should make things "netter". 00085 00086 Revision 1.4 2001/05/21 11:53:16 mpeeters 00087 Removed Makefile.in, which is automatically generated anyway. 00088 00089 Revision 1.3 2000/10/09 09:46:56 mpeeters 00090 Administrative changes (new files etc...) 00091 Added NO_COPY to Bin 00092 00093 Revision 1.2 2000/09/15 10:26:31 mpeeters 00094 Cleaned out header and added CVS tails to files, removed superfuous 00095 @author comments, inserted dates 00096 00097 *********************************************************************/
More Info? Michael Peeters. Also, check our research website: www.alna.vub.ac.be
Last update: June 2002.