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
449a0279
Commit
449a0279
authored
Apr 23, 2018
by
Martin Reinecke
Browse files
fixes
parent
329b16b8
Pipeline
#27867
passed with stages
in 14 minutes and 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty4/library/krylov_sampling.py
View file @
449a0279
...
...
@@ -53,6 +53,7 @@ def generate_krylov_samples(D_inv, S, j, N_samps, controller):
D_inv(x) = j
and the second entry are a list of samples from D_inv.inverse
"""
# MR FIXME: this should be synchronized with the "official" Nifty CG
j
=
S
.
draw_sample
(
from_inverse
=
True
)
if
j
is
None
else
j
x
=
Field
.
full
(
D_inv
.
domain
,
0.
)
energy
=
QuadraticEnergy
(
x
,
D_inv
,
j
)
...
...
@@ -65,7 +66,6 @@ def generate_krylov_samples(D_inv, S, j, N_samps, controller):
r
=
j
.
copy
()
p
=
r
.
copy
()
d
=
p
.
vdot
(
D_inv
(
p
))
y
=
[
S
.
draw_sample
()
for
_
in
range
(
N_samps
)]
while
True
:
gamma
=
r
.
vdot
(
r
)
/
d
if
gamma
==
0.
:
...
...
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