RingDecomposerLib 1.0
Public Member Functions | Public Attributes | List of all members
py_rdl.Calculator.Calculator Class Reference

Public Member Functions

def __init__ (self, graph)
 
def get_calculated_result_for_graph (cls, graph)
 
def get_calculated_result (cls, edge_iterable, get_node_1=operator.itemgetter(0), get_node_2=operator.itemgetter(1), get_node_id=lambda x:x, get_edge_id=lambda x:x)
 
def set_graph (self, graph)
 
def calculate (self)
 
def is_calculated (self)
 
def get_nof_urf (self)
 
def get_nof_rcf (self)
 
def get_nof_ringsystems (self)
 
def __len__ (self)
 
def get_nodes_for_urf (self, urf_index)
 
def get_nodes_for_rcf (self, rcf_index)
 
def get_nodes_for_ringsystem (self, rs_index)
 
def get_edges_for_urf (self, urf_index)
 
def get_edges_for_rcf (self, rcf_index)
 
def get_edges_for_ringsystem (self, rs_index)
 
def get_weight_for_urf (self, urf_index)
 
def get_weight_for_rcf (self, rcf_index)
 
def get_relevant_cycles_for_urf (self, urf_index)
 
def get_relevant_cycles_for_rcf (self, rcf_index)
 
def get_urfs_for_node (self, node)
 
def get_urfs_for_edge (self, edge)
 
def get_rcfs_for_node (self, node)
 
def get_rcfs_for_edge (self, edge)
 
def get_sssr (self)
 
def get_relevant_cycles (self)
 
def get_nof_relevant_cycles (self)
 
def get_nof_relevant_cycles_for_urf (self, urf_index)
 
def get_relevant_cycle_prototypes (self)
 
def __getitem__ (self, item)
 

Public Attributes

 urfs
 List of calculated URFs. More...
 
 rcfs
 List of calculated RCFs. More...
 
 ringsystems
 List of calculated ring systems. More...
 

Detailed Description

Object for representing a calculation result.

Constructor & Destructor Documentation

◆ __init__()

def py_rdl.Calculator.Calculator.__init__ (   self,
  graph 
)
Initialize a new Calculator object with a Graph.

Use @classmethod provided instead
(get_calculated_result_for_graph, get_calculated_result).

You can access URFs, RCFs and ring systems with the
public attributes `urfs`, `rcfs` and `ringsystems`.
The objects can be uses as indices for all functions below,
that operate on the respective ring descriptions.

Member Function Documentation

◆ __getitem__()

def py_rdl.Calculator.Calculator.__getitem__ (   self,
  item 
)
Get the item-th URF.
item: The index of the URF
raises RDLError if calculation wasn't successful
raises IndexError if the index is out of range
returns the item-th URF.

◆ __len__()

def py_rdl.Calculator.Calculator.__len__ (   self)
Builtin for getting the length (number of URFs).

◆ calculate()

def py_rdl.Calculator.Calculator.calculate (   self)
Calculate results for the graph datastructure.
raises RDLError, if the calculation fails

When creating a Calculator object with the
@classmethod provided
(get_calculated_result_for_graph, get_calculated_result)
calling this function
is not necessary.

◆ get_calculated_result()

def py_rdl.Calculator.Calculator.get_calculated_result (   cls,
  edge_iterable,
  get_node_1 = operator.itemgetter(0),
  get_node_2 = operator.itemgetter(1),
  get_node_id = lambda x: x,
  get_edge_id = lambda x: x 
)
Calculate the ring topologies and return the results.

edge_iterable: an iterable containing the edges
get_node_1: function retrieving the first node of an edge
get_node_2: function retrieving the second node of an edge
get_node_id: function for retrieving node identifier
get_edge_id: function for retrieving edge identifier
returns the calculated Calculator

This @classmethod creates a new Graph.
The edge_iterable can be any iterable (list, generator etc.).
An edge can be as simple as a pair of nodes.
The get_node function must return the respective nodes adjacent
to an edge.
The node must be hashable. If it's not, use some unique ID
instead.
The edge must be hashable. If it's not, use some unique ID
instead.

◆ get_calculated_result_for_graph()

def py_rdl.Calculator.Calculator.get_calculated_result_for_graph (   cls,
  graph 
)
Calculate the ring topologies for a Graph
and return the results.

◆ get_edges_for_rcf()

def py_rdl.Calculator.Calculator.get_edges_for_rcf (   self,
  rcf_index 
)
Get the edges in this RCF.
raises RDLError if calculation wasn't successful
returns list of edges in this RCF

◆ get_edges_for_ringsystem()

def py_rdl.Calculator.Calculator.get_edges_for_ringsystem (   self,
  rs_index 
)
Get the edges in this Ringsystem.
A ring system is a 2-connected component of the graph.
raises RDLError if calculation wasn't successful
returns list of edges in this Ringsystem

◆ get_edges_for_urf()

def py_rdl.Calculator.Calculator.get_edges_for_urf (   self,
  urf_index 
)
Get the edges in this URF.
raises RDLError if calculation wasn't successful
returns list of edges in this URF

◆ get_nodes_for_rcf()

def py_rdl.Calculator.Calculator.get_nodes_for_rcf (   self,
  rcf_index 
)
Get the nodes in this RCF.
raises RDLError if calculation wasn't successful
returns list of nodes in this RCF

