cucon/digraph.h: Directed and Undirected Graphs (deprecated)
[Deprecated (Subject to Removal)]

Data Structures

struct  cucon_digraph_vertex
struct  cucon_digraph_edge
struct  cucon_digraph

Defines

#define cucon_digraph_opt_list_of_vertices   0x01
#define cucon_digraph_opt_list_of_edges   0x02
#define cucon_digraph_opt_lists   cucon_digraph_opt_list_of_vertices | cucon_digraph_opt_list_of_edges
#define cucon_digraph_opt_no_oneedge_loops   0x10
#define cucon_digraph_opt_no_multiedge_loops   0x20
#define cucon_digraph_opt_no_loops   0x30
#define cucon_digraph_all_edges_it_next   cucon_listnode_next
#define cucon_digraph_all_edges_it_prev   cucon_listnode_prev
#define cucon_digraph_all_edges_it_get   cucon_listnode_mem
#define cucon_digraph_all_edges_begin(g)   cucon_list_begin(&(g)->edges)
#define cucon_digraph_all_edges_end(g)   cucon_list_end(&(g)->edges)
#define cucon_digraph_all_vertices_it_next   cucon_listnode_next
#define cucon_digraph_all_vertices_it_prev   cucon_listnode_prev
#define cucon_digraph_all_vertices_it_get   cucon_listnode_mem
#define cucon_digraph_all_vertices_begin(g)   cucon_list_begin(&(g)->vertices)
#define cucon_digraph_all_vertices_end(g)   cucon_list_end(&(g)->vertices)
#define cucon_digraph_vertex_get_mem(v)   ((void*)CU_ALIGNED_MARG_END(cucon_digraph_vertex_t, (v)))
#define cucon_digraph_vertex_from_mem(mem)   CU_ALIGNED_PTR_FROM_END(cucon_digraph_t, mem)
#define cucon_digraph_vertex_get_ptr(v)   (*(void**)CU_ALIGNED_MARG_END(cucon_digraph_vertex_t, (v)))
#define cucon_digraph_vertex_set_ptr(v, x)   (*(void**)CU_ALIGNED_MARG_END(cucon_digraph_vertex_t, (v)) = (x))
#define cuconP_OUTEDGE(e)
#define cuconP_OUTEDGE_TO_IT(e)   (&CU_MARG(cucon_digraph_edge_t, e)->as_output)
#define cucon_digraph_edge_first_from_vertex(v)
#define cucon_digraph_edge_last_from_vertex(v)
#define cucon_digraph_edge_stop_from_vertex(v)
#define cucon_digraph_edge_next_from_vertex(e)   cuconP_OUTEDGE(cucon_listnode_next(cuconP_OUTEDGE_TO_IT(e)))
#define cucon_digraph_edge_prev_from_vertex(e)   cuconP_OUTEDGE(cucon_listnode_prev(cuconP_OUTEDGE_TO_IT(e)))
#define cucon_digraph_edge_get_mem(e)   ((void*)CU_ALIGNED_MARG_END(cucon_digraph_edge_t, e))
#define cucon_digraph_edge_from_mem(mem)   ALIGNED_PTR_FROM_END(cucon_digraph_edge_t, mem)
#define cucon_digraph_edge_get_ptr(e)   (*(void**)CU_ALIGNED_MARG_END(cucon_digraph_edge_t, e))
#define cucon_digraph_edge_set_ptr(e, x)   (*(void**)CU_ALIGNED_MARG_END(cucon_digraph_edge_t, e) = (x))
#define cucon_digraph_edge_src(e)   ((e)->src)
#define cucon_digraph_edge_dst(e)   ((e)->dst)
#define cucon_digraph_edge_is_directed(e)   cu_false

Typedefs

typedef unsigned int cucon_digraph_opt_t
typedef cucon_listnode_t cucon_digraph_all_edges_it_t
typedef cucon_listnode_t cucon_digraph_all_vertices_it_t

Functions

