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