Commit fb82805a authored by Martin Reinecke's avatar Martin Reinecke
Browse files

fix issue #242

parent f6d28ab7
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
import numpy as np import numpy as np
from .linear_operator import LinearOperator
from .diagonal_operator import DiagonalOperator from .diagonal_operator import DiagonalOperator
from .endomorphic_operator import EndomorphicOperator from .endomorphic_operator import EndomorphicOperator
from .scaling_operator import ScalingOperator from .scaling_operator import ScalingOperator
...@@ -46,6 +47,10 @@ class SandwichOperator(EndomorphicOperator): ...@@ -46,6 +47,10 @@ class SandwichOperator(EndomorphicOperator):
cheese: EndomorphicOperator cheese: EndomorphicOperator
the cheese part the cheese part
""" """
if not isinstance(bun, LinearOperator):
raise TypeError("bun must be a linear operator")
if cheese is not None and not isinstance(cheese, LinearOperator):
raise TypeError("cheese must be a linear operator")
if cheese is None: if cheese is None:
cheese = ScalingOperator(1., bun.target) cheese = ScalingOperator(1., bun.target)
op = bun.adjoint*bun op = bun.adjoint*bun
......
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