cucon_digraph_t cucon_digraph_new (cucon_digraph_opt_t options)
cucon_digraph_vertex_t cucon_digraph_insert_vertex_mem (cucon_digraph_t, size_t size)
cucon_digraph_vertex_t cucon_digraph_insert_vertex_ptr (cucon_digraph_t, void *ptr)
void cucon_digraph_insert_vertex_node_cct (cucon_digraph_t G, cucon_digraph_vertex_t node)
cucon_digraph_edge_t cucon_digraph_insert_edge_mem (cucon_digraph_t G, cucon_digraph_vertex_t v0, cucon_digraph_vertex_t v1, size_t value_size)
cucon_digraph_edge_t cucon_digraph_insert_edge_ptr (cucon_digraph_t G, cucon_digraph_vertex_t v0, cucon_digraph_vertex_t v1, cu_ptr_t value_ptr)
cucon_list_t cucon_digraph_shortest_path_if (cucon_digraph_t g, cucon_digraph_vertex_t v_start, cu_clop(vertex_test, cu_bool_t, cucon_digraph_vertex_t), cu_clop(edge_distance, double, cucon_digraph_edge_t))
cucon_list_t cucon_digraph_shortest_path (cucon_digraph_t g, cucon_digraph_vertex_t v_start, cucon_digraph_vertex_t v_final, cu_clop(edge_distance, double, cucon_digraph_edge_t))
void cucon_digraph_write_graphviz (cucon_digraph_t g, cu_clop(vertex_label, char const *, cucon_digraph_vertex_t), cu_clop(edge_label, char const *, cucon_digraph_edge_t), FILE *out)
void cucon_digraph_write_graphviz_props (cucon_digraph_t g, cu_clop(vertex_print_props, void, cucon_digraph_vertex_t, FILE *), cu_clop(edge_print_props, void, cucon_digraph_edge_t, FILE *), FILE *out)

Detailed Description

Deprecated:
Replaced by the cugra library.

Define Documentation

#define cucon_digraph_edge_first_from_vertex (  ) 
Value:
cuconP_OUTEDGE(                 \
            cucon_list_begin(&CU_MARG(cucon_digraph_vertex_t, v)->output_edges))
#define cucon_digraph_edge_last_from_vertex (  ) 
Value:
cuconP_OUTEDGE(                 \
            cucon_listnode_prev(                \
                cucon_list_end(&CU_MARG(cucon_digraph_vertex_t, v)->output_edges)))
#define cucon_digraph_edge_stop_from_vertex (  ) 
Value:
cuconP_OUTEDGE( \
            cucon_list_end(&CU_MARG(cucon_digraph_vertex_t, v)->output_edges))
#define cuconP_OUTEDGE (  ) 
Value:
((cucon_digraph_edge_t)                                         \
         (cu_ptr_sub((void *)e,                                         \
                     offsetof(struct cucon_digraph_edge, as_output))))

Function Documentation

cucon_digraph_edge_t cucon_digraph_insert_edge_mem ( cucon_digraph_t  G,
cucon_digraph_vertex_t  v0,
cucon_digraph_vertex_t  v1,
size_t  value_size 
)

Insert an edge from v0 to v1 into G, with a value_size bytes value slot. Use value_size = 0 for a plain edge.

cucon_digraph_edge_t cucon_digraph_insert_edge_ptr ( cucon_digraph_t  G,
cucon_digraph_vertex_t  v0,
cucon_digraph_vertex_t  v1,
cu_ptr_t  value_ptr 
)

Insert an edge from v0 to v1 into G, with a value value_ptr.

cucon_digraph_vertex_t cucon_digraph_insert_vertex_mem ( cucon_digraph_t  ,
size_t  size 
)

Insert a new vertex with value_size allocated byes for the vertex value.

void cucon_digraph_insert_vertex_node_cct ( cucon_digraph_t  G,
cucon_digraph_vertex_t  node 
)

Construct and insert node into G.

Precondition:
G must not have the cucon_digraph_opt_list_of_vertices option.
cucon_digraph_vertex_t cucon_digraph_insert_vertex_ptr ( cucon_digraph_t  ,
void *  ptr 
)

Insert a new vertex with a pointer-sized value set to value_ptr.

Generated 2009-11-23 for culibs-0.25 using Doxygen. Maintained by Petter Urkedal.