Changeset 588 for branches


Ignore:
Timestamp:
11/07/12 22:10:17 (4 years ago)
Author:
mmckerns
Message:

allow hausdorff normalization of y

Location:
branches/UQ/math
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/UQ/math/legacy/TEST_OUQ_1dSurr_CxCy.py

    r586 r588  
    190190  Cy = 0.1           #NOTE: SET THE 'cutoff' HERE! 
    191191  Cx = (2.0,0.0,0.0) #NOTE: SET THE 'wiggle' HERE! 
    192   hausdorff = (1.0,0.0,0.0) #NOTE: SET THE 'hausdorff normalization' HERE! 
     192  hausdorff = (1.0,0.0,0.0,1.0) #NOTE: SET THE 'hausdorff normalization' HERE! 
    193193  valid_tol = 0.0  #NOTE: SET THE 'model tolerance' HERE! 
    194194  imax_c = 200     #NOTE: SET THE 'max iterations to check valid' HERE! 
  • branches/UQ/math/legacy/test_graph_dist.py

    r585 r588  
    4141# calculate hausdorff distances 
    4242Cy = 0.0; Cx = 0.0  # enforce x = x' 
    43 hausdorff = (1.0, 1.0, 1.0) 
     43hausdorff = (1.0, 1.0, 1.0, 1.0) 
    4444print "dH(Cy=0.0,Cx=0.0):", graphical_distance(model, d, ytol=Cy, xtol=Cx, ipop=ipop, imax=imax, hausdorff=hausdorff) 
    4545""" 
     
    5151print "dH(Cy=0.0,Cx=0.6,norm=True):", graphical_distance(model, d, ytol=Cy, xtol=Cx, ipop=ipop, imax=imax, hausdorff=hausdorff) 
    5252""" 
    53 dH(Cy=0.0,Cx=0.6,norm=True): [ 0.  1.  2.  0.  0.  2.  1.  1.65 
     53dH(Cy=0.0,Cx=0.6,norm=True): [ 0.   0.2  0.4  0.   0.   0.4  1.   1. ] 
    5454""" 
    5555 
     
    6262 
    6363Cy = 0.0; Cx = 0.6  # allow x != x' 
    64 hausdorff = (1.0, 1.0, 1.0) # normalization given in each direction 
    65 print "dH(Cy=0.0,Cx=0.6,norm=[1.0,1.0,1.0]):", graphical_distance(model, d, ytol=Cy, xtol=Cx, ipop=ipop, imax=imax, hausdorff=hausdorff) 
     64hausdorff = (1.0, 1.0, 1.0, 1.0) # normalization given in each direction 
     65print "dH(Cy=0.0,Cx=0.6,norm=[1.0,1.0,1.0,1.0]):", graphical_distance(model, d, ytol=Cy, xtol=Cx, ipop=ipop, imax=imax, hausdorff=hausdorff) 
    6666""" 
    67 dH(Cy=0.0,Cx=0.6,norm=[1.0,1.0,1.0]): [ 0.  1.  2.  0.  0.  2.  0.5  0.9] 
     67dH(Cy=0.0,Cx=0.6,norm=[1.0,1.0,1.0,1.0]): [ 0.  1.  2.  0.  0.  2.  0.5  0.9] 
    6868""" 
    6969 
  • branches/UQ/math/sausage/TEST_OUQ_1dSurr_diam.py

    r575 r588  
    9292  # generate primary constraints function 
    9393  def constraints(rv): 
    94     ## bounds 
    95     rv = [max(rv[i], lb[i]) for i in range(len(rv))] 
    96     rv = [min(rv[i], ub[i]) for i in range(len(rv))] 
     94    rrv = range(len(rv)) 
     95    # impose range constraints: first try bounce-back to maintain randomness 
     96    rv = [2*lb[i]-rv[i] if max(rv[i], lb[i]) == lb[i] else rv[i] for i in rrv] 
     97    rv = [2*ub[i]-rv[i] if min(rv[i], ub[i]) == ub[i] else rv[i] for i in rrv] 
     98    # if bounceback fails, then use a hard cutoff  #FIXME: breaks randomness 
     99    rv = [max(rv[i], lb[i]) for i in rrv] 
     100    rv = [min(rv[i], ub[i]) for i in rrv] 
    97101 
    98102    c = scenario() 
  • branches/UQ/math/sausage/TEST_OUQ_StStSurr.py

    r575 r588  
    9191  # generate primary constraints function 
    9292  def constraints(rv): 
    93     ## bounds 
    94     rv = [max(rv[i], lb[i]) for i in range(len(rv))] 
    95     rv = [min(rv[i], ub[i]) for i in range(len(rv))] 
     93    rrv = range(len(rv)) 
     94    # impose range constraints: first try bounce-back to maintain randomness 
     95    rv = [2*lb[i]-rv[i] if max(rv[i], lb[i]) == lb[i] else rv[i] for i in rrv] 
     96    rv = [2*ub[i]-rv[i] if min(rv[i], ub[i]) == ub[i] else rv[i] for i in rrv] 
     97    # if bounceback fails, then use a hard cutoff  #FIXME: breaks randomness 
     98    rv = [max(rv[i], lb[i]) for i in rrv] 
     99    rv = [min(rv[i], ub[i]) for i in rrv] 
    96100 
    97101    c = scenario() 
Note: See TracChangeset for help on using the changeset viewer.