26 |
# list of arguments: a list item has the form [a0,a1,a2] |
# list of arguments: a list item has the form [a0,a1,a2] |
27 |
# what a0 is the default value and a1 is used for tag Tag1 |
# what a0 is the default value and a1 is used for tag Tag1 |
28 |
# and a2 for tag2. a0,a1,a2 are converted into numarrays. |
# and a2 for tag2. a0,a1,a2 are converted into numarrays. |
29 |
# |
# |
30 |
# binary operations are tested on all pairs from arglist |
# binary operations are tested on all pairs from arglist |
31 |
# |
# |
32 |
# each item in the arglist are used to construct the following 5 argument |
# each item in the arglist are used to construct the following 5 argument |
41 |
# |
# |
42 |
# i.e for a single binary arithmetic operation (len(arglist)*5)**2 |
# i.e for a single binary arithmetic operation (len(arglist)*5)**2 |
43 |
# test are performed. |
# test are performed. |
44 |
# |
# |
45 |
|
|
46 |
arglist = [ \ |
arglist = [ \ |
47 |
[ [3,4], [-5,6.], [2,3] ], \ |
[ [3,4], [-5,6.], [2,3] ], \ |
125 |
|
|
126 |
print wh |
print wh |
127 |
|
|
128 |
#for ex1 in ["Array","Constant","Expanded","Tagged1","Tagged2"]: |
for ex1 in ["Array","Constant","Expanded","Tagged1","Tagged2"]: |
|
for ex1 in ["Constant","Expanded","Tagged1","Tagged2"]: |
|
129 |
|
|
130 |
#for ex2 in ["Array","Constant","Expanded","Tagged1","Tagged2"]: |
for ex2 in ["Array","Constant","Expanded","Tagged1","Tagged2"]: |
|
for ex2 in ["Constant","Expanded","Tagged1","Tagged2"]: |
|
131 |
|
|
132 |
if ex1=="Array" and ex2=="Array": |
if ex1=="Array" and ex2=="Array": |
133 |
continue |
continue |
152 |
else: |
else: |
153 |
t2="" |
t2="" |
154 |
|
|
155 |
# the shape must match or at least one argument is sclar: |
# the shape must match or at least one argument is scalar: |
156 |
if (getRank(arg1)==getRank(arg2)) or isScalar(arg1) or isScalar(arg2): |
if (getRank(arg1)==getRank(arg2)) or isScalar(arg1) or isScalar(arg2): |
157 |
|
|
158 |
# sum |
# sum |