This commit is contained in:
Martin Diehl 2019-09-11 18:54:26 -07:00
parent 953ba53211
commit de313269d9
1 changed files with 11 additions and 3 deletions

View File

@ -235,14 +235,22 @@ class DADF5():
def add_norm(self,x,ord=None): def add_norm(self,x,ord=None):
"""Adds norm of vector or tensor or magnitude of a scalar.""" """
# ToDo: The output unit should be the input unit Adds norm of vector or tensor or magnitude of a scalar.
Todo
----
The output unit should be the input unit.
The ord parameter should be taken into account.
The whole thing should be vectorized. This requires to parse optional arguments to func.
"""
args = [{'label':x,'shape':None,'unit':None}] args = [{'label':x,'shape':None,'unit':None}]
result = {'label':'norm_{}({})'.format(str(ord),x), result = {'label':'norm_{}({})'.format(str(ord),x),
'unit':'n/a', 'unit':'n/a',
'Description': 'Norm of vector or tensor or magnitude of a scalar. See numpy.linalg.norm manual for details'} 'Description': 'Norm of vector or tensor or magnitude of a scalar. See numpy.linalg.norm manual for details'}
self.add_generic_pointwise_vectorized(np.linalg.norm,args,result) self.add_generic_pointwise(np.linalg.norm,args,result)
def add_determinant(self,a): def add_determinant(self,a):