23 std::vector<unsigned> AtomIdx;
24 std::vector<unsigned> BondIdx;
30 std::vector<unsigned>::iterator it =
31 std::lower_bound(AtomIdx.begin(), AtomIdx.end(), i);
32 AtomIdx.insert(it, i);
35 std::vector<unsigned>::iterator it =
36 std::lower_bound(BondIdx.begin(), BondIdx.end(), i);
37 BondIdx.insert(it, i);
41 return AtomIdx.size() == right.AtomIdx.size() &&
42 BondIdx.size() == right.BondIdx.size() &&
43 0 == memcmp(&AtomIdx[0], &right.AtomIdx[0],
44 AtomIdx.size() *
sizeof(
unsigned)) &&
45 0 == memcmp(&BondIdx[0], &right.BondIdx[0],
46 BondIdx.size() *
sizeof(
unsigned));
50 if (AtomIdx.size() < right.AtomIdx.size()) {
53 if (AtomIdx.size() > right.AtomIdx.size()) {
57 if (BondIdx.size() < right.BondIdx.size()) {
60 if (BondIdx.size() > right.BondIdx.size()) {
66 diff = memcmp(&AtomIdx[0], &right.AtomIdx[0],
67 AtomIdx.size() *
sizeof(
unsigned));
74 return memcmp(&BondIdx[0], &right.BondIdx[0],
75 BondIdx.size() *
sizeof(
unsigned)) < 0;
80 std::map<TKey, TValue> Index;
95 std::map<TKey, TValue>::const_iterator entryit = Index.find(key);
96 if (Index.end() != entryit) {
97 value = entryit->second;
99 return Index.end() != entryit;
107 Index.insert(std::pair<TKey, bool>(key, found));
size_t getNumAtoms() const
bool operator==(const TKey &right) const
bool operator<(const TKey &right) const
size_t getNumBonds() const
void add(const TKey &key, TValue found=true)
bool find(const TKey &key, TValue &value) const