Data Structures | Defines | Typedefs | Functions

ne_sys.h File Reference

Defines the NetEvo system data type and associated functions. More...

#include <igraph.h>
#include <gsl/gsl_matrix.h>
#include "ne_std.h"
#include "ne_dyn.h"

Go to the source code of this file.

Data Structures

struct  ne_sys_t
 System data structure. More...

Defines

#define NE_DYN_PARAMS   10
 Fixed number of node and edge dynamic parameters.
#define NE_NODE_PARAMS   5
 Fixed number of node parameters.
#define NE_EDGE_PARAMS   5
 Fixed number of edge parameters.

Typedefs

typedef ne_real_t ne_dyn_param_t
 Dynamic parameter type.
typedef ne_real_t ne_param_t
 Node and edge parameter type.

Functions

ne_sys_tne_sys_alloc (ne_bool_t directed, ne_int_t nodes, ne_int_t nodeStates, ne_int_t edgeStates, ne_bool_t dynNodeVary, ne_bool_t dynEdgeVary, ne_bool_t dynNodeParamsVary, ne_bool_t dynEdgeParamsVary)
 Allocate a new ne_system.
ne_sys_tne_sys_alloc_from_igraph (igraph_t *G, ne_int_t nodeStates, ne_int_t edgeStates, ne_bool_t dynNodeVary, ne_bool_t dynEdgeVary, ne_bool_t dynNodeParamsVary, ne_bool_t dynEdgeParamsVary)
 Allocate a new ne_system from an igraph topology.
ne_sys_tne_sys_clone (ne_sys_t *from)
 Clone the ne_system.
void ne_sys_free (ne_sys_t *sys)
 Free the ne_system.
igraph_t * ne_sys_igraph (ne_sys_t *sys)
 Return the igraph topology for the ne_system.
ne_bool_t ne_sys_directed (ne_sys_t *sys)
 Return if the topology is directed.
ne_int_t ne_sys_node_states (ne_sys_t *sys)
 Return the number of node states (regarding dynamics).
ne_int_t ne_sys_edge_states (ne_sys_t *sys)
 Return the number of edge states (regarding dynamics).
ne_int_t ne_sys_nodes (ne_sys_t *sys)
 Return the number of nodes.
ne_int_t ne_sys_edges (ne_sys_t *sys)
 Return the number of edges.
ne_bool_t ne_sys_dyn_node_vary (ne_sys_t *sys)
 Return if the node dynamics can vary.
ne_bool_t ne_sys_dyn_edge_vary (ne_sys_t *sys)
 Return if the edge dynamics can vary.
ne_bool_t ne_sys_dyn_node_param_vary (ne_sys_t *sys)
 Return if the node parameters can vary.
ne_bool_t ne_sys_dyn_edge_param_vary (ne_sys_t *sys)
 Return if the edge parameters can vary.
ne_bool_t ne_sys_edge_exists (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode)
 Check is edge exists.
ne_err_code_t ne_sys_add_node (ne_sys_t *sys, ne_dyn_node_t *dyn, ne_dyn_param_t *params)
 Add a node with given dynamics and dynamic parameters.
ne_err_code_t ne_sys_add_edge (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode, ne_dyn_edge_t *dyn, ne_dyn_param_t *params)
 Add an edge with given dynamics and dynamic parameters.
ne_err_code_t ne_sys_del_node (ne_sys_t *sys, ne_int_t node)
 Delete a node.
ne_err_code_t ne_sys_del_edge (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode)
 Delete an edge.
ne_err_code_t ne_sys_del_eid (ne_sys_t *sys, ne_int_t eid)
 Delete an edge using ID.
ne_param_t ne_sys_node_param (ne_sys_t *sys, ne_int_t node, ne_int_t param)
 Return a nodes parameters.
ne_param_t ne_sys_edge_param (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode, ne_int_t param)
 Return an edges parameters.
ne_param_t ne_sys_eid_param (ne_sys_t *sys, ne_int_t eid, ne_int_t param)
 Return an edge IDs parameters.
