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

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

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

revision 97 by jgs, Tue Dec 14 05:39:33 2004 UTC revision 104 by jgs, Fri Dec 17 07:43:12 2004 UTC
# Line 196  def length(arg): Line 196  def length(arg):
196      @param arg      @param arg
197      """      """
198      if isinstance(arg,escript.Data):      if isinstance(arg,escript.Data):
199         return arg.length()         if arg.getRank()==1:
200              sum=escript.Scalar(0,arg.getFunctionSpace())
201              for i in range(arg.getShape()[0]):
202                 sum+=arg[i]**2
203              return sqrt(sum)
204           else:
205              raise SystemError,"length is not been implemented yet"
206           # return arg.length()
207      else:      else:
208         return sqrt((arg**2).sum())         return sqrt((arg**2).sum())
209    
# Line 276  def dot(arg1,arg2): Line 283  def dot(arg1,arg2):
283         return numarray.dot(arg1,arg2)         return numarray.dot(arg1,arg2)
284  #  #
285  # $Log$  # $Log$
286  # Revision 1.3  2004/12/14 05:39:26  jgs  # Revision 1.6  2004/12/17 07:43:10  jgs
287  # *** empty log message ***  # *** empty log message ***
288  #  #
289    # Revision 1.2.2.5  2004/12/17 00:06:53  gross
290    # mk sets ESYS_ROOT is undefined
291    #
292  # Revision 1.2.2.4  2004/12/07 03:19:51  gross  # Revision 1.2.2.4  2004/12/07 03:19:51  gross
293  # options for GMRES and PRES20 added  # options for GMRES and PRES20 added
294  #  #

Legend:
Removed from v.97  
changed lines
  Added in v.104

  ViewVC Help
Powered by ViewVC 1.1.26