IMP logo
IMP Reference Guide  2.10.1
The Integrative Modeling Platform
ConnectingPairContainer.h
Go to the documentation of this file.
1 /**
2  * \file IMP/container/ConnectingPairContainer.h
3  * \brief A container which has pairs which ensure a set is connected
4  *
5  * Copyright 2007-2018 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPCONTAINER_CONNECTING_PAIR_CONTAINER_H
9 #define IMPCONTAINER_CONNECTING_PAIR_CONTAINER_H
10 
11 #include <IMP/container/container_config.h>
12 #include <IMP/core/internal/MovedSingletonContainer.h>
13 #include <IMP/internal/ListLikeContainer.h>
14 #include <IMP/PairContainer.h>
15 #include <IMP/SingletonContainer.h>
16 #include <IMP/macros.h>
17 #include <IMP/OptimizerState.h>
18 #include <IMP/ScoreState.h>
19 
20 IMPCONTAINER_BEGIN_NAMESPACE
21 
22 //! A container which keeps a set of pairs that connect a set of spheres.
23 /** This container is for implementing connectivity when
24  - there is no ambiguity about the set of particles being connected
25  - the distance score used in the restraint is a monotonic function of the
26  distance between the two particles.
27 
28  The contents of this container are a set of pairs defining a tree over
29  the spheres in the supplied SingletonContainer. This set of edges has
30  the property that
31  - for particles whose balls do not intersect, if there is a path
32  connecting those balls entirely contained in the union of the set of
33  all balls, then there is no edge connecting those two particles.
34 
35 
36  It is significantly more efficient than the ConnectivityRestraint
37  but less flexible.
38  \see {core::ConnectivityRestraint}
39  */
40 class IMPCONTAINEREXPORT ConnectingPairContainer :
41 #if defined(IMP_DOXYGEN) || defined(SWIG)
42  public PairContainer
43 #else
44  public IMP::internal::ListLikeContainer<PairContainer>
45 #endif
46  {
49  PointerMember<ScoreState> score_state_;
50  ParticlePairsTemp data_;
51  double error_bound_;
52  bool mst_;
53  void initialize(SingletonContainer *sc);
54 
55  public:
56  /** For efficiency, the set of edges is only updated occasionally. The
57  error parameter determines how far particles need to move before
58  the set of edges is updated.*/
60 
61 #if defined(IMP_DOXYGEN) || defined(SWIG)
65  void do_apply(const PairModifier *sm) const;
68 
69  private:
70  virtual std::size_t do_get_contents_hash() const IMP_OVERRIDE;
71 #else
73  virtual ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
74  ModelObjectsTemp get_score_state_inputs() const;
75  void do_score_state_before_evaluate();
76  void do_score_state_after_evaluate() {}
79  bool get_is_decomposable() const { return false; }
80 #endif
81 };
82 
84 
85 IMPCONTAINER_END_NAMESPACE
86 
87 #endif /* IMPCONTAINER_CONNECTING_PAIR_CONTAINER_H */
virtual ParticleIndexPairs get_range_indexes() const =0
A shared container for Pairs.
Definition: PairContainer.h:37
A container for Singletons.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Various general useful macros for IMP.
A base class for modifiers of ParticlePairsTemp.
Definition: PairModifier.h:32
A container for Pairs.
A container which keeps a set of pairs that connect a set of spheres.
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:146
A shared container for Singletons.
Shared score state.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
Definition: object_macros.h:44
virtual ParticleIndexes get_all_possible_indexes() const =0
Get contained particles.
Shared optimizer state.
virtual ParticleIndexPairs get_indexes() const =0
virtual ModelObjectsTemp do_get_inputs() const =0
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.