ratedMoveVector.cc
Go to the documentation of this file.
/* ratedMoveVector.cc
*/
#include "osl/rating/ratedMoveVector.h"
#include <algorithm>
#include <functional>
#include <iostream>
#ifndef MINIMAL
std::ostream& osl::rating::operator<<(std::ostream& os, RatedMoveVector const& mv)
{
os<< "RatedMoves" << std::endl;
for (const auto& move: mv) {
os << move << std::endl;
}
return os << std::endl;
}
#endif
bool osl::rating::operator==(const RatedMoveVector& l, const RatedMoveVector& r)
{
return l.size() == r.size()
&& std::equal(l.begin(), l.end(), r.begin());
}
void osl::rating::RatedMoveVector::sort()
{
std::sort(begin(), end(), std::greater<RatedMove>());
}
const osl::rating::RatedMove* osl::rating::RatedMoveVector::find(Move m) const
{
for (const_iterator p=begin(); p!=end(); ++p)
if (p->move() == m)
return &*p;
return 0;
}
/* ------------------------------------------------------------------------- */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::FixedCapacityVector::size
size_t size() const
Definition container.h:243
osl::FixedCapacityVector::end
iterator end()
Definition container.h:199
osl::FixedCapacityVector::begin
iterator begin()
Definition container.h:198
osl::FixedCapacityVector< RatedMove, Move::MaxUniqMoves >::const_iterator
array_t::const_iterator const_iterator
Definition container.h:157
osl::Move
圧縮していない moveの表現 .
Definition basic_type.h:1052
osl::rating::RatedMoveVector
Definition ratedMoveVector.h:17
osl::rating::RatedMoveVector::sort
void sort()
ratingが高い順にsort
Definition ratedMoveVector.cc:25
osl::rating::RatedMoveVector::find
const RatedMove * find(Move) const
Definition ratedMoveVector.cc:30
osl::rating::RatedMove
Definition ratedMove.h:14
osl::rating::operator==
bool operator==(RatedMove const &lhs, RatedMove const &rhs)
Definition ratedMove.h:35
osl::rating::operator<<
std::ostream & operator<<(std::ostream &os, RatedMove const &moveLogProb)
Definition ratedMove.cc:6
ratedMoveVector.h