00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00029 #ifndef NE_SYS_H
00030 #define NE_SYS_H
00031
00032 #include <igraph.h>
00033 #include <gsl/gsl_matrix.h>
00034 #include "ne_std.h"
00035 #include "ne_dyn.h"
00036
00037
00042 #define NE_DYN_PARAMS 10
00043
00047 #define NE_NODE_PARAMS 5
00048
00052 #define NE_EDGE_PARAMS 5
00053
00055 typedef ne_real_t ne_dyn_param_t;
00056
00058 typedef ne_real_t ne_param_t;
00059
00070 typedef struct {
00071
00072 igraph_t *graph;
00073 ne_int_t nodeStates;
00074 ne_int_t edgeStates;
00075 ne_param_t *nodeParams;
00076 ne_param_t *edgeParams;
00077
00078 ne_bool_t nodeDynVary;
00079 ne_bool_t edgeDynVary;
00080 ne_dyn_node_t **nodeDyn;
00081 ne_dyn_edge_t **edgeDyn;
00082 ne_bool_t nodeDynParamsVary;
00083 ne_bool_t edgeDynParamsVary;
00084 ne_dyn_param_t *nodeDynParams;
00085 ne_dyn_param_t *edgeDynParams;
00086
00087 } ne_sys_t;
00088
00089
00090
00091
00092
00093
00095 ne_sys_t * ne_sys_alloc (ne_bool_t directed, ne_int_t nodes, ne_int_t nodeStates,
00096 ne_int_t edgeStates, ne_bool_t dynNodeVary, ne_bool_t dynEdgeVary,
00097 ne_bool_t dynNodeParamsVary, ne_bool_t dynEdgeParamsVary);
00099 ne_sys_t * ne_sys_alloc_from_igraph (igraph_t *G, ne_int_t nodeStates, ne_int_t edgeStates,
00100 ne_bool_t dynNodeVary, ne_bool_t dynEdgeVary,
00101 ne_bool_t dynNodeParamsVary, ne_bool_t dynEdgeParamsVary);
00103 ne_sys_t * ne_sys_clone (ne_sys_t *from);
00105 void ne_sys_free (ne_sys_t *sys);
00106
00108 igraph_t * ne_sys_igraph (ne_sys_t *sys);
00110 ne_bool_t ne_sys_directed (ne_sys_t *sys);
00112 ne_int_t ne_sys_node_states (ne_sys_t *sys);
00114 ne_int_t ne_sys_edge_states (ne_sys_t *sys);
00116 ne_int_t ne_sys_nodes (ne_sys_t *sys);
00118 ne_int_t ne_sys_edges (ne_sys_t *sys);
00120 ne_bool_t ne_sys_dyn_node_vary (ne_sys_t *sys);
00122 ne_bool_t ne_sys_dyn_edge_vary (ne_sys_t *sys);
00124 ne_bool_t ne_sys_dyn_node_param_vary (ne_sys_t *sys);
00126 ne_bool_t ne_sys_dyn_edge_param_vary (ne_sys_t *sys);
00128 ne_bool_t ne_sys_edge_exists (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode);
00129
00131 ne_err_code_t ne_sys_add_node (ne_sys_t *sys, ne_dyn_node_t *dyn, ne_dyn_param_t *params);
00133 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);
00135 ne_err_code_t ne_sys_del_node (ne_sys_t *sys, ne_int_t node);
00137 ne_err_code_t ne_sys_del_edge (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode);
00139 ne_err_code_t ne_sys_del_eid (ne_sys_t *sys, ne_int_t eid);
00140
00142 ne_param_t ne_sys_node_param (ne_sys_t *sys, ne_int_t node, ne_int_t param);
00144 ne_param_t ne_sys_edge_param (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode, ne_int_t param);
00146 ne_param_t ne_sys_eid_param (ne_sys_t *sys, ne_int_t eid, ne_int_t param);
00148 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);
00150 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);
00152 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);
00154 ne_dyn_node_t * ne_sys_dyn_node (ne_sys_t *sys, ne_int_t node);
00156 ne_dyn_edge_t * ne_sys_dyn_edge (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode);
00158 ne_dyn_edge_t * ne_sys_dyn_eid (ne_sys_t *sys, ne_int_t eid);
00160 ne_err_code_t ne_sys_set_dyn_node (ne_sys_t *sys, ne_int_t node, ne_dyn_node_t *nodeDyn);
00162 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);
00164 ne_err_code_t ne_sys_set_dyn_eid (ne_sys_t *sys, ne_int_t eid, ne_dyn_edge_t *edgeDyn);
00165
00167 ne_dyn_param_t ne_sys_dyn_node_param (ne_sys_t *sys, ne_int_t node, ne_int_t param);
00169 ne_dyn_param_t * ne_sys_dyn_node_params (ne_sys_t *sys, ne_int_t node);
00171 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);
00173 ne_dyn_param_t ne_sys_dyn_eid_param (ne_sys_t *sys, ne_int_t eid, ne_int_t param);
00175 ne_dyn_param_t * ne_sys_dyn_edge_params (ne_sys_t *sys, ne_int_t startNode, ne_int_t endNode);
00177 ne_dyn_param_t * ne_sys_dyn_eid_params (ne_sys_t *sys, ne_int_t eid);
00179 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);
00181 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);
00183 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);
00185 ne_err_code_t ne_sys_set_dyn_node_params (ne_sys_t *sys, ne_int_t node, ne_dyn_param_t *params);
00187 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);
00189 ne_err_code_t ne_sys_set_dyn_eid_params (ne_sys_t *sys, ne_int_t eid, ne_dyn_param_t *params);
00190
00192 ne_err_code_t ne_sys_to_GML (ne_sys_t *sys, FILE *file);
00194 ne_sys_t * ne_sys_from_GML (FILE *file);
00196 void ne_sys_print (ne_sys_t *sys);
00198 gsl_matrix * ne_sys_adj_to_gsl_matrix_alloc (ne_sys_t *sys);
00200 gsl_matrix * ne_sys_laplacian_to_gsl_matrix_alloc (ne_sys_t *sys);
00201
00202
00203 #endif