IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
AttributeDistancePairScore.h
Go to the documentation of this file.
1/**
2 * \file IMP/spb/AttributeDistancePairScore.h
3 * \brief A score based on the unmodified value of an attribute.
4 *
5 * Copyright 2007-2022 IMP Inventors. All rights reserved.
6 */
7
8#ifndef IMPSPB_ATTRIBUTE_DISTANCE_PAIR_SCORE_H
9#define IMPSPB_ATTRIBUTE_DISTANCE_PAIR_SCORE_H
10
11#include <IMP/PairScore.h>
12#include <IMP/Pointer.h>
13#include <IMP/UnaryFunction.h>
14#include <IMP/pair_macros.h>
15#include <IMP/spb/spb_config.h>
16
17IMPSPB_BEGIN_NAMESPACE
18
19//! Apply a function to an attribute.
20/** This Score scores a particle by passing an attribute value directly
21 to a UnaryFunction.
22 */
23class IMPSPBEXPORT AttributeDistancePairScore : public PairScore {
24 // IMP::OwnerPointer<UnaryFunction> f_; //replaced deprecated version
26 FloatKey k_;
27
28 public:
29 //! Apply function f to attribute k
31
33 DerivativeAccumulator *da) const override;
34
36 IMP::Model *m, const IMP::ParticleIndexes &pis) const override;
37
38 // void show(std::ostream &out) const ;
39
43
44 /** deprecated code
45 IMP_SIMPLE_PAIR_SCORE(AttributeDistancePairScore);
46 */
47};
48
50
51IMPSPB_END_NAMESPACE
52
53#endif /* IMPSPB_ATTRIBUTE_DISTANCE_PAIR_SCORE_H */
Define PairScore.
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.
Definition Model.h:111
Abstract single variable functor class for score functions.
virtual IMP::ModelObjectsTemp do_get_inputs(IMP::Model *m, const IMP::ParticleIndexes &pis) const override
Overload this method to specify the inputs.
AttributeDistancePairScore(UnaryFunction *f, FloatKey k)
Apply function f to attribute k.
virtual double evaluate_index(IMP::Model *m, const IMP::ParticleIndexPair &p, DerivativeAccumulator *da) const override
Compute the score and the derivative if needed.
IMP::Vector< IMP::Pointer< AttributeDistancePairScore > > AttributeDistancePairScores
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Definition base_types.h:199
Key< 0 > FloatKey
The type used to identify float attributes in the Particles.
Definition base_types.h:32
Array< 2, ParticleIndex > ParticleIndexPair
An ordered pair of particles, each identified by its ParticleIndex.
Definition base_types.h:202
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.
Macros for various classes.
#define IMP_PAIR_SCORE_METHODS(Name)
Definition pair_macros.h:25
#define IMP_SHOWABLE(Name)
A smart pointer to a ref-counted Object that is a class member.
Definition Pointer.h:144