Commit a2a1e63e by maarten

alles doet 't weer

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@353 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent a83fb559
......@@ -25,7 +25,7 @@ class DistanceMap
DistanceMap(const DistanceMap&) = delete;
DistanceMap& operator=(const DistanceMap&) = delete;
// float operator()(const Atom& a, const Atom& b) const;
float operator()(const Atom& a, const Atom& b) const;
std::vector<Atom> near(const Atom& a, float maxDistance = 3.5f) const;
std::vector<Atom> near(const Point& p, float maxDistance = 3.5f) const;
......
......@@ -386,7 +386,7 @@ class Structure
void removeAtom(Atom& a);
void swapAtoms(Atom& a1, Atom& a2); // swap the labels for these atoms
void moveAtom(Atom& a, Point p); // move atom to a new location
void changeResidue(Residue& res, const std::string& newCompound,
void changeResidue(const Residue& res, const std::string& newCompound,
const std::vector<std::tuple<std::string,std::string>>& remappedAtoms);
// iterator for all residues
......
......@@ -278,49 +278,49 @@ void DistanceMap::AddDistancesForAtoms(const Residue& a, const Residue& b, DistM
}
}
//float DistanceMap::operator()(const Atom& a, const Atom& b) const
//{
// size_t ixa, ixb;
//
// try
// {
// ixa = index.at(a.id());
// }
// catch (const out_of_range& ex)
// {
// throw runtime_error("atom " + a.id() + " not found in distance map");
// }
//
// try
// {
// ixb = index.at(b.id());
// }
// catch (const out_of_range& ex)
// {
// throw runtime_error("atom " + b.id() + " not found in distance map");
// }
//
//// if (ixb < ixa)
//// std::swap(ixa, ixb);
//
// size_t L = mIA[ixa];
// size_t R = mIA[ixa + 1] - 1;
//
// while (L <= R)
// {
// size_t i = (L + R) / 2;
//
// if (mJA[i] == ixb)
// return get<0>(mA[i]);
//
// if (mJA[i] < ixb)
// L = i + 1;
// else
// R = i - 1;
// }
//
// return 100.f;
//}
float DistanceMap::operator()(const Atom& a, const Atom& b) const
{
size_t ixa, ixb;
try
{
ixa = index.at(a.id());
}
catch (const out_of_range& ex)
{
throw runtime_error("atom " + a.id() + " not found in distance map");
}
try
{
ixb = index.at(b.id());
}
catch (const out_of_range& ex)
{
throw runtime_error("atom " + b.id() + " not found in distance map");
}
// if (ixb < ixa)
// std::swap(ixa, ixb);
size_t L = mIA[ixa];
size_t R = mIA[ixa + 1] - 1;
while (L <= R)
{
size_t i = (L + R) / 2;
if (mJA[i] == ixb)
return get<0>(mA[i]);
if (mJA[i] < ixb)
L = i + 1;
else
R = i - 1;
}
return 100.f;
}
vector<Atom> DistanceMap::near(const Atom& a, float maxDistance) const
{
......
......@@ -1666,7 +1666,7 @@ void Structure::moveAtom(Atom& a, Point p)
a.location(p);
}
void Structure::changeResidue(Residue& res, const string& newCompound,
void Structure::changeResidue(const Residue& res, const string& newCompound,
const vector<tuple<string,string>>& remappedAtoms)
{
cif::Datablock& db = *mFile.impl().mDb;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment