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
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
ift
NIFTy
Commits
ad129166
Commit
ad129166
authored
Apr 01, 2018
by
Martin Reinecke
Browse files
rename 'preconditioner' to 'approximantion'
parent
add893a1
Pipeline
#26706
passed with stage
in 8 minutes and 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty4/operators/inversion_enabler.py
View file @
ad129166
...
...
@@ -38,16 +38,18 @@ class InversionEnabler(LinearOperator):
inverter : :class:`Minimizer`
The minimizer to use for the iterative numerical inversion.
Typically, this is a :class:`ConjugateGradient` object.
preconditioner : :class:`LinearOperator`, optional
if not None, this operator is used as a preconditioner during the
iterative inversion, to accelerate convergence.
approximation : :class:`LinearOperator`, optional
if not None, this operator should be an approximation to `op`, which
supports the operation modes that `op` doesn't have. It is used as a
preconditioner during the iterative inversion, to accelerate
convergence.
"""
def
__init__
(
self
,
op
,
inverter
,
precondi
tion
er
=
None
):
def
__init__
(
self
,
op
,
inverter
,
approxima
tion
=
None
):
super
(
InversionEnabler
,
self
).
__init__
()
self
.
_op
=
op
self
.
_inverter
=
inverter
self
.
_
precondi
tion
er
=
precondi
tion
er
self
.
_
approxima
tion
=
approxima
tion
@
property
def
domain
(
self
):
...
...
@@ -69,7 +71,7 @@ class InversionEnabler(LinearOperator):
x0
=
Field
.
zeros
(
self
.
_tgt
(
mode
),
dtype
=
x
.
dtype
)
invmode
=
self
.
_modeTable
[
self
.
INVERSE_BIT
][
self
.
_ilog
[
mode
]]
invop
=
self
.
_op
.
_flip_modes
(
self
.
_ilog
[
invmode
])
prec
=
self
.
_
precondi
tion
er
prec
=
self
.
_
approxima
tion
if
prec
is
not
None
:
prec
=
prec
.
_flip_modes
(
self
.
_ilog
[
mode
])
energy
=
QuadraticEnergy
(
A
=
invop
,
b
=
x
,
position
=
x0
)
...
...
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