IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
ConnectivityRestraint.h
Go to the documentation of this file.
1/**
2 * \file IMP/core/ConnectivityRestraint.h \brief Connectivity restraint.
3 *
4 * Restrict max distance between at least one pair of particles of any
5 * two distinct types.
6 *
7 * Copyright 2007-2022 IMP Inventors. All rights reserved.
8 *
9 */
10
11#ifndef IMPCORE_CONNECTIVITY_RESTRAINT_H
12#define IMPCORE_CONNECTIVITY_RESTRAINT_H
13
14#include <IMP/core/core_config.h>
15#include "DistanceRestraint.h"
16
18#include <IMP/Restraint.h>
19#include <IMP/PairScore.h>
20
21IMPCORE_BEGIN_NAMESPACE
22
23//! Ensure that a set of particles remains connected with one another.
24/** The restraint implements ambiguous connectivity. That is, it takes
25 several particles and ensures that they remain
26 connected, but allows how they are connected to change. If you wish
27 to restrain the connectivity of sets of
28 particles (e.g. each protein is represented using a set of balls)
29 use an appropriate PairScore which calls a Refiner (such
30 as ClosePairsPairScore).
31
32 \include connectivity_restraint.py
33
34 More precisely, the restraint scores by computing the minimum spanning
35 tree on the complete graph connecting all the particles. The edge
36 weights are given by the value of the PairScore for the two endpoints
37 of the edge.
38 */
39class IMPCOREEXPORT ConnectivityRestraint : public Restraint {
42
43 public:
44 //! Use the given PairScore
46
47 //! Return the set of pairs which are connected by the restraint
48 /** This set of pairs reflects the current configuration at the time of
49 the get_connected_pairs() call, not the set at the time of the last
50 evaluate() call.
51 */
53
54 //! Return the pair score used for scoring
55 PairScore *get_pair_score() const { return ps_; }
56
58
59 public:
61 override;
64 ;
65};
66
67IMPCORE_END_NAMESPACE
68
69#endif /* IMPCORE_CONNECTIVITY_RESTRAINT_H */
Distance restraint between two particles.
Define PairScore.
Abstract base class for all restraints.
A container for Singletons.
Class for adding derivatives from restraints to the model.
Abstract class for scoring object(s) of type ParticleIndexPair.
Definition PairScore.h:45
Restraint(Model *m, std::string name)
Create a restraint and register it with the model.
Restraints do_create_current_decomposition() const override
double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const override
Return the unweighted score for the restraint.
PairScore * get_pair_score() const
Return the pair score used for scoring.
ParticleIndexPairs get_connected_index_pairs() const
Return the set of pairs which are connected by the restraint.
ConnectivityRestraint(PairScore *ps, SingletonContainerAdaptor sc)
Use the given PairScore.
IMP::ModelObjectsTemp do_get_inputs() const override
IMP::Vector< IMP::Pointer< Restraint > > Restraints
Definition base_types.h:120
IMP::Vector< ParticleIndexPair, std::allocator< ParticleIndexPair > > ParticleIndexPairs
Definition base_types.h:208
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
A smart pointer to a ref-counted Object that is a class member.
Definition Pointer.h:144