rdkit/rdkit — pull request #250 by ptosco (2014-04-15 21:42:40+00:00)
Title: - removed a few spurious, though non harmful,  "const" keywords from

- removed a few spurious, though non harmful, "const" keywords from
Code/ForceField/MMFF/Params.h, Code/ForceField/UFF/Params.h,
Code/GraphMol/ForceFieldHelpers/MMFF/AtomTyper.cpp
and Code/GraphMol/ForceFieldHelpers/MMFF/AtomTyper.h (I realized
their uselessness thanks to a warning issued by Intel C++ compiler)
- refactored O3A code; most notably:
* modified the signature of the "expert" O3A::O3A() constructor
to reduce calculations (e.g., heavy atom bit arrays can be passed rather
than being recomputed at each iteration) and to fix an important issue
which went unnoticed so far: since the "expert" constructor was
called by the "normal user" constructor iteratively to obtain the
best alignment, the original prbMol passed to the constructor was
altered at each iteration, which is not nice, since there is an align()
method to apply the final best transformation, while the constructor
is supposed to simply find it leaving the original coordinates unaltered.
This was especially troublesome using O3A::O3A in multithreaded
applications, where it was mandatory to make a copy upfront.
Even worse, the transformation returned by the trans() was basically
meaningless since it did not refer to the original coordinates but to
some intermediate coordinates of no relevance to the user.
Now all this is fixed, since the "normal user" constructor makes a
copy upfront, while the "expert" constructor allows to pass a pointer to
a copy of the molecule to save time on making copies at each iteration.
If the pointer is NULL or not specified, a copy is made on the fly.
Other minor issues might arise when less than 3 matches were found;
now the code is much more robust in that respect. If less than 3 matches
are found, no alignment is performed, score is set to 0.0 and the returned
is rmsd is the distance between the centroids of the original conformations.
* added the possibility to set weighted constraints on selected
atom pairs
* added an option to carry out local-only optimization
* removed obsolete and useless #ifdef O3A_CONSTRUCTOR preprocessor
directives