Commit a566a074 authored by Peter Eastman's avatar Peter Eastman
Browse files

Added index bounds checking to lots of methods

parent 12daada5
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/AmoebaTorsionTorsionForce.h" #include "openmm/AmoebaTorsionTorsionForce.h"
#include "openmm/serialization/XmlSerializer.h" #include "openmm/serialization/XmlSerializer.h"
#include <iostream> #include <iostream>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/AmoebaUreyBradleyForce.h" #include "openmm/AmoebaUreyBradleyForce.h"
#include "openmm/serialization/XmlSerializer.h" #include "openmm/serialization/XmlSerializer.h"
#include <iostream> #include <iostream>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/AmoebaVdwForce.h" #include "openmm/AmoebaVdwForce.h"
#include "openmm/serialization/XmlSerializer.h" #include "openmm/serialization/XmlSerializer.h"
#include <iostream> #include <iostream>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/AmoebaWcaDispersionForce.h" #include "openmm/AmoebaWcaDispersionForce.h"
#include "openmm/serialization/XmlSerializer.h" #include "openmm/serialization/XmlSerializer.h"
#include <iostream> #include <iostream>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* This tests the reference implementation of GBVIForce. * This tests the reference implementation of GBVIForce.
*/ */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/System.h" #include "openmm/System.h"
#include "openmm/Context.h" #include "openmm/Context.h"
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* This tests all the different force terms in the reference implementation of CustomGBForce. * This tests all the different force terms in the reference implementation of CustomGBForce.
*/ */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "sfmt/SFMT.h" #include "sfmt/SFMT.h"
#include "openmm/Context.h" #include "openmm/Context.h"
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
*/ */
#include "openmm/System.h" #include "openmm/System.h"
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "sfmt/SFMT.h" #include "sfmt/SFMT.h"
#include "openmm/Context.h" #include "openmm/Context.h"
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* This tests the reference implementation of GBVIForce. * This tests the reference implementation of GBVIForce.
*/ */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/Context.h" #include "openmm/Context.h"
#include "ReferencePlatform.h" #include "ReferencePlatform.h"
#include "openmm/GBVISoftcoreForce.h" #include "openmm/GBVISoftcoreForce.h"
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* This tests all the different force terms in the reference implementation of CustomGBForce. * This tests all the different force terms in the reference implementation of CustomGBForce.
*/ */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "sfmt/SFMT.h" #include "sfmt/SFMT.h"
#include "openmm/Context.h" #include "openmm/Context.h"
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* This tests all the different force terms in the reference implementation of CustomGBForce. * This tests all the different force terms in the reference implementation of CustomGBForce.
*/ */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "sfmt/SFMT.h" #include "sfmt/SFMT.h"
#include "openmm/Context.h" #include "openmm/Context.h"
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* Utility methods shared across unit tests * Utility methods shared across unit tests
*/ */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/Context.h" #include "openmm/Context.h"
#include "openmm/System.h" #include "openmm/System.h"
#include "../src/SimTKUtilities/SimTKOpenMMRealType.h" #include "../src/SimTKUtilities/SimTKOpenMMRealType.h"
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/GBSAOBCSoftcoreForce.h" #include "openmm/GBSAOBCSoftcoreForce.h"
#include "openmm/serialization/XmlSerializer.h" #include "openmm/serialization/XmlSerializer.h"
#include <iostream> #include <iostream>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/GBVISoftcoreForce.h" #include "openmm/GBVISoftcoreForce.h"
#include "openmm/serialization/XmlSerializer.h" #include "openmm/serialization/XmlSerializer.h"
#include <iostream> #include <iostream>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/NonbondedSoftcoreForce.h" #include "openmm/NonbondedSoftcoreForce.h"
#include "openmm/serialization/XmlSerializer.h" #include "openmm/serialization/XmlSerializer.h"
#include <iostream> #include <iostream>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* This tests the OpenCL implementation of RPMDIntegrator. * This tests the OpenCL implementation of RPMDIntegrator.
*/ */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/Context.h" #include "openmm/Context.h"
#include "openmm/CustomNonbondedForce.h" #include "openmm/CustomNonbondedForce.h"
#include "openmm/HarmonicBondForce.h" #include "openmm/HarmonicBondForce.h"
...@@ -73,7 +73,6 @@ void testFreeParticles() { ...@@ -73,7 +73,6 @@ void testFreeParticles() {
vector<double> ke(numCopies, 0.0); vector<double> ke(numCopies, 0.0);
vector<double> rg(numParticles, 0.0); vector<double> rg(numParticles, 0.0);
const RealOpenMM hbar = 1.054571628e-34*AVOGADRO/(1000*1e-12); const RealOpenMM hbar = 1.054571628e-34*AVOGADRO/(1000*1e-12);
const double wn = numCopies*BOLTZ*temperature/hbar;
for (int i = 0; i < numSteps; i++) { for (int i = 0; i < numSteps; i++) {
integ.step(1); integ.step(1);
vector<State> state(numCopies); vector<State> state(numCopies);
...@@ -167,7 +166,6 @@ void testParaHydrogen() { ...@@ -167,7 +166,6 @@ void testParaHydrogen() {
const double invBoxSize = 1.0/boxSize; const double invBoxSize = 1.0/boxSize;
double meanKE = 0.0; double meanKE = 0.0;
const RealOpenMM hbar = 1.054571628e-34*AVOGADRO/(1000*1e-12); const RealOpenMM hbar = 1.054571628e-34*AVOGADRO/(1000*1e-12);
const double wn = numCopies*BOLTZ*temperature/hbar;
for (int step = 0; step < numSteps; step++) { for (int step = 0; step < numSteps; step++) {
integ.step(20); integ.step(20);
vector<State> states(numCopies); vector<State> states(numCopies);
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* This tests the Reference implementation of RPMDIntegrator. * This tests the Reference implementation of RPMDIntegrator.
*/ */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/Context.h" #include "openmm/Context.h"
#include "openmm/HarmonicBondForce.h" #include "openmm/HarmonicBondForce.h"
#include "openmm/Platform.h" #include "openmm/Platform.h"
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/serialization/SerializationNode.h" #include "openmm/serialization/SerializationNode.h"
#include <iostream> #include <iostream>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/AndersenThermostat.h" #include "openmm/AndersenThermostat.h"
#include "openmm/serialization/XmlSerializer.h" #include "openmm/serialization/XmlSerializer.h"
#include <iostream> #include <iostream>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/CMAPTorsionForce.h" #include "openmm/CMAPTorsionForce.h"
#include "openmm/serialization/XmlSerializer.h" #include "openmm/serialization/XmlSerializer.h"
#include <iostream> #include <iostream>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "../../../tests/AssertionUtilities.h" #include "openmm/internal/AssertionUtilities.h"
#include "openmm/CMMotionRemover.h" #include "openmm/CMMotionRemover.h"
#include "openmm/serialization/XmlSerializer.h" #include "openmm/serialization/XmlSerializer.h"
#include <iostream> #include <iostream>
......
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