|
Rosetta 3.5
|
#include <DisjointSets.hh>

Public Member Functions | |
| DisjointSets () | |
| default constructor, for when number of nodes is not known More... | |
| DisjointSets (platform::Size n_nodes) | |
| ctor for class if the number of nodes is known upfront. Fastest. More... | |
| platform::Size | n_nodes () const |
| returns the total number of nodes More... | |
| void | ds_make_set () |
| add a new node – as implemented, O(N) operation use the DS(platform::Size) constructor for better speed. More... | |
| platform::Size | ds_find (platform::Size node_id) const |
| return the representative for a node More... | |
| void | ds_union (platform::Size node1, platform::Size node2) |
| make it so that two nodes end up in the same set More... | |
| DS_Node const & | node (platform::Size node_id) const |
| DS_Node read access. More... | |
| platform::Size | n_disjoint_sets () const |
| count the number of disjoint sets. O(N) More... | |
| utility::vector1< platform::Size > | disjoint_set_sizes () const |
| count the size of each disjoint set. O(N) More... | |
| utility::vector1< platform::Size > | nodes_in_set (platform::Size node_id) const |
| return the nodes in the set containing the specified node. More... | |
| std::map< platform::Size, utility::vector1 < platform::Size > > | sets () const |
| return a map from the representative node of each set to the list of nodes in their sets More... | |
Private Attributes | |
| utility::vector1< DS_Node > | nodes_ |
Definition at line 35 of file DisjointSets.hh.
| core::graph::DisjointSets::DisjointSets | ( | ) |
default constructor, for when number of nodes is not known
Definition at line 24 of file DisjointSets.cc.
| core::graph::DisjointSets::DisjointSets | ( | platform::Size | n_nodes) |
ctor for class if the number of nodes is known upfront. Fastest.
constructor for when number of nodes is known up front. fastest.
Definition at line 33 of file DisjointSets.cc.
| utility::vector1< platform::Size > core::graph::DisjointSets::disjoint_set_sizes | ( | ) | const |
count the size of each disjoint set. O(N)
returns a vector1 containing the size of each disjoint set. O(N)
DisjointSets::disjoint_set_sizes()
Definition at line 137 of file DisjointSets.cc.
References ds_find(), n_nodes(), and nodes_.
Referenced by core::pack::interaction_graph::HPatchInteractionGraph< V, E, G >::calculate_alt_state_hpatch_score(), and core::scoring::SecondaryStructurePotential::sheets_from_dimers().
| platform::Size core::graph::DisjointSets::ds_find | ( | platform::Size | node_id) | const |
return the representative for a node
given a node_id, return the representative for that node
Definition at line 77 of file DisjointSets.cc.
References nodes_.
Referenced by core::pack::interaction_graph::HPatchInteractionGraph< V, E, G >::calculate_alt_state_hpatch_score(), core::pack::interaction_graph::SurfacePotential::compute_pose_hpatch_score(), disjoint_set_sizes(), ds_union(), nodes_in_set(), protocols::forge::methods::replace(), sets(), and core::pack::interaction_graph::HPatchInteractionGraph< V, E, G >::update_disjoint_sets_using_cache().
| void core::graph::DisjointSets::ds_make_set | ( | ) |
add a new node – as implemented, O(N) operation use the DS(platform::Size) constructor for better speed.
creates a new set
This implementation uses indices to objects in arrays instead of pointers and so it relies on vector push-back methods (O(N)) instead of list push-back methods (O(1)). If enough people clamour, I'll go back and make this faster...(apl)
Definition at line 63 of file DisjointSets.cc.
| void core::graph::DisjointSets::ds_union | ( | platform::Size | node1, |
| platform::Size | node2 | ||
| ) |
make it so that two nodes end up in the same set
combine two sets; make it so that two nodes end up in the same set
Definition at line 93 of file DisjointSets.cc.
References ds_find(), and nodes_.
Referenced by core::pack::interaction_graph::SurfacePotential::compute_pose_hpatch_score(), protocols::forge::methods::fold_tree_from_pose(), protocols::forge::methods::replace(), core::scoring::SecondaryStructurePotential::sheets_from_dimers(), protocols::forge::methods::union_interval(), and core::pack::interaction_graph::HPatchInteractionGraph< V, E, G >::update_disjoint_sets_using_cache().
| platform::Size core::graph::DisjointSets::n_disjoint_sets | ( | ) | const |
count the number of disjoint sets. O(N)
DisjointSets::n_disjoint_sets()
Definition at line 119 of file DisjointSets.cc.
References n_nodes(), and nodes_.
Referenced by protocols::forge::methods::replace().
| platform::Size core::graph::DisjointSets::n_nodes | ( | ) | const |
returns the total number of nodes
Definition at line 48 of file DisjointSets.cc.
References nodes_.
Referenced by disjoint_set_sizes(), DisjointSets(), ds_make_set(), n_disjoint_sets(), nodes_in_set(), sets(), and protocols::forge::methods::union_interval().
|
inline |
DS_Node read access.
Definition at line 59 of file DisjointSets.hh.
References nodes_.
Referenced by core::pack::interaction_graph::HPatchInteractionGraph< V, E, G >::calculate_alt_state_hpatch_score().
| utility::vector1< platform::Size > core::graph::DisjointSets::nodes_in_set | ( | platform::Size | node_id) | const |
return the nodes in the set containing the specified node.
returns a vector1 of the nodes in the set containing the specified node.
Definition at line 162 of file DisjointSets.cc.
References ds_find(), and n_nodes().
Referenced by core::scoring::SecondaryStructurePotential::sheets_from_dimers().
| std::map< platform::Size, utility::vector1< platform::Size > > core::graph::DisjointSets::sets | ( | ) | const |
return a map from the representative node of each set to the list of nodes in their sets
Definition at line 185 of file DisjointSets.cc.
References ds_find(), and n_nodes().
Referenced by core::pack::interaction_graph::HPatchInteractionGraph< V, E, G >::calculate_alt_state_hpatch_score(), core::pack::interaction_graph::SurfacePotential::compute_pose_hpatch_score(), protocols::forge::methods::replace(), and core::scoring::SecondaryStructurePotential::sheets_from_dimers().
|
mutableprivate |
Definition at line 81 of file DisjointSets.hh.
Referenced by disjoint_set_sizes(), DisjointSets(), ds_find(), ds_make_set(), ds_union(), n_disjoint_sets(), n_nodes(), and node().
1.8.4