struct ses_edge_s
{
- scf_vector_t* crosses;
+ ScfEcomponent* c;
- ScfEpin* p0;
- ScfEpin* p1;
+ scf_vector_t* crosses;
};
struct ses_flow_s
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(ScfEpin* p0, ScfEpin* p1);
-void ses_edge_free (ses_edge_t* edge);
+ses_edge_t* ses_edge_alloc(ScfEcomponent* c);
+void ses_edge_free (ses_edge_t* edge);
ses_ctx_t* ses_ctx_alloc();
void ses_ctx_free (ses_ctx_t* ctx);
const ses_edge_t* edge0 = v0;
const ses_edge_t* edge1 = v1;
- if (edge0->p0 == edge1->p0 && edge0->p1 == edge1->p1)
+ if (edge0->c == edge1->c)
return 0;
return -1;
}
-static inline ses_edge_t* __ses_edge_add(scf_vector_t* edges, ScfEpin* p0, ScfEpin* p1)
+static inline ses_edge_t* __ses_edge_add(scf_vector_t* edges, ScfEcomponent* c)
{
- ses_edge_t tmp = {NULL, p0, p1};
+ ses_edge_t tmp = {c, NULL};
ses_edge_t* edge = scf_vector_find_cmp(edges, &tmp, edge_cmp);
if (!edge) {
- edge = ses_edge_alloc(p0, p1);
+ edge = ses_edge_alloc(c);
if (!edge)
return NULL;
if ((y0 < y2 && y2 < y1 && y1 < y3) || (y2 < y0 && y0 < y3 && y3 < y1)) {
- edge0 = __ses_edge_add(edges, p0, p1);
+ edge0 = __ses_edge_add(edges, c0);
if (!edge0)
return -ENOMEM;
- edge1 = __ses_edge_add(edges, p2, p3);
+ edge1 = __ses_edge_add(edges, c1);
if (!edge1)
return -ENOMEM;
if (scf_vector_add(edge1->crosses, edge0) < 0)
return -ENOMEM;
}
+ goto next;
}
}
}
+next:
+ c1 = NULL;
}
}
}
for (i = 0; i < edges->size; i++) {
edge0 = edges->data[i];
- scf_logw("i: %ld, c%ldp%ld--c%ldp%ld\n", i, edge0->p0->cid, edge0->p0->id, edge0->p1->cid, edge0->p1->id);
+ scf_logw("c%ld\n", edge0->c->id);
for (j = 0; j < edge0->crosses->size; j++) {
edge1 = edge0->crosses->data[j];
- scf_logi("j: %ld, c%ldp%ld--c%ldp%ld\n", j, edge1->p0->cid, edge1->p0->id, edge1->p1->cid, edge1->p1->id);
+ scf_logi("j: %ld, c%ld\n", j, edge1->c->id);
}
printf("\n");
return ret;
}
- ses_steps_analyse(f, 5, 1);
+// ses_steps_analyse(f, 5, 1);
x = f->x;
y = f->y;