}
#if 1
- for (i = 0; i < f->n_elines; ) {
- el0 = f->elines[i];
+ k0 = 0;
+ do {
+ k1 = k0;
+ k0 = 0;
- if (0 == el0->n_lines || el0->n_pins <= 4) {
- i++;
- continue;
- }
+ for (i = 0; i < f->n_elines; i++) {
+ el0 = f->elines[i];
- for (j = i + 1; j < f->n_elines; j++)
- f->elines[j - 1] = f->elines[j];
+ if (el0->n_pins > 4)
+ continue;
- j = __ses_find_eline_index(f, el0->conns[0]->lid);
+ for (j = i + 1; j < f->n_elines; j++)
+ f->elines[j - 1] = f->elines[j];
- if (el0->n_conns > 1) {
- m = __ses_find_eline_index(f, el0->conns[1]->lid);
+ j = __ses_find_eline_index(f, el0->conns[0]->lid);
- if (j > m)
- SCF_XCHG(j, m);
- } else
- m = j + 2;
+ if (el0->n_conns > 1) {
+ m = __ses_find_eline_index(f, el0->conns[1]->lid);
- for (n = f->n_elines - 1; n > j + 1; n--)
- f->elines[n] = f->elines[n - 1];
+ if (j > m)
+ SCF_XCHG(j, m);
- f->elines[j + 1] = el0;
- el0->n_lines = 0;
+ el1 = f->elines[j];
+ ++j;
+ } else if (j > f->n_elines / 2) {
+ el1 = f->elines[j];
+ ++j;
+ } else {
+ el1 = f->elines[j];
+ }
- scf_loge("mov el%ld: %ld --> (%ld) %ld (%ld)\n", el0->id, i, j, j + 1, m);
- }
+ for (n = f->n_elines - 1; n > j; n--)
+ f->elines[n] = f->elines[n - 1];
+
+ f->elines[j] = el0;
+
+ if (j != i) {
+ k0++;
+ scf_loge("mov el%ld [%ld] --> [%ld] el%ld\n", el0->id, i, j, el1->id);
+ }
+ }
+
+ printf("k0: %ld, k1: %ld\n", k0, k1);
+
+ } while (k0 != k1);
#endif
#if 1
p1->x = c->x;
else {
p1->x += c->x - tmp;
- p1->x = (c->x * 3 + p1->x) / 4;
+// p1->x = (c->x * 3 + p1->x) / 4;
}
if (tx0 > p1->x)