Changeset 084afb4 in sasview
- Timestamp:
- Apr 4, 2014 5:16:11 PM (11 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- da5d8e8
- Parents:
- c5442fb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
park-1.2.1/park/fitmc.py
r3570545 r084afb4 147 147 See `park.fitresult.FitHandler` for details. 148 148 """ 149 # Generate random number within bounds. If bounds are indefinite, use [0,1] 150 # If bounds are semi-definite, use [low,low+1] or [high-1,high], depending 151 # on which limit is unbounded. 149 152 lo,hi = bounds 153 inf_lo = numpy.isinf(lo) 154 inf_hi = numpy.isinf(hi) 150 155 delta = hi-lo 151 delta[ numpy.isinf(delta)] = 1152 lo[ numpy.isinf(lo)] = hi-1153 lo[ numpy.isinf(lo)] =0156 delta[inf_lo|inf_hi] = 1.0 157 lo[inf_lo] = hi[inf_lo] - 1.0 158 lo[inf_lo&inf_hi] = 0.0 154 159 P = numpy.random.rand(n,len(x0))*delta+lo 155 160 #print "Population",P 156 161 P[0] = x0 162 157 163 pmap.pmapreduce(MapMC(localfit,fitness), 158 164 CollectMC(n,handler),
Note: See TracChangeset
for help on using the changeset viewer.