# Diff of /trunk/escript/py_src/util.py

revision 2255 by gross, Mon Feb 9 06:10:13 2009 UTC revision 2259 by jfenwick, Tue Feb 10 01:49:44 2009 UTC
# Line 4653  def maximum(*args): Line 4653  def maximum(*args):
4653            out=a*1.            out=a*1.
4654         else:         else:
4655            if isinstance(out,escript.Data) and isinstance(a,escript.Data):            if isinstance(out,escript.Data) and isinstance(a,escript.Data):
4656               out.copyWithMask(a,wherePositive(a-out))           if out.getRank()==0 and a.getRank()>0:
4657            #We need to consider the case where we have scalars and higher
4658            #ranked objects mixed. If the scalar was first it will get
4659            #picked as the initial out and we have a problem,
4660            #so we swap the objects
4661            res=a.copy()    #Deep copy of a
4663            out=res
4664             else:
4666            else:            else:
# Line 4677  def minimum(*args): Line 4686  def minimum(*args):
4686            out=a*1.            out=a*1.
4687         else:         else:
4688            if isinstance(out,escript.Data) and isinstance(a,escript.Data):            if isinstance(out,escript.Data) and isinstance(a,escript.Data):
4689               out.copyWithMask(a,whereNegative(a-out))           if out.getRank()==0 and a.getRank()>0:
4690            #We need to consider the case where we have scalars and higher
4691            #ranked objects mixed. If the scalar was first it will get
4692            #picked as the initial out and we have a problem,
4693            #so we swap the objects
4694            res=a.copy()    #Deep copy of a