655 size_t size = input_subset.size();
658 ((
ifst_->Properties(kILabelSorted,
false) & kILabelSorted) != 0);
661 for (
size_t i = 0;
i < size;
i++) {
667 *output_subset = input_subset;
671 for (
size_t i = 0;
i < size;
i++) {
674 ecinfo_.push_back(EpsilonClosureInfo(input_subset[
i],
675 input_subset[i].weight,
677 ecinfo_.back().element.weight = Weight::Zero();
688 elem.weight = Weight::Zero();
689 for (
size_t i = 0; i < s; i++) {
704 EpsilonClosureInfo &info =
ecinfo_[index];
705 Element &elem = info.element;
706 Weight unprocessed_weight = info.weight_to_process;
708 elem.weight =
Plus(elem.weight, unprocessed_weight);
709 info.weight_to_process = Weight::Zero();
711 info.in_queue =
false;
715 KALDI_ERR <<
"Determinization aborted since looped more than " 730 output_subset->clear();
733 output_subset->reserve(size);
734 for (
size_t i = 0; i < size; i++) {
735 EpsilonClosureInfo& info =
ecinfo_[
i];
736 if (info.weight_to_process != Weight::Zero()) {
737 info.element.weight =
Plus(info.element.weight, info.weight_to_process);
739 output_subset->push_back(info.element);
void AddOneElement(const Element &elem, const Weight &unprocessed_weight)
LatticeWeightTpl< FloatType > Plus(const LatticeWeightTpl< FloatType > &w1, const LatticeWeightTpl< FloatType > &w2)
std::deque< typename Arc::StateId > queue_
void ExpandOneElement(const Element &elem, bool sorted, const Weight &unprocessed_weight, bool save_to_queue_2=false)
std::vector< Element > queue_2_
std::vector< EpsilonClosureInfo > ecinfo_
Arc::StateId InputStateId
std::vector< int > id_to_index_