Skip to content
GitLab
Menu
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
3028acad
Commit
3028acad
authored
Jul 20, 2019
by
Philipp Arras
Browse files
Add type checks to InversionEnabler
parent
13b65502
Pipeline
#52196
passed with stages
in 8 minutes and 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/inversion_enabler.py
View file @
3028acad
...
...
@@ -23,6 +23,7 @@ from ..minimization.iteration_controllers import IterationController
from
..minimization.quadratic_energy
import
QuadraticEnergy
from
..sugar
import
full
from
.endomorphic_operator
import
EndomorphicOperator
from
.linear_operator
import
LinearOperator
class
InversionEnabler
(
EndomorphicOperator
):
...
...
@@ -47,6 +48,10 @@ class InversionEnabler(EndomorphicOperator):
"""
def
__init__
(
self
,
op
,
iteration_controller
,
approximation
=
None
):
if
not
isinstance
(
op
,
LinearOperator
):
raise
TypeError
(
'Operator needs to be linear.'
)
if
op
.
domain
is
not
op
.
target
:
raise
TypeError
(
'Operator needs to be endomorphic.'
)
self
.
_op
=
op
self
.
_ic
=
iteration_controller
self
.
_approximation
=
approximation
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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