[SciPy-user] Generating tuples and lists connected with
optimize.fmin_l_bfgs_b(func, guess, bounds=bounds, iprint=-1)
nwagner at mecha.uni-stuttgart.de
Fri Jul 1 02:14:01 CDT 2005
Nils Wagner wrote:
> Hi all,
> Sorry for this inquiry but how can I initialize the list "bounds" and
> the tuple "guess" more efficiently ?
> The entries in bounds are identical for each design variable, while
> the initial guess consists of two different values.
> So how can I benefit from this pattern in building "bounds" and
> "guess" for 2n design variables ?
> bounds = [(0.0,2.0), (0.0,2.0), (0.0,2.0), (0.0,2.0), (0.0,2.0),
> guess = 2.0,2.0,2.0,1.0,1.0,1.0
> A small example would be appreciated.
> Thanks in advance
> SciPy-user mailing list
> SciPy-user at scipy.net
Is there a better way for building bounds ?
for i in arange(0,2*n):
bounds = bounds + [(0.0,2.0)]
More information about the SciPy-user