diff options
Diffstat (limited to 'unsupported/Eigen/src/NonLinear/hybrd.h')
-rw-r--r-- | unsupported/Eigen/src/NonLinear/hybrd.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/unsupported/Eigen/src/NonLinear/hybrd.h b/unsupported/Eigen/src/NonLinear/hybrd.h index e935b3c35..3b17e444b 100644 --- a/unsupported/Eigen/src/NonLinear/hybrd.h +++ b/unsupported/Eigen/src/NonLinear/hybrd.h @@ -28,8 +28,7 @@ int ei_hybrd( fvec.resize(n); qtf.resize(n); R.resize(lr); - int ldfjac = n; - fjac.resize(ldfjac, n); + fjac.resize(n, n); /* Local variables */ int i, j, l, iwa[1]; @@ -58,7 +57,7 @@ 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. || ldfjac < n || lr < n * (n + 1) / 2) { + factor <= 0. || lr < n * (n + 1) / 2) { goto L300; } if (mode == 2) @@ -105,7 +104,7 @@ L30: /* compute the qr factorization of the jacobian. */ - ei_qrfac<Scalar>(n, n, fjac.data(), ldfjac, false, iwa, 1, wa1.data(), wa2.data(), wa3.data()); + ei_qrfac<Scalar>(n, n, fjac.data(), fjac.rows(), false, iwa, 1, wa1.data(), wa2.data(), wa3.data()); /* on the first iteration and if mode is 1, scale according */ /* to the norms of the columns of the initial jacobian. */ @@ -179,7 +178,7 @@ L110: /* accumulate the orthogonal factor in fjac. */ - ei_qform<Scalar>(n, n, fjac.data(), ldfjac, wa1.data()); + ei_qform<Scalar>(n, n, fjac.data(), fjac.rows(), wa1.data()); /* rescale if necessary. */ @@ -358,7 +357,7 @@ L260: /* compute the qr factorization of the updated jacobian. */ ei_r1updt<Scalar>(n, n, R.data(), lr, wa1.data(), wa2.data(), wa3.data(), &sing); - ei_r1mpyq<Scalar>(n, n, fjac.data(), ldfjac, wa2.data(), wa3.data()); + ei_r1mpyq<Scalar>(n, n, fjac.data(), fjac.rows(), wa2.data(), wa3.data()); ei_r1mpyq<Scalar>(1, n, qtf.data(), 1, wa2.data(), wa3.data()); /* end of the inner loop. */ |