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 sure. 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. AJennings 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? Index: Lib/optimize/__minpack.h =================================================================== --- Lib/optimize/__minpack.h (revision 2901) +++ Lib/optimize/__minpack.h (working copy) @@ -149,7 +149,7 @@ return -1; } if (multipack_jac_transpose == 1) - MATRIXC2F(fjac, result_array->data, *n, *ldfjac) + MATRIXC2F(fjac, result_array->data, *ldfjac, *n) else memcpy(fjac, result_array->data, (*n)*(*ldfjac)*sizeof(double)); }
Andy Jennings wrote:
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?
No, please open a ticket so it doesn't get lost. At the bottom of the page where you enter the ticket's information, there will be a checkbox labeled something like "I have files to attach to this ticket." Check that box, submit the ticket, then you will be presented a page where you can upload the patch. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
participants (2)
-
Andy Jennings -
Robert Kern