Lines Matching refs:states_
51 for (StateId s = 0; s < states_.size(); ++s) in ~VectorFstBaseImpl()
52 delete states_[s]; in ~VectorFstBaseImpl() local
57 Weight Final(StateId s) const { return states_[s]->final; } in Final()
59 StateId NumStates() const { return states_.size(); } in NumStates()
61 size_t NumArcs(StateId s) const { return states_[s]->arcs.size(); } in NumArcs()
65 void SetFinal(StateId s, Weight w) { states_[s]->final = w; } in SetFinal()
68 states_.push_back(new State); in AddState()
69 return states_.size() - 1; in AddState()
73 states_.push_back(state); in AddState()
74 return states_.size() - 1; in AddState()
78 states_[s]->arcs.push_back(arc); in AddArc()
82 vector<StateId> newid(states_.size(), 0); in DeleteStates()
86 for (StateId s = 0; s < states_.size(); ++s) { in DeleteStates()
90 states_[nstates] = states_[s]; in DeleteStates()
93 delete states_[s]; in DeleteStates() local
96 states_.resize(nstates); in DeleteStates()
97 for (StateId s = 0; s < states_.size(); ++s) { in DeleteStates()
98 vector<Arc> &arcs = states_[s]->arcs; in DeleteStates()
109 --states_[s]->niepsilons; in DeleteStates()
111 --states_[s]->noepsilons; in DeleteStates()
121 for (StateId s = 0; s < states_.size(); ++s) in DeleteStates()
122 delete states_[s]; in DeleteStates() local
123 states_.clear(); in DeleteStates()
128 states_[s]->arcs.resize(states_[s]->arcs.size() - n); in DeleteArcs()
131 void DeleteArcs(StateId s) { states_[s]->arcs.clear(); } in DeleteArcs()
133 State *GetState(StateId s) { return states_[s]; } in GetState()
135 const State *GetState(StateId s) const { return states_[s]; } in GetState()
137 void SetState(StateId s, State *state) { states_[s] = state; } in SetState()
139 void ReserveStates(StateId n) { states_.reserve(n); } in ReserveStates()
141 void ReserveArcs(StateId s, size_t n) { states_[s]->arcs.reserve(n); } in ReserveArcs()
146 data->nstates = states_.size(); in InitStateIterator()
152 data->narcs = states_[s]->arcs.size(); in InitArcIterator()
153 data->arcs = data->narcs > 0 ? &states_[s]->arcs[0] : 0; in InitArcIterator()
158 vector<State *> states_; // States represenation.