iwa is not really an argument, but just an old fashioned 'work array' :

remove it from the eigen API
This commit is contained in:
Thomas Capricelli 2009-08-20 22:46:38 +02:00
parent b423e640a6
commit 8d2f6ad7e1
2 changed files with 2 additions and 4 deletions

View File

@ -250,17 +250,16 @@ template<typename Functor, typename Scalar>
int ei_lmdif1(
Matrix< Scalar, Dynamic, 1 > &x,
Matrix< Scalar, Dynamic, 1 > &fvec,
VectorXi &iwa,
Scalar tol = ei_sqrt(epsilon<Scalar>())
)
{
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<Scalar> (
Functor::f, 0,

View File

@ -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<lmdif1_functor,double>(x, fvec, iwa);
info = ei_lmdif1<lmdif1_functor,double>(x, fvec);
// check return value
VERIFY( 1 == info);