Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bentriou Mahmoud
MarkovProcesses.jl
Commits
8c673bae
Commit
8c673bae
authored
Feb 16, 2021
by
Bentriou Mahmoud
Browse files
small change to small improvement of performance in lha
parent
29d43eec
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/lha.jl
View file @
8c673bae
...
...
@@ -213,13 +213,16 @@ function next_state!(Snplus1::StateLHA, A::LHA,
println
(
"Time flies with the flow..."
)
end
# Now time flies according to the flow
for
i
in
eachindex
(
Snplus1
.
values
)
coeff_deriv
=
(
A
.
flow
[
Snplus1
.
loc
])[
i
]
values_Snplus1
=
getfield
(
Snplus1
,
:
values
)
time_Snplus1
=
getfield
(
Snplus1
,
:
time
)
current_loc
=
getfield
(
Snplus1
,
:
loc
)
for
i
in
eachindex
(
values_Snplus1
)
@inbounds
coeff_deriv
=
(
getfield
(
A
,
:
flow
)[
current_loc
])[
i
]
if
coeff_deriv
>
0
Snplus1
.
values
[
i
]
+=
coeff_deriv
*
(
tnplus1
-
Snplus1
.
time
)
@inbounds
values_
Snplus1
[
i
]
+=
coeff_deriv
*
(
tnplus1
-
time_
Snplus1
)
end
end
Snplus1
.
time
=
tnplus1
setfield!
(
Snplus1
,
:
time
,
tnplus1
)
if
verbose
@show
Snplus1
end
...
...
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