00001 #ifndef OSL_MOVE_LOG_PROB_VECTOR_H 00002 #define OSL_MOVE_LOG_PROB_VECTOR_H 00003 #include "osl/moveLogProb.h" 00004 #include "osl/container.h" 00005 #include <iosfwd> 00006 00007 namespace osl 00008 { 00009 namespace container 00010 { 00011 typedef FixedCapacityVector<MoveLogProb,Move::MaxUniqMoves> MoveLogProbVectorBase; 00012 00013 class MoveLogProbVector : public MoveLogProbVectorBase 00014 { 00015 typedef MoveLogProbVectorBase base_t; 00016 public: 00017 MoveLogProbVector() {} 00018 explicit MoveLogProbVector(size_t size) : MoveLogProbVectorBase(size) 00019 { 00020 } 00021 MoveLogProbVector(const MoveLogProbVector& src) : MoveLogProbVectorBase(src) 00022 { 00023 } 00024 template <class RangeIterator> 00025 MoveLogProbVector(const RangeIterator& first, const RangeIterator& last) 00026 : MoveLogProbVectorBase(first, last) 00027 { 00028 } 00029 void push_back(Move move,int prob) { 00030 base_t::push_back(MoveLogProb(move,prob)); 00031 } 00032 void push_back(const MoveLogProb& move) { 00033 base_t::push_back(move); 00034 } 00035 template <class RangeIterator> 00036 void push_back(const RangeIterator& first, const RangeIterator& last) 00037 { 00038 MoveLogProbVectorBase::push_back(first, last); 00039 } 00041 void sortByProbability(); 00043 void sortByProbabilityReverse(); 00044 const MoveLogProb* find(Move) const; 00045 }; 00046 std::ostream& operator<<(std::ostream& os,MoveLogProbVector const& mv); 00047 bool operator==(const MoveLogProbVector& l, const MoveLogProbVector& r); 00048 00049 } // namespace container 00050 using container::MoveLogProbVector; 00051 } // namespace osl 00052 #endif // OSL_MOVE_LOG_PROB_VECTOR_H 00053 // ;;; Local Variables: 00054 // ;;; mode:c++ 00055 // ;;; c-basic-offset:2 00056 // ;;; coding:utf-8 00057 // ;;; End: