Commit 9483e218 authored by Jakob Knollmueller's avatar Jakob Knollmueller
Browse files

derivative for clip added

parent 37f9b9b6
......@@ -7,6 +7,7 @@ from .compat import *
from .field import Field
from .multi_field import MultiField
from .sugar import makeOp
from .operators.scaling_operator import ScalingOperator
class Linearization(object):
......@@ -189,7 +190,14 @@ class Linearization(object):
def clip(self, min=None, max=None):
tmp = self._val.clip(min, max)
tmp2 = makeOp(1.-(tmp == eps))
if (min is None) and (max is None):
tmp2 = ScalingOperator(1,self._val.domain)
elif max is None:
tmp2 = makeOp(1. - (tmp == min))
elif min is None:
tmp2 = makeOp(1. - (tmp == max))
tmp2 = makeOp(1. - (tmp == min) - (tmp == max))
return, tmp2(self._jac))
def sin(self):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment