00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00028 #ifndef _datacache_hh_
00029 #define _datacache_hh_
00030
00031 #include<string>
00032 #include<vector>
00033 #include<fstream>
00034
00035 #include"etreedef.hh"
00036
00038
00043 class DataCache {
00044
00045 private:
00046
00047 protected:
00048
00049 vector<double*> data;
00050 int dim;
00051
00052 int *shuffler;
00053 int currentVector;
00054
00055 void DeleteData();
00056 void CreateShuffler();
00057
00058 vector<string> labels;
00059
00060 public:
00061
00062 DataCache();
00063 ~DataCache();
00064 bool ReadFromDisk(string filename);
00065
00066
00067 const double* GetRandomVector();
00068 void Shuffle();
00069 void StartNewRound();
00070 const double* GetNextVector(bool &last);
00071 const double* GetVectorNumber(int number) const;
00072 int GetDimension() const { return dim; }
00073 int GetSize() const { return data.size(); }
00074 double *GetMinMax() const;
00075 string GetLabel(int n) const;
00076 };
00077
00078 #endif
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097