- Timestamp:
- 10/16/12 14:38:03 (4 years ago)
- Location:
- branches/decorate
- Files:
-
- 1 added
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/decorate/wrapper.py
r550 r580 9 9 """ 10 10 def dec(f): 11 def func(*args, **kwds): 11 def func(*args, **kwds): #FIXME: doesn't preserve function signature 12 12 return f(inner(*args, **kwds)) 13 13 return func … … 98 98 The resulting function is: f'(x) = scale * f(x) + shift * mixin(x). 99 99 If normalized, then f' = f' / (scale + shift)""" 100 norm = 1.0101 100 def dec(f): 102 101 def func(*args, **kwds): 102 norm = 1.0 103 103 if normalized: norm = scale + shift 104 104 return (scale * f(*args, **kwds) + shift * mixin(*args, **kwds)) / norm
Note: See TracChangeset
for help on using the changeset viewer.