Commit 1d5c7417 authored by Peter Eastman's avatar Peter Eastman
Browse files

Added default values for some arguments

parent 11d2d8ae
...@@ -171,7 +171,7 @@ public: ...@@ -171,7 +171,7 @@ public:
* @param parameters the list of parameters for the new angle * @param parameters the list of parameters for the new angle
* @return the index of the angle that was added * @return the index of the angle that was added
*/ */
int addAngle(int particle1, int particle2, int particle3, const std::vector<double>& parameters); int addAngle(int particle1, int particle2, int particle3, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Get the force field parameters for an angle term. * Get the force field parameters for an angle term.
* *
...@@ -191,7 +191,7 @@ public: ...@@ -191,7 +191,7 @@ public:
* @param particle3 the index of the third particle connected by the angle * @param particle3 the index of the third particle connected by the angle
* @param parameters the list of parameters for the angle * @param parameters the list of parameters for the angle
*/ */
void setAngleParameters(int index, int particle1, int particle2, int particle3, const std::vector<double>& parameters); void setAngleParameters(int index, int particle1, int particle2, int particle3, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Update the per-angle parameters in a Context to match those stored in this Force object. This method provides * Update the per-angle parameters in a Context to match those stored in this Force object. This method provides
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it. * an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
......
...@@ -170,7 +170,7 @@ public: ...@@ -170,7 +170,7 @@ public:
* @param parameters the list of parameters for the new bond * @param parameters the list of parameters for the new bond
* @return the index of the bond that was added * @return the index of the bond that was added
*/ */
int addBond(int particle1, int particle2, const std::vector<double>& parameters); int addBond(int particle1, int particle2, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Get the force field parameters for a bond term. * Get the force field parameters for a bond term.
* *
...@@ -188,7 +188,7 @@ public: ...@@ -188,7 +188,7 @@ public:
* @param particle2 the index of the second particle connected by the bond * @param particle2 the index of the second particle connected by the bond
* @param parameters the list of parameters for the bond * @param parameters the list of parameters for the bond
*/ */
void setBondParameters(int index, int particle1, int particle2, const std::vector<double>& parameters); void setBondParameters(int index, int particle1, int particle2, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Update the per-bond parameters in a Context to match those stored in this Force object. This method provides * Update the per-bond parameters in a Context to match those stored in this Force object. This method provides
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it. * an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
......
...@@ -237,7 +237,7 @@ public: ...@@ -237,7 +237,7 @@ public:
* If this is omitted, then particle masses will be used as weights. * If this is omitted, then particle masses will be used as weights.
* @return the index of the group that was added * @return the index of the group that was added
*/ */
int addGroup(const std::vector<int>& particles, const std::vector<double>& weights = std::vector<double>()); int addGroup(const std::vector<int>& particles, const std::vector<double>& weights=std::vector<double>());
/** /**
* Get the properties of a group. * Get the properties of a group.
* *
...@@ -256,7 +256,7 @@ public: ...@@ -256,7 +256,7 @@ public:
* @param weights the weight to use for each particle when computing the center position. * @param weights the weight to use for each particle when computing the center position.
* If this is omitted, then particle masses will be used as weights. * If this is omitted, then particle masses will be used as weights.
*/ */
void setGroupParameters(int index, const std::vector<int>& particles, const std::vector<double>& weights = std::vector<double>()); void setGroupParameters(int index, const std::vector<int>& particles, const std::vector<double>& weights=std::vector<double>());
/** /**
* Add a bond to the force * Add a bond to the force
* *
...@@ -264,7 +264,7 @@ public: ...@@ -264,7 +264,7 @@ public:
* @param parameters the list of per-bond parameter values for the new bond * @param parameters the list of per-bond parameter values for the new bond
* @return the index of the bond that was added * @return the index of the bond that was added
*/ */
int addBond(const std::vector<int>& groups, const std::vector<double>& parameters); int addBond(const std::vector<int>& groups, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Get the properties of a bond. * Get the properties of a bond.
* *
...@@ -280,7 +280,7 @@ public: ...@@ -280,7 +280,7 @@ public:
* @param groups the indices of the groups in the bond * @param groups the indices of the groups in the bond
* @param parameters the list of per-bond parameter values for the bond * @param parameters the list of per-bond parameter values for the bond
*/ */
void setBondParameters(int index, const std::vector<int>& groups, const std::vector<double>& parameters); void setBondParameters(int index, const std::vector<int>& groups, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Add a tabulated function that may appear in the energy expression. * Add a tabulated function that may appear in the energy expression.
* *
......
...@@ -219,7 +219,7 @@ public: ...@@ -219,7 +219,7 @@ public:
* @param parameters the list of per-bond parameter values for the new bond * @param parameters the list of per-bond parameter values for the new bond
* @return the index of the bond that was added * @return the index of the bond that was added
*/ */
int addBond(const std::vector<int>& particles, const std::vector<double>& parameters); int addBond(const std::vector<int>& particles, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Get the properties of a bond. * Get the properties of a bond.
* *
...@@ -235,7 +235,7 @@ public: ...@@ -235,7 +235,7 @@ public:
* @param particles the indices of the particles in the bond * @param particles the indices of the particles in the bond
* @param parameters the list of per-bond parameter values for the bond * @param parameters the list of per-bond parameter values for the bond
*/ */
void setBondParameters(int index, const std::vector<int>& particles, const std::vector<double>& parameters); void setBondParameters(int index, const std::vector<int>& particles, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Add a tabulated function that may appear in the energy expression. * Add a tabulated function that may appear in the energy expression.
* *
......
...@@ -180,7 +180,7 @@ public: ...@@ -180,7 +180,7 @@ public:
* @param parameters the list of parameters for the new force term * @param parameters the list of parameters for the new force term
* @return the index of the particle term that was added * @return the index of the particle term that was added
*/ */
int addParticle(int particle, const std::vector<double>& parameters); int addParticle(int particle, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Get the force field parameters for a force field term. * Get the force field parameters for a force field term.
* *
...@@ -196,7 +196,7 @@ public: ...@@ -196,7 +196,7 @@ public:
* @param particle the index of the particle this term is applied to * @param particle the index of the particle this term is applied to
* @param parameters the list of parameters for the force field term * @param parameters the list of parameters for the force field term
*/ */
void setParticleParameters(int index, int particle, const std::vector<double>& parameters); void setParticleParameters(int index, int particle, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Update the per-particle parameters in a Context to match those stored in this Force object. This method provides * Update the per-particle parameters in a Context to match those stored in this Force object. This method provides
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it. * an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
......
...@@ -319,7 +319,7 @@ public: ...@@ -319,7 +319,7 @@ public:
* @param parameters the list of parameters for the new particle * @param parameters the list of parameters for the new particle
* @return the index of the particle that was added * @return the index of the particle that was added
*/ */
int addParticle(const std::vector<double>& parameters); int addParticle(const std::vector<double>& parameters=std::vector<double>());
/** /**
* Get the nonbonded force parameters for a particle. * Get the nonbonded force parameters for a particle.
* *
......
...@@ -296,7 +296,7 @@ public: ...@@ -296,7 +296,7 @@ public:
* @param parameters the list of per-donor parameter values for the new donor * @param parameters the list of per-donor parameter values for the new donor
* @return the index of the donor that was added * @return the index of the donor that was added
*/ */
int addDonor(int d1, int d2, int d3, const std::vector<double>& parameters); int addDonor(int d1, int d2, int d3, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Get the properties of a donor group. * Get the properties of a donor group.
* *
...@@ -320,7 +320,7 @@ public: ...@@ -320,7 +320,7 @@ public:
* less than three particles, this must be -1. * less than three particles, this must be -1.
* @param parameters the list of per-donor parameter values for the donor * @param parameters the list of per-donor parameter values for the donor
*/ */
void setDonorParameters(int index, int d1, int d2, int d3, const std::vector<double>& parameters); void setDonorParameters(int index, int d1, int d2, int d3, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Add an acceptor group to the force * Add an acceptor group to the force
* *
...@@ -332,7 +332,7 @@ public: ...@@ -332,7 +332,7 @@ public:
* @param parameters the list of per-acceptor parameter values for the new acceptor * @param parameters the list of per-acceptor parameter values for the new acceptor
* @return the index of the acceptor that was added * @return the index of the acceptor that was added
*/ */
int addAcceptor(int a1, int a2, int a3, const std::vector<double>& parameters); int addAcceptor(int a1, int a2, int a3, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Get the properties of an acceptor group. * Get the properties of an acceptor group.
* *
...@@ -356,7 +356,7 @@ public: ...@@ -356,7 +356,7 @@ public:
* less than three particles, this must be -1. * less than three particles, this must be -1.
* @param parameters the list of per-acceptor parameter values for the acceptor * @param parameters the list of per-acceptor parameter values for the acceptor
*/ */
void setAcceptorParameters(int index, int a1, int a2, int a3, const std::vector<double>& parameters); void setAcceptorParameters(int index, int a1, int a2, int a3, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Add a donor-acceptor pair to the list of interactions that should be excluded. * Add a donor-acceptor pair to the list of interactions that should be excluded.
* *
......
...@@ -348,7 +348,7 @@ public: ...@@ -348,7 +348,7 @@ public:
* @param type the type of the new particle * @param type the type of the new particle
* @return the index of the particle that was added * @return the index of the particle that was added
*/ */
int addParticle(const std::vector<double>& parameters, int type=0); int addParticle(const std::vector<double>& parameters=std::vector<double>(), int type=0);
/** /**
* Get the nonbonded force parameters for a particle. * Get the nonbonded force parameters for a particle.
* *
......
...@@ -328,7 +328,7 @@ public: ...@@ -328,7 +328,7 @@ public:
* @param parameters the list of parameters for the new particle * @param parameters the list of parameters for the new particle
* @return the index of the particle that was added * @return the index of the particle that was added
*/ */
int addParticle(const std::vector<double>& parameters); int addParticle(const std::vector<double>& parameters=std::vector<double>());
/** /**
* Get the nonbonded force parameters for a particle. * Get the nonbonded force parameters for a particle.
* *
......
...@@ -172,7 +172,7 @@ public: ...@@ -172,7 +172,7 @@ public:
* @param parameters the list of parameters for the new torsion * @param parameters the list of parameters for the new torsion
* @return the index of the torsion that was added * @return the index of the torsion that was added
*/ */
int addTorsion(int particle1, int particle2, int particle3, int particle4, const std::vector<double>& parameters); int addTorsion(int particle1, int particle2, int particle3, int particle4, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Get the force field parameters for a torsion term. * Get the force field parameters for a torsion term.
* *
...@@ -194,7 +194,7 @@ public: ...@@ -194,7 +194,7 @@ public:
* @param particle4 the index of the fourth particle connected by the torsion * @param particle4 the index of the fourth particle connected by the torsion
* @param parameters the list of parameters for the torsion * @param parameters the list of parameters for the torsion
*/ */
void setTorsionParameters(int index, int particle1, int particle2, int particle3, int particle4, const std::vector<double>& parameters); void setTorsionParameters(int index, int particle1, int particle2, int particle3, int particle4, const std::vector<double>& parameters=std::vector<double>());
/** /**
* Update the per-torsion parameters in a Context to match those stored in this Force object. This method provides * Update the per-torsion parameters in a Context to match those stored in this Force object. This method provides
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it. * an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
......
...@@ -132,8 +132,7 @@ void testIllegalVariable() { ...@@ -132,8 +132,7 @@ void testIllegalVariable() {
system.addParticle(1.0); system.addParticle(1.0);
system.addParticle(1.0); system.addParticle(1.0);
CustomAngleForce* force = new CustomAngleForce("theta+none"); CustomAngleForce* force = new CustomAngleForce("theta+none");
vector<double> params; force->addAngle(0, 1, 2);
force->addAngle(0, 1, 2, params);
system.addForce(force); system.addForce(force);
VerletIntegrator integrator(0.001); VerletIntegrator integrator(0.001);
bool threwException = false; bool threwException = false;
......
...@@ -135,8 +135,7 @@ void testIllegalVariable() { ...@@ -135,8 +135,7 @@ void testIllegalVariable() {
system.addParticle(1.0); system.addParticle(1.0);
system.addParticle(1.0); system.addParticle(1.0);
CustomBondForce* force = new CustomBondForce("r+none"); CustomBondForce* force = new CustomBondForce("r+none");
vector<double> params; force->addBond(0, 1);
force->addBond(0, 1, params);
system.addForce(force); system.addForce(force);
VerletIntegrator integrator(0.001); VerletIntegrator integrator(0.001);
bool threwException = false; bool threwException = false;
......
...@@ -264,8 +264,7 @@ void testIllegalVariable() { ...@@ -264,8 +264,7 @@ void testIllegalVariable() {
vector<int> groups; vector<int> groups;
groups.push_back(0); groups.push_back(0);
groups.push_back(1); groups.push_back(1);
vector<double> params; force->addBond(groups);
force->addBond(groups, params);
system.addForce(force); system.addForce(force);
VerletIntegrator integrator(0.001); VerletIntegrator integrator(0.001);
bool threwException = false; bool threwException = false;
......
...@@ -317,8 +317,7 @@ void testIllegalVariable() { ...@@ -317,8 +317,7 @@ void testIllegalVariable() {
vector<int> particles; vector<int> particles;
particles.push_back(0); particles.push_back(0);
particles.push_back(1); particles.push_back(1);
vector<double> params; force->addBond(particles);
force->addBond(particles, params);
system.addForce(force); system.addForce(force);
VerletIntegrator integrator(0.001); VerletIntegrator integrator(0.001);
bool threwException = false; bool threwException = false;
......
...@@ -171,8 +171,7 @@ void testIllegalVariable() { ...@@ -171,8 +171,7 @@ void testIllegalVariable() {
System system; System system;
system.addParticle(1.0); system.addParticle(1.0);
CustomExternalForce* force = new CustomExternalForce("x+none"); CustomExternalForce* force = new CustomExternalForce("x+none");
vector<double> params; force->addParticle(0);
force->addParticle(0, params);
system.addForce(force); system.addForce(force);
VerletIntegrator integrator(0.001); VerletIntegrator integrator(0.001);
bool threwException = false; bool threwException = false;
......
...@@ -475,8 +475,7 @@ void testIllegalVariable() { ...@@ -475,8 +475,7 @@ void testIllegalVariable() {
system.addParticle(1.0); system.addParticle(1.0);
CustomGBForce* force = new CustomGBForce(); CustomGBForce* force = new CustomGBForce();
force->addComputedValue("a", "r+none", CustomGBForce::ParticlePair); force->addComputedValue("a", "r+none", CustomGBForce::ParticlePair);
vector<double> params; force->addParticle();
force->addParticle(params);
system.addForce(force); system.addForce(force);
VerletIntegrator integrator(0.001); VerletIntegrator integrator(0.001);
bool threwException = false; bool threwException = false;
......
...@@ -230,9 +230,8 @@ void testIllegalVariable() { ...@@ -230,9 +230,8 @@ void testIllegalVariable() {
system.addParticle(1.0); system.addParticle(1.0);
system.addParticle(1.0); system.addParticle(1.0);
CustomHbondForce* force = new CustomHbondForce("1+none"); CustomHbondForce* force = new CustomHbondForce("1+none");
vector<double> params; force->addDonor(0, -1, -1);
force->addDonor(0, -1, -1, params); force->addAcceptor(1, -1, -1);
force->addAcceptor(1, -1, -1, params);
system.addForce(force); system.addForce(force);
VerletIntegrator integrator(0.001); VerletIntegrator integrator(0.001);
bool threwException = false; bool threwException = false;
......
...@@ -711,8 +711,7 @@ void testIllegalVariable() { ...@@ -711,8 +711,7 @@ void testIllegalVariable() {
System system; System system;
system.addParticle(1.0); system.addParticle(1.0);
CustomManyParticleForce* force = new CustomManyParticleForce(2, "x1+y2+none"); CustomManyParticleForce* force = new CustomManyParticleForce(2, "x1+y2+none");
vector<double> params; force->addParticle();
force->addParticle(params);
system.addForce(force); system.addForce(force);
VerletIntegrator integrator(0.001); VerletIntegrator integrator(0.001);
bool threwException = false; bool threwException = false;
......
...@@ -997,8 +997,7 @@ void testIllegalVariable() { ...@@ -997,8 +997,7 @@ void testIllegalVariable() {
System system; System system;
system.addParticle(1.0); system.addParticle(1.0);
CustomNonbondedForce* force = new CustomNonbondedForce("r+none"); CustomNonbondedForce* force = new CustomNonbondedForce("r+none");
vector<double> params; force->addParticle();
force->addParticle(params);
system.addForce(force); system.addForce(force);
VerletIntegrator integrator(0.001); VerletIntegrator integrator(0.001);
bool threwException = false; bool threwException = false;
......
...@@ -173,8 +173,7 @@ void testIllegalVariable() { ...@@ -173,8 +173,7 @@ void testIllegalVariable() {
system.addParticle(1.0); system.addParticle(1.0);
system.addParticle(1.0); system.addParticle(1.0);
CustomTorsionForce* force = new CustomTorsionForce("theta+none"); CustomTorsionForce* force = new CustomTorsionForce("theta+none");
vector<double> params; force->addTorsion(0, 1, 2, 3);
force->addTorsion(0, 1, 2, 3, params);
system.addForce(force); system.addForce(force);
VerletIntegrator integrator(0.001); VerletIntegrator integrator(0.001);
bool threwException = false; bool threwException = false;
......
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