Allow maxord=1 w/o crash
This commit is contained in:
parent
7b3960506f
commit
a5bfc9d6bd
|
|
@ -68,7 +68,7 @@ CKTsetup(CKTcircuit *ckt)
|
||||||
if(error) return(error);
|
if(error) return(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(i=0;i<=ckt->CKTmaxOrder+1;i++) {
|
for(i=0;i<=MAX(2,ckt->CKTmaxOrder)+1;i++) { /* dctran needs 3 states as minimum */
|
||||||
CKALLOC(ckt->CKTstates[i],ckt->CKTnumStates,double);
|
CKALLOC(ckt->CKTstates[i],ckt->CKTnumStates,double);
|
||||||
}
|
}
|
||||||
#ifdef WANT_SENSE2
|
#ifdef WANT_SENSE2
|
||||||
|
|
|
||||||
|
|
@ -113,9 +113,9 @@ CKTsetOpt(CKTcircuit *ckt, JOB *anal, int opt, IFvalue *val)
|
||||||
case OPT_MAXORD:
|
case OPT_MAXORD:
|
||||||
task->TSKmaxOrder = val->iValue;
|
task->TSKmaxOrder = val->iValue;
|
||||||
/* Check options method and maxorder for consistency */
|
/* Check options method and maxorder for consistency */
|
||||||
if (task->TSKmaxOrder < 2) {
|
if (task->TSKmaxOrder < 1) {
|
||||||
task->TSKmaxOrder = 2;
|
task->TSKmaxOrder = 1;
|
||||||
fprintf(stderr,"\nWarning -- Option maxord < 2 not allowed in ngspice\nSet to 2\n\n");
|
fprintf(stderr,"\nWarning -- Option maxord < 1 not allowed in ngspice\nSet to 1\n\n");
|
||||||
}
|
}
|
||||||
else if (task->TSKmaxOrder > 6) {
|
else if (task->TSKmaxOrder > 6) {
|
||||||
task->TSKmaxOrder = 6;
|
task->TSKmaxOrder = 6;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue