Glauber Dynamics in C
Simulation for Glauber Dynamics written in C11
vertex.h
Go to the documentation of this file.
1
8#include "edge.h"
9
16typedef struct vertex {
17 int dim;
18 double local_weight;
21
25
38void vertex_free(vertex *v);
39
48
58
Define the edge struct and functions relating to it.
Edge struct to be used as edges in the graph structs.
Definition: edge.h:10
The vertex struct containing the neighbouring edges as pointers.
Definition: vertex.h:16
edge ** edges
The list of neighbour edge instances as pointers.
Definition: vertex.h:19
double local_weight
The sum of all weights of connected edges.
Definition: vertex.h:18
int dim
The number of slots in array (local dimension)
Definition: vertex.h:17
void vertex_add_edge_to_neighbourhood(vertex *v, edge *e)
Add the edge e to the neighbourhood v->edges.
Definition: vertex.c:23
edge * vertex_find_connecting_edge(vertex *v, int dst)
Find the edge that connects vertex v with the vertex of index dst.
Definition: vertex.c:77
vertex * vertex_new()
Allocate the memory for a new vertex with no neighbours.
Definition: vertex.c:6
void vertex_rm_edge_from_neighbourhood(vertex *v, edge *e)
Remove edge e from neighbourhood of vertex v.
Definition: vertex.c:65
void vertex_free(vertex *v)
Free the input vertex pointer and all edges pointing to it.
Definition: vertex.c:13
struct vertex vertex
The typedef of the vertex struct.