Commit 12439028 authored by Philipp Arras's avatar Philipp Arras
Browse files

Add SumOp back in

parent e3e42447
......@@ -152,16 +152,16 @@ class _OpProd(Operator):
return Linearization(lin1._val*lin2._val, op(x.jac))
# class _OpSum(_CombinedOperator):
# def __init__(self, ops, _callingfrommake=False):
# from ..sugar import domain_union
# super(_OpSum, self).__init__(ops, _callingfrommake)
# self._domain = domain_union([op.domain for op in self._ops])
# self._target = domain_union([op.target for op in self._ops])
#
# def apply(self, x):
# res = None
# for op in self._ops:
# tmp = op(x.extract(op.domain))
# res = tmp if res is None else res.unite(tmp)
# return res
class _OpSum(_CombinedOperator):
def __init__(self, ops, _callingfrommake=False):
from ..sugar import domain_union
super(_OpSum, self).__init__(ops, _callingfrommake)
self._domain = domain_union([op.domain for op in self._ops])
self._target = domain_union([op.target for op in self._ops])
def apply(self, x):
res = None
for op in self._ops:
tmp = op(x.extract(op.domain))
res = tmp if res is None else res.unite(tmp)
return res
Markdown is supported
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