Corrected another error discovered by Andrei Bondar in which
the critical property (e.g., L for transistors) is required to match exactly between devices in order to allow the additive property (e.g., W for transistors) to be summed. The critical property should match if all values are within the slop value, for floating-point values. Note: The implementation is still not rigorous, as the saved critical value may shift from device to device; so comparing, e.g., 1.00 to 1.01 to 1.02 to 1.03, etc., can find that all individual comparisons are within the slop value even though the slop is exceeded across all values.
This commit is contained in:
parent
df8fa29b2f
commit
e1aa231db1
|
|
@ -5169,6 +5169,7 @@ int PropertyOptimize(struct objlist *ob, struct nlist *tp, int run, int series,
|
||||||
// (if any)
|
// (if any)
|
||||||
|
|
||||||
if (comb == TRUE) {
|
if (comb == TRUE) {
|
||||||
|
double pd;
|
||||||
int mult, cidx = -1;
|
int mult, cidx = -1;
|
||||||
struct valuelist *avl, *cvl = NULL;
|
struct valuelist *avl, *cvl = NULL;
|
||||||
critval.type = PROP_ENDLIST;
|
critval.type = PROP_ENDLIST;
|
||||||
|
|
@ -5187,12 +5188,15 @@ int PropertyOptimize(struct objlist *ob, struct nlist *tp, int run, int series,
|
||||||
/* combine as specified by the merge type of the property. */
|
/* combine as specified by the merge type of the property. */
|
||||||
|
|
||||||
for (p = 1; p < pcount; p++) {
|
for (p = 1; p < pcount; p++) {
|
||||||
|
kl = plist[p];
|
||||||
vl = vlist[p][i];
|
vl = vlist[p][i];
|
||||||
ctype = clist[p][i];
|
ctype = clist[p][i];
|
||||||
|
|
||||||
/* critical properties never combine, but track them */
|
/* critical properties never combine, but track them */
|
||||||
if ((series == TRUE) && (ctype & MERGE_S_CRIT)) {
|
if ((series == TRUE) && (ctype & MERGE_S_CRIT)) {
|
||||||
if ((vl->type != critval.type) || (vl->value.dval != critval.value.dval))
|
pd = 2 * fabs(vl->value.dval - critval.value.dval) /
|
||||||
|
(vl->value.dval + critval.value.dval);
|
||||||
|
if ((vl->type != critval.type) || (pd > kl->slop.dval))
|
||||||
{
|
{
|
||||||
critval.type = vl->type;
|
critval.type = vl->type;
|
||||||
critval.value = vl->value;
|
critval.value = vl->value;
|
||||||
|
|
@ -5201,7 +5205,9 @@ int PropertyOptimize(struct objlist *ob, struct nlist *tp, int run, int series,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((series == FALSE) && (ctype & MERGE_P_CRIT)) {
|
if ((series == FALSE) && (ctype & MERGE_P_CRIT)) {
|
||||||
if ((vl->type != critval.type) || (vl->value.dval != critval.value.dval))
|
pd = 2 * fabs(vl->value.dval - critval.value.dval) /
|
||||||
|
(vl->value.dval + critval.value.dval);
|
||||||
|
if ((vl->type != critval.type) || (pd > kl->slop.dval))
|
||||||
{
|
{
|
||||||
critval.type = vl->type;
|
critval.type = vl->type;
|
||||||
critval.value = vl->value;
|
critval.value = vl->value;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue