diff --git a/unsupported/Eigen/src/NonLinear/MathFunctions.h b/unsupported/Eigen/src/NonLinear/MathFunctions.h index cb0ded33c..d4efa5e01 100644 --- a/unsupported/Eigen/src/NonLinear/MathFunctions.h +++ b/unsupported/Eigen/src/NonLinear/MathFunctions.h @@ -250,17 +250,16 @@ template int ei_lmdif1( Matrix< Scalar, Dynamic, 1 > &x, Matrix< Scalar, Dynamic, 1 > &fvec, - VectorXi &iwa, Scalar tol = ei_sqrt(epsilon()) ) { int n = x.size(); int ldfjac = fvec.size(); int lwa = ldfjac*n+5*n+ldfjac; + VectorXi iwa(n); Matrix< Scalar, Dynamic, 1 > wa(lwa); Matrix< Scalar, Dynamic, Dynamic > fjac(ldfjac, n); - iwa.resize(n); wa.resize(lwa); return lmdif1_template ( Functor::f, 0, diff --git a/unsupported/test/NonLinear.cpp b/unsupported/test/NonLinear.cpp index ff94198c2..7591634ff 100644 --- a/unsupported/test/NonLinear.cpp +++ b/unsupported/test/NonLinear.cpp @@ -681,13 +681,12 @@ void testLmdif1() int m=15, n=3, info; VectorXd x(n), fvec(m); - VectorXi iwa; /* the following starting values provide a rough fit. */ x.setConstant(n, 1.); // do the computation - info = ei_lmdif1(x, fvec, iwa); + info = ei_lmdif1(x, fvec); // check return value VERIFY( 1 == info);