Lines Matching defs:Subset
103 float delta; // Quantization delta for subset weights
219 typedef std::forward_list<Element> Subset;
220 typedef map<Label, Subset*> LabelMap;
244 Subset *subset = new Subset;
245 subset->push_front(element);
246 return FindState(subset);
250 Subset *subset = subsets_[s];
252 for (typename Subset::iterator siter = subset->begin();
253 siter != subset->end();
262 // Finds the state corresponding to a subset. Only creates a new state
263 // if the subset is not found in the subset hash. FindState takes
264 // ownership of the subset argument (so that it doesn't have to copy it
268 // associative container subset_hash_ are of the form (subset,
269 // id(subset) + 1), i.e. subset_hash_[subset] > 0 if subset has been
271 // subset_hash_[subset] creates a new pair (subset, 0). As a result,
272 // subset_hash_[subset] == 0 iff subset is new.
273 StateId FindState(Subset *subset) {
274 StateId &assoc_value = subset_hash_[subset];
275 if (assoc_value == 0) { // subset wasn't present; assign it a new ID
276 subsets_.push_back(subset);
279 delete subset;
299 // Constructs destination subsets per label. At return, subset
303 Subset *src_subset = subsets_[s];
305 for (typename Subset::iterator siter = src_subset->begin();
315 Subset* &dest_subset = (*label_map)[arc.ilabel];
317 dest_subset = new Subset;
324 // with subset DEST_SUBSET (as created by LabelSubsets).
325 void AddArc(StateId s, Label label, Subset *dest_subset) {
331 typename Subset::iterator oiter;
332 for (typename Subset::iterator diter = dest_subset->begin();
355 // Divides out label weight from destination subset elements.
358 for (typename Subset::iterator diter = dest_subset->begin();
372 // Comparison object for hashing Subset(s). Subsets are not sorted in this
383 // NULL for each state in the subset arguments. When this operator
386 bool operator()(Subset* subset1, Subset* subset2) const {
392 // Loads first subset elements in element vector.
393 for (typename Subset::iterator iter1 = subset1->begin();
400 // Checks second subset matches first via element vector.
401 for (typename Subset::iterator iter2 = subset2->begin();
408 for (typename Subset::iterator iter1 = subset1->begin();
423 // Hash function for Subset to Fst states. Subset elements are not
425 // under subset reordering.
428 size_t operator()(const Subset* subset) const {
430 for (typename Subset::const_iterator iter = subset->begin();
431 iter != subset->end();
447 float delta_; // Quantization delta for subset weights
453 // Maps from StateId to Subset.
454 vector<Subset *> subsets_;
456 // Hashes from Subset to its StateId in the output automaton.
457 typedef std::unordered_map<Subset *, StateId, SubsetKey, SubsetEqual>
684 float delta; // Quantization delta for subset weights