Implemented another change discussed in netgen github issue #47
by Anton Blanchard, which prevents the double-loop in the PropertyOptimize() routine from continuing the outer loop if all devices in the run have already been merged.
This commit is contained in:
parent
d0ec17e442
commit
bfb01e032f
|
|
@ -4921,6 +4921,7 @@ int PropertyOptimize(struct objlist *ob, struct nlist *tp, int run, int series,
|
||||||
// Now combine records with same properties by summing M (S).
|
// Now combine records with same properties by summing M (S).
|
||||||
if (comb == FALSE) {
|
if (comb == FALSE) {
|
||||||
for (i = 0; i < run - 1; i++) {
|
for (i = 0; i < run - 1; i++) {
|
||||||
|
int nr_empty = 0;
|
||||||
for (j = i + 1; j < run; j++) {
|
for (j = i + 1; j < run; j++) {
|
||||||
pmatch = 0;
|
pmatch = 0;
|
||||||
for (p = 1; p < pcount; p++) {
|
for (p = 1; p < pcount; p++) {
|
||||||
|
|
@ -5044,8 +5045,14 @@ int PropertyOptimize(struct objlist *ob, struct nlist *tp, int run, int series,
|
||||||
vlist[0][i]->value.ival += vlist[0][j]->value.ival;
|
vlist[0][i]->value.ival += vlist[0][j]->value.ival;
|
||||||
vlist[0][j]->value.ival = 0;
|
vlist[0][j]->value.ival = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
nr_empty++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If everything from i to the end of the run has been matched
|
||||||
|
// and zeroed out, then nothing more can be merged.
|
||||||
|
if (nr_empty == (run - (i + 1)))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue