adding kernels flattening and parameters already in hierarchy

This commit is contained in:
Max Zwiessele 2014-03-18 17:41:08 +00:00
parent 9c553ba15c
commit 6637eb7ac8
11 changed files with 624 additions and 9 deletions

View file

@ -140,12 +140,7 @@ class Kern(Parameterized):
"""
assert isinstance(other, Kern), "only kernels can be added to kernels..."
from add import Add
kernels = []
if isinstance(self, Add): kernels.extend(self._parameters_)
else: kernels.append(self)
if isinstance(other, Add): kernels.extend(other._parameters_)
else: kernels.append(other)
return Add(kernels, name=name)
return Add([self, other], name=name)
def __mul__(self, other):
""" Here we overload the '*' operator. See self.prod for more information"""