FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
hecmw_graph.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2019 FrontISTR Commons
3  * This software is released under the MIT License, see LICENSE.txt
4  *****************************************************************************/
13 #ifndef HECMW_GRAPH_INCLUDED
14 #define HECMW_GRAPH_INCLUDED
15 
16 #include <stdio.h>
17 
18 #include "hecmw_varray_idx.h"
19 
20 struct hecmw_varray_int;
21 
25 struct hecmw_graph {
28  struct hecmw_varray_idx
32  struct hecmw_varray_int
34  int is_ref;
35 };
36 
42 extern int HECMW_graph_init(struct hecmw_graph *graph
43  );
44 
51  struct hecmw_graph *graph,
52  int num_vertex,
53  idx_t *edge_index,
54  idx_t *edge_item
55  );
56 
59 extern void HECMW_graph_finalize(struct hecmw_graph *graph
60  );
61 
64 extern void HECMW_graph_setNumVertex(
65  struct hecmw_graph *graph,
66  int num_vertex
67  );
68 
74 extern int HECMW_graph_addEdge(
75  struct hecmw_graph *graph,
76  int vert1,
77  int vert2
78  );
79 
82 extern void HECMW_graph_print(
83  const struct hecmw_graph *graph,
84  FILE *fp
85  );
86 
91 extern int HECMW_graph_getNumVertex(
92  const struct hecmw_graph *graph
93  );
94 
100  const struct hecmw_graph *graph
101  );
102 
107 extern const idx_t *HECMW_graph_getEdgeIndex(
108  const struct hecmw_graph *graph
109  );
110 
115 extern const idx_t *HECMW_graph_getEdgeItem(
116  const struct hecmw_graph *graph
117  );
118 
124 extern int HECMW_graph_degeneGraph(
125  struct hecmw_graph *graph,
126  const struct hecmw_graph
127  *refgraph,
128  int num_part,
129  const int *parttab
130  );
131 
132 #endif /* HECMW_GRAPH_INCLUDED */
int HECMW_graph_degeneGraph(struct hecmw_graph *graph, const struct hecmw_graph *refgraph, int num_part, const int *parttab)
Definition: hecmw_graph.c:161
const idx_t * HECMW_graph_getEdgeItem(const struct hecmw_graph *graph)
Definition: hecmw_graph.c:157
idx_t HECMW_graph_getNumEdge(const struct hecmw_graph *graph)
Definition: hecmw_graph.c:149
const idx_t * HECMW_graph_getEdgeIndex(const struct hecmw_graph *graph)
Definition: hecmw_graph.c:153
int HECMW_graph_addEdge(struct hecmw_graph *graph, int vert1, int vert2)
Definition: hecmw_graph.c:114
int HECMW_graph_getNumVertex(const struct hecmw_graph *graph)
Definition: hecmw_graph.c:145
int HECMW_graph_init_with_arrays(struct hecmw_graph *graph, int num_vertex, idx_t *edge_index, idx_t *edge_item)
Definition: hecmw_graph.c:73
void HECMW_graph_print(const struct hecmw_graph *graph, FILE *fp)
Definition: hecmw_graph.c:123
void HECMW_graph_finalize(struct hecmw_graph *graph)
Definition: hecmw_graph.c:97
void HECMW_graph_setNumVertex(struct hecmw_graph *graph, int num_vertex)
Definition: hecmw_graph.c:106
int HECMW_graph_init(struct hecmw_graph *graph)
Definition: hecmw_graph.c:55
long long idx_t
int m_num_vertex
Definition: hecmw_graph.h:26
struct hecmw_varray_idx * m_edge_index
Definition: hecmw_graph.h:28
struct hecmw_varray_idx * m_edge_item
Definition: hecmw_graph.h:30
idx_t m_num_edge
Definition: hecmw_graph.h:27
struct hecmw_varray_int * m_vertex_weight
Definition: hecmw_graph.h:32