Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
7ecdbcec
Commit
7ecdbcec
authored
Aug 12, 2018
by
Martin Reinecke
Browse files
more printing
parent
cbd6cbcc
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/scaling_operator.py
View file @
7ecdbcec
...
...
@@ -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
nifty5/operators/sum_operator.py
View file @
7ecdbcec
...
...
@@ -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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment