diff --git a/unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h b/unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h index ee98300ab..188313b2c 100644 --- a/unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h +++ b/unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h @@ -190,12 +190,13 @@ HybridNonLinearSolver::solveOneStep( /* compute the qr factorization of the jacobian. */ - ei_qrfac(n, n, fjac.data(), fjac.rows(), false, iwa, 1, wa1.data(), wa2.data()); + ei_qrfac(n, n, fjac.data(), fjac.rows(), false, iwa, wa1.data(), wa2.data()); - /* on the first iteration and if mode is 1, scale according */ - /* to the norms of the columns of the initial jacobian. */ if (iter == 1) { + + /* on the first iteration and if mode is 1, scale according */ + /* to the norms of the columns of the initial jacobian. */ if (mode != 2) for (j = 0; j < n; ++j) { diag[j] = wa2[j]; @@ -205,7 +206,6 @@ HybridNonLinearSolver::solveOneStep( /* on the first iteration, calculate the norm of the scaled x */ /* and initialize the step bound delta. */ - wa3 = diag.cwise() * x; xnorm = wa3.stableNorm(); delta = parameters.factor * xnorm; @@ -507,7 +507,7 @@ HybridNonLinearSolver::solveNumericalDiffOneStep( /* compute the qr factorization of the jacobian. */ - ei_qrfac(n, n, fjac.data(), fjac.rows(), false, iwa, 1, wa1.data(), wa2.data()); + ei_qrfac(n, n, fjac.data(), fjac.rows(), false, iwa, wa1.data(), wa2.data()); /* on the first iteration and if mode is 1, scale according */ /* to the norms of the columns of the initial jacobian. */ diff --git a/unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h b/unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h index 47576e733..2f964358a 100644 --- a/unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h +++ b/unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h @@ -217,7 +217,7 @@ LevenbergMarquardt::minimizeOneStep( /* compute the qr factorization of the jacobian. */ - ei_qrfac(m, n, fjac.data(), fjac.rows(), true, ipvt.data(), n, wa1.data(), wa2.data()); + ei_qrfac(m, n, fjac.data(), fjac.rows(), true, ipvt.data(), wa1.data(), wa2.data()); ipvt.cwise()-=1; // qrfac() creates ipvt with fortran convetion (1->n), convert it to c (0->n-1) /* on the first iteration and if mode is 1, scale according */ @@ -480,7 +480,7 @@ LevenbergMarquardt::minimizeNumericalDiffOneStep( /* compute the qr factorization of the jacobian. */ - ei_qrfac(m, n, fjac.data(), fjac.rows(), true, ipvt.data(), n, wa1.data(), wa2.data()); + ei_qrfac(m, n, fjac.data(), fjac.rows(), true, ipvt.data(), wa1.data(), wa2.data()); ipvt.cwise()-=1; // qrfac() creates ipvt with fortran convetion (1->n), convert it to c (0->n-1) /* on the first iteration and if mode is 1, scale according */ @@ -783,7 +783,7 @@ LevenbergMarquardt::minimizeOptimumStorageOneStep( } if (sing) { ipvt.cwise()+=1; - ei_qrfac(n, n, fjac.data(), fjac.rows(), true, ipvt.data(), n, wa1.data(), wa2.data()); + ei_qrfac(n, n, fjac.data(), fjac.rows(), true, ipvt.data(), wa1.data(), wa2.data()); ipvt.cwise()-=1; // qrfac() creates ipvt with fortran convetion (1->n), convert it to c (0->n-1) for (j = 0; j < n; ++j) { if (fjac(j,j) != 0.) { diff --git a/unsupported/Eigen/src/NonLinear/qrfac.h b/unsupported/Eigen/src/NonLinear/qrfac.h index c14fd0714..481fe57d8 100644 --- a/unsupported/Eigen/src/NonLinear/qrfac.h +++ b/unsupported/Eigen/src/NonLinear/qrfac.h @@ -1,7 +1,7 @@ template void ei_qrfac(int m, int n, Scalar *a, int - lda, int pivot, int *ipvt, int /* lipvt */, Scalar *rdiag, + lda, int pivot, int *ipvt, Scalar *rdiag, Scalar *acnorm) { /* System generated locals */