ne_err_code_t ne_sys_set_node_param (ne_sys_t *sys, ne_int_t node, ne_int_t param, ne_param_t value)
 Set a nodes parameter.
ne_err_code_t ne_sys_set_edge_param (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode, ne_int_t param, ne_param_t value)
 Set an edges parameter.
ne_err_code_t ne_sys_set_eid_param (ne_sys_t *sys, ne_int_t eid, ne_int_t param, ne_param_t value)
 Set an edge IDs parameter.
ne_dyn_node_tne_sys_dyn_node (ne_sys_t *sys, ne_int_t node)
 Return the nodes dynamic.
ne_dyn_edge_tne_sys_dyn_edge (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode)
 Return the edges dynamic.
ne_dyn_edge_tne_sys_dyn_eid (ne_sys_t *sys, ne_int_t eid)
 Return the edge IDs dynamic.
ne_err_code_t ne_sys_set_dyn_node (ne_sys_t *sys, ne_int_t node, ne_dyn_node_t *nodeDyn)
 Set the nodes dynamic.
ne_err_code_t ne_sys_set_dyn_edge (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode, ne_dyn_edge_t *edgeDyn)
 Set the edges dynamic.
ne_err_code_t ne_sys_set_dyn_eid (ne_sys_t *sys, ne_int_t eid, ne_dyn_edge_t *edgeDyn)
 Set the edge IDs dynamic.
ne_dyn_param_t ne_sys_dyn_node_param (ne_sys_t *sys, ne_int_t node, ne_int_t param)
 Return a parameter for a nodes dynamic.
ne_dyn_param_tne_sys_dyn_node_params (ne_sys_t *sys, ne_int_t node)
 Return all parameters for a nodes dynamic.
ne_dyn_param_t ne_sys_dyn_edge_param (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode, ne_int_t param)
 Return a parameter for an edges dynamic.
ne_dyn_param_t ne_sys_dyn_eid_param (ne_sys_t *sys, ne_int_t eid, ne_int_t param)
 Return a parametes for an edge IDs dynamic.
ne_dyn_param_tne_sys_dyn_edge_params (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode)
 Return all parameters for an edges dynamic.
ne_dyn_param_tne_sys_dyn_eid_params (ne_sys_t *sys, ne_int_t eid)
 Return all parameters for an edge IDs dynamic.
ne_err_code_t ne_sys_set_dyn_node_param (ne_sys_t *sys, ne_int_t node, ne_int_t param, ne_dyn_param_t value)
 Set a parameter for a nodes dynamic.
ne_err_code_t ne_sys_set_dyn_edge_param (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode, ne_int_t param, ne_dyn_param_t value)
 Set a parameter for an edges dynamic.
ne_err_code_t ne_sys_set_dyn_eid_param (ne_sys_t *sys, ne_int_t eid, ne_int_t param, ne_dyn_param_t value)
 Set a parameter for an edge IDs dynamic.
ne_err_code_t ne_sys_set_dyn_node_params (ne_sys_t *sys, ne_int_t node, ne_dyn_param_t *params)
 Set all parameters for a nodes dynamic.
ne_err_code_t ne_sys_set_dyn_edge_params (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode, ne_dyn_param_t *params)
 Set all parameters for an edges dynamic.
ne_err_code_t ne_sys_set_dyn_eid_params (ne_sys_t *sys, ne_int_t eid, ne_dyn_param_t *params)
 Set all parameters for an edge IDs dynamic.
ne_err_code_t ne_sys_to_GML (ne_sys_t *sys, FILE *file)
 Write an ne_system to GML file.
ne_sys_tne_sys_from_GML (FILE *file)
 Create ne_system from GML file.
void ne_sys_print (ne_sys_t *sys)
 Print an ne_system to stdout.
gsl_matrix * ne_sys_adj_to_gsl_matrix_alloc (ne_sys_t *sys)
 Create GSL matrix of ne_system adjacency matrix.
gsl_matrix * ne_sys_laplacian_to_gsl_matrix_alloc (ne_sys_t *sys)
 Create GSL matrix of ne_system Laplacian matrix.

Detailed Description

Defines the NetEvo system data type and associated functions.

