7#if !defined(TETENGO_LATTICE_NBESTITERATOR_HPP)
8#define TETENGO_LATTICE_NBESTITERATOR_HPP
17#include <boost/operators.hpp>
18#include <boost/stl_interfaces/iterator_interface.hpp>
33 class cap :
public boost::less_than_comparable<cap>
66 [[nodiscard]]
const std::vector<node>&
tail_path()
const;
86 std::vector<node> m_tail_path;
90 int m_whole_path_cost;
98 public boost::stl_interfaces::iterator_interface<n_best_iterator, std::forward_iterator_tag, path>
183 std::priority_queue<cap, std::vector<cap>, std::greater<cap>> m_caps;
185 std::size_t m_eos_hash;
187 std::shared_ptr<constraint> m_p_constraint;
A cap.
Definition n_best_iterator.hpp:34
cap(std::vector< node > tail_path, int tail_path_cost, int whole_path_cost)
Creates a cap.
int tail_path_cost() const
Returns the tail path cost.
int whole_path_cost() const
Returns the whole path cost.
friend bool operator<(const cap &one, const cap &another)
Returns true if one is less than another.
const std::vector< node > & tail_path() const
Returns the tail path.
A lattice.
Definition lattice.hpp:29
An N-best lattice path iterator.
Definition n_best_iterator.hpp:99
n_best_iterator()
Creates an iterator.
path * operator->()
Returns the pointer to the value.
n_best_iterator & operator++()
Increments the iterator.
path & operator*()
Dereferences the iterator.
n_best_iterator(const lattice &lattice_, node eos_node, std::unique_ptr< constraint > &&p_constraint)
Creates an iterator.
const path * operator->() const
Returns the pointer to the value.
const path & operator*() const
Dereferences the iterator.
n_best_iterator operator++(int)
Postincrements the iterator.
friend bool operator==(const n_best_iterator &one, const n_best_iterator &another)
Returns true when one iterator is equal to another.
A node.
Definition node.hpp:27
A path.
Definition path.hpp:21