/[escript]/trunk/escript/py_src/util.py
ViewVC logotype

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

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

revision 399 by gross, Wed Dec 21 05:11:31 2005 UTC revision 400 by gross, Wed Dec 21 23:13:39 2005 UTC
# Line 912  def wherePositive(arg): Line 912  def wherePositive(arg):
912     @raises TypeError: if the type of the argument is not expected.     @raises TypeError: if the type of the argument is not expected.
913     """     """
914     if isinstance(arg,numarray.NumArray):     if isinstance(arg,numarray.NumArray):
915        out=numarray.greater(arg,numarray.zeros(arg.shape,numarray.Float))        out=numarray.greater(arg,numarray.zeros(arg.shape,numarray.Float))*1.
916        if isinstance(out,float): out=numarray.array(out)        if isinstance(out,float): out=numarray.array(out)
917        return out        return out
918     elif isinstance(arg,escript.Data):     elif isinstance(arg,escript.Data):
# Line 994  def whereNegative(arg): Line 994  def whereNegative(arg):
994     @raises TypeError: if the type of the argument is not expected.     @raises TypeError: if the type of the argument is not expected.
995     """     """
996     if isinstance(arg,numarray.NumArray):     if isinstance(arg,numarray.NumArray):
997        out=numarray.less(arg,numarray.zeros(arg.shape,numarray.Float))        out=numarray.less(arg,numarray.zeros(arg.shape,numarray.Float))*1.
998        if isinstance(out,float): out=numarray.array(out)        if isinstance(out,float): out=numarray.array(out)
999        return out        return out
1000     elif isinstance(arg,escript.Data):     elif isinstance(arg,escript.Data):
# Line 1076  def whereNonNegative(arg): Line 1076  def whereNonNegative(arg):
1076     @raises TypeError: if the type of the argument is not expected.     @raises TypeError: if the type of the argument is not expected.
1077     """     """
1078     if isinstance(arg,numarray.NumArray):     if isinstance(arg,numarray.NumArray):
1079        out=numarray.greater_equal(arg,numarray.zeros(arg.shape,numarray.Float))        out=numarray.greater_equal(arg,numarray.zeros(arg.shape,numarray.Float))*1.
1080        if isinstance(out,float): out=numarray.array(out)        if isinstance(out,float): out=numarray.array(out)
1081        return out        return out
1082     elif isinstance(arg,escript.Data):     elif isinstance(arg,escript.Data):

Legend:
Removed from v.399  
changed lines
  Added in v.400

  ViewVC Help
Powered by ViewVC 1.1.26