This is used throughout the library to hold all the necessary information (topology and dynamics) of a graph. We use fixed numbers of parameters for the dynamics and general information about nodes and edges. These can be altered by updating the source if memory becomes an issue.

Author:
T.E. Gorochowski

Definition in file ne_sys.h.


Define Documentation

#define NE_DYN_PARAMS   10

Fixed number of node and edge dynamic parameters.

These are parameters used by the dynamical functions associated with the nodes and edges.

Definition at line 42 of file ne_sys.h.

#define NE_EDGE_PARAMS   5

Fixed number of edge parameters.

These are parameters about the edges and unrelated to dynamics.

Definition at line 52 of file ne_sys.h.

#define NE_NODE_PARAMS   5

Fixed number of node parameters.

These are parameters about the nodes and unrelated to dynamics.

Definition at line 47 of file ne_sys.h.


Typedef Documentation

Dynamic parameter type.

Definition at line 55 of file ne_sys.h.

Node and edge parameter type.

Definition at line 58 of file ne_sys.h.


Function Documentation

ne_err_code_t ne_sys_add_edge ( ne_sys_t sys,
ne_int_t  startNode,
ne_int_t  endNode,
ne_dyn_edge_t dyn,
ne_dyn_param_t params 
)

Add an edge with given dynamics and dynamic parameters.

Definition at line 399 of file ne_sys.c.

ne_err_code_t ne_sys_add_node ( ne_sys_t sys,
ne_dyn_node_t dyn,
ne_dyn_param_t params 
)

Add a node with given dynamics and dynamic parameters.

Definition at line 345 of file ne_sys.c.

gsl_matrix* ne_sys_adj_to_gsl_matrix_alloc ( ne_sys_t sys  ) 

Create GSL matrix of ne_system adjacency matrix.

Definition at line 1099 of file ne_sys.c.

ne_sys_t* ne_sys_alloc ( ne_bool_t  directed,
ne_int_t  nodes,
ne_int_t  nodeStates,
ne_int_t  edgeStates,
ne_bool_t  dynNodeVary,
ne_bool_t  dynEdgeVary,
ne_bool_t  dynNodeParamsVary,
ne_bool_t  dynEdgeParamsVary 
)

Allocate a new ne_system.

Returned structure should be freed using ne_sys_free.

Definition at line 27 of file ne_sys.c.

ne_sys_t* ne_sys_alloc_from_igraph ( igraph_t *  G,
ne_int_t  nodeStates,
ne_int_t  edgeStates,
ne_bool_t  dynNodeVary,
ne_bool_t  dynEdgeVary,
ne_bool_t  dynNodeParamsVary,
ne_bool_t  dynEdgeParamsVary 
)

Allocate a new ne_system from an igraph topology.

Returned structure should be freed using ne_sys_free.

Definition at line 41 of file ne_sys.c.

ne_sys_t* ne_sys_clone ( ne_sys_t from  ) 

Clone the ne_system.

Returned structure should be freed using ne_sys_free.

Definition at line 188 of file ne_sys.c.

ne_err_code_t ne_sys_del_edge ( ne_sys_t sys,
ne_int_t  startNode,
ne_int_t  endNode 
)

Delete an edge.

Definition at line 531 of file ne_sys.c.

ne_err_code_t ne_sys_del_eid ( ne_sys_t sys,
ne_int_t  eid 
)

Delete an edge using ID.

Definition at line 543 of file ne_sys.c.

ne_err_code_t ne_sys_del_node ( ne_sys_t sys,
ne_int_t  node 
)

Delete a node.

Removes all associate edges.

Definition at line 459 of file ne_sys.c.

ne_bool_t ne_sys_directed ( ne_sys_t sys  ) 

Return if the topology is directed.

Definition at line 259 of file ne_sys.c.

ne_dyn_edge_t* ne_sys_dyn_edge ( ne_sys_t sys,
ne_int_t  startNode,
ne_int_t  endNode 
)

Return the edges dynamic.

Definition at line 658 of file ne_sys.c.

ne_dyn_param_t ne_sys_dyn_edge_param ( ne_sys_t sys,
ne_int_t  startNode,
ne_int_t  endNode,
ne_int_t  param 
)

