ses_edge_t
authoryu.dongliang <18588496441@163.com>
Tue, 31 Oct 2023 16:01:51 +0000 (00:01 +0800)
committeryu.dongliang <18588496441@163.com>
Tue, 31 Oct 2023 16:01:51 +0000 (00:01 +0800)
ses_core.h
ses_utils.c

index 882f9fc3c7fb894a14d870e413ce5f17094b0691..3ba07f2566b51590bc5c4cab8bae8c0b50df33a7 100644 (file)
@@ -8,8 +8,17 @@ typedef struct ses_step_s    ses_step_t;
 typedef struct ses_path_s    ses_path_t;
 typedef struct ses_flow_s    ses_flow_t;
 typedef struct ses_info_s    ses_info_t;
+typedef struct ses_edge_s    ses_edge_t;
 typedef struct ses_ctx_s     ses_ctx_t;
 
+struct ses_edge_s
+{
+       scf_vector_t*  conflicts;
+
+       ScfEpin*       p0;
+       ScfEpin*       p1;
+};
+
 struct ses_flow_s
 {
        scf_vector_t*  paths;
@@ -108,6 +117,9 @@ void        ses_flow_v_pos(ses_flow_t* flow, double a, double ja);
 void        ses_flow_v_neg(ses_flow_t* flow, double a, double ja);
 void        ses_flow_jr   (ses_flow_t* flow);
 
+ses_edge_t* ses_edge_alloc();
+void        ses_edge_free (ses_edge_t* edge);
+
 ses_ctx_t*  ses_ctx_alloc();
 void        ses_ctx_free (ses_ctx_t* ctx);
 
index b098854f8f198c003c73a5b3ec8cea93b83c5da4..de61d5f6356d05733c1fd93421dd5a995ad4729c 100644 (file)
@@ -1,5 +1,30 @@
 #include"ses_core.h"
 
+ses_edge_t* ses_edge_alloc()
+{
+       ses_edge_t* edge = calloc(1, sizeof(ses_edge_t));
+       if (!edge)
+               return NULL;
+
+       edge->conflicts = scf_vector_alloc();
+       if (!edge->conflicts) {
+               free(edge);
+               return NULL;
+       }
+
+       return edge;
+}
+
+void ses_edge_free(ses_edge_t* edge)
+{
+       if (edge) {
+               if (edge->conflicts)
+                       scf_vector_free(edge->conflicts);
+
+               free(edge);
+       }
+}
+
 ses_flow_t* ses_flow_alloc()
 {
        ses_flow_t* flow = calloc(1, sizeof(ses_flow_t));