IMP  2.1.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-2013 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/ListLikePairContainer.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::ListLikePairContainer
45 #endif
46  {
50  double error_bound_;
51  bool mst_;
52  void initialize(SingletonContainer *sc);
53 
54  public:
55  /** For efficiency, the set of edges is only updated occasionally. The
56  error parameter determines how far particles need to move before
57  the set of edges is updated.*/
59 
60 #if defined(IMP_DOXYGEN) || defined(SWIG)
63  void do_before_evaluate();
65  void do_apply(const PairModifier *sm) const;
68 #else
69  virtual kernel::ParticleIndexes get_all_possible_indexes() const IMP_OVERRIDE;
70  virtual kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
71  virtual void do_before_evaluate() IMP_OVERRIDE;
72  virtual kernel::ParticleIndexPairs get_range_indexes() const IMP_OVERRIDE;
74  bool get_is_decomposable() const { return false; }
75 #endif
76 };
77 
79 
80 IMPCONTAINER_END_NAMESPACE
81 
82 #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 memeber.
Definition: base/Pointer.h:147
A shared container for Pairs.
virtual ParticleIndexPairs get_indexes() const =0
Import IMP/kernel/macros.h in the namespace.
Import IMP/kernel/PairContainer.h in the namespace.
virtual ParticleIndexPairs get_range_indexes() const =0
A container which keeps a set of pairs that connect a set of spheres.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Import IMP/kernel/ScoreState.h in the namespace.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
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 ParticlePairsTemp.