30 #include "opal_config.h"
36 #include "opal/class/opal_value_array.h"
41 #define DISTANCE_INFINITY 0x7fffffff
78 typedef void *(*opal_graph_alloc_vertex_data)(void);
98 typedef char *(*opal_graph_print_vertex)(
void *vertex_data);
169 int number_of_vertices;
OPAL_DECLSPEC int opal_graph_get_size(opal_graph_t *graph)
This Graph API returns the size of the graph (number of edges)
Definition: opal_graph.c:454
This structure represent the distance (weight) of a vertex from some point in the graph...
Definition: opal_graph.h:181
dynamic pointer array
Definition: opal_pointer_array.h:45
OPAL_DECLSPEC int opal_graph_get_graph_vertices(opal_graph_t *graph, opal_pointer_array_t *vertices_list)
This graph API returns an array of pointers of all the vertices in the graph.
Definition: opal_graph.c:505
OPAL_DECLSPEC opal_graph_vertex_t * opal_graph_find_vertex(opal_graph_t *graph, void *vertex_data)
This graph API finds a vertex in the graph according the vertex data.
Definition: opal_graph.c:468
OPAL_DECLSPEC void opal_graph_remove_edge(opal_graph_t *graph, opal_graph_edge_t *edge)
This graph API removes an edge (a connection between two vertices) from the graph.
Definition: opal_graph.c:330
OPAL_DECLSPEC void opal_graph_remove_vertex(opal_graph_t *graph, opal_graph_vertex_t *vertex)
This graph API remove a vertex from graph.
Definition: opal_graph.c:348
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
See opal_bitmap.h for an explanation of why there is a split between OPAL and ORTE for this generic c...
int(* opal_graph_compare_vertex_data)(void *vertex_data1, void *vertex_data2)
Compare two vertices data.
Definition: opal_graph.h:91
void *(* opal_graph_alloc_vertex_data)(void)
Allocate vertex data.
Definition: opal_graph.h:78
Definition: opal_list.h:98
A vertex class.
Definition: opal_graph.h:104
OPAL_DECLSPEC int opal_graph_get_order(opal_graph_t *graph)
This Graph API returns the order of the graph (number of vertices)
Definition: opal_graph.c:441
OPAL_DECLSPEC void opal_graph_duplicate(opal_graph_t **dest, opal_graph_t *src)
This graph API duplicates a graph.
Definition: opal_graph.c:766
An edge class.
Definition: opal_graph.h:146
OPAL_DECLSPEC void opal_graph_print(opal_graph_t *graph)
This graph API prints a graph - mostly for debug uses.
Definition: opal_graph.c:834
OPAL_DECLSPEC int opal_graph_add_edge(opal_graph_t *graph, opal_graph_edge_t *edge)
This graph API adds an edge (connection between two vertices) to a graph.
Definition: opal_graph.c:279
An opal_adjacency_list_t class.
Definition: opal_graph.h:128
Base object.
Definition: opal_object.h:182
A graph class.
Definition: opal_graph.h:165
char *(* opal_graph_print_vertex)(void *vertex_data)
print a vertex data.
Definition: opal_graph.h:98
Definition: opal_list.h:147
void(* opal_graph_free_vertex_data)(void *vertex_data)
free vertex data.
Definition: opal_graph.h:73
OPAL_DECLSPEC void opal_graph_add_vertex(opal_graph_t *graph, opal_graph_vertex_t *vertex)
This graph API adds a vertex to graph.
Definition: opal_graph.c:237
Definition: opal_value_array.h:38
A simple C-language object-oriented system with single inheritance and ownership-based memory managem...
OPAL_DECLSPEC uint32_t opal_graph_adjacent(opal_graph_t *graph, opal_graph_vertex_t *vertex1, opal_graph_vertex_t *vertex2)
This graph API tell us if two vertices are adjacent.
Definition: opal_graph.c:388
OPAL_DECLSPEC uint32_t opal_graph_spf(opal_graph_t *graph, opal_graph_vertex_t *vertex1, opal_graph_vertex_t *vertex2)
This graph API finds the shortest path between two vertices.
Definition: opal_graph.c:588
OPAL_DECLSPEC int opal_graph_get_adjacent_vertices(opal_graph_t *graph, opal_graph_vertex_t *vertex, opal_value_array_t *adjacent)
This graph API returns all the adjacent of a vertex and the distance (weight) of those adjacent and t...
Definition: opal_graph.c:542
void(* opal_graph_copy_vertex_data)(void **dst, void *src)
Function pointer for coping a vertex data from one vertex to another.
Definition: opal_graph.h:64
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236
OPAL_DECLSPEC uint32_t opal_graph_dijkstra(opal_graph_t *graph, opal_graph_vertex_t *vertex, opal_value_array_t *distance_array)
This graph API returns the distance (weight) from a reference vertex to all other vertices in the gra...
Definition: opal_graph.c:678