16 Commits

Author SHA1 Message Date
Hussein Faara
44364fd982 remove no-op macros and dead code (pt 4) (#8037)
* remove no-op macros and dead code (pt 4)

* review comments
2025-01-26 07:49:50 +01:00
Ricardo Rodriguez
999d9097c1 fix potential division by zero (#8007) 2024-11-15 16:16:29 +01:00
Anna Brünisholz
d315e246e1 Cleanup: Force field (#7406)
* 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>
2024-05-10 13:22:15 +02:00
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +02:00
Eisuke Kawashima
75f03412ef Modernize deprecated header inclusion (#3137) 2020-05-04 10:40:57 +02:00
Greg Landrum
d41752d558 run clang-tidy with readability-braces-around-statements (#2899)
* run clang-tidy with readability-braces-around-statements
clang-format the results
clean up all the parts that clang-tidy-8 broke

* fix problem on windows
2020-01-25 14:19:32 +01:00
Paolo Tosco
4d6f099431 Fixes a bug in TorsionConstraint (#2732)
* - fixed UFF/MMFF torsion constraints when the dihedral is set to 0.0
- removed some code duplication
- added relevant test and fixed existing ones

* - fix Windows exports

* - added PRECONDITION for RDGeom::Point3D pointers
- removed inline keywords
2019-10-24 16:03:58 +02:00
Brian Kelley
7488840ac4 Fix/urange check (#1506)
* 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
2017-09-11 21:17:33 +02:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Brian Kelley
fb84c9f0b7 Switches to URANGE_CHECK when appropriate 2015-10-18 21:14:02 -04:00
ptosco
ba4a48ce05 - fixed a bug in Code/ForceField/MMFF/testMMFFForceField.cpp
- 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
2014-06-01 16:23:03 +01:00
ptosco
5b70cdbdc1 - added relative DistanceConstraints (i.e., +/- with respect
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
2013-12-02 19:58:29 +01:00
ptosco
dbf04ca926 The only relevant changes to implement Marcus Martin corrections
to original Rappe' UFF equations are in Code/ForceField/UFF/AngleBend.cpp
and Code/ForceField/UFF/BondStretch.cpp; the changes in
Code/ForceField/UFF/TorsionAngle.cpp are purely cosmetic.

Tests modified according to the small differences in geometries
and energies following the implementation of those corrections:
- Code/ForceField/UFF/testUFFForceField.cpp,
- Code/GraphMol/DistGeomHelpers/Wrap/testDistGeom.py,
- Code/GraphMol/DistGeomHelpers/testDgeomHelpers.cpp,
- Code/GraphMol/MolChemicalFeatures/Wrap/testChemicalFeatures.py,
- rdkit/Chem/Pharm3D/UnitTestEmbed.py

Coordinate files modified according to the small differences in
geometries following the implementation of those corrections:
- Code/GraphMol/DistGeomHelpers/test_data/initCoords.random.sdf
2013-09-24 11:29:33 +02:00
Greg Landrum
f3fbef45c5 update copyright statements 2010-09-26 17:04:37 +00:00
Greg Landrum
5d03333c22 setup svn keywords (should have done this before import... grn) 2006-05-06 22:54:39 +00:00
Greg Landrum
75a79b6327 initial import 2006-05-06 22:20:08 +00:00