RDKit
Open-source cheminformatics and machine learning.
Toggle main menu visibility
Loading...
Searching...
No Matches
SeedSet.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2014 Novartis Institutes for BioMedical Research
3
//
4
// @@ All Rights Reserved @@
5
// This file is part of the RDKit.
6
// The contents are covered by the terms of the BSD license
7
// which is included in the file license.txt, found at the root
8
// of the RDKit source tree.
9
//
10
#include <
RDGeneral/export.h
>
11
#pragma once
12
#include <map>
13
#include <algorithm>
14
#include "
Seed.h
"
15
16
namespace
RDKit
{
17
namespace
FMCS
{
18
class
RDKIT_FMCS_EXPORT
SeedSet
{
// sorted by amount of bonds
19
typedef
std::list<Seed> ValueSet;
20
ValueSet Seeds;
21
Seed
EmptySeed;
22
23
public
:
24
typedef
Seed
Value
;
25
typedef
ValueSet::iterator
iterator
;
26
typedef
ValueSet::const_iterator
const_iterator
;
27
28
public
:
29
void
clear
() { Seeds.clear(); }
30
void
erase
(
iterator
where) { Seeds.erase(where); }
31
size_t
size
() {
32
return
Seeds.size();
// for statistics only
33
}
34
bool
empty
() {
return
Seeds.empty(); }
35
iterator
begin
() {
return
Seeds.begin(); }
36
iterator
end
() {
return
Seeds.end(); }
37
Value
&
front
() {
return
Seeds.front(); }
38
const_iterator
begin
()
const
{
return
Seeds.begin(); }
39
const_iterator
end
()
const
{
return
Seeds.end(); }
40
const
Value
&
front
()
const
{
return
Seeds.front(); }
41
42
Value
&
push_back
(
const
Value
&seed) {
43
Seeds.push_back(seed);
44
return
Seeds.back();
45
}
46
Value
&
add
(
const
Value
&seed) {
47
iterator
where;
48
for
(where = Seeds.begin(); where != Seeds.end();
49
where++) {
// find position in sorted list
50
if
(where->getNumBonds() < seed.getNumBonds()) {
51
break
;
52
}
53
}
54
iterator
it = Seeds.insert(where, EmptySeed);
55
Value
&val = *it;
56
val.
setMoleculeFragment
(seed);
57
58
return
val;
59
}
60
};
61
}
// namespace FMCS
62
}
// namespace RDKit
Seed.h
RDKit::FMCS::SeedSet
Definition
SeedSet.h:18
RDKit::FMCS::SeedSet::end
iterator end()
Definition
SeedSet.h:36
RDKit::FMCS::SeedSet::iterator
ValueSet::iterator iterator
Definition
SeedSet.h:25
RDKit::FMCS::SeedSet::add
Value & add(const Value &seed)
Definition
SeedSet.h:46
RDKit::FMCS::SeedSet::begin
iterator begin()
Definition
SeedSet.h:35
RDKit::FMCS::SeedSet::size
size_t size()
Definition
SeedSet.h:31
RDKit::FMCS::SeedSet::Value
Seed Value
Definition
SeedSet.h:24
RDKit::FMCS::SeedSet::begin
const_iterator begin() const
Definition
SeedSet.h:38
RDKit::FMCS::SeedSet::push_back
Value & push_back(const Value &seed)
Definition
SeedSet.h:42
RDKit::FMCS::SeedSet::const_iterator
ValueSet::const_iterator const_iterator
Definition
SeedSet.h:26
RDKit::FMCS::SeedSet::front
Value & front()
Definition
SeedSet.h:37
RDKit::FMCS::SeedSet::erase
void erase(iterator where)
Definition
SeedSet.h:30
RDKit::FMCS::SeedSet::front
const Value & front() const
Definition
SeedSet.h:40
RDKit::FMCS::SeedSet::empty
bool empty()
Definition
SeedSet.h:34
RDKit::FMCS::SeedSet::clear
void clear()
Definition
SeedSet.h:29
RDKit::FMCS::SeedSet::end
const_iterator end() const
Definition
SeedSet.h:39
RDKit::FMCS::Seed
Definition
Seed.h:61
RDKit::FMCS::Seed::setMoleculeFragment
void setMoleculeFragment(const Seed &src)
Definition
Seed.h:124
export.h
RDKIT_FMCS_EXPORT
#define RDKIT_FMCS_EXPORT
Definition
export.h:211
RDKit::FMCS
Definition
Composition2N.h:13
RDKit
Std stuff.
Definition
Abbreviations.h:19
GraphMol
FMCS
SeedSet.h
Generated on
for RDKit by
1.17.0