Changeset 1146
- Timestamp:
- 07/19/08 08:30:57 (4 months ago)
- Files:
-
- trunk/openopt/scikits/openopt/Kernel/BaseProblem.py (modified) (1 diff)
- trunk/openopt/scikits/openopt/Kernel/LLSP.py (modified) (1 diff)
- trunk/openopt/scikits/openopt/Kernel/LSP.py (modified) (1 diff)
- trunk/openopt/scikits/openopt/__init__.py (modified) (1 diff)
- trunk/openopt/scikits/openopt/oo.py (modified) (7 diffs)
- trunk/openopt/scikits/openopt/solvers/CoinOr/ipopt_oo.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openopt/scikits/openopt/Kernel/BaseProblem.py
r1145 r1146 219 219 220 220 #TODO: hold it in single place 221 for key in ['lb', 'ub', 'A', 'Aeq', 'b', 'beq', 'contol', 'xtol', 'ftol', 'gradtol', 'iprint', 'plot', 'maxIter', 'maxTime', 'maxCPUTime','fEnough', 'goal', 'color', 'debug' ] :221 for key in ['lb', 'ub', 'A', 'Aeq', 'b', 'beq', 'contol', 'xtol', 'ftol', 'gradtol', 'iprint', 'plot', 'maxIter', 'maxTime', 'maxCPUTime','fEnough', 'goal', 'color', 'debug', 'maxFunEvals'] : 222 222 if hasattr(self, key): setattr(newProb, key, getattr(self, key)) 223 223 trunk/openopt/scikits/openopt/Kernel/LLSP.py
r1145 r1146 44 44 prob.goal = 'minimum' 45 45 prob.allowedGoals = ['minimum', 'min'] 46 prob.showGoal = False 46 47 47 48 kwargs['C'] = asfarray(kwargs['C']) trunk/openopt/scikits/openopt/Kernel/LSP.py
r1091 r1146 14 14 self.probType = 'LSP' 15 15 self.allowedGoals = ['minimum', 'min'] 16 self.showGoal = False 16 17 self.isObjFunValueASingleNumber = False 17 18 trunk/openopt/scikits/openopt/__init__.py
r1145 r1146 4 4 #from info import __doc__, __version__ 5 5 6 from oo import LP, NLP, NSP, MILP, QP, NLSP, LSP, GLP, LLSP, MMP 6 from oo import LP, NLP, NSP, MILP, QP, NLSP, LSP, GLP, LLSP, MMP, LLAVP 7 7 from Kernel.Function import oofun 8 8 from info import __version__ trunk/openopt/scikits/openopt/oo.py
r1139 r1146 15 15 from Kernel.LLSP import LLSP as CLLSP 16 16 from Kernel.MMP import MMP as CMMP 17 from Kernel.LLAVP import LLAVP as CLLAVP 17 18 18 19 def MILP(*args, **kwargs): … … 47 48 r.xf - desired solution (NaNs if a problem occured) 48 49 r.ff - objFun value (<f,x_opt>) (NaN if a problem occured) 49 (see also other fields, such as CPUTimeElapsed, TimeElapsed, etc)50 (see also other r fields) 50 51 Solvers available for now: 51 52 lpSolve (LGPL) - requires lpsolve + Python bindings installations (all mentioned is available in http://sourceforge.net/projects/lpsolve) … … 85 86 r.xf - desired solution (NaNs if a problem occured) 86 87 r.ff - objFun value (<f,x_opt>) (NaN if a problem occured) 87 (see also other fields, such as CPUTimeElapsed, TimeElapsed, etc)88 (see also other r fields) 88 89 Solvers available for now: 89 90 lpSolve (LGPL) - requires lpsolve + Python bindings installations (all mentioned is available in http://sourceforge.net/projects/lpsolve) … … 122 123 r.xf - desired solution (NaNs if a problem occured) 123 124 r.ff - objFun value (NaN if a problem occured) 124 (see also other fields, such as CPUTimeElapsed, TimeElapsed, etc)125 (see also other r fields) 125 126 Solvers available for now: 126 127 cvxopt_qp (GPL) - requires CVXOPT (http://abel.ee.ucla.edu/cvxopt) … … 295 296 """ 296 297 LLSP: constructor for Linear Least Squares Problem assignment 297 ||C * x - d|| -> min298 298 0.5*||C*x-d||^2 + 0.5*damp*||x-X||^2 + <f,x> -> min 299 299 … … 326 326 r.xf - desired solution (NaNs if a problem occured) 327 327 r.ff - objFun value (NaN if a problem occured) 328 (see also other fields, such as CPUTimeElapsed, TimeElapsed, etc)328 (see also other r fields) 329 329 Solvers available for now: 330 330 lapack_dgelss - slow but stable, requires scipy; unconstrained … … 346 346 """ 347 347 return CMMP(*args, **kwargs) 348 349 def LLAVP(*args, **kwargs): 350 """ 351 LLAVP : constructor for Linear Least Absolute Value Problem assignment 352 ||C * x - d||_1 + damp*||x-X||_1-> min 353 354 subjected to: 355 lb <= x <= ub 356 357 Examples of valid calls: 358 p = LLAVP(C, d, <params as kwargs>) 359 p = LLAVP(C=my_C, d=my_d, <params as kwargs>) 360 361 p = LLAVP(C, d, lb=lb, ub=ub) 362 363 See also: /examples/llavp_*.py 364 365 :Parameters: 366 C - float m x n numpy.ndarray, numpy.matrix or Python list of lists 367 d - float array of length m (numpy.ndarray, numpy.matrix, Python list or tuple) 368 damp - non-negative float number 369 X - float array of length n (by default all-zeros) 370 lb, ub - float arrays of length n (numpy.ndarray, numpy.matrix, Python list or tuple) 371 372 :Returns: 373 OpenOpt LLAVP class instance 374 375 Notes 376 ----- 377 Solving of LLAVPs is performed via 378 r = p.solve(string_name_of_solver) 379 r.xf - desired solution (NaNs if a problem occured) 380 r.ff - objFun value (NaN if a problem occured) 381 (see also other r fields) 382 Solvers available for now: 383 nsp:<NSP_solver_name> - converter llavp2nsp. Example: r = p.solve('nsp:ralg', plot=1, iprint =15, <...>) 384 """ 385 return CLLAVP(*args, **kwargs) trunk/openopt/scikits/openopt/solvers/CoinOr/ipopt_oo.py
r1098 r1146 17 17 18 18 # CHECK ME! 19 __isIterPointAlwaysFeasible__ = lambda self, p: p.__isNoMoreThanBoxBounded__() 19 __isIterPointAlwaysFeasible__ = lambda self, p: False 20 #__isIterPointAlwaysFeasible__ = lambda self, p: p.__isNoMoreThanBoxBounded__() 20 21 21 22 optFile = 'auto' … … 81 82 x, zl, zu, obj = nlp.solve(p.x0) 82 83 83 nlp.close() 84 84 85 p.istop = 1000 85 86 p.iterfcn(x, obj) 87 nlp.close() 86 88 87 89
