BALL  1.5.0
connectedComponentsProcessor.h
Go to the documentation of this file.
1 #ifndef BALL_STRUCTURE_CONNECTEDCOMPONENTSPROCESSOR_H
2 #define BALL_STRUCTURE_CONNECTEDCOMPONENTSPROCESSOR_H
3 
4 #ifndef BALL_CONCEPT_PROCESSOR_H
5 # include <BALL/CONCEPT/processor.h>
6 #endif
7 
8 #ifndef BALL_KERNEL_MOLECULE_H
9 #include <BALL/KERNEL/molecule.h>
10 #endif
11 
12 #ifndef BOOST_PENDING_DISJOINT_SETS_HPP
13 #include <boost/pending/disjoint_sets.hpp>
14 #endif
15 namespace BALL
16 {
32  : public UnaryProcessor<AtomContainer>
33  {
34  public:
38  typedef std::vector<Atom*> Component;
39  typedef std::vector<Molecule> MolVec;
40  typedef std::vector<Component> ComponentVector;
42 
44 
45 
49 
52 
56 
60 
62  virtual bool start();
63 
66  void clear();
67 
70  virtual Processor::Result operator ()(AtomContainer& ac);
71 
73  virtual bool finish();
74 
76 
80 
82  Size getNumberOfConnectedComponents();
83 
97  void getComponents(ComponentVector &comp);
98 
109  void getLargestComponent(Molecule &result);
110 
121  void getMinAtomsComponents(MolVec &result, size_t min);
122 
130  void getAllComponents(MolVec& results);
132 
133  protected:
134  typedef boost::disjoint_sets < int*, int*,
135  boost::find_with_full_path_compression > DisjointSet;
137  };
138 }
139 
140 #endif // BALL_STRUCTURE_CONNECTEDCOMPONENTSPROCESSOR_H
BALL::ConnectedComponentsProcessor::Component
std::vector< Atom * > Component
Definition: connectedComponentsProcessor.h:38
BALL::Molecule
Definition: molecule.h:29
BALL_EXPORT
#define BALL_EXPORT
Definition: COMMON/global.h:50
BALL::ConnectedComponentsProcessor::components_
ComponentVector components_
Definition: connectedComponentsProcessor.h:136
BALL::AtomContainer
Definition: atomContainer.h:29
BALL_SIZE_TYPE
BALL
Definition: constants.h:12
BALL::ConnectedComponentsProcessor::DisjointSet
boost::disjoint_sets< int *, int *, boost::find_with_full_path_compression > DisjointSet
Definition: connectedComponentsProcessor.h:135
BALL::ConnectedComponentsProcessor
Computation of the connected components of the molecular graph.
Definition: connectedComponentsProcessor.h:31
BALL::ConnectedComponentsProcessor::ComponentVector
std::vector< Component > ComponentVector
Definition: connectedComponentsProcessor.h:40
BALL::Maths::min
T min(const T &a, const T &b)
Definition: MATHS/common.h:102
processor.h
BALL::ConnectedComponentsProcessor::MolVec
std::vector< Molecule > MolVec
Definition: connectedComponentsProcessor.h:39
BALL::UnaryProcessor
Definition: processor.h:58
BALL::Processor::Result
int Result
Definition: processor.h:36
BALL_CREATE
#define BALL_CREATE(name)
Definition: create.h:62
molecule.h