Home | History | Annotate | Download | only in fst

Lines Matching full:class_id

104   // Add element_id to class_id. The Add method is used to initialize
107 void Add(T element_id, T class_id) {
110 if (classes_[class_id])
111 classes_[class_id]->prev = element;
112 element->next = classes_[class_id];
114 classes_[class_id] = element;
116 class_index_[element_id] = class_id;
117 class_size_[class_id]++;
120 // Move and element_id to class_id. Disconnects (removes) element
122 void Move(T element_id, T class_id) {
130 Add(element_id, class_id);
136 T class_id = class_index_[element_id];
137 if (class_size_[class_id] == 1) return;
140 if (split_size_[class_id] == 0)
141 visited_classes_.push_back(class_id);
144 split_size_[class_id]++;
147 if (class_split_[class_id] == 0)
148 class_split_[class_id] = classes_[class_id];
149 if (class_split_[class_id] == elements_[element_id])
150 class_split_[class_id] = elements_[element_id]->next;
153 Move(element_id, class_id);
156 // Finalize class_id, split if required, and update class_splits,
159 T SplitRefine(T class_id) {
161 if (class_size_[class_id] == split_size_[class_id]) {
162 class_split_[class_id] = 0;
163 split_size_[class_id] = 0;
168 size_t remainder = class_size_[class_id] - split_size_[class_id];
169 if (remainder < split_size_[class_id]) { // add smaller
170 Element* split_el = class_split_[class_id];
172 class_size_[class_id] = split_size_[class_id];
177 Element* split_el = class_split_[class_id];
178 classes_[new_class] = classes_[class_id];
179 class_size_[class_id] = remainder;
180 class_size_[new_class] = split_size_[class_id];
183 classes_[class_id] = split_el;
190 class_split_[class_id] = 0;
191 split_size_[class_id] = 0;
212 const T class_id(T element_id) const {
220 const size_t class_size(T class_id) const {
221 return class_size_[class_id];
260 PartitionIterator(const Partition<T>& partition, T class_id)
262 element_(p_.classes_[class_id]),
263 class_id_(class_id) {}