/[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 116 by jgs, Mon Feb 28 07:06:33 2005 UTC revision 117 by jgs, Fri Apr 1 05:48:57 2005 UTC
# Line 392  def Lsup(arg): Line 392  def Lsup(arg):
392      else:      else:
393         return max(numarray.abs(arg))         return max(numarray.abs(arg))
394    
395    def Linf(arg):
396        """
397        @brief
398    
399        @param arg
400        """
401        if isinstance(arg,escript.Data):
402           return arg.Linf()
403        elif isinstance(arg,float) or isinstance(arg,int):
404           return abs(arg)
405        else:
406           return min(numarray.abs(arg))
407    
408  def dot(arg1,arg2):  def dot(arg1,arg2):
409      """      """
410      @brief      @brief
# Line 407  def dot(arg1,arg2): Line 420  def dot(arg1,arg2):
420    
421  def kronecker(d):  def kronecker(d):
422     return numarray.identity(d)     return numarray.identity(d)
423    
424    def unit(i,d):
425       """
426       @brief return a unit vector of dimension d with nonzero index i
427       @param d dimension
428       @param i index
429       """
430       e = numarray.zeros((d,))
431       e[i] = 1.0
432       return e

Legend:
Removed from v.116  
changed lines
  Added in v.117

  ViewVC Help
Powered by ViewVC 1.1.26