Return a parameter for an edges dynamic.

Definition at line 750 of file ne_sys.c.

ne_bool_t ne_sys_dyn_edge_param_vary ( ne_sys_t sys  ) 

Return if the edge parameters can vary.

Definition at line 307 of file ne_sys.c.

ne_dyn_param_t* ne_sys_dyn_edge_params ( ne_sys_t sys,
ne_int_t  startNode,
ne_int_t  endNode 
)

Return all parameters for an edges dynamic.

Definition at line 777 of file ne_sys.c.

ne_bool_t ne_sys_dyn_edge_vary ( ne_sys_t sys  ) 

Return if the edge dynamics can vary.

Definition at line 295 of file ne_sys.c.

ne_dyn_edge_t* ne_sys_dyn_eid ( ne_sys_t sys,
ne_int_t  eid 
)

Return the edge IDs dynamic.

Definition at line 673 of file ne_sys.c.

ne_dyn_param_t ne_sys_dyn_eid_param ( ne_sys_t sys,
ne_int_t  eid,
ne_int_t  param 
)

Return a parametes for an edge IDs dynamic.

Definition at line 766 of file ne_sys.c.

ne_dyn_param_t* ne_sys_dyn_eid_params ( ne_sys_t sys,
ne_int_t  eid 
)

Return all parameters for an edge IDs dynamic.

Definition at line 792 of file ne_sys.c.

ne_dyn_node_t* ne_sys_dyn_node ( ne_sys_t sys,
ne_int_t  node 
)

Return the nodes dynamic.

Definition at line 647 of file ne_sys.c.

ne_dyn_param_t ne_sys_dyn_node_param ( ne_sys_t sys,
ne_int_t  node,
ne_int_t  param 
)

Return a parameter for a nodes dynamic.

Definition at line 728 of file ne_sys.c.

ne_bool_t ne_sys_dyn_node_param_vary ( ne_sys_t sys  ) 

Return if the node parameters can vary.

Definition at line 301 of file ne_sys.c.

ne_dyn_param_t* ne_sys_dyn_node_params ( ne_sys_t sys,
ne_int_t  node 
)

Return all parameters for a nodes dynamic.

Definition at line 739 of file ne_sys.c.

ne_bool_t ne_sys_dyn_node_vary ( ne_sys_t sys  ) 

Return if the node dynamics can vary.

Definition at line 289 of file ne_sys.c.

ne_bool_t ne_sys_edge_exists ( ne_sys_t sys,
ne_int_t  startNode,
ne_int_t  endNode 
)

Check is edge exists.

Definition at line 313 of file ne_sys.c.

ne_param_t ne_sys_edge_param ( ne_sys_t sys,
ne_int_t  startNode,
ne_int_t  endNode,
ne_int_t  param 
)

Return an edges parameters.

Definition at line 605 of file ne_sys.c.

ne_int_t ne_sys_edge_states ( ne_sys_t sys  ) 

Return the number of edge states (regarding dynamics).

Definition at line 270 of file ne_sys.c.

ne_int_t ne_sys_edges ( ne_sys_t sys  ) 

Return the number of edges.

Definition at line 282 of file ne_sys.c.

ne_param_t ne_sys_eid_param ( ne_sys_t sys,
ne_int_t  eid,
ne_int_t  param 
)

Return an edge IDs parameters.

Definition at line 614 of file ne_sys.c.

void ne_sys_free ( ne_sys_t sys  ) 

Free the ne_system.

Definition at line 240 of file ne_sys.c.

ne_sys_t* ne_sys_from_GML ( FILE *  file  ) 

Create ne_system from GML file.

Definition at line 993 of file ne_sys.c.

igraph_t* ne_sys_igraph ( ne_sys_t sys  ) 

Return the igraph topology for the ne_system.

Definition at line 253 of file ne_sys.c.

gsl_matrix* ne_sys_laplacian_to_gsl_matrix_alloc ( ne_sys_t sys  ) 

Create GSL matrix of ne_system Laplacian matrix.

Definition at line 1117 of file ne_sys.c.

