@@ -37,8 +37,8 @@ bool move_mol_to_new_cluster(t_pack_molecule* molecule,
37
37
}
38
38
39
39
// remove the molecule from its current cluster
40
- std::unordered_set<AtomBlockId>* old_clb_atoms = cluster_to_atoms (old_clb);
41
- if (old_clb_atoms-> size () == 1 ) {
40
+ std::unordered_set<AtomBlockId>& old_clb_atoms = cluster_to_mutable_atoms (old_clb);
41
+ if (old_clb_atoms. size () == 1 ) {
42
42
VTR_LOGV (verbosity > 4 , " Atom: %zu move failed. This is the last atom in its cluster.\n " );
43
43
return false ;
44
44
}
@@ -101,17 +101,17 @@ bool move_mol_to_existing_cluster(t_pack_molecule* molecule,
101
101
AtomBlockId root_atom_id = molecule->atom_block_ids [molecule->root ];
102
102
int molecule_size = get_array_size_of_molecule (molecule);
103
103
t_lb_router_data* old_router_data = nullptr ;
104
- std::unordered_set<AtomBlockId>* new_clb_atoms = cluster_to_atoms (new_clb);
104
+ std::unordered_set<AtomBlockId>& new_clb_atoms = cluster_to_mutable_atoms (new_clb);
105
105
ClusterBlockId old_clb = atom_to_cluster (root_atom_id);
106
106
107
- // check old and new clusters compitability
108
- bool is_compitable = check_type_and_mode_compitability (old_clb, new_clb, verbosity);
109
- if (!is_compitable )
107
+ // check old and new clusters compatibility
108
+ bool is_compatible = check_type_and_mode_compatibility (old_clb, new_clb, verbosity);
109
+ if (!is_compatible )
110
110
return false ;
111
111
112
112
// remove the molecule from its current cluster
113
- std::unordered_set<AtomBlockId>* old_clb_atoms = cluster_to_atoms (old_clb);
114
- if (old_clb_atoms-> size () == 1 ) {
113
+ std::unordered_set<AtomBlockId>& old_clb_atoms = cluster_to_mutable_atoms (old_clb);
114
+ if (old_clb_atoms. size () == 1 ) {
115
115
VTR_LOGV (verbosity > 4 , " Atom: %zu move failed. This is the last atom in its cluster.\n " );
116
116
return false ;
117
117
}
@@ -181,19 +181,21 @@ bool swap_two_molecules(t_pack_molecule* molecule_1,
181
181
return false ;
182
182
}
183
183
// Check that the old and new clusters are of the same type
184
- bool is_compitable = check_type_and_mode_compitability (clb_1, clb_2, verbosity);
184
+ bool is_compitable = check_type_and_mode_compatibility (clb_1, clb_2, verbosity);
185
185
if (!is_compitable)
186
186
return false ;
187
187
188
188
t_lb_router_data* old_1_router_data = nullptr ;
189
189
t_lb_router_data* old_2_router_data = nullptr ;
190
190
191
191
// save the atoms of the 2 clusters
192
- std::unordered_set<AtomBlockId>* clb_1_atoms = cluster_to_atoms (clb_1);
193
- std::unordered_set<AtomBlockId>* clb_2_atoms = cluster_to_atoms (clb_2);
192
+ std::unordered_set<AtomBlockId>& clb_1_atoms = cluster_to_mutable_atoms (clb_1);
193
+ std::unordered_set<AtomBlockId>& clb_2_atoms = cluster_to_mutable_atoms (clb_2);
194
194
195
- if (clb_1_atoms->size () == 1 || clb_2_atoms->size () == 1 ) {
196
- VTR_LOGV (verbosity > 4 , " Atom: %zu, %zu swap failed. This is the last atom in its cluster.\n " , molecule_1->atom_block_ids [molecule_1->root ], molecule_2->atom_block_ids [molecule_2->root ]);
195
+ if (clb_1_atoms.size () == 1 || clb_2_atoms.size () == 1 ) {
196
+ VTR_LOGV (verbosity > 4 , " Atom: %zu, %zu swap failed. This is the last atom in its cluster.\n " ,
197
+ molecule_1->atom_block_ids [molecule_1->root ],
198
+ molecule_2->atom_block_ids [molecule_2->root ]);
197
199
return false ;
198
200
}
199
201
0 commit comments