27 #ifndef RING_DECOMPOSER_LIB_H 28 #define RING_DECOMPOSER_LIB_H 30 #if (defined( _WIN32 ) && defined( _MSC_VER ) ) 32 #define RDL_API __declspec(dllexport) 33 #elif __GNUC__ >= 4 || defined(__clang__) 34 #define RDL_API __attribute__((visibility("default"))) 96 typedef void (*RDL_outputFunction) (RDL_ERROR_LEVEL level,
const char* m, ...);
226 RDL_node **RDL_node_array_ptr);
241 RDL_edge **RDL_edge_array_ptr);
254 RDL_node **RDL_node_array_ptr);
269 RDL_edge **RDL_edge_array_ptr);
339 unsigned **RDL_ids_ptr);
358 RDL_node node2,
unsigned **RDL_ids_ptr);
376 unsigned **RDL_ids_ptr);
395 RDL_node node2,
unsigned **RDL_ids_ptr);
636 char ***RDL_cycle_array_ptr);
732 const RDL_data *data,
unsigned idx, RDL_node** nodes);
745 const RDL_data* data,
unsigned from,
unsigned to);
RDL_API unsigned RDL_getWeightForRCF(const RDL_data *data, unsigned index)
Returns the weight of each cycle in the RCF identified by its index.
RDL_ERROR_LEVEL
error levels for custom logging functions
Definition: RingDecomposerLib.h:83
RDL_node RDL_edge[2]
An edge is represented by an array of size two containing the adjacent nodes.
Definition: RingDecomposerLib.h:78
RDL_API const unsigned RDL_DUPLICATE_EDGE
Duplicate edge indicator.
RDL_API unsigned RDL_getNofRingsystems(const RDL_data *data)
Get the number of ring systems in the graph.
struct RDL_data RDL_data
Structure representing a calculation result.
Definition: RingDecomposerLib.h:50
RDL_API double RDL_getNofRC(const RDL_data *data)
Gives the number of relevant cycles.
RDL_API RDL_graph * RDL_initNewGraph(unsigned nof_nodes)
Initializes a new RDL_graph.
RDL_API unsigned RDL_getSSSR(const RDL_data *data, RDL_cycle ***RDL_cycle_array_ptr)
Gives a set of cycles that forms a Minimal Cycle Basis of the graph.
RDL_API unsigned RDL_getURFsContainingEdge(const RDL_data *data, RDL_node node1, RDL_node node2, unsigned **RDL_ids_ptr)
Gives all URFs containing the edge.
RDL_API unsigned RDL_getRingsystemForEdge(const RDL_data *data, unsigned from, unsigned to)
Get the ring system id for given edge.
RDL_API unsigned RDL_addUEdge(RDL_graph *graph, RDL_node node1, RDL_node node2)
Adds an undirected edge to the graph.
RDL_API unsigned RDL_getEdgesForURF(const RDL_data *data, unsigned index, RDL_edge **RDL_edge_array_ptr)
Gives the edges of an URF identified with its index.
RDL_API unsigned RDL_getNodesForRCF(const RDL_data *data, unsigned index, RDL_node **RDL_node_array_ptr)
Gives the nodes of an RCF identified with its index in an array of RDL_node.
RDL_API const double RDL_INVALID_RC_COUNT
Invalid number of RCs.
RDL_API unsigned RDL_getURFsContainingNode(const RDL_data *data, RDL_node node, unsigned **RDL_ids_ptr)
Gives all URFs containing the node.
RDL_API unsigned RDL_getNofEdgesForRingsystem(const RDL_data *data, unsigned idx)
Get the number of edges in the ring system.
RDL_API void RDL_writeNothing(RDL_ERROR_LEVEL level, const char *fmt,...)
No output function.
unsigned weight
Definition: RingDecomposerLib.h:405
struct RDL_graph RDL_graph
Datastructure representing a graph for calculations.
Definition: RingDecomposerLib.h:68
RDL_API unsigned RDL_getNofRCF(const RDL_data *data)
Returns the number of RCFs.
RDL_edge * edges
Definition: RingDecomposerLib.h:403
RDL_API unsigned RDL_getRCFsContainingNode(const RDL_data *data, RDL_node node, unsigned **RDL_ids_ptr)
Gives all RCFs containing the node.
RDL_API void RDL_deleteCycleIterator(RDL_cycleIterator *it)
Free memory of the cycle iterator.
RDL_API RDL_cycleIterator * RDL_getRCyclesForURFIterator(const RDL_data *data, unsigned index)
Get iterator for all relevant cycles of the URF with the given index.
RDL_API double RDL_getNofRCForURF(const RDL_data *data, unsigned index)
Gives the number of relevant cycles in this URF.
Definition: RingDecomposerLib.h:401
RDL_API void RDL_setOutputFunction(RDL_outputFunction func)
Set the output function for warning and error messages.
RDL_API unsigned RDL_getRCyclesForURF(const RDL_data *data, unsigned index, RDL_cycle ***RDL_cycle_array_ptr)
Gives all relevant cycles of the URF with the given index.
RDL_API void RDL_deleteCycles(RDL_cycle **cycles, unsigned number)
Deallocates the structure given by RDL_getRCycles(), RDL_getSSSR(), RDL_getRCPrototypes() and RDL_get...
RDL_API unsigned RDL_getNodesForRingsystem(const RDL_data *data, unsigned idx, RDL_node **nodes)
Get the nodes in the ring system.
RDL_API unsigned RDL_getNofRCFContainingNode(const RDL_data *data, RDL_node node)
Returns the number of RCFs that contain the given node.
RDL_API const unsigned RDL_INVALID_RESULT
Invalid result indicator.
unsigned rcf
Definition: RingDecomposerLib.h:409
RDL_API unsigned RDL_getNofEdges(const RDL_data *data)
Get the number of edges in the graph.
RDL_API RDL_cycleIterator * RDL_getRCyclesForRCFIterator(const RDL_data *data, unsigned index)
Get iterator for all relevant cycles of the RCF with the given index.
RDL_API unsigned RDL_getEdgeArray(const RDL_data *data, RDL_edge **RDL_edge_array_ptr)
Gives the edges of the graph.
RDL_API unsigned RDL_getNofURFContainingEdge(const RDL_data *data, RDL_node node1, RDL_node node2)
Returns the number of URFs that contain the RDL_edge defined by the two given nodes.
RDL_API void RDL_deleteData(RDL_data *data)
Deletes RDL_data from memory, including the RDL_graph.
RDL_API unsigned RDL_getNodesForURF(const RDL_data *data, unsigned index, RDL_node **RDL_node_array_ptr)
Gives the nodes of an URF identified with its index in an array of RDL_node.
RDL_API unsigned RDL_getEdgeId(const RDL_data *data, unsigned from, unsigned to)
Get the id of the edge.
RDL_API unsigned RDL_getRCPrototypes(const RDL_data *data, RDL_cycle ***RDL_cycle_array_ptr)
Gives a list of relevant cycle prototypes (one for each RCF).
unsigned RDL_node
A node is represented by its index in the graph (0 to |V|-1).
Definition: RingDecomposerLib.h:73
RDL_API unsigned RDL_getRCycles(const RDL_data *data, RDL_cycle ***RDL_cycle_array_ptr)
Gives a list of all relevant cycles.
RDL_API unsigned RDL_translateCycArray(const RDL_data *data, RDL_cycle **old_array, unsigned number, char ***RDL_cycle_array_ptr)
Translates the results of RDL_getRCycles(), RDL_getSSSR(), RDL_getRCPrototypes() and RDL_getRCyclesFo...
unsigned urf
Definition: RingDecomposerLib.h:407
RDL_API double RDL_getNofRCForRCF(const RDL_data *data, unsigned index)
Gives the number of relevant cycles in this RCF.
RDL_API RDL_outputFunction RDL_outputFunc
the output function for warnings and errors
RDL_API const unsigned RDL_NO_RINGSYSTEM
No ringsystem indicator.
RDL_API unsigned RDL_getRCyclesForRCF(const RDL_data *data, unsigned index, RDL_cycle ***RDL_cycle_array_ptr)
Gives all relevant cycles of the RCF with the given index.
RDL_API unsigned RDL_getWeightForURF(const RDL_data *data, unsigned index)
Returns the weight of each cycle in the URF identified by its index.
struct RDL_cycleIterator RDL_cycleIterator
Iterator for relevant cycles.
Definition: RingDecomposerLib.h:437
RDL_API unsigned RDL_getEdgesForRingsystem(const RDL_data *data, unsigned idx, RDL_edge **edges)
Get the edges in the ring system.
RDL_API unsigned RDL_getEdgesForRCF(const RDL_data *data, unsigned index, RDL_edge **RDL_edge_array_ptr)
Gives the edges of an RCF identified with its index.
RDL_API unsigned RDL_getNofURF(const RDL_data *data)
Returns the number of URFs.
RDL_API unsigned RDL_getRCFsContainingEdge(const RDL_data *data, RDL_node node1, RDL_node node2, unsigned **RDL_ids_ptr)
Gives all RCFs containing the edge.
RDL_API RDL_cycleIterator * RDL_cycleIteratorNext(RDL_cycleIterator *it)
Advance the cycle iterator by one.
RDL_API RDL_cycle * RDL_cycleIteratorGetCycle(RDL_cycleIterator *it)
Get the cycle as RDL_cycle.
RDL_API void RDL_writeToStderr(RDL_ERROR_LEVEL level, const char *fmt,...)
An output function for writing everything to stderr.
RDL_API unsigned RDL_getNofURFContainingNode(const RDL_data *data, RDL_node node)
Returns the number of URFs that contain the given node.
RDL_API unsigned RDL_getNofRCFContainingEdge(const RDL_data *data, RDL_node node1, RDL_node node2)
Returns the number of RCFs that contain the RDL_edge defined by the two given nodes.
RDL_API RDL_data * RDL_calculate(RDL_graph *input_graph)
Calculates the RDL_data structure of the given graph and returns it.
RDL_API void RDL_deleteEdgeIdxArray(char **cycles, unsigned number)
Deallocates the structure given by RDL_translateCycArray(), if called on its result and return value ...
RDL_API void RDL_deleteCycle(RDL_cycle *cycle)
Free memory of RDL_cycle.
RDL_API RDL_cycleIterator * RDL_getRCyclesIterator(const RDL_data *data)
Get iterator for all relevant cycles.
RDL_API void RDL_deleteGraph(RDL_graph *graph)
Delete RDL_graph.
RDL_API unsigned RDL_getNofNodesForRingsystem(const RDL_data *data, unsigned idx)
Get the number of nodes in the ring system.
RDL_API int RDL_cycleIteratorAtEnd(RDL_cycleIterator *it)
Check if iterator is at end (invalid)
struct RDL_cycle RDL_cycle