ne_param_t ne_sys_node_param ( ne_sys_t sys,
ne_int_t  node,
ne_int_t  param 
)

Return a nodes parameters.

Definition at line 599 of file ne_sys.c.

ne_int_t ne_sys_node_states ( ne_sys_t sys  ) 

Return the number of node states (regarding dynamics).

Definition at line 265 of file ne_sys.c.

ne_int_t ne_sys_nodes ( ne_sys_t sys  ) 

Return the number of nodes.

Definition at line 276 of file ne_sys.c.

void ne_sys_print ( ne_sys_t sys  ) 

Print an ne_system to stdout.

Definition at line 1092 of file ne_sys.c.

ne_err_code_t ne_sys_set_dyn_edge ( ne_sys_t sys,
ne_int_t  startNode,
ne_int_t  endNode,
ne_dyn_edge_t edgeDyn 
)

Set the edges dynamic.

Definition at line 697 of file ne_sys.c.

ne_err_code_t ne_sys_set_dyn_edge_param ( ne_sys_t sys,
ne_int_t  startNode,
ne_int_t  endNode,
ne_int_t  param,
ne_dyn_param_t  value 
)

Set a parameter for an edges dynamic.

Definition at line 817 of file ne_sys.c.

ne_err_code_t ne_sys_set_dyn_edge_params ( ne_sys_t sys,
ne_int_t  startNode,
ne_int_t  endNode,
ne_dyn_param_t params 
)

Set all parameters for an edges dynamic.

Copies array to ne_system data structure.

Definition at line 861 of file ne_sys.c.

ne_err_code_t ne_sys_set_dyn_eid ( ne_sys_t sys,
ne_int_t  eid,
ne_dyn_edge_t edgeDyn 
)

Set the edge IDs dynamic.

Definition at line 715 of file ne_sys.c.

ne_err_code_t ne_sys_set_dyn_eid_param ( ne_sys_t sys,
ne_int_t  eid,
ne_int_t  param,
ne_dyn_param_t  value 
)

Set a parameter for an edge IDs dynamic.

Definition at line 835 of file ne_sys.c.

ne_err_code_t ne_sys_set_dyn_eid_params ( ne_sys_t sys,
ne_int_t  eid,
ne_dyn_param_t params 
)

Set all parameters for an edge IDs dynamic.

Copies array to ne_system data structure.

Definition at line 880 of file ne_sys.c.

ne_err_code_t ne_sys_set_dyn_node ( ne_sys_t sys,
ne_int_t  node,
ne_dyn_node_t nodeDyn 
)

Set the nodes dynamic.

Definition at line 684 of file ne_sys.c.

ne_err_code_t ne_sys_set_dyn_node_param ( ne_sys_t sys,
ne_int_t  node,
ne_int_t  param,
ne_dyn_param_t  value 
)

Set a parameter for a nodes dynamic.

Definition at line 803 of file ne_sys.c.

ne_err_code_t ne_sys_set_dyn_node_params ( ne_sys_t sys,
ne_int_t  node,
ne_dyn_param_t params 
)

Set all parameters for a nodes dynamic.

Copies array to ne_system data structure.

Definition at line 849 of file ne_sys.c.

ne_err_code_t ne_sys_set_edge_param ( ne_sys_t sys,
ne_int_t  startNode,
ne_int_t  endNode,
ne_int_t  param,
ne_param_t  value 
)

Set an edges parameter.

Definition at line 628 of file ne_sys.c.

ne_err_code_t ne_sys_set_eid_param ( ne_sys_t sys,
ne_int_t  eid,
ne_int_t  param,
ne_param_t  value 
)

Set an edge IDs parameter.

Definition at line 639 of file ne_sys.c.

ne_err_code_t ne_sys_set_node_param ( ne_sys_t sys,
ne_int_t  node,
ne_int_t  param,
ne_param_t  value 
)

Set a nodes parameter.

Definition at line 620 of file ne_sys.c.

ne_err_code_t ne_sys_to_GML ( ne_sys_t sys,
FILE *  file 
)

Write an ne_system to GML file.

Definition at line 892 of file ne_sys.c.