◆ get_nodes_for_ringsystem()

def py_rdl.Calculator.Calculator.get_nodes_for_ringsystem (   self,
  rs_index 
)
Get the nodes in this Ringsystem.
A ring system is a 2-connected component of the graph.
raises RDLError if calculation wasn't successful
returns list of nodes in this Ringsystem

◆ get_nodes_for_urf()

def py_rdl.Calculator.Calculator.get_nodes_for_urf (   self,
  urf_index 
)
Get the nodes in this URF.
raises RDLError if calculation wasn't successful
returns list of nodes in this URF

◆ get_nof_rcf()

def py_rdl.Calculator.Calculator.get_nof_rcf (   self)
Get the number of RCFs.
raises RDLError if calculation wasn't successful

◆ get_nof_relevant_cycles()

def py_rdl.Calculator.Calculator.get_nof_relevant_cycles (   self)
Get the number of relevant cycles.
raises RDLError if calculation wasn't successful
returns number of RCs

◆ get_nof_relevant_cycles_for_urf()

def py_rdl.Calculator.Calculator.get_nof_relevant_cycles_for_urf (   self,
  urf_index 
)
Get the number of relevant cycles for given URF.
raises RDLError if calculation wasn't successful
returns number of RCs

◆ get_nof_ringsystems()

def py_rdl.Calculator.Calculator.get_nof_ringsystems (   self)
Get the number of Ringsystems.
A ring system is a 2-connected component of the graph.
raises RDLError if calculation wasn't successful

◆ get_nof_urf()

def py_rdl.Calculator.Calculator.get_nof_urf (   self)
Get the number of URFs.
raises RDLError if calculation wasn't successful

◆ get_rcfs_for_edge()

def py_rdl.Calculator.Calculator.get_rcfs_for_edge (   self,
  edge 
)
Get the RCFs this edge is part of.
raises RDLError if calculation wasn't successful
returns list of RCFs

◆ get_rcfs_for_node()

def py_rdl.Calculator.Calculator.get_rcfs_for_node (   self,
  node 
)
Get the RCFs this node is part of.
raises RDLError if calculation wasn't successful
returns a list of RCFs

◆ get_relevant_cycle_prototypes()

def py_rdl.Calculator.Calculator.get_relevant_cycle_prototypes (   self)
Get relevant cycle prototypes (one for each RCF).
raises RDLError if calculation wasn't successful
returns list of relevant cycle prototypes

◆ get_relevant_cycles()

def py_rdl.Calculator.Calculator.get_relevant_cycles (   self)
Get relevant cycles.
raises RDLError if calculation wasn't successful
returns generator for enumerating relevant cycles

◆ get_relevant_cycles_for_rcf()

def py_rdl.Calculator.Calculator.get_relevant_cycles_for_rcf (   self,
  rcf_index 
)
Get the cycles in this of RCF.
raises RDLError if calculation wasn't successful
returns generator for enumerating relevant cycles in this RCF

◆ get_relevant_cycles_for_urf()

def py_rdl.Calculator.Calculator.get_relevant_cycles_for_urf (   self,
  urf_index 
)
Get the cycles in this of URF.
raises RDLError if calculation wasn't successful
returns generator for enumerating relevant cycles in this URF

◆ get_sssr()

def py_rdl.Calculator.Calculator.get_sssr (   self)
Get a minimal cycle base.
raises RDLError if calculation wasn't successful
returns list of cycles

◆ get_urfs_for_edge()

def py_rdl.Calculator.Calculator.get_urfs_for_edge (   self,
  edge 
)
Get the URFs this edge is part of.
raises RDLError if calculation wasn't successful
returns list of URFs

◆ get_urfs_for_node()

def py_rdl.Calculator.Calculator.get_urfs_for_node (   self,
  node 
)
Get the URFs this node is part of.
raises RDLError if calculation wasn't successful
returns a list of URFs

◆ get_weight_for_rcf()

def py_rdl.Calculator.Calculator.get_weight_for_rcf (   self,
  rcf_index 
)
Get weight of this RCF.
raises RDLError if calculation wasn't successful
return weight for given RCF

◆ get_weight_for_urf()

def py_rdl.Calculator.Calculator.get_weight_for_urf (   self,
  urf_index 
)
Get weight of this URF.
raises RDLError if calculation wasn't successful
return weight for given URF

◆ is_calculated()

def py_rdl.Calculator.Calculator.is_calculated (   self)
Check calculation status.
returns True if calculation was successful, False otherwise.

◆ set_graph()

def py_rdl.Calculator.Calculator.set_graph (   self,
  graph 
)
Set the graph data structure.

This has to be a Graph object. See Graph
for a generic interface.

Member Data Documentation

◆ rcfs

py_rdl.Calculator.Calculator.rcfs

List of calculated RCFs.

You can access individual RCFs using this list and use the RCF objects as index to all functions below, that take an RCF as argument.

◆ ringsystems

py_rdl.Calculator.Calculator.ringsystems

List of calculated ring systems.

You can access individual ring systems using this list and use the Ringsystem objects as index to all functions below, that take an ring system as argument.

◆ urfs

py_rdl.Calculator.Calculator.urfs

List of calculated URFs.

You can access individual URFs using this list and use the URF objects as index to all functions below, that take an URF as argument.


The documentation for this class was generated from the following file: