8#ifndef IMPEXAMPLE_EXAMPLE_PAIR_SCORE_H
9#define IMPEXAMPLE_EXAMPLE_PAIR_SCORE_H
11#include <IMP/example/example_config.h>
17#include <cereal/access.hpp>
19IMPEXAMPLE_BEGIN_NAMESPACE
26class IMPEXAMPLEEXPORT ExamplePairScore :
public PairScore {
30 ExamplePairScore(
double x0,
double k);
33 double get_mean()
const {
return x0_; }
34 double get_force_constant()
const {
return k_; }
46 friend class cereal::access;
47 template<
class Archive>
void serialize(Archive &ar) {
48 ar(cereal::base_class<PairScore>(
this), x0_, k_);
56IMPEXAMPLE_END_NAMESPACE
A nullptr-initialized pointer to an IMP Object.
Single variable function.
Class for adding derivatives from restraints to the model.
Class for storing model, its restraints, constraints, and particles.
Apply a harmonic to the distance between two particles.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
virtual double evaluate_index(Model *m, const ParticleIndexPair &p, DerivativeAccumulator *da) const override
Compute the score and the derivative if needed.
IMP::Vector< IMP::Pointer< ExamplePairScore > > ExamplePairScores
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Array< 2, ParticleIndex > ParticleIndexPair
An ordered pair of particles, each identified by its ParticleIndex.
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Macros for various classes.
#define IMP_PAIR_SCORE_METHODS(Name)