IMP  2.3.0
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-2014 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/kernel/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 kernel::internal::ListLikeContainer<kernel::PairContainer>
45 #endif
46  {
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 kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
74  kernel::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 ParticleIndexes get_all_possible_indexes() const =0
Get contained particles.
IMP::base::Vector< IMP::base::WeakPointer< kernel::ModelObject > > ModelObjectsTemp
Import IMP/kernel/SingletonContainer.h in the namespace.
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:147
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
virtual kernel::ParticleIndexPairs get_indexes() const =0
A shared container for Pairs.
Import IMP/kernel/macros.h in the namespace.
Import IMP/kernel/PairContainer.h in the namespace.
A container which keeps a set of pairs that connect a set of spheres.
virtual kernel::ParticleIndexPairs get_range_indexes() const =0
Import IMP/kernel/ScoreState.h in the namespace.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
Definition: object_macros.h:52
virtual ModelObjectsTemp do_get_inputs() const =0
Import IMP/kernel/OptimizerState.h in the namespace.
A shared container for Singletons.
A base class for modifiers of kernel::ParticlePairsTemp.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.