- Timestamp:
- 10/07/14 15:29:24 (20 months ago)
- Location:
- mystic
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/_math/measures.py
r760 r763 380 380 w = float(sum(weights)) 381 381 if not w: #XXX: is this the best behavior? 382 from numpy import inf 382 from numpy import inf, nan 383 weights[weights == 0.0] = nan 383 384 return list(weights * inf) # protect against ZeroDivision 384 385 if float(mass) or not zsum: -
mystic/mystic/abstract_map_solver.py
r713 r763 41 41 >>> from pyina.launchers import Mpi as Pool 42 42 >>> NNODES = 4 43 >>> >npts = 2043 >>> npts = 20 44 44 >>> 45 45 >>> # instantiate and configure the solver 46 >>> from mystic.solvers import ScattershotSolver47 >>> solver = ScattershotSolver(len(lb), npts)46 >>> from mystic.solvers import BuckshotSolver 47 >>> solver = BuckshotSolver(len(lb), npts) 48 48 >>> solver.SetMapper(Pool(NNODES).map) 49 49 >>> solver.SetGenerationMonitor(stepmon) -
mystic/mystic/abstract_solver.py
r760 r763 77 77 78 78 import numpy 79 from numpy import inf, shape, asarray, absolute, asfarray 79 from numpy import inf, shape, asarray, absolute, asfarray, seterr 80 80 from mystic.tools import wrap_function, wrap_nested, wrap_reducer 81 81 from mystic.tools import wrap_bounds, wrap_penalty, reduced … … 341 341 hi = self._strictMax 342 342 # crop x0 at bounds 343 settings = numpy.seterr(all='ignore') 343 344 x0[x0<lo] = lo[x0<lo] 344 345 x0[x0>hi] = hi[x0>hi] 346 numpy.seterr(**settings) 345 347 return x0 346 348 -
mystic/mystic/scipy_optimize.py
r758 r763 119 119 val[bounded] = x0[bounded] + (hi[bounded]-lo[bounded])*radius 120 120 # crop val at bounds 121 settings = numpy.seterr(all='ignore') 121 122 val[val<lo] = lo[val<lo] 122 123 val[val>hi] = hi[val>hi] 124 numpy.seterr(**settings) 123 125 # handle collisions (when val[i] == x0[i]) 124 126 collision = val==x0
Note: See TracChangeset
for help on using the changeset viewer.