cleaning some more

This commit is contained in:
Thomas Capricelli 2009-08-24 16:08:13 +02:00
parent 63071ac968
commit c6d7da6edc
5 changed files with 37 additions and 37 deletions

View File

@ -56,10 +56,10 @@ int ei_hybrd(
/* check the input parameters for errors. */
if (n <= 0 || xtol < 0. || maxfev <= 0 || nb_of_subdiagonals < 0 || nb_of_superdiagonals < 0 || factor <= 0. )
goto L300;
goto algo_end;
if (mode == 2)
for (j = 0; j < n; ++j)
if (diag[j] <= 0.) goto L300;
if (diag[j] <= 0.) goto algo_end;
/* evaluate the function at the starting point */
/* and calculate its norm. */
@ -67,7 +67,7 @@ int ei_hybrd(
iflag = Functor::f(x, fvec);
nfev = 1;
if (iflag < 0)
goto L300;
goto algo_end;
fnorm = fvec.stableNorm();
/* determine the number of calls to fcn needed to compute */
@ -170,7 +170,7 @@ int ei_hybrd(
if ((iter - 1) % nprint == 0)
iflag = Functor::debug(x, fvec);
if (iflag < 0)
goto L300;
goto algo_end;
}
/* determine the direction p. */
@ -194,7 +194,7 @@ int ei_hybrd(
iflag = Functor::f(wa2, wa4);
++nfev;
if (iflag < 0)
goto L300;
goto algo_end;
fnorm1 = wa4.stableNorm();
/* compute the scaled actual reduction. */
@ -269,7 +269,7 @@ int ei_hybrd(
if (delta <= xtol * xnorm || fnorm == 0.)
info = 1;
if (info != 0)
goto L300;
goto algo_end;
/* tests for termination and stringent tolerances. */
@ -283,7 +283,7 @@ int ei_hybrd(
if (nslow1 == 10)
info = 5;
if (info != 0)
goto L300;
goto algo_end;
/* criterion for recalculating jacobian approximation */
/* by forward differences. */
@ -314,7 +314,7 @@ int ei_hybrd(
}
/* end of the outer loop. */
}
L300:
algo_end:
/* termination, either normal or user imposed. */
if (iflag < 0)
info = iflag;

View File

@ -51,10 +51,10 @@ int ei_hybrj(
/* check the input parameters for errors. */
if (n <= 0 || xtol < 0. || maxfev <= 0 || factor <= 0. )
goto L300;
goto algo_end;
if (mode == 2)
for (j = 0; j < n; ++j)
if (diag[j] <= 0.) goto L300;
if (diag[j] <= 0.) goto algo_end;
/* evaluate the function at the starting point */
/* and calculate its norm. */
@ -62,7 +62,7 @@ int ei_hybrj(
iflag = Functor::f(x, fvec);
nfev = 1;
if (iflag < 0)
goto L300;
goto algo_end;
fnorm = fvec.stableNorm();
/* initialize iteration counter and monitors. */
@ -158,7 +158,7 @@ int ei_hybrj(
if ((iter - 1) % nprint == 0)
iflag = Functor::debug(x, fvec, fjac);
if (iflag < 0)
goto L300;
goto algo_end;
}
/* determine the direction p. */
@ -182,7 +182,7 @@ int ei_hybrj(
iflag = Functor::f(wa2, wa4);
++nfev;
if (iflag < 0)
goto L300;
goto algo_end;
fnorm1 = wa4.stableNorm();
/* compute the scaled actual reduction. */
@ -257,7 +257,7 @@ int ei_hybrj(
if (delta <= xtol * xnorm || fnorm == 0.)
info = 1;
if (info != 0)
goto L300;
goto algo_end;
/* tests for termination and stringent tolerances. */
@ -271,7 +271,7 @@ int ei_hybrj(
if (nslow1 == 10)
info = 5;
if (info != 0)
goto L300;
goto algo_end;
/* criterion for recalculating jacobian. */
@ -301,7 +301,7 @@ int ei_hybrj(
}
/* end of the outer loop. */
}
L300:
algo_end:
/* termination, either normal or user imposed. */
if (iflag < 0)
info = iflag;

View File

@ -47,11 +47,11 @@ int ei_lmder(
/* check the input parameters for errors. */
if (n <= 0 || m < n || ftol < 0. || xtol < 0. || gtol < 0. || maxfev <= 0 || factor <= 0.)
goto L300;
goto algo_end;
if (mode == 2)
for (j = 0; j < n; ++j)
if (diag[j] <= 0.) goto L300;
if (diag[j] <= 0.) goto algo_end;
/* evaluate the function at the starting point */
/* and calculate its norm. */
@ -59,7 +59,7 @@ int ei_lmder(
iflag = Functor::f(x, fvec);
nfev = 1;
if (iflag < 0)
goto L300;
goto algo_end;
fnorm = fvec.stableNorm();
/* initialize levenberg-marquardt parameter and iteration counter. */
@ -182,7 +182,7 @@ int ei_lmder(
iflag = Functor::f(wa2, wa4);
++nfev;
if (iflag < 0)
goto L300;
goto algo_end;
fnorm1 = wa4.stableNorm();
/* compute the scaled actual reduction. */
@ -252,7 +252,7 @@ int ei_lmder(
if (ei_abs(actred) <= ftol && prered <= ftol && Scalar(.5) * ratio <= 1. && info == 2)
info = 3;
if (info != 0)
goto L300;
goto algo_end;
/* tests for termination and stringent tolerances. */
@ -265,12 +265,12 @@ int ei_lmder(
if (gnorm <= epsilon<Scalar>())
info = 8;
if (info != 0)
goto L300;
goto algo_end;
/* end of the inner loop. repeat if iteration unsuccessful. */
} while (ratio < Scalar(1e-4));
/* end of the outer loop. */
}
L300:
algo_end:
/* termination, either normal or user imposed. */
if (iflag < 0)

View File

@ -46,10 +46,10 @@ int ei_lmdif(
/* check the input parameters for errors. */
if (n <= 0 || m < n || ftol < 0. || xtol < 0. || gtol < 0. || maxfev <= 0 || factor <= 0.)
goto L300;
goto algo_end;
if (mode == 2)
for (j = 0; j < n; ++j)
if (diag[j] <= 0.) goto L300;
if (diag[j] <= 0.) goto algo_end;
/* evaluate the function at the starting point */
/* and calculate its norm. */
@ -57,7 +57,7 @@ int ei_lmdif(
iflag = Functor::f(x, fvec);
nfev = 1;
if (iflag < 0)
goto L300;
goto algo_end;
fnorm = fvec.stableNorm();
/* initialize levenberg-marquardt parameter and iteration counter. */
@ -180,7 +180,7 @@ int ei_lmdif(
iflag = Functor::f(wa2, wa4);
++nfev;
if (iflag < 0)
goto L300;
goto algo_end;
fnorm1 = wa4.stableNorm();
/* compute the scaled actual reduction. */
@ -250,7 +250,7 @@ int ei_lmdif(
if (ei_abs(actred) <= ftol && prered <= ftol && Scalar(.5) * ratio <= 1. && info == 2)
info = 3;
if (info != 0)
goto L300;
goto algo_end;
/* tests for termination and stringent tolerances. */
@ -263,12 +263,12 @@ int ei_lmdif(
if (gnorm <= epsilon<Scalar>())
info = 8;
if (info != 0)
goto L300;
goto algo_end;
/* end of the inner loop. repeat if iteration unsuccessful. */
} while (ratio < Scalar(1e-4));
/* end of the outer loop. */
}
L300:
algo_end:
/* termination, either normal or user imposed. */
if (iflag < 0)

View File

@ -47,10 +47,10 @@ int ei_lmstr(
/* check the input parameters for errors. */
if (n <= 0 || m < n || ftol < 0. || xtol < 0. || gtol < 0. || maxfev <= 0 || factor <= 0.)
goto L340;
goto algo_end;
if (mode == 2)
for (j = 0; j < n; ++j)
if (diag[j] <= 0.) goto L340;
if (diag[j] <= 0.) goto algo_end;
/* evaluate the function at the starting point */
/* and calculate its norm. */
@ -58,7 +58,7 @@ int ei_lmstr(
iflag = Functor::f(x, fvec);
nfev = 1;
if (iflag < 0)
goto L340;
goto algo_end;
fnorm = fvec.stableNorm();
/* initialize levenberg-marquardt parameter and iteration counter. */
@ -197,7 +197,7 @@ int ei_lmstr(
iflag = Functor::f(wa2, wa4);
++nfev;
if (iflag < 0)
goto L340;
goto algo_end;
fnorm1 = wa4.stableNorm();
/* compute the scaled actual reduction. */
@ -267,7 +267,7 @@ int ei_lmstr(
if (ei_abs(actred) <= ftol && prered <= ftol && Scalar(.5) * ratio <= 1. && info == 2)
info = 3;
if (info != 0)
goto L340;
goto algo_end;
/* tests for termination and stringent tolerances. */
@ -280,12 +280,12 @@ int ei_lmstr(
if (gnorm <= epsilon<Scalar>())
info = 8;
if (info != 0)
goto L340;
goto algo_end;
/* end of the inner loop. repeat if iteration unsuccessful. */
} while (ratio < Scalar(1e-4));
/* end of the outer loop. */
}
L340:
algo_end:
/* termination, either normal or user imposed. */
if (iflag < 0)