From 8d2f6ad7e11715689cd036659940f3c703f20ee6 Mon Sep 17 00:00:00 2001 From: Thomas Capricelli Date: Thu, 20 Aug 2009 22:46:38 +0200 Subject: [PATCH] iwa is not really an argument, but just an old fashioned 'work array' : remove it from the eigen API --- unsupported/Eigen/src/NonLinear/MathFunctions.h | 3 +-- unsupported/test/NonLinear.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) 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);