Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/ein16/synth/d2/obj_ex.py
ViewVC logotype

Diff of /branches/ein16/synth/d2/obj_ex.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3997, Sun Jun 19 15:55:49 2016 UTC revision 3998, Sun Jun 19 17:12:03 2016 UTC
# Line 67  Line 67 
67      return rtn      return rtn
68    
69  #-------------- make list of type args  ----------------------  #-------------- make list of type args  ----------------------
70    # ps_..  list of unary args   [[a],[b],..]
71  # unary args  # unary args
72  ps_unu_all =        get_unu(l_all_F)  ps_unu_all =        get_unu(l_all_F)    # all fields
73  ex_probe = example(op_probe, ps_unu_all) # 0 probe  ps_unu_s =          get_unu(scalarFlds) # all scalar fields
74  ex_negation = example(op_negation,ps_unu_all) #1 negation  ps_unu_vec =        get_unu(vectorFlds) # all vector fields
75  # unary operators for all scalar fields  ps_unu_mat =        get_unu(matrixFlds) # all matrix fields
76  ps_unu_s =          get_unu(scalarFlds)  # unary operators
77  ex_gradient = example(op_gradient, ps_unu_s) #2 gradient  ex_probe = example(op_probe, ps_unu_all)            # probe
78  # unary operators for all vector fields  ex_negation = example(op_negation,ps_unu_all)       # negation
79  ps_unu_vec =        get_unu(vectorFlds)  ex_gradient = example(op_gradient, ps_unu_s)        # gradient
80  ex_divergence = example(op_divergence, ps_unu_vec)  #3 divergence  ex_divergence = example(op_divergence, ps_unu_vec)  # divergence
81  ex_curl =  example(op_curl, ps_unu_vec)  #4 curl  ex_curl =  example(op_curl, ps_unu_vec)             # curl
82  ex_jacobian = example(op_jacob, ps_unu_vec) #5 jacobian  ex_jacobian = example(op_jacob, ps_unu_vec)         # jacobian
83  #binary operators for the same field  ex_norm = example(op_norm, ps_unu_all)              # norm
84  ps_bin_add =         get_bin_same(l_all_F) # 6addition  ex_normalize = example(op_normalize, ps_unu_all)    # normalize
85  ex_add = example(op_add, ps_bin_add) #6     addition  ex_trace = example(op_trace, ps_unu_mat)            # trace
86  ex_subtract = example(op_subtract, ps_bin_add) #7 subtraction  ex_transpose = example(op_transpose, ps_unu_mat)    # tranpose
87  #binary operators between a vector field and higher order tensors with specific shape  ex_det = example(op_det, ps_unu_mat)            # det
88  ps_bin_vec_cross =  get_vF_n(1,1)  
89  ex_cross = example(op_cross, ps_bin_vec_cross) #8 cross product  # binary args
90    # makes sure one arg is a field and the other has the same shape
91    ps_bin_add = get_add()
92    #binary ops between a vector field and higher-order tensors with specific shape
93    ps_bin_vec_cross =  get_vF_n(1,1)           # cross product
94  ps_bin_vec_outer =  get_vF_n(1,2)           # outer product  ps_bin_vec_outer =  get_vF_n(1,2)           # outer product
 ex_outer = example(op_outer, ps_bin_vec_outer) #9  outer product  
95  ps_bin_vec_inner =  get_vF_n(1,3)           # inner product  ps_bin_vec_inner =  get_vF_n(1,3)           # inner product
96  ex_inner = example(op_inner, ps_bin_vec_inner) #10   inner product  ps_bin_sca_all =    get_mul()                  # one arg is a scalar
97  # binar operators, one arg is a scalar  ps_bin_sca_second = get_division()          # second arg is a scalar
98  ps_bin_sca_all = get_mul()  #binary opertaors
99    ex_add = example(op_add, ps_bin_add) #     addition
100    ex_subtract = example(op_subtract, ps_bin_add) # subtraction
101    ex_cross = example(op_cross, ps_bin_vec_cross) # cross product
102    ex_outer = example(op_outer, ps_bin_vec_outer) # outer product
103    ex_inner = example(op_inner, ps_bin_vec_inner) # inner product
104  ex_scale = example (op_scale, ps_bin_sca_all)   # scaling  ex_scale = example (op_scale, ps_bin_sca_all)   # scaling
105    ex_division= example (op_division, ps_bin_sca_second)   # 11 division
106    
107    # order of edxamples
108    exs_unary = [ex_probe, ex_negation, ex_gradient, ex_divergence, ex_curl, ex_jacobian, ex_norm, ex_normalize, ex_trace, ex_transpose, ex_det]
109    exs_binary = [ex_add, ex_subtract, ex_cross, ex_outer, ex_inner, ex_scale, ex_division]
110    
111  exs = [ex_probe, ex_negation, ex_gradient, ex_divergence, ex_curl, ex_jacobian, ex_add, ex_subtract, ex_cross, ex_outer, ex_inner, ex_scale]  exs = exs_unary+exs_binary
112    
113  # returns example object  # returns example object
114  def get_ex(opr_num):  def get_ex(opr_num):

Legend:
Removed from v.3997  
changed lines
  Added in v.3998

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0