Ignore:
Timestamp:
08/25/10 13:40:01 (6 years ago)
Author:
mmckerns
Message:

reduce scipy function copies (and likely delay due to importing)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/alta/mystic-0.2a1/scipy_bfgs.py

    r418 r419  
    6060 
    6161from _scipyoptimize import zoom, _cubicmin, _quadmin, _epsilon 
    62 from _scipyoptimize import line_search, approx_fprime 
     62from _scipyoptimize import linesearch, line_search, approx_fprime 
    6363 
    6464########################################################################## 
     
    217217            pk = -numpy.dot(Hk,gfk) 
    218218 
    219             # If user has scipy installed, use that line search (since line search requires 
    220             # minpack.so). If scipy is not installed, use 
    221             # the function line_search (defined above, in helper functions) 
    222             try: 
    223                 import scipy.optimize 
    224                 alpha_k, fc, gc, old_fval, old_old_fval, gfkp1 = \ 
    225                 scipy.optimize.linesearch.line_search(func,myfprime,xk,pk,gfk, 
    226                                       old_fval,old_old_fval) 
    227             except ImportError: 
    228                 alpha_k = None 
    229             #XXX If it gets stuck in the linesearch in scipy, 'exit' in the signal  
    230             # handler does not work. 
     219            alpha_k, fc, gc, old_fval, old_old_fval, gfkp1 = \ 
     220                             linesearch.line_search(func,myfprime,xk,pk,gfk, \ 
     221                             old_fval,old_old_fval) 
     222            #XXX If it gets stuck in the linesearch in scipy, 
     223            # 'exit' in the signal handler does not work. 
    231224            #alpha_k = None 
    232225 
Note: See TracChangeset for help on using the changeset viewer.