File tree 2 files changed +10
-9
lines changed
core/indigo-core/molecule
2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 19
19
#ifndef __molecule_rgroups_composition__
20
20
#define __molecule_rgroups_composition__
21
21
22
+ #include < map>
22
23
#include < memory>
23
24
24
25
#include " base_cpp/array.h"
25
- #include " base_cpp/multimap.h"
26
26
#include " molecule/molecule.h"
27
27
28
28
namespace indigo
@@ -240,13 +240,13 @@ namespace indigo
240
240
241
241
inline Fragment _fragment_coordinates (int rsite, int fragment) const
242
242
{
243
- const RedBlackSet<int >& rs = _rsite2rgroup[_rsite2vertex.at (rsite)];
244
-
245
243
int r = -1 ;
246
244
int f = fragment;
247
- for (int i = rs.begin (); i != rs.end (); i = rs.next (i))
245
+ const auto it_end = _rsite2rgroup.upper_bound (_rsite2vertex.at (rsite));
246
+
247
+ for (auto it = _rsite2rgroup.lower_bound (_rsite2vertex.at (rsite)); it != it_end; it++)
248
248
{
249
- r = rs. key (i) ;
249
+ r = it-> second ;
250
250
int size = _rgroup2size[r];
251
251
if (f >= size)
252
252
{
@@ -281,7 +281,7 @@ namespace indigo
281
281
282
282
Array<int > _limits;
283
283
Array<int > _rgroup2size;
284
- MultiMap <int , int > _rsite2rgroup;
284
+ std::multimap <int , int > _rsite2rgroup;
285
285
RedBlackMap<int , int > _rsite2vertex;
286
286
287
287
mutable std::unique_ptr<Attachments> _ats;
Original file line number Diff line number Diff line change 16
16
* limitations under the License.
17
17
***************************************************************************/
18
18
19
- #include < map>
20
-
21
19
#include " base_cpp/array.h"
22
20
#include " molecule/base_molecule.h"
23
21
@@ -44,7 +42,10 @@ MoleculeRGroupsComposition::MoleculeRGroupsComposition(BaseMolecule& mol)
44
42
45
43
Array<int > rgroups;
46
44
_mol.getAllowedRGroups (vertex, rgroups);
47
- _rsite2rgroup.insert (vertex, rgroups);
45
+ for (const auto & rgroup : rgroups)
46
+ {
47
+ _rsite2rgroup.emplace (vertex, rgroup);
48
+ }
48
49
49
50
int total = 0 ;
50
51
for (int i = 0 ; i < rgroups.size (); i++)
You can’t perform that action at this time.
0 commit comments