All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ratedMoveVector.cc
Go to the documentation of this file.
1 /* ratedMoveVector.cc
2  */
4 #include <boost/foreach.hpp>
5 #include <algorithm>
6 #include <functional>
7 #include <iostream>
8 
9 #ifndef MINIMAL
10 std::ostream& osl::rating::operator<<(std::ostream& os, RatedMoveVector const& mv)
11 {
12  os<< "RatedMoves" << std::endl;
13  BOOST_FOREACH(const RatedMove& move, mv) {
14  os << move << std::endl;
15  }
16  return os << std::endl;
17 }
18 #endif
19 
21 {
22  return l.size() == r.size()
23  && std::equal(l.begin(), l.end(), r.begin());
24 }
25 
27 {
28  std::sort(begin(), end(), std::greater<RatedMove>());
29 }
30 
32 {
33  for (const_iterator p=begin(); p!=end(); ++p)
34  if (p->move() == m)
35  return &*p;
36  return 0;
37 }
38 
39 /* ------------------------------------------------------------------------- */
40 // ;;; Local Variables:
41 // ;;; mode:c++
42 // ;;; c-basic-offset:2
43 // ;;; End:
44