Changeset 688
- Timestamp:
- 06/15/13 19:36:31 (3 years ago)
- Files:
-
- 2 deleted
- 2 edited
- 44 copied
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/collapse/TEST_OUQ_surrogate_diam_collapse.py
r687 r688 191 191 c = product_measure() 192 192 c.load(solved,npts) 193 print "solved: [wx,x]\n%s" % array(zip(c[0].weights,c[0]. coords))194 print "solved: [wy,y]\n%s" % array(zip(c[1].weights,c[1]. coords))195 print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2]. coords))193 print "solved: [wx,x]\n%s" % array(zip(c[0].weights,c[0].positions)) 194 print "solved: [wy,y]\n%s" % array(zip(c[1].weights,c[1].positions)) 195 print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2].positions)) 196 196 197 197 print "expect: %s" % str( c.expect(model) ) -
mystic/examples_OUQ/TEST4d_OUQ_surrogate_diam.py
r687 r688 241 241 c = product_measure() 242 242 c.load(solved,npts) 243 print "solved: [wx,x]\n%s" % array(zip(c[0].weights,c[0]. coords))244 print "solved: [wy,y]\n%s" % array(zip(c[1].weights,c[1]. coords))245 print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2]. coords))243 print "solved: [wx,x]\n%s" % array(zip(c[0].weights,c[0].positions)) 244 print "solved: [wy,y]\n%s" % array(zip(c[1].weights,c[1].positions)) 245 print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2].positions)) 246 246 247 247 # XXX: 4D-expect -
mystic/examples_OUQ/TEST_OUQ_surrogate_diam.py
r687 r688 193 193 c = product_measure() 194 194 c.load(solved,npts) 195 print "solved: [wx,x]\n%s" % array(zip(c[0].weights,c[0]. coords))196 print "solved: [wy,y]\n%s" % array(zip(c[1].weights,c[1]. coords))197 print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2]. coords))195 print "solved: [wx,x]\n%s" % array(zip(c[0].weights,c[0].positions)) 196 print "solved: [wy,y]\n%s" % array(zip(c[1].weights,c[1].positions)) 197 print "solved: [wz,z]\n%s" % array(zip(c[2].weights,c[2].positions)) 198 198 199 199 print "expect: %s" % str( c.expect(model) ) -
mystic/tests/test_dirac_measure.py
r687 r688 27 27 coordinates = samplepts(lower_bounds, upper_bounds, npts) 28 28 D = [i[0] for i in coordinates] 29 print " coords: %s" % D29 print "positions: %s" % D 30 30 31 31 # calculate sample range … … 51 51 # ------------------------------------- 52 52 # get new random distribution 53 print "modify coords, maintaining mean and range"53 print "modify positions, maintaining mean and range" 54 54 coordinates = samplepts(lower_bounds, upper_bounds, npts) 55 55 D = [i[0] for i in coordinates] … … 60 60 61 61 # print results 62 print " coords: %s" % D62 print "positions: %s" % D 63 63 R = spread(D) 64 64 print "range: %s" % R … … 88 88 w = norm(weights) 89 89 print "norm: %s" % w 90 print " coords: %s" % DD90 print "positions: %s" % DD 91 91 R = spread(DD) 92 92 print "range: %s" % R … … 188 188 # build a collection 189 189 c = collection([sx,sy,sz]) 190 print "x_ coords: %s" % c[0].coords191 print "y_ coords: %s" % c[1].coords192 print "z_ coords: %s" % c[2].coords190 print "x_positions: %s" % c[0].positions 191 print "y_positions: %s" % c[1].positions 192 print "z_positions: %s" % c[2].positions 193 193 print "x_weights: %s" % c[0].weights 194 194 print "y_weights: %s" % c[1].weights … … 198 198 print "npts: %s (i.e. %s)" % (c.npts, c.pts) 199 199 print "weights: %s" % c.weights 200 coords = c.coords201 print " coords: %s" % coords200 positions = c.positions 201 print "positions: %s" % positions 202 202 203 203 print "mass: %s" % c.mass … … 207 207 #print "delta: %s" % c.delta 208 208 209 # change the coords in the collection210 coords[::3]211 points = [ list(i) for i in coords[::3] ]209 # change the positions in the collection 210 positions[::3] 211 points = [ list(i) for i in positions[::3] ] 212 212 for i in range(len(points)): 213 213 points[i][0] = 0.5 214 214 215 coords[::3] = points216 c. coords = coords217 print "x_ coords: %s" % c[0].coords218 print "y_ coords: %s" % c[1].coords219 print "z_ coords: %s" % c[2].coords215 positions[::3] = points 216 c.positions = positions 217 print "x_positions: %s" % c[0].positions 218 print "y_positions: %s" % c[1].positions 219 print "z_positions: %s" % c[2].positions 220 220 print "expect: %s" % c.expect(f) 221 221 … … 252 252 assert c.npts == d.npts 253 253 assert c.weights == d.weights 254 assert c. coords == d.coords254 assert c.positions == d.positions 255 255 256 256 # flatten() and load(...) … … 261 261 assert c.npts == e.npts 262 262 assert c.weights == e.weights 263 assert c. coords == e.coords263 assert c.positions == e.positions 264 264 265 265 # decompose and compose … … 270 270 assert c.npts == b.npts 271 271 assert c.weights == b.weights 272 assert c. coords == b.coords272 assert c.positions == b.positions 273 273 return 274 274
Note: See TracChangeset
for help on using the changeset viewer.