00001 #include "BidirectionalReorderingState.h"
00002
00003 namespace Moses
00004 {
00005
00007
00008
00009 size_t BidirectionalReorderingState::hash() const
00010 {
00011 size_t ret = m_backward->hash();
00012 boost::hash_combine(ret, m_forward->hash());
00013 return ret;
00014 }
00015
00016 bool BidirectionalReorderingState::operator==(const FFState& o) const
00017 {
00018 if (&o == this) return true;
00019
00020 BidirectionalReorderingState const &other
00021 = static_cast<BidirectionalReorderingState const&>(o);
00022
00023 bool ret = (*m_backward == *other.m_backward) && (*m_forward == *other.m_forward);
00024 return ret;
00025 }
00026
00027 LRState*
00028 BidirectionalReorderingState::
00029 Expand(const TranslationOption& topt, const InputType& input,
00030 ScoreComponentCollection* scores) const
00031 {
00032 LRState *newbwd = m_backward->Expand(topt,input, scores);
00033 LRState *newfwd = m_forward->Expand(topt, input, scores);
00034 return new BidirectionalReorderingState(m_configuration, newbwd, newfwd, m_offset);
00035 }
00036
00037 }
00038