"platforms/brook/src/BrookRandomNumberGenerator.h" did not exist on "4ed009314e4530bd185fc7c723561e005bb3968a"
Commit 5d4dcb42 authored by peastman's avatar peastman
Browse files

Delete TabulatedFunctions when their owner is deleted

parent a773952e
......@@ -107,6 +107,7 @@ public:
* and per-bond parameters
*/
explicit CustomCompoundBondForce(int numParticles, const std::string& energy);
~CustomCompoundBondForce();
/**
* Get the number of particles used to define each bond.
*/
......
......@@ -182,6 +182,7 @@ public:
* Create a CustomGBForce.
*/
CustomGBForce();
~CustomGBForce();
/**
* Get the number of particles for which force field parameters have been defined.
*/
......
......@@ -125,6 +125,7 @@ public:
* per-acceptor parameters
*/
explicit CustomHbondForce(const std::string& energy);
~CustomHbondForce();
/**
* Get the number of donors for which force field parameters have been defined.
*/
......
......@@ -157,6 +157,7 @@ public:
* of r, the distance between them, as well as any global and per-particle parameters
*/
explicit CustomNonbondedForce(const std::string& energy);
~CustomNonbondedForce();
/**
* Get the number of particles for which force field parameters have been defined.
*/
......
......@@ -51,6 +51,12 @@ using std::vector;
CustomCompoundBondForce::CustomCompoundBondForce(int numParticles, const string& energy) : particlesPerBond(numParticles), energyExpression(energy) {
}
CustomCompoundBondForce::~CustomCompoundBondForce() {
for (int i = 0; i < (int) functions.size(); i++)
delete functions[i].function;
}
const string& CustomCompoundBondForce::getEnergyFunction() const {
return energyExpression;
}
......
......@@ -50,6 +50,11 @@ using std::vector;
CustomGBForce::CustomGBForce() : nonbondedMethod(NoCutoff), cutoffDistance(1.0) {
}
CustomGBForce::~CustomGBForce() {
for (int i = 0; i < (int) functions.size(); i++)
delete functions[i].function;
}
CustomGBForce::NonbondedMethod CustomGBForce::getNonbondedMethod() const {
return nonbondedMethod;
}
......
......@@ -50,6 +50,12 @@ using std::vector;
CustomHbondForce::CustomHbondForce(const string& energy) : energyExpression(energy), nonbondedMethod(NoCutoff), cutoffDistance(1.0) {
}
CustomHbondForce::~CustomHbondForce() {
for (int i = 0; i < (int) functions.size(); i++)
delete functions[i].function;
}
const string& CustomHbondForce::getEnergyFunction() const {
return energyExpression;
}
......
......@@ -51,6 +51,11 @@ CustomNonbondedForce::CustomNonbondedForce(const string& energy) : energyExpress
switchingDistance(-1.0), useSwitchingFunction(false), useLongRangeCorrection(false) {
}
CustomNonbondedForce::~CustomNonbondedForce() {
for (int i = 0; i < (int) functions.size(); i++)
delete functions[i].function;
}
const string& CustomNonbondedForce::getEnergyFunction() const {
return energyExpression;
}
......
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