[SciPy-dev] lmder patch
Wed Apr 11 12:19:54 CDT 2007
optimize.leastsq is not converging when I use a jacobian function.
MATRIXC2F is transposing the wrong way. Below is a patch that fixes it in
jac_multipack_lm_function, but I'm not sure this is the right fix. It looks
like jac_multipack_calling_function might have the same problem, in which
case maybe it's better to fix the definition of MATRIXC2F in
Lib/optimize/minpack.h. I guess I would want a test case for hybrj to be
Lib/integrate/multipack.h and Lib/interpolate/multipack.h also define a
MATRIXC2F macro. I have no idea if they need to be looked at as well.
P.S. I just signed up for a trac account a few days ago. I have to submit
patches to someone with the rights to commit, right? Is this scipy-dev list
the best place to do it?
--- Lib/optimize/__minpack.h (revision 2901)
+++ Lib/optimize/__minpack.h (working copy)
@@ -149,7 +149,7 @@
if (multipack_jac_transpose == 1)
- MATRIXC2F(fjac, result_array->data, *n, *ldfjac)
+ MATRIXC2F(fjac, result_array->data, *ldfjac, *n)
memcpy(fjac, result_array->data, (*n)*(*ldfjac)*sizeof(double));
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Scipy-dev