My Project
ratedMoveVector.cc
Go to the documentation of this file.
1/* ratedMoveVector.cc
2 */
4#include <algorithm>
5#include <functional>
6#include <iostream>
7
8#ifndef MINIMAL
9std::ostream& osl::rating::operator<<(std::ostream& os, RatedMoveVector const& mv)
10{
11 os<< "RatedMoves" << std::endl;
12 for (const auto& move: mv) {
13 os << move << std::endl;
14 }
15 return os << std::endl;
16}
17#endif
18
20{
21 return l.size() == r.size()
22 && std::equal(l.begin(), l.end(), r.begin());
23}
24
26{
27 std::sort(begin(), end(), std::greater<RatedMove>());
28}
29
31{
32 for (const_iterator p=begin(); p!=end(); ++p)
33 if (p->move() == m)
34 return &*p;
35 return 0;
36}
37
38/* ------------------------------------------------------------------------- */
39// ;;; Local Variables:
40// ;;; mode:c++
41// ;;; c-basic-offset:2
42// ;;; End:
43
size_t size() const
Definition container.h:243
array_t::const_iterator const_iterator
Definition container.h:157
圧縮していない moveの表現 .
void sort()
ratingが高い順にsort
const RatedMove * find(Move) const
bool operator==(RatedMove const &lhs, RatedMove const &rhs)
Definition ratedMove.h:35
std::ostream & operator<<(std::ostream &os, RatedMove const &moveLogProb)
Definition ratedMove.cc:6