5#ifndef GEMMI_BOND_IDX_HPP_
6#define GEMMI_BOND_IDX_HPP_
24 std::map<int, std::vector<AtomImage>>
index;
28 if (!
index.emplace(cra.atom->serial, std::vector<AtomImage>()).second)
29 fail(
"duplicated serial numbers");
49 for (
const Residue& res : chain.residues) {
56 fail(
"Monomer description not found: " + res.name);
58 for (
char alt : altlocs)
62 if (!
at1->altloc && !
at2->altloc)
75 for (
int distance = 1; distance <=
max_distance; ++distance) {
76 for (
size_t n =
neighbors.size(); n--; ) {
79 ai.same_image = !
ai.same_image;
80 if (
ai.atom_serial == b.
serial &&
ai.same_image == same_image)
void add_distinct_altlocs(const Residue &res, std::string &altlocs)
bool in_vector(const T &x, const std::vector< T > &v)
void fail(const std::string &msg)
Represents atom site in macromolecular structure (~100 bytes).
bool operator==(const AtomImage &o) const
std::map< int, std::vector< AtomImage > > index
void add_link(const Atom &a, const Atom &b, bool same_image)
bool are_linked(const Atom &a, const Atom &b, bool same_image) const
void add_oneway_link(const Atom &a, const Atom &b, bool same_image)
void add_monomer_bonds(MonLib &monlib)
int graph_distance(const Atom &a, const Atom &b, bool same_image, int max_distance=4) const
BondIndex(const Model &model_)