@@ -37,8 +37,8 @@ bool move_mol_to_new_cluster(t_pack_molecule* molecule,
3737 }
3838
3939 // 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 ) {
4242 VTR_LOGV (verbosity > 4 , " Atom: %zu move failed. This is the last atom in its cluster.\n " );
4343 return false ;
4444 }
@@ -101,17 +101,17 @@ bool move_mol_to_existing_cluster(t_pack_molecule* molecule,
101101 AtomBlockId root_atom_id = molecule->atom_block_ids [molecule->root ];
102102 int molecule_size = get_array_size_of_molecule (molecule);
103103 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);
105105 ClusterBlockId old_clb = atom_to_cluster (root_atom_id);
106106
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 )
110110 return false ;
111111
112112 // 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 ) {
115115 VTR_LOGV (verbosity > 4 , " Atom: %zu move failed. This is the last atom in its cluster.\n " );
116116 return false ;
117117 }
@@ -181,19 +181,21 @@ bool swap_two_molecules(t_pack_molecule* molecule_1,
181181 return false ;
182182 }
183183 // 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);
185185 if (!is_compitable)
186186 return false ;
187187
188188 t_lb_router_data* old_1_router_data = nullptr ;
189189 t_lb_router_data* old_2_router_data = nullptr ;
190190
191191 // 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);
194194
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 ]);
197199 return false ;
198200 }
199201
0 commit comments