1 #ifndef NOPREDICTOR_HEADER_
2 #define NOPREDICTOR_HEADER_
4 #include "../headers.h"
6 /** Predictor that doesn't predict, just tries all the domains */
7 class MNoPredictor
: public IStdEncPredictor
{
9 DECLARE_TypeInfo_noSettings( MNoPredictor
, "brute force"
10 , "Doesn't predict, tries all possibilities." )
13 /** \name IStdEncPredictor interface
15 IOneRangePredictor
* newPredictor(const NewPredictorData
&data
)
16 { return new OneRangePredictor( data
.poolInfos
->back().indexBegin
, data
.allowRotations
); }
17 void cleanUp() {} // nothing to clean up
21 /** Predictor class returned when calling #newPredictor
22 * - returns all domains in all rotations in one chunk */
23 class OneRangePredictor
: public IOneRangePredictor
{
24 int domCount
/// the domain count
25 , rotations
; ///< the number of rotations used
28 OneRangePredictor(int domainCount
,bool allowRotations
)
29 : domCount(domainCount
), rotations( allowRotations
? 8 : 1 ) {}
30 /** \name OneRangePred interface
32 Predictions
& getChunk(float /*maxPredictedSE*/,Predictions
&store
) {
35 store
.reserve(domCount
*rotations
);
36 for (int id
=0; id
<domCount
; ++id
)
37 for (int r
=0; r
<rotations
; ++r
)
38 store
.push_back( Prediction(id
,r
) );
44 }; // MNoPredictor::OneRangePredictor class
46 }; // MNoPredictor class