9#ifndef IMPEXAMPLE_EXAMPLE_RESTRAINT_H
10#define IMPEXAMPLE_EXAMPLE_RESTRAINT_H
12#include <IMP/example/example_config.h>
14#include <cereal/access.hpp>
16IMPEXAMPLE_BEGIN_NAMESPACE
40 double get_force_constant()
const {
return k_; }
50 friend class cereal::access;
51 template<
class Archive>
void serialize(Archive &ar) {
54 ar(cereal::base_class<Restraint>(
this), p_, k_);
63IMPEXAMPLE_END_NAMESPACE
Abstract base class for all restraints.
Restraint(Model *m, std::string name)
Create a restraint and register it with the model.
Class for adding up scores during ScoringFunction evaluation.
Restrain a particle to be in the x,y plane.
ExampleRestraint(Model *m, ParticleIndex p, double k)
Create the restraint.
void do_add_score_and_derivatives(ScoreAccumulator sa) const override
Add the score and (if requested) derivatives to the accumulator.
ModelObjectsTemp do_get_inputs() const override
Index< ParticleIndexTag > ParticleIndex
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.