# Diff of /trunk/escript/test/python/BinaryOps.py

revision 555 by jgs, Tue Feb 21 01:24:05 2006 UTC revision 556 by jgs, Wed Feb 22 04:45:15 2006 UTC
# Line 26  tol=1.E-15 Line 26  tol=1.E-15
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
# Line 41  tol=1.E-15 Line 41  tol=1.E-15
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] ], \
# Line 125  for wh in [ContinuousFunction(msh),Funct Line 125  for wh in [ContinuousFunction(msh),Funct
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
# Line 154  for wh in [ContinuousFunction(msh),Funct Line 152  for wh in [ContinuousFunction(msh),Funct
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

Legend:
 Removed from v.555 changed lines Added in v.556