00001 #ifndef NOPREDICTOR_HEADER_ 00002 #define NOPREDICTOR_HEADER_ 00003 00004 #include "../headers.h" 00005 00007 class MNoPredictor: public IStdEncPredictor { 00008 00009 DECLARE_TypeInfo_noSettings( MNoPredictor, "brute force" 00010 , "Doesn't predict, tries all possibilities." ) 00011 00012 public: 00015 IOneRangePredictor* newPredictor(const NewPredictorData &data) 00016 { return new OneRangePredictor( data.poolInfos->back().indexBegin, data.allowRotations ); } 00017 void cleanUp() {} // nothing to clean up 00019 00020 protected: 00023 class OneRangePredictor: public IOneRangePredictor { 00024 int domCount 00025 , rotations; 00026 00027 public: 00028 OneRangePredictor(int domainCount,bool allowRotations) 00029 : domCount(domainCount), rotations( allowRotations ? 8 : 1 ) {} 00032 Predictions& getChunk(float /*maxPredictedSE*/,Predictions &store) { 00033 store.clear(); 00034 if (domCount) { 00035 store.reserve(domCount*rotations); 00036 for (int id=0; id<domCount; ++id) 00037 for (int r=0; r<rotations; ++r) 00038 store.push_back( Prediction(id,r) ); 00039 domCount= 0; 00040 } 00041 return store; 00042 } 00044 }; // MNoPredictor::OneRangePredictor class 00045 00046 }; // MNoPredictor class 00047 00048 #endif