* Condense MMFF electrostatics and contrib instances.
Previously, a separate contrib had been added for each common term.
Each of these required a separate allocation, and a separate dynamic dispatch
on call. This change moves to an SOA style, making data access contiguous and
drastically reducing the number of calls.
* Make suggested copyright fixes and svn artifact removals
* fix unsigned int to int comparison
* revert previous mistake
* declaration & init together, sinthetaSq in [0, 1]
* using std::swap
* use that sinThetaSq in [0,1]
* declare & init at same time
* use knowledge about target range
* use std::clamp
* use std::max
* numerically more stable trigonometrics
* numerically more stable trigonometrics
* numerically more stable trigonometrics
* range based for-loop
* actually do the assignement
* Update Code/ForceField/MMFF/Params.h
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
* implemented suggested changes
* Revert "implemented suggested changes"
This reverts commit f56e8f0ab2.
* auto typing
* remove old comment
* revert to numerically more stable expression
* now correctly formatted
---------
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
* Fixes atom documentation
* Fixes#1461
This is a complicated one. Basically URANGE_CHECK when
used on unsigned integers has a problem when the size of
the range it’s checking is 0. The standard operations is
to check
URANGE(num, size-1)
Which (for unsigned integers) obviously rolls over.
This fixes all usage cases to be
URANGE(num+1, size)
And fixes the bugs found. (addBond and the mmff tests)
* Fixes#1461 - Updates URANGE_CHECK to be 0<=x<hi
(i.e., equilibrium distances/angles and force constants) from
UFF and MMFF in response to two requests recently appeared
on the RDKit-discuss mailing list:
http://sourceforge.net/p/rdkit/mailman/message/32953737/http://sourceforge.net/p/rdkit/mailman/message/32880156/
- did some clean up on the MMFF code
- NB there are two ABI changes:
1) StretchBendContrib(ForceField *owner,
const unsigned int idx1, const unsigned int idx2, const unsigned int idx3,
const MMFFStbn *mmffStbnParams, const MMFFAngle *mmffAngleParams,
const MMFFBond *mmffBondParams1, const MMFFBond *mmffBondParams2);
previously was:
StretchBendContrib(ForceField *owner,
const unsigned int idx1, const unsigned int idx2, const unsigned int idx3,
const std::pair<bool, const MMFFStbn *> mmffStbnParams,
const MMFFAngle *mmffAngleParams, const MMFFBond *mmffBondParams1,
const MMFFBond *mmffBondParams2);
2) std::pair<double, double> calcStbnForceConstants(const MMFFStbn *mmffStbnParams);
previously was:
std::pair<double, double> calcStbnForceConstants
(const std::pair<bool, const MMFFStbn *> mmffStbnParams);
The two changes are NOT mandatory - however, both the StretchBendContrib constructor
and calcStbnForceConstants(), though public, are basically "internal" method that
most likely no-one has ever invoked. Given that the current API is MUCH better
and cleaner, I would really advise for the new version.
- fixed a bug in Code/GraphMol/ForceFieldHelpers/MMFF/AtomTyper.cpp
which caused misassignment of atom types in CYGUAN01 upon shuffling
the order of atoms in the validation SDF files
- added checks for acos and asin function parameters to be within
a (-1, 1) range
to the current value) (C++/Python)
- added absolute/relative AngleConstraints (C++/Python)
- added absolute/relative TorsionConstraints (C++/Python)
- added PositionConstraints (C++/Python)
- exposed fixedPoints from Python
- added relevant C++/Python tests
- removed a number of redundant "this->" in member functions
- moved some getGrad() code into Utils::calcAngleBendGrad and
Utils::calcTorsionGrad to avoid repeating the same code
for constraints
Code/ForceField and Code/GraphMol/ForceFieldHelpers to the
respective UFF subfolders since from now on UFF will not be
the only available force field anymore. I updated the
relevant CMakeLists.txt files accordingly.
Paolo