Commit 7ecdbcec authored by Martin Reinecke's avatar Martin Reinecke
Browse files

more printing

parent cbd6cbcc
......@@ -24,6 +24,7 @@ from ..compat import *
from ..domain_tuple import DomainTuple
from ..sugar import full
from .endomorphic_operator import EndomorphicOperator
from .. import utilities
class ScalingOperator(EndomorphicOperator):
......@@ -94,3 +95,7 @@ class ScalingOperator(EndomorphicOperator):
from ..sugar import from_random
return from_random(random_type="normal", domain=self._domain,
std=self._get_fct(from_inverse), dtype=dtype)
def __repr__(self):
subs = utilities.indent(self._domain.__repr__())
return "ScalingOperator:\n Factor={}\n".format(self._factor) + subs
......@@ -21,7 +21,7 @@ from __future__ import absolute_import, division, print_function
import numpy as np
from ..compat import *
from ..utilities import my_sum
from ..utilities import my_sum, indent
from .linear_operator import LinearOperator
from .scaling_operator import ScalingOperator
from .diagonal_operator import DiagonalOperator
......@@ -196,3 +196,7 @@ class SumOperator(LinearOperator):
tmp = op.draw_sample(from_inverse, dtype)
res = tmp if res is None else res.unite(tmp)
return res
def __repr__(self):
subs = "\n".join(sub.__repr__() for sub in self._ops)
return "SumOperator:\n"+indent(subs)
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