Graph utility.
More...
#include <stdio.h>
Go to the source code of this file.
|
int | HECMW_graph_init (struct hecmw_graph *graph) |
|
int | HECMW_graph_init_with_arrays (struct hecmw_graph *graph, int num_vertex, int *edge_index, int *edge_item) |
|
void | HECMW_graph_finalize (struct hecmw_graph *graph) |
|
void | HECMW_graph_setNumVertex (struct hecmw_graph *graph, int num_vertex) |
|
int | HECMW_graph_addEdge (struct hecmw_graph *graph, int vert1, int vert2) |
|
void | HECMW_graph_print (const struct hecmw_graph *graph, FILE *fp) |
|
int | HECMW_graph_getNumVertex (const struct hecmw_graph *graph) |
|
int | HECMW_graph_getNumEdge (const struct hecmw_graph *graph) |
|
const int * | HECMW_graph_getEdgeIndex (const struct hecmw_graph *graph) |
|
const int * | HECMW_graph_getEdgeItem (const struct hecmw_graph *graph) |
|
int | HECMW_graph_degeneGraph (struct hecmw_graph *graph, const struct hecmw_graph *refgraph, int num_part, const int *parttab) |
|
Graph utility.
- Author
- Kazuya Goto (VINAS)
- Date
- Feb 6, 2012
Definition in file hecmw_graph.h.
◆ HECMW_graph_addEdge()
int HECMW_graph_addEdge |
( |
struct hecmw_graph * |
graph, |
|
|
int |
vert1, |
|
|
int |
vert2 |
|
) |
| |
Add edge.
- Return values
-
HECMW_SUCCESS | normal return |
HECMW_ERROR | failed to add edge |
- Parameters
-
[in,out] | graph | [inout] graph |
[in] | vert1 | [in] the first vertex of the edge |
[in] | vert2 | [in] the other vertex of the edge |
Definition at line 114 of file hecmw_graph.c.
◆ HECMW_graph_degeneGraph()
int HECMW_graph_degeneGraph |
( |
struct hecmw_graph * |
graph, |
|
|
const struct hecmw_graph * |
refgraph, |
|
|
int |
num_part, |
|
|
const int * |
parttab |
|
) |
| |
Degenerate graph.
- Return values
-
HECMW_SUCCESS | normal return |
HECMW_ERROR | failed to create degenerated graph |
- Parameters
-
[in,out] | graph | [inout] graph |
[in] | refgraph | [in] original graph to be degenerated |
[in] | num_part | [in] number of vertices after degeneration |
[in] | parttab | [in] id of each vertex after degeneration |
Definition at line 160 of file hecmw_graph.c.
◆ HECMW_graph_finalize()
void HECMW_graph_finalize |
( |
struct hecmw_graph * |
graph | ) |
|
Finalize.
- Parameters
-
[in,out] | graph | [inout] graph |
Definition at line 97 of file hecmw_graph.c.
◆ HECMW_graph_getEdgeIndex()
const int* HECMW_graph_getEdgeIndex |
( |
const struct hecmw_graph * |
graph | ) |
|
Get edge index array.
- Returns
- head pointer of the edge index array
- Parameters
-
Definition at line 152 of file hecmw_graph.c.
◆ HECMW_graph_getEdgeItem()
const int* HECMW_graph_getEdgeItem |
( |
const struct hecmw_graph * |
graph | ) |
|
Get edge item array.
- Returns
- head pointer of the edge item array
- Parameters
-
Definition at line 156 of file hecmw_graph.c.
◆ HECMW_graph_getNumEdge()
int HECMW_graph_getNumEdge |
( |
const struct hecmw_graph * |
graph | ) |
|
Get number of edges (doubled due to both-ways).
- Returns
- number of edges
- Parameters
-
Definition at line 148 of file hecmw_graph.c.
◆ HECMW_graph_getNumVertex()
int HECMW_graph_getNumVertex |
( |
const struct hecmw_graph * |
graph | ) |
|
Get number of vertices.
- Returns
- number of vertices
- Parameters
-
Definition at line 144 of file hecmw_graph.c.
◆ HECMW_graph_init()
Initialize.
- Return values
-
HECMW_SUCCESS | normal return |
HECMW_ERROR | failed to initialize |
- Parameters
-
[in,out] | graph | [inout] graph |
Definition at line 55 of file hecmw_graph.c.
◆ HECMW_graph_init_with_arrays()
int HECMW_graph_init_with_arrays |
( |
struct hecmw_graph * |
graph, |
|
|
int |
num_vertex, |
|
|
int * |
edge_index, |
|
|
int * |
edge_item |
|
) |
| |
Initialize with given index and item arrays.
- Return values
-
HECMW_SUCCESS | normal return |
HECMW_ERROR | failed to initialize |
- Parameters
-
[in,out] | graph | [inout] graph |
[in] | num_vertex | [in] number of vertices |
[in] | edge_index | [in] edge index array |
[in] | edge_item | [in] edge item array |
Definition at line 73 of file hecmw_graph.c.
◆ HECMW_graph_print()
void HECMW_graph_print |
( |
const struct hecmw_graph * |
graph, |
|
|
FILE * |
fp |
|
) |
| |
Print graph.
- Parameters
-
[in] | graph | [in] graph |
[in] | fp | [in] File pointer for output |
Definition at line 123 of file hecmw_graph.c.
◆ HECMW_graph_setNumVertex()
void HECMW_graph_setNumVertex |
( |
struct hecmw_graph * |
graph, |
|
|
int |
num_vertex |
|
) |
| |
Set number of vertices.
- Parameters
-
[in,out] | graph | [inout] graph |
[in] | num_vertex | [in] number of vertices |
Definition at line 106 of file hecmw_graph.c.