graph¶
Bindings for utility::graph namespace
-
class
pyrosetta.rosetta.utility.graph.
Digraph
¶ Bases:
pybind11_builtins.pybind11_object
A Digraph with constant time edge insertion and deletion. Extensible.
-
add_edge
(*args, **kwargs)¶ Overloaded function.
- add_edge(self: pyrosetta.rosetta.utility.graph.Digraph, tail_node: int, head_node: int) -> pyrosetta.rosetta.utility.graph.DirectedEdge
- add a directed edge between two vertices. Invokes “create_edge” from the derived class.
- Returns a pointer to the edge after its been added, allowing the calling function to immediately set data for this edge.
C++: utility::graph::Digraph::add_edge(unsigned long, unsigned long) –> class utility::graph::DirectedEdge *
- add_edge(self: pyrosetta.rosetta.utility.graph.Digraph, example_edge: pyrosetta.rosetta.utility.graph.DirectedEdge) -> pyrosetta.rosetta.utility.graph.DirectedEdge
- add an edge to this graph copying the data from an edge in another graph.
- Returns a pointer to the edge after its been added, allowing the calling function to immediately set data for this edge.
C++: utility::graph::Digraph::add_edge(const class utility::graph::DirectedEdge *) –> class utility::graph::DirectedEdge *
-
add_node
(self: pyrosetta.rosetta.utility.graph.Digraph) → None¶ Add a new node to the graph; preserve all of the existing edges in the graph
C++: utility::graph::Digraph::add_node() –> void
-
assign
(self: pyrosetta.rosetta.utility.graph.Digraph, source: pyrosetta.rosetta.utility.graph.Digraph) → pyrosetta.rosetta.utility.graph.Digraph¶ assignment operator. source and this must have the same type.
C++: utility::graph::Digraph::operator=(const class utility::graph::Digraph &) –> class utility::graph::Digraph &
-
const_edge_list_begin
(self: pyrosetta.rosetta.utility.graph.Digraph) → pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator¶ - returns a const iterator to the beginning of the (unordered) edge list for the graph.
- this edge list contains all the edges in the graph, not simply those for a particular vertex
C++: utility::graph::Digraph::const_edge_list_begin() const –> class utility::graph::DirectedEdgeListConstIterator
-
const_edge_list_end
(self: pyrosetta.rosetta.utility.graph.Digraph) → pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator¶ - returns a const iterator to the end of the (unordered) edge list for the graph.
- this edge list contains all the edges in the graph, not simply those for a particular vertex
C++: utility::graph::Digraph::const_edge_list_end() const –> class utility::graph::DirectedEdgeListConstIterator
-
copy_connectivity
(self: pyrosetta.rosetta.utility.graph.Digraph, source: pyrosetta.rosetta.utility.graph.Digraph) → None¶ - copy the edge connectivity from a source graph with a potentially
- unknown type.
C++: utility::graph::Digraph::copy_connectivity(const class utility::graph::Digraph &) –> void
-
delete_edge
(self: pyrosetta.rosetta.utility.graph.Digraph, edge: pyrosetta.rosetta.utility.graph.DirectedEdge) → None¶ - remove an edge from the graph. (NEW AS OF 12/9/07) Never call C++’s
- “delete” function on an edge pointer directly. Derived classes must implement this function. If they wish to use unordered_object_pools to manage their memory
C++: utility::graph::Digraph::delete_edge(class utility::graph::DirectedEdge *) –> void
-
drop_all_edges
(self: pyrosetta.rosetta.utility.graph.Digraph) → None¶ delete all the edges present in the graph
C++: utility::graph::Digraph::drop_all_edges() –> void
-
drop_all_edges_for_node
(self: pyrosetta.rosetta.utility.graph.Digraph, node: int) → None¶ delete all the edges for a single vertex in the graph
C++: utility::graph::Digraph::drop_all_edges_for_node(unsigned long) –> void
-
edge_list_begin
(self: pyrosetta.rosetta.utility.graph.Digraph) → pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator¶ - returns a non-const iterator to the beginning of the (unordered) edge list for the graph.
- this edge list contains all the edges in the graph, not simply those for a particular vertex
C++: utility::graph::Digraph::edge_list_begin() –> class utility::graph::DirectedEdgeListIterator
-
edge_list_end
(self: pyrosetta.rosetta.utility.graph.Digraph) → pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator¶ - returns a non-const iterator to the end of the (unordered) edge list for the graph.
- this edge list contains all the edges in the graph, not simply those for a particular vertex
C++: utility::graph::Digraph::edge_list_end() –> class utility::graph::DirectedEdgeListIterator
-
find_edge
(self: pyrosetta.rosetta.utility.graph.Digraph, tail_node: int, head_node: int) → pyrosetta.rosetta.utility.graph.DirectedEdge¶ - returns a pointer to the directed edge connecting nodes tail_node and head_node, if that edge exists
- in the graph, o.w. returns 0. Focuses the graph on this edge for fast subsequent retrieval.
C++: utility::graph::Digraph::find_edge(unsigned long, unsigned long) –> class utility::graph::DirectedEdge *
-
focused_edge
(self: pyrosetta.rosetta.utility.graph.Digraph) → pyrosetta.rosetta.utility.graph.DirectedEdge¶ returns a pointer to the focused edge
C++: utility::graph::Digraph::focused_edge() –> class utility::graph::DirectedEdge *
-
getTotalMemoryUsage
(self: pyrosetta.rosetta.utility.graph.Digraph) → int¶ - returns a count of all the memory used by every vertex and edge in a graph
- by invoking the polymorphic count_static_memory and count_dynamic_memory of each (possibly derived) node and edge object as well as for the (possibly derived) graph class.
C++: utility::graph::Digraph::getTotalMemoryUsage() const –> unsigned long
-
get_edge_exists
(self: pyrosetta.rosetta.utility.graph.Digraph, tail_node: int, head_node: int) → bool¶ is an edge already present in the graph? O(V) worst case. O(1) iff all vertices have O(1) edges
C++: utility::graph::Digraph::get_edge_exists(unsigned long, unsigned long) const –> bool
-
get_node
(self: pyrosetta.rosetta.utility.graph.Digraph, index: int) → pyrosetta.rosetta.utility.graph.DirectedNode¶ C++: utility::graph::Digraph::get_node(unsigned long) –> class utility::graph::DirectedNode *
-
get_self_ptr
(self: pyrosetta.rosetta.utility.graph.Digraph) → pyrosetta.rosetta.utility.graph.Digraph¶ C++: utility::graph::Digraph::get_self_ptr() –> class std::shared_ptr<class utility::graph::Digraph>
-
num_edges
(self: pyrosetta.rosetta.utility.graph.Digraph) → int¶ C++: utility::graph::Digraph::num_edges() const –> unsigned long
-
num_nodes
(self: pyrosetta.rosetta.utility.graph.Digraph) → int¶ the number of nodes in the graph
C++: utility::graph::Digraph::num_nodes() const –> unsigned long
-
output_connectivity
(self: pyrosetta.rosetta.utility.graph.Digraph, os: pyrosetta.rosetta.std.ostream) → None¶ send an edge list to the stream os.
C++: utility::graph::Digraph::output_connectivity(class std::basic_ostream<char> &) const –> void
-
output_dimacs
(self: pyrosetta.rosetta.utility.graph.Digraph, os: pyrosetta.rosetta.std.ostream) → None¶ describe this graph in dimacs form to the stream os.
C++: utility::graph::Digraph::output_dimacs(class std::basic_ostream<char> &) const –> void
-
print_vertices
(self: pyrosetta.rosetta.utility.graph.Digraph) → None¶ send summary information to the screen for all vertices in the graph
C++: utility::graph::Digraph::print_vertices() const –> void
-
set_num_nodes
(self: pyrosetta.rosetta.utility.graph.Digraph, num_nodes: int) → None¶ set the number of nodes in the graph – deletes any existing edges in the graph
C++: utility::graph::Digraph::set_num_nodes(unsigned long) –> void
-
-
class
pyrosetta.rosetta.utility.graph.
DirectedEdgeList
¶ Bases:
pybind11_builtins.pybind11_object
Custom edge list class. Returns const-iterators which only return DirectedEdge const ‘s and non-const-iterators which can return either const or non-const DirectedEdge’s. Manages its own memory using an unordered-object-pool for fast insertion and deletion of DirectedEdgeListElements. Implemented as a doubly linked list, though there’s no practical way to start at the end of a list and work backward since decrementing the end iterator is not a valid operation.
-
begin
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeList) → pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator¶ returns a non-const iterator to the front of the list
C++: utility::graph::DirectedEdgeList::begin() –> class utility::graph::DirectedEdgeListIterator
-
const_begin
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeList) → pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator¶ returns a const iterator to the front of the list
C++: utility::graph::DirectedEdgeList::const_begin() const –> class utility::graph::DirectedEdgeListConstIterator
-
const_end
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeList) → pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator¶ returns a const iterator to the end of the list
C++: utility::graph::DirectedEdgeList::const_end() const –> class utility::graph::DirectedEdgeListConstIterator
-
const_last
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeList) → pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator¶ returns a const iterator to the last element in the list
C++: utility::graph::DirectedEdgeList::const_last() const –> class utility::graph::DirectedEdgeListConstIterator
-
end
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeList) → pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator¶ returns a non-const iterator to the end of the list
C++: utility::graph::DirectedEdgeList::end() –> class utility::graph::DirectedEdgeListIterator
-
erase
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeList, to_erase: pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator) → None¶ removes an element from the list pointed to by the input iterator
C++: utility::graph::DirectedEdgeList::erase(class utility::graph::DirectedEdgeListIterator) –> void
-
insert
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeList, element_to_insert_before: pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator, edgeptr: utility::graph::DirectedEdge) → pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator¶ - insert a new edge-list element in the list infront of the input iterator and
- return an iterator to the position of the new element
C++: utility::graph::DirectedEdgeList::insert(const class utility::graph::DirectedEdgeListIterator &, class utility::graph::DirectedEdge *) –> class utility::graph::DirectedEdgeListIterator
-
is_end_element
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeList, element: pyrosetta.rosetta.utility.graph.DirectedEdgeListElement) → bool¶ - method invoked by the DirectedEdgeListIterator class: is an iterator the special
- end iterator for a list?
C++: utility::graph::DirectedEdgeList::is_end_element(const class utility::graph::DirectedEdgeListElement *) const –> bool
-
last
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeList) → pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator¶ returns a non-const iterator to the last element in the list
C++: utility::graph::DirectedEdgeList::last() –> class utility::graph::DirectedEdgeListIterator
-
push_back
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeList, edgeptr: utility::graph::DirectedEdge) → None¶ create a new edge-list element and insert it at the front of the list
C++: utility::graph::DirectedEdgeList::push_back(class utility::graph::DirectedEdge *) –> void
-
push_front
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeList, edgeptr: utility::graph::DirectedEdge) → None¶ create a new edge-list element and insert it at the end of the list
C++: utility::graph::DirectedEdgeList::push_front(class utility::graph::DirectedEdge *) –> void
-
size
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeList) → int¶ O(N)
C++: utility::graph::DirectedEdgeList::size() const –> unsigned long
-
-
class
pyrosetta.rosetta.utility.graph.
DirectedEdgeListConstIterator
¶ Bases:
pybind11_builtins.pybind11_object
Custom DirectedEdge list const iterator class, which returns only const DirectedEdge pointers. This iterator cannot be used to change the structure of its list without access to that list directly. Customized since STL’s const-iterator cannot be prevented from giving non-const access to its data.
-
assign
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator, rhs: pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator) → pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator¶ assignmnet operator
C++: utility::graph::DirectedEdgeListConstIterator::operator=(const class utility::graph::DirectedEdgeListConstIterator &) –> class utility::graph::DirectedEdgeListConstIterator &
-
minus_minus
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator) → pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator¶ decrement operator. Point this iterator at the previous element in the list.
C++: utility::graph::DirectedEdgeListConstIterator::operator–() –> const class utility::graph::DirectedEdgeListConstIterator &
-
plus_plus
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator) → pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator¶ increment operator. Point this iterator at the next element in the list.
C++: utility::graph::DirectedEdgeListConstIterator::operator++() –> const class utility::graph::DirectedEdgeListConstIterator &
-
valid
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListConstIterator) → bool¶ Is this a valid iterator?
C++: utility::graph::DirectedEdgeListConstIterator::valid() const –> bool
-
-
class
pyrosetta.rosetta.utility.graph.
DirectedEdgeListElement
¶ Bases:
pybind11_builtins.pybind11_object
Custom written edge list element class. Little more than a struct. Defined so that edge list memory management could rely on boost::pool like object
-
const_edge
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListElement) → utility::graph::DirectedEdge¶ C++: utility::graph::DirectedEdgeListElement::const_edge() const –> const class utility::graph::DirectedEdge *
-
const_next
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListElement) → pyrosetta.rosetta.utility.graph.DirectedEdgeListElement¶ C++: utility::graph::DirectedEdgeListElement::const_next() const –> const class utility::graph::DirectedEdgeListElement *
-
const_previous
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListElement) → pyrosetta.rosetta.utility.graph.DirectedEdgeListElement¶ C++: utility::graph::DirectedEdgeListElement::const_previous() const –> const class utility::graph::DirectedEdgeListElement *
-
edge
(*args, **kwargs)¶ Overloaded function.
- edge(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListElement) -> utility::graph::DirectedEdge
C++: utility::graph::DirectedEdgeListElement::edge() –> class utility::graph::DirectedEdge *
- edge(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListElement, setting: utility::graph::DirectedEdge) -> None
C++: utility::graph::DirectedEdgeListElement::edge(class utility::graph::DirectedEdge *) –> void
-
next
(*args, **kwargs)¶ Overloaded function.
- next(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListElement) -> pyrosetta.rosetta.utility.graph.DirectedEdgeListElement
C++: utility::graph::DirectedEdgeListElement::next() –> class utility::graph::DirectedEdgeListElement *
- next(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListElement, setting: pyrosetta.rosetta.utility.graph.DirectedEdgeListElement) -> None
C++: utility::graph::DirectedEdgeListElement::next(class utility::graph::DirectedEdgeListElement *) –> void
-
previous
(*args, **kwargs)¶ Overloaded function.
- previous(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListElement) -> pyrosetta.rosetta.utility.graph.DirectedEdgeListElement
C++: utility::graph::DirectedEdgeListElement::previous() –> class utility::graph::DirectedEdgeListElement *
- previous(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListElement, setting: pyrosetta.rosetta.utility.graph.DirectedEdgeListElement) -> None
C++: utility::graph::DirectedEdgeListElement::previous(class utility::graph::DirectedEdgeListElement *) –> void
-
-
class
pyrosetta.rosetta.utility.graph.
DirectedEdgeListIterator
¶ Bases:
pybind11_builtins.pybind11_object
Custom DirectedEdge list (non-const) iterator class, which can return non-const DirectedEdge pointers. This iterator cannot be used to change the structure of its list without access to that list directly. Customized since STL’s const-iterator cannot be prevented from giving non-const access to its data. The former workaround to this problem was to define two sets of edge lists on each vertex: a list< DirectedEdge * > and a list< DirectedEdge const * >.
-
assign
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator, rhs: pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator) → pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator¶ assignmnet operator
C++: utility::graph::DirectedEdgeListIterator::operator=(const class utility::graph::DirectedEdgeListIterator &) –> class utility::graph::DirectedEdgeListIterator &
-
minus_minus
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator) → pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator¶ decrement operator. Point this iterator at the previous element in the list.
C++: utility::graph::DirectedEdgeListIterator::operator–() –> const class utility::graph::DirectedEdgeListIterator &
-
plus_plus
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator) → pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator¶ increment operator. Point this iterator at the next element in the list.
C++: utility::graph::DirectedEdgeListIterator::operator++() –> const class utility::graph::DirectedEdgeListIterator &
-
valid
(self: pyrosetta.rosetta.utility.graph.DirectedEdgeListIterator) → bool¶ - check that this iterator is valid. Will not guarantee that the iterator points at an element
- that has not been destroyed.
C++: utility::graph::DirectedEdgeListIterator::valid() const –> bool
-
-
class
pyrosetta.rosetta.utility.graph.
EXCN_Stop_BFS
¶ Bases:
pyrosetta.rosetta.utility.excn.Exception
Class to raise to do an immediate stop of a breadth first search. ONLY THROW FROM WITHIN A VISITOR PASSED TO breadth_first_visit_prune/breadth_first_search_prune
-
add_msg
(self: pyrosetta.rosetta.utility.excn.Exception, str: str) → None¶ C++: utility::excn::Exception::add_msg(const class std::basic_string<char> &) –> void
-
assign
(self: pyrosetta.rosetta.utility.graph.EXCN_Stop_BFS, : pyrosetta.rosetta.utility.graph.EXCN_Stop_BFS) → pyrosetta.rosetta.utility.graph.EXCN_Stop_BFS¶ C++: utility::graph::EXCN_Stop_BFS::operator=(const class utility::graph::EXCN_Stop_BFS &) –> class utility::graph::EXCN_Stop_BFS &
-
msg
(*args, **kwargs)¶ Overloaded function.
- msg(self: pyrosetta.rosetta.utility.excn.Exception) -> str
C++: utility::excn::Exception::msg() const –> std::string
- msg(self: pyrosetta.rosetta.utility.excn.Exception, m: str) -> None
C++: utility::excn::Exception::msg(const class std::basic_string<char> &) –> void
-
show
(self: pyrosetta.rosetta.utility.excn.Exception, : pyrosetta.rosetta.std.ostream) → None¶ C++: utility::excn::Exception::show(class std::basic_ostream<char> &) const –> void
-
what
(self: pyrosetta.rosetta.std.exception) → str¶ C++: std::exception::what() const –> const char *
-
-
class
pyrosetta.rosetta.utility.graph.
EdgeList
¶ Bases:
pybind11_builtins.pybind11_object
Custom edge list class. Returns const-iterators which only return Edge const ‘s and non-const-iterators which can return either const or non-const Edge’s. Manages its own memory using an unordered-object-pool for fast insertion and deletion of EdgeListElements. Implemented as a doubly linked list, though there’s no practical way to start at the end of a list and work backward since decrementing the end iterator is not a valid operation.
-
begin
(self: pyrosetta.rosetta.utility.graph.EdgeList) → pyrosetta.rosetta.utility.graph.EdgeListIterator¶ returns a non-const iterator to the front of the list
C++: utility::graph::EdgeList::begin() –> class utility::graph::EdgeListIterator
-
const_begin
(self: pyrosetta.rosetta.utility.graph.EdgeList) → pyrosetta.rosetta.utility.graph.EdgeListConstIterator¶ returns a const iterator to the front of the list
C++: utility::graph::EdgeList::const_begin() const –> class utility::graph::EdgeListConstIterator
-
const_end
(self: pyrosetta.rosetta.utility.graph.EdgeList) → pyrosetta.rosetta.utility.graph.EdgeListConstIterator¶ returns a const iterator to the end of the list
C++: utility::graph::EdgeList::const_end() const –> class utility::graph::EdgeListConstIterator
-
const_last
(self: pyrosetta.rosetta.utility.graph.EdgeList) → pyrosetta.rosetta.utility.graph.EdgeListConstIterator¶ returns a const iterator to the last element in the list
C++: utility::graph::EdgeList::const_last() const –> class utility::graph::EdgeListConstIterator
-
end
(self: pyrosetta.rosetta.utility.graph.EdgeList) → pyrosetta.rosetta.utility.graph.EdgeListIterator¶ returns a non-const iterator to the end of the list
C++: utility::graph::EdgeList::end() –> class utility::graph::EdgeListIterator
-
erase
(self: pyrosetta.rosetta.utility.graph.EdgeList, to_erase: pyrosetta.rosetta.utility.graph.EdgeListIterator) → None¶ removes an element from the list pointed to by the input iterator
C++: utility::graph::EdgeList::erase(class utility::graph::EdgeListIterator) –> void
-
insert
(self: pyrosetta.rosetta.utility.graph.EdgeList, element_to_insert_before: pyrosetta.rosetta.utility.graph.EdgeListIterator, edgeptr: utility::graph::Edge) → pyrosetta.rosetta.utility.graph.EdgeListIterator¶ - insert a new edge-list element in the list infront of the input iterator and
- return an iterator to the position of the new element
C++: utility::graph::EdgeList::insert(const class utility::graph::EdgeListIterator &, class utility::graph::Edge *) –> class utility::graph::EdgeListIterator
-
is_end_element
(self: pyrosetta.rosetta.utility.graph.EdgeList, element: pyrosetta.rosetta.utility.graph.EdgeListElement) → bool¶ - method invoked by the EdgeListIterator class: is an iterator the special
- end iterator for a list?
C++: utility::graph::EdgeList::is_end_element(const class utility::graph::EdgeListElement *) const –> bool
-
last
(self: pyrosetta.rosetta.utility.graph.EdgeList) → pyrosetta.rosetta.utility.graph.EdgeListIterator¶ returns a non-const iterator to the last element in the list
C++: utility::graph::EdgeList::last() –> class utility::graph::EdgeListIterator
-
push_back
(self: pyrosetta.rosetta.utility.graph.EdgeList, edgeptr: utility::graph::Edge) → None¶ create a new edge-list element and insert it at the front of the list
C++: utility::graph::EdgeList::push_back(class utility::graph::Edge *) –> void
-
push_front
(self: pyrosetta.rosetta.utility.graph.EdgeList, edgeptr: utility::graph::Edge) → None¶ create a new edge-list element and insert it at the end of the list
C++: utility::graph::EdgeList::push_front(class utility::graph::Edge *) –> void
-
size
(self: pyrosetta.rosetta.utility.graph.EdgeList) → int¶ O(N)
C++: utility::graph::EdgeList::size() const –> unsigned long
-
-
class
pyrosetta.rosetta.utility.graph.
EdgeListConstIterator
¶ Bases:
pybind11_builtins.pybind11_object
Custom Edge list const iterator class, which returns only const Edge pointers. This iterator cannot be used to change the structure of its list without access to that list directly. Customized since STL’s const-iterator cannot be prevented from giving non-const access to its data. The former workaround to this problem was to define two sets of edge lists on each vertex: a list< Edge * > and a list< Edge const * >.
-
assign
(self: pyrosetta.rosetta.utility.graph.EdgeListConstIterator, rhs: pyrosetta.rosetta.utility.graph.EdgeListConstIterator) → pyrosetta.rosetta.utility.graph.EdgeListConstIterator¶ assignmnet operator
C++: utility::graph::EdgeListConstIterator::operator=(const class utility::graph::EdgeListConstIterator &) –> class utility::graph::EdgeListConstIterator &
-
minus_minus
(self: pyrosetta.rosetta.utility.graph.EdgeListConstIterator) → pyrosetta.rosetta.utility.graph.EdgeListConstIterator¶ decrement operator. Point this iterator at the previous element in the list.
C++: utility::graph::EdgeListConstIterator::operator–() –> const class utility::graph::EdgeListConstIterator &
-
plus_plus
(self: pyrosetta.rosetta.utility.graph.EdgeListConstIterator) → pyrosetta.rosetta.utility.graph.EdgeListConstIterator¶ increment operator. Point this iterator at the next element in the list.
C++: utility::graph::EdgeListConstIterator::operator++() –> const class utility::graph::EdgeListConstIterator &
-
valid
(self: pyrosetta.rosetta.utility.graph.EdgeListConstIterator) → bool¶ Is this a valid iterator?
C++: utility::graph::EdgeListConstIterator::valid() const –> bool
-
-
class
pyrosetta.rosetta.utility.graph.
EdgeListElement
¶ Bases:
pybind11_builtins.pybind11_object
Custom written edge list element class. Little more than a struct. Defined so that edge list memory management could rely on boost::pool like object
-
const_edge
(self: pyrosetta.rosetta.utility.graph.EdgeListElement) → utility::graph::Edge¶ C++: utility::graph::EdgeListElement::const_edge() const –> const class utility::graph::Edge *
-
const_next
(self: pyrosetta.rosetta.utility.graph.EdgeListElement) → pyrosetta.rosetta.utility.graph.EdgeListElement¶ C++: utility::graph::EdgeListElement::const_next() const –> const class utility::graph::EdgeListElement *
-
const_previous
(self: pyrosetta.rosetta.utility.graph.EdgeListElement) → pyrosetta.rosetta.utility.graph.EdgeListElement¶ C++: utility::graph::EdgeListElement::const_previous() const –> const class utility::graph::EdgeListElement *
-
edge
(*args, **kwargs)¶ Overloaded function.
- edge(self: pyrosetta.rosetta.utility.graph.EdgeListElement) -> utility::graph::Edge
C++: utility::graph::EdgeListElement::edge() –> class utility::graph::Edge *
- edge(self: pyrosetta.rosetta.utility.graph.EdgeListElement, setting: utility::graph::Edge) -> None
C++: utility::graph::EdgeListElement::edge(class utility::graph::Edge *) –> void
-
next
(*args, **kwargs)¶ Overloaded function.
- next(self: pyrosetta.rosetta.utility.graph.EdgeListElement) -> pyrosetta.rosetta.utility.graph.EdgeListElement
C++: utility::graph::EdgeListElement::next() –> class utility::graph::EdgeListElement *
- next(self: pyrosetta.rosetta.utility.graph.EdgeListElement, setting: pyrosetta.rosetta.utility.graph.EdgeListElement) -> None
C++: utility::graph::EdgeListElement::next(class utility::graph::EdgeListElement *) –> void
-
previous
(*args, **kwargs)¶ Overloaded function.
- previous(self: pyrosetta.rosetta.utility.graph.EdgeListElement) -> pyrosetta.rosetta.utility.graph.EdgeListElement
C++: utility::graph::EdgeListElement::previous() –> class utility::graph::EdgeListElement *
- previous(self: pyrosetta.rosetta.utility.graph.EdgeListElement, setting: pyrosetta.rosetta.utility.graph.EdgeListElement) -> None
C++: utility::graph::EdgeListElement::previous(class utility::graph::EdgeListElement *) –> void
-
-
class
pyrosetta.rosetta.utility.graph.
EdgeListIterator
¶ Bases:
pybind11_builtins.pybind11_object
Custom Edge list (non-const) iterator class, which can return non-const Edge pointers. This iterator cannot be used to change the structure of its list without access to that list directly. Customized since STL’s const-iterator cannot be prevented from giving non-const access to its data. The former workaround to this problem was to define two sets of edge lists on each vertex: a list< Edge * > and a list< Edge const * >.
-
assign
(self: pyrosetta.rosetta.utility.graph.EdgeListIterator, rhs: pyrosetta.rosetta.utility.graph.EdgeListIterator) → pyrosetta.rosetta.utility.graph.EdgeListIterator¶ assignmnet operator
C++: utility::graph::EdgeListIterator::operator=(const class utility::graph::EdgeListIterator &) –> class utility::graph::EdgeListIterator &
-
minus_minus
(self: pyrosetta.rosetta.utility.graph.EdgeListIterator) → pyrosetta.rosetta.utility.graph.EdgeListIterator¶ decrement operator. Point this iterator at the previous element in the list.
C++: utility::graph::EdgeListIterator::operator–() –> const class utility::graph::EdgeListIterator &
-
plus_plus
(self: pyrosetta.rosetta.utility.graph.EdgeListIterator) → pyrosetta.rosetta.utility.graph.EdgeListIterator¶ increment operator. Point this iterator at the next element in the list.
C++: utility::graph::EdgeListIterator::operator++() –> const class utility::graph::EdgeListIterator &
-
valid
(self: pyrosetta.rosetta.utility.graph.EdgeListIterator) → bool¶ - check that this iterator is valid. Will not guarantee that the iterator points at an element
- that has not been destroyed.
C++: utility::graph::EdgeListIterator::valid() const –> bool
-
-
class
pyrosetta.rosetta.utility.graph.
Graph
¶ Bases:
pybind11_builtins.pybind11_object
A Graph with constant time edge insertion and deletion. Extensible.
-
add_edge
(*args, **kwargs)¶ Overloaded function.
- add_edge(self: pyrosetta.rosetta.utility.graph.Graph, node1: int, node2: int) -> pyrosetta.rosetta.utility.graph.Edge
- add an edge between two vertices. Invokes “create_edge” from the derived class.
- Returns a pointer to the edge after its been added, allowing the calling function to immediately set data for this edge.
C++: utility::graph::Graph::add_edge(unsigned long, unsigned long) –> class utility::graph::Edge *
- add_edge(self: pyrosetta.rosetta.utility.graph.Graph, example_edge: pyrosetta.rosetta.utility.graph.Edge) -> pyrosetta.rosetta.utility.graph.Edge
- add an edge to this graph copying the data from an edge in another graph.
- Returns a pointer to the edge after its been added, allowing the calling function to immediately set data for this edge.
C++: utility::graph::Graph::add_edge(const class utility::graph::Edge *) –> class utility::graph::Edge *
-
all_pairs_shortest_paths
(self: pyrosetta.rosetta.utility.graph.Graph) → ObjexxFCL::FArray2D<int>¶ - O(V^3). Computes all pairs shortest paths using Warshall’s algorithm
- and writes all the path distances to the two-dimensional table.
C++: utility::graph::Graph::all_pairs_shortest_paths() const –> class ObjexxFCL::FArray2D<int>
-
assign
(self: pyrosetta.rosetta.utility.graph.Graph, source: pyrosetta.rosetta.utility.graph.Graph) → pyrosetta.rosetta.utility.graph.Graph¶ assignment operator. source and this must have the same type.
C++: utility::graph::Graph::operator=(const class utility::graph::Graph &) –> class utility::graph::Graph &
-
const_edge_list_begin
(self: pyrosetta.rosetta.utility.graph.Graph) → pyrosetta.rosetta.utility.graph.EdgeListConstIterator¶ - returns a const iterator to the beginning of the (unordered) edge list for the graph.
- this edge list contains all the edges in the graph, not simply those for a particular vertex
C++: utility::graph::Graph::const_edge_list_begin() const –> class utility::graph::EdgeListConstIterator
-
const_edge_list_end
(self: pyrosetta.rosetta.utility.graph.Graph) → pyrosetta.rosetta.utility.graph.EdgeListConstIterator¶ - returns a const iterator to the end of the (unordered) edge list for the graph.
- this edge list contains all the edges in the graph, not simply those for a particular vertex
C++: utility::graph::Graph::const_edge_list_end() const –> class utility::graph::EdgeListConstIterator
-
copy_connectivity
(self: pyrosetta.rosetta.utility.graph.Graph, source: pyrosetta.rosetta.utility.graph.Graph) → None¶ - copy the edge connectivity from a source graph with a potentially
- unknown type.
C++: utility::graph::Graph::copy_connectivity(const class utility::graph::Graph &) –> void
-
delete_edge
(self: pyrosetta.rosetta.utility.graph.Graph, edge: pyrosetta.rosetta.utility.graph.Edge) → None¶ - remove an edge from the graph. (NEW AS OF 12/9/07) Never call C++’s
- “delete” function on an edge pointer directly. Derived classes must implement this function. If they wish to use unordered_object_pools to manage their memory
C++: utility::graph::Graph::delete_edge(class utility::graph::Edge *) –> void
-
drop_all_edges
(self: pyrosetta.rosetta.utility.graph.Graph) → None¶ delete all the edges present in the graph
C++: utility::graph::Graph::drop_all_edges() –> void
-
drop_all_edges_for_node
(self: pyrosetta.rosetta.utility.graph.Graph, node: int) → None¶ delete all the edges for a single vertex in the graph
C++: utility::graph::Graph::drop_all_edges_for_node(unsigned long) –> void
-
edge_list_begin
(self: pyrosetta.rosetta.utility.graph.Graph) → pyrosetta.rosetta.utility.graph.EdgeListIterator¶ - returns a non-const iterator to the beginning of the (unordered) edge list for the graph.
- this edge list contains all the edges in the graph, not simply those for a particular vertex
C++: utility::graph::Graph::edge_list_begin() –> class utility::graph::EdgeListIterator
-
edge_list_end
(self: pyrosetta.rosetta.utility.graph.Graph) → pyrosetta.rosetta.utility.graph.EdgeListIterator¶ - returns a non-const iterator to the end of the (unordered) edge list for the graph.
- this edge list contains all the edges in the graph, not simply those for a particular vertex
C++: utility::graph::Graph::edge_list_end() –> class utility::graph::EdgeListIterator
-
find_edge
(self: pyrosetta.rosetta.utility.graph.Graph, node1: int, node2: int) → pyrosetta.rosetta.utility.graph.Edge¶ - returns a pointer to the edge connecting nodes node1 and node2, if that edge exists
- in the graph, o.w. returns 0. Focuses the graph on this edge for fast subsequent retrieval.
C++: utility::graph::Graph::find_edge(unsigned long, unsigned long) –> class utility::graph::Edge *
-
focused_edge
(self: pyrosetta.rosetta.utility.graph.Graph) → pyrosetta.rosetta.utility.graph.Edge¶ returns a pointer to the focused edge
C++: utility::graph::Graph::focused_edge() –> class utility::graph::Edge *
-
getTotalMemoryUsage
(self: pyrosetta.rosetta.utility.graph.Graph) → int¶ - returns a count of all the memory used by every vertex and edge in a graph
- by invoking the polymorphic count_static_memory and count_dynamic_memory of each (possibly derived) node and edge object as well as for the (possibly derived) graph class.
C++: utility::graph::Graph::getTotalMemoryUsage() const –> unsigned long
-
get_edge_exists
(self: pyrosetta.rosetta.utility.graph.Graph, node1: int, node2: int) → bool¶ is an edge already present in the graph? O(V) worst case. O(1) iff all vertices have O(1) edges
C++: utility::graph::Graph::get_edge_exists(unsigned long, unsigned long) const –> bool
-
get_node
(self: pyrosetta.rosetta.utility.graph.Graph, index: int) → pyrosetta.rosetta.utility.graph.Node¶ C++: utility::graph::Graph::get_node(unsigned long) –> class utility::graph::Node *
-
get_self_ptr
(self: pyrosetta.rosetta.utility.graph.Graph) → pyrosetta.rosetta.utility.graph.Graph¶ C++: utility::graph::Graph::get_self_ptr() –> class std::shared_ptr<class utility::graph::Graph>
-
num_edges
(self: pyrosetta.rosetta.utility.graph.Graph) → int¶ C++: utility::graph::Graph::num_edges() const –> unsigned long
-
num_nodes
(self: pyrosetta.rosetta.utility.graph.Graph) → int¶ the number of nodes in the graph
C++: utility::graph::Graph::num_nodes() const –> unsigned long
-
output_connectivity
(self: pyrosetta.rosetta.utility.graph.Graph, os: pyrosetta.rosetta.std.ostream) → None¶ send an edge list to the stream os.
C++: utility::graph::Graph::output_connectivity(class std::basic_ostream<char> &) const –> void
-
output_dimacs
(self: pyrosetta.rosetta.utility.graph.Graph, os: pyrosetta.rosetta.std.ostream) → None¶ describe this graph in dimacs form to the stream os.
C++: utility::graph::Graph::output_dimacs(class std::basic_ostream<char> &) const –> void
-
print_vertices
(self: pyrosetta.rosetta.utility.graph.Graph) → None¶ send summary information to the screen for all vertices in the graph
C++: utility::graph::Graph::print_vertices() const –> void
-
set_num_nodes
(self: pyrosetta.rosetta.utility.graph.Graph, num_nodes: int) → None¶ set the number of nodes in the graph – deletes any existing edges in the graph
C++: utility::graph::Graph::set_num_nodes(unsigned long) –> void
-
-
pyrosetta.rosetta.utility.graph.
block_allocation_error_message
(block_size: int, array_size: int, neg_space_element_size: int) → str¶ C++: utility::graph::block_allocation_error_message(unsigned long, unsigned long, unsigned long) –> std::string
-
pyrosetta.rosetta.utility.graph.
delete_all_intragroup_edges
(g: pyrosetta.rosetta.utility.graph.Graph, node_groups: pyrosetta.rosetta.utility.vector1_unsigned_long) → None¶ C++: utility::graph::delete_all_intragroup_edges(class utility::graph::Graph &, const class utility::vector1<unsigned long, class std::allocator<unsigned long> > &) –> void
-
pyrosetta.rosetta.utility.graph.
digraph_is_a_DAG
(g: pyrosetta.rosetta.utility.graph.Digraph) → bool¶ - Return whether or not the input directed graph is a DAG – this invokes
- the topological_sort function and simply returns the second element in the pair that it returns.
C++: utility::graph::digraph_is_a_DAG(const class utility::graph::Digraph &) –> bool
-
pyrosetta.rosetta.utility.graph.
find_connected_components
(g: pyrosetta.rosetta.utility.graph.Graph) → pyrosetta.rosetta.utility.vector1_std_pair_unsigned_long_unsigned_long_t¶ - returns a vector1 of connected component descriptions:
- each entry holds a representative vertex from that connected component (first entry in pair) and the connected-component size (second entry in pair). O( V+E ).
C++: utility::graph::find_connected_components(const class utility::graph::Graph &) –> class utility::vector1<struct std::pair<unsigned long, unsigned long>, class std::allocator<struct std::pair<unsigned long, unsigned long> > >
-
pyrosetta.rosetta.utility.graph.
neg_space_element_allocation_error_message
(block_size: int, neg_space_element_size: int) → str¶ C++: utility::graph::neg_space_element_allocation_error_message(unsigned long, unsigned long) –> std::string
-
pyrosetta.rosetta.utility.graph.
topological_sort
(g: pyrosetta.rosetta.utility.graph.Digraph) → Tuple[pyrosetta.rosetta.std.list_unsigned_long_t, bool]¶ - Construct a topological sort for the input directed graph, if it is a DAG,
- and return whether or not the input graph is actually a DAG.
C++: utility::graph::topological_sort(const class utility::graph::Digraph &) –> struct std::pair<class std::list<unsigned long, class std::allocator<unsigned long> >, bool>