Code: Select all

```
for (err=1, j=0; err > CONVERGE; j++) {
init_coef_list();
(*fun)();
if((ierr = spar_matsol())) {
return ierr;
}
for (err=0.,i=1; i<=n; i++) {
s_(i-1) += rhs[i];
#if 1
if (!linflag && s_(i-1) < 0.) { s_(i-1) = 0.; }
#endif
err += fabs(rhs[i]);
}
if (j > MAXSTEPS) {
return EXCEED_ITERS;
}
if (linflag) break;
}
```