IMP logo
IMP Reference Guide  2.10.0
The Integrative Modeling Platform
Hierarchies of particles

Manipulate particles representing molecules at multiple levels. More...

Detailed Description

Manipulate particles representing molecules at multiple levels.

Classes

class  IMP::atom::Atom
 A decorator for a particle representing an atom. More...
 
class  IMP::core::ChildrenRefiner
 Return the hierarchy children of a particle. More...
 
class  IMP::core::Hierarchy
 A decorator for helping deal with a generalized hierarchy. More...
 
struct  IMP::core::HierarchyCounter
 A simple functor to count the number of particles in a hierarchy. More...
 
class  IMP::core::HierarchyVisitor
 A visitor for traversal of a hierarchy. More...
 
class  IMP::core::LeavesRefiner
 Return the hierarchy leaves under a particle. More...
 
class  IMP::core::ModifierVisitor
 A visitor which applies a modifier to each Particle in a hierarchy. More...
 
class  IMP::atom::Residue
 A decorator for a residue. More...
 

Functions

template<class HD , class F >
HD IMP::core::find_breadth_first (HD h, F f)
 Find the first node which matches some criteria. More...
 
template<class H , class Out , class F >
Out IMP::core::gather (H h, F f, Out out)
 Gather all the particles in the hierarchy that meet some criteria. More...
 
template<class H , class Out , class K , class V >
Out IMP::core::gather_by_attribute (H h, K k, V v, Out out)
 Gather all the particles in the hierarchy which match on an attribute. More...
 
template<class H , class Out , class K0 , class V0 , class K1 , class V1 >
Out IMP::core::gather_by_attributes (H h, K0 k0, V0 v0, K1 k1, V1 v1, Out out)
 Gather all the particles in the hierarchy which match on two attributes. More...
 
template<class H , class Out , class F >
Out IMP::core::gather_slice (H h, F f, Out out)
 Gather all the uppermost particles in the hierarchy that meet some criteria. More...
 
template<class ND >
std::ostream & IMP::core::show (Hierarchy h, std::ostream &out=std::cout)
 Print the hierarchy using a given decorator to display each node. More...
 
template<class HD , class F >
IMP::core::visit_breadth_first (HD d, F f)
 Apply the visitor to each particle, breadth first. More...
 
template<class HD , class F >
IMP::core::visit_breadth_first_with_data (HD d, F f, typename F::result_type i)
 Apply functor F to each particle, traversing the hierarchy breadth first. More...
 
template<class HD , class F >
IMP::core::visit_depth_first (HD d, F &f)
 Apply functor F to each particle, traversing the hierarchy depth first. More...
 
template<class HD , class F >
IMP::core::visit_depth_first_with_data (HD d, F f, typename F::result_type i)
 Apply functor F to each particle, traversing the hierarchy depth first. More...
 

Function Documentation

template<class HD , class F >
HD IMP::core::find_breadth_first ( HD  h,
f 
)

Find the first node which matches some criteria.

See Also
Hierarchy

Definition at line 489 of file core/Hierarchy.h.

template<class H , class Out , class F >
Out IMP::core::gather ( h,
f,
Out  out 
)

Gather all the particles in the hierarchy that meet some criteria.

Gather all the particles in the hierarchy for which f() returns true and appends them to out

Parameters
hhierarchy root
fboolean function / functor that returns true on desired particles
outa output iterator for appending the result
Returns
the output iterator
See Also
Hierarchy

Definition at line 440 of file core/Hierarchy.h.

+ Here is the call graph for this function:

template<class H , class Out , class K , class V >
Out IMP::core::gather_by_attribute ( h,
k,
v,
Out  out 
)

Gather all the particles in the hierarchy which match on an attribute.

See Also
Hierarchy

Definition at line 465 of file core/Hierarchy.h.

+ Here is the call graph for this function:

template<class H , class Out , class K0 , class V0 , class K1 , class V1 >
Out IMP::core::gather_by_attributes ( h,
K0  k0,
V0  v0,
K1  k1,
V1  v1,
Out  out 
)

Gather all the particles in the hierarchy which match on two attributes.

See Also
Hierarchy

Definition at line 477 of file core/Hierarchy.h.

+ Here is the call graph for this function:

template<class H , class Out , class F >
Out IMP::core::gather_slice ( h,
f,
Out  out 
)

Gather all the uppermost particles in the hierarchy that meet some criteria.

Descent in the tree terminates when a node is gathered so that none of its children are explored.

See Also
Hierarchy

Definition at line 454 of file core/Hierarchy.h.

+ Here is the call graph for this function:

template<class ND >
std::ostream& IMP::core::show ( Hierarchy  h,
std::ostream &  out = std::cout 
)

Print the hierarchy using a given decorator to display each node.

See Also
Hierarchy

Definition at line 396 of file core/Hierarchy.h.

template<class HD , class F >
F IMP::core::visit_breadth_first ( HD  d,
f 
)

Apply the visitor to each particle, breadth first.

Parameters
[in]dThe Hierarchy for the tree in question
[in]fThe visitor to be applied. This is passed by reference. A branch of the traversal stops when f returns false.
See Also
Hierarchy

Definition at line 285 of file core/Hierarchy.h.

template<class HD , class F >
F IMP::core::visit_breadth_first_with_data ( HD  d,
f,
typename F::result_type  i 
)

Apply functor F to each particle, traversing the hierarchy breadth first.

This method allows data to be associated with each visited node. The data of the parent is passed to each invocation of the child.

Parameters
[in]dThe Hierarchy for the tree in question
[in]fThe functor to be applied F must define a type Data which is returned by each call. The result of the parent call is passed as the second argument to the operator() of the child. e.g. struct DepthVisitor { typedef int result_type; result_type operator()(Particle *p, int i) const { if (p==nullptr) return 0; else return i+1; } };
[in]iThe data to be used for d (since it has no relevant parent)
Returns
A copy of the functor passed in. Use this if you care about the functor state.
See Also
Hierarchy

Definition at line 351 of file core/Hierarchy.h.

template<class HD , class F >
F IMP::core::visit_depth_first ( HD  d,
F &  f 
)

Apply functor F to each particle, traversing the hierarchy depth first.

See visit_breadth_first() for documentation.

See Also
Hierarchy

Definition at line 308 of file core/Hierarchy.h.

template<class HD , class F >
F IMP::core::visit_depth_first_with_data ( HD  d,
f,
typename F::result_type  i 
)

Apply functor F to each particle, traversing the hierarchy depth first.

See visit_breadth_first() for documentation.

See Also
Hierarchy

Definition at line 374 of file core/Hierarchy.h.