[SciPy-User] Gradient inputs to SciPy optimize routines

The Helmbolds helmrp@yahoo....
Mon Jul 23 10:12:05 CDT 2012


Thanks. That's good to know. So if all the optimize routines simply inserted 
     fprime = np.ascontinuaousarray(fprime)
before calling _minimize_(whatever), the user's `fprime` function could return any "array like" object and all would be well?

The Helmbolds
2645 E Southern Ave A241
Tempe AZ 85282
Email: helmrp@yahoo.com
VOX: 480-831-3611
CELL Igor: 480-438-3918
CELL Alf: 602-568-6948 (but not often turned on)


>________________________________
> From: Sturla Molden <sturla@molden.no>
>To: The Helmbolds <helmrp@yahoo.com>; SciPy Users List <scipy-user@scipy.org> 
>Cc: Warren Weckesser <warren.weckesser@enthought.com>; SciPy Users List <scipy-user@scipy.org> 
>Sent: Monday, July 23, 2012 7:36 AM
>Subject: Re: [SciPy-User] Gradient inputs to SciPy optimize routines
> 
<snip>
>
>The NumPy functions np.ascontiguousarray and np.asfortranarray are often used internally in SciPy for this purpose; that is, they will only make a copy if the argument is not a NumPy ndarray that can be passed safely to C or Fortran. Any Python sequence which is not a C or Fortran contiguous NumPy array will be converted in that process.
>
>Sturla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120723/f6c54e61/attachment.html 


More information about the SciPy-User mailing list