#6592: minimize_constrained only takes lambda functions as constraints
-------------------------+--------------------------------------------------
Reporter: rlm | Owner: jkantor
Type: defect | Status: new
Priority: major | Milestone: sage-4.3.4
Component: numerical | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-------------------------+--------------------------------------------------
Changes (by jason):
* upstream: => N/A
Comment:
More clearly, here's the "bug" part of this. The documentation says that
the function takes a symbolic function, but clearly does not:
{{{
sage: f(x,y) = (100 - x) + (1000 - y)
sage: c = x + y - 479
sage: minimize_constrained(f,[c],[100,300])
---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call
last)
/home/grout/<ipython console> in <module>()
/home/grout/sage/local/lib/python2.6/site-
packages/sage/numerical/optimize.pyc in minimize_constrained(func, cons,
x0, gradient, algorithm, **args)
408 elif isinstance(cons, function_type):
409 min= optimize.fmin_cobyla(f,x0,cons,iprint=0,**args)
--> 410 return vector(RDF,min)
411
412
UnboundLocalError: local variable 'min' referenced before assignment
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6592#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.