clean fortran stuff in fdjac*

This commit is contained in:
Thomas Capricelli 2009-08-24 21:53:08 +02:00
parent 45442b8d41
commit 86cb9364c9
4 changed files with 8 additions and 7 deletions

View File

@ -6,9 +6,7 @@ int ei_fdjac1(
Matrix< Scalar, Dynamic, 1 > &fvec,
Matrix< Scalar, Dynamic, Dynamic > &fjac,
int ml, int mu,
Scalar epsfcn,
Matrix< Scalar, Dynamic, 1 > &wa1,
Matrix< Scalar, Dynamic, 1 > &wa2)
Scalar epsfcn)
{
/* Local variables */
Scalar h;
@ -20,6 +18,9 @@ int ei_fdjac1(
/* Function Body */
const Scalar epsmch = epsilon<Scalar>();
const int n = x.size();
assert(fvec.size()==n);
Matrix< Scalar, Dynamic, 1 > wa1(n);
Matrix< Scalar, Dynamic, 1 > wa2(n);
eps = ei_sqrt((std::max(epsfcn,epsmch)));
msum = ml + mu + 1;

View File

@ -5,8 +5,7 @@ int ei_fdjac2(
Matrix< Scalar, Dynamic, 1 > &x,
Matrix< Scalar, Dynamic, 1 > &fvec,
Matrix< Scalar, Dynamic, Dynamic > &fjac,
Scalar epsfcn,
Matrix< Scalar, Dynamic, 1 > &wa)
Scalar epsfcn)
{
/* Local variables */
Scalar h, temp;
@ -16,6 +15,7 @@ int ei_fdjac2(
const Scalar epsmch = epsilon<Scalar>();
const int n = x.size();
const Scalar eps = ei_sqrt((std::max(epsfcn,epsmch)));
Matrix< Scalar, Dynamic, 1 > wa(fvec.size());
for (int j = 0; j < n; ++j) {
temp = x[j];

View File

@ -93,7 +93,7 @@ int ei_hybrd(
/* calculate the jacobian matrix. */
iflag = ei_fdjac1(Functor, x, fvec, fjac,
nb_of_subdiagonals, nb_of_superdiagonals, epsfcn, wa1, wa2);
nb_of_subdiagonals, nb_of_superdiagonals, epsfcn);
nfev += msum;
if (iflag < 0)
break;

View File

@ -72,7 +72,7 @@ int ei_lmdif(
/* calculate the jacobian matrix. */
iflag = ei_fdjac2(Functor, x, fvec, fjac, epsfcn, wa4);
iflag = ei_fdjac2(Functor, x, fvec, fjac, epsfcn);
nfev += n;
if (iflag < 0)
break;