From: yu.dongliang <18588496441@163.com> Date: Sat, 11 Nov 2023 07:19:55 +0000 (+0800) Subject: Revert "tmp" X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=0abe0f420178b01952265453f8a60e7896795574;p=ses.git Revert "tmp" This reverts commit a4bc411a63b6464c5b5f5d6ad3739f4f804e80b4. --- diff --git a/ses_core.h b/ses_core.h index 3a08b02..431968d 100644 --- a/ses_core.h +++ b/ses_core.h @@ -220,25 +220,4 @@ static inline void ses_merge_r(double* tr, double* jtr, double r0, double jr0, d *jtr = jr0 / -R; } -static int ses_vertex_cmp_edges(const void* v0, const void* v1) -{ - const ses_vertex_t* sv0 = *(const ses_vertex_t**)v0; - const ses_vertex_t* sv1 = *(const ses_vertex_t**)v1; - - const ScfEcomponent* c0 = sv0->data; - const ScfEcomponent* c1 = sv1->data; - - if (sv0->edges->size > sv1->edges->size) - return -1; - if (sv0->edges->size < sv1->edges->size) - return 1; - - if (SCF_EDA_NPN == c0->type) - return -1; - if (SCF_EDA_NPN == c1->type) - return 1; - - return 0; -} - #endif diff --git a/ses_graph.h b/ses_graph.h index 249803c..459920e 100644 --- a/ses_graph.h +++ b/ses_graph.h @@ -21,6 +21,18 @@ void ses_vertex_free (ses_vertex_t* v); int ses_graph_kcolor(ses_graph_t* graph, int k, scf_vector_t* colors); +static int ses_vertex_cmp_edges(const void* v0, const void* v1) +{ + const ses_vertex_t* sv0 = *(const ses_vertex_t**)v0; + const ses_vertex_t* sv1 = *(const ses_vertex_t**)v1; + + if (sv0->edges->size > sv1->edges->size) + return -1; + if (sv0->edges->size < sv1->edges->size) + return 1; + return 0; +} + static int ses_vertex_cmp(const void* v0, const void* v1) { const ses_vertex_t* sv0 = v0; diff --git a/ses_layout.c b/ses_layout.c index 2ce1494..43853ac 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -1180,18 +1180,16 @@ static int __ses_de_cross(ScfEfunction* f, int d) scf_loge("**********\n"); } - int n = 0; for (i = 0; i < graph->size; i++) { v = graph->data[i]; if (v->color < 0) { - c = v->data; scf_loge("j: %ld, i: %ld, c%ld->color: %ld\n", j, i, c->id, v->color); - n++; + break; } } - if (n > 0) + if (i < graph->size) break; for (i = 0; i < graph->size; i++) {