void ses_ctx_free (ses_ctx_t* ctx);
+int ses_cross_graph_kcolor(scf_vector_t* graph, int k, scf_vector_t* colors);
+
int ses_layout_board (ScfEboard* b);
int ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t count);
}
}
+int ses_cross(ScfEfunction* f, int d)
+{
+ scf_vector_t* graph = scf_vector_alloc();
+ scf_vector_t* colors = scf_vector_alloc();
+ ses_edge_t* edge;
+
+ scf_loge("\n");
+ __ses_get_crosses(f, d, graph);
+
+ scf_vector_add(colors, (void*)1);
+ scf_vector_add(colors, (void*)2);
+
+ int ret = ses_cross_graph_kcolor(graph, 2, colors);
+ if (ret < 0) {
+ scf_loge("\n");
+ }
+
+ int i;
+ for (i = 0; i < graph->size; i++) {
+ edge = graph->data[i];
+
+ scf_logi("i: %d, c%ld->color: %ld\n", i, edge->c->id, edge->color);
+ }
+
+ scf_vector_clear(graph, ( void (*)(void*) )ses_edge_free);
+ scf_vector_free(graph);
+ scf_vector_free(colors);
+}
+
int ses_layout_function(ScfEfunction* f, int d)
{
ScfEcomponent* c;
qsort(f->elines, f->n_elines, sizeof(ScfEline*), eline_cmp_id);
- scf_vector_t* crosses0 = scf_vector_alloc();
- scf_vector_t* crosses1 = scf_vector_alloc();
-
- scf_loge("\n");
- __ses_get_crosses(f, d, crosses0);
-
__ses_de_cross(f, d);
__ses_setc_xy(f, d);
__ses_xchg_cx(f, d);
__ses_xchg_ce(f, d);
- scf_loge("\n");
- __ses_get_crosses(f, d, crosses1);
+ ses_cross(f, d);
__ses_mov_pos(f, d);
__ses_layout_cx(f, d);
- scf_vector_clear(crosses0, ( void (*)(void*) )ses_edge_free);
- scf_vector_clear(crosses1, ( void (*)(void*) )ses_edge_free);
- scf_vector_free(crosses0);
- scf_vector_free(crosses1);
- crosses0 = NULL;
- crosses1 = NULL;
-
int tx0 = INT_MAX;
int tx1 = 0;