IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
BondSingletonScore.h
Go to the documentation of this file.
1/**
2 * \file IMP/atom/BondSingletonScore.h
3 * \brief A Score on the distance between a the two particles in a bond.
4 *
5 * Copyright 2007-2022 IMP Inventors. All rights reserved.
6 */
7
8#ifndef IMPATOM_BOND_SINGLETON_SCORE_H
9#define IMPATOM_BOND_SINGLETON_SCORE_H
10
11#include <IMP/atom/atom_config.h>
12#include "bond_decorators.h"
13#include <IMP/SingletonScore.h>
14#include <IMP/UnaryFunction.h>
15#include <IMP/Pointer.h>
16
17IMPATOM_BEGIN_NAMESPACE
18
19//! Score the bond based on a UnaryFunction,
20/** The score is based on the difference between the stored length
21 and the actual length and scaled by the stiffness. That is
22 stiffness * (distance-bond_length)
23 \ingroup bond
24 \see Bond
25 \see Bonded
26 */
27class IMPATOMEXPORT BondSingletonScore : public SingletonScore {
29
30 public:
31 //! Use f to penalize deviations in length
33 UnaryFunction *get_unary_function() const { return f_; }
34 virtual double evaluate_index(Model *m, ParticleIndex p,
35 DerivativeAccumulator *da) const override;
37 Model *m, const ParticleIndexes &pis) const override;
40};
41
43
44IMPATOM_END_NAMESPACE
45
46#endif /* IMPATOM_BOND_SINGLETON_SCORE_H */
A nullptr-initialized pointer to an IMP Object.
Define SingletonScore.
Single variable function.
Contains decorators for a bond.
Class for adding derivatives from restraints to the model.
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Abstract single variable functor class for score functions.
Score the bond based on a UnaryFunction,.
virtual double evaluate_index(Model *m, ParticleIndex p, DerivativeAccumulator *da) const override
Compute the score and the derivative if needed.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
BondSingletonScore(UnaryFunction *f)
Use f to penalize deviations in length.
IMP::Vector< IMP::Pointer< BondSingletonScore > > BondSingletonScores
Index< ParticleIndexTag > ParticleIndex
Definition base_types.h:196
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Definition base_types.h:199
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
#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.
#define IMP_SINGLETON_SCORE_METHODS(Name)
A smart pointer to a ref-counted Object that is a class member.
Definition Pointer.h:144