Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MRIBuilder.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michiel Cottaar
MRIBuilder.jl
Commits
56f55f50
Verified
Commit
56f55f50
authored
1 year ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
new_time does not have to be a number
parent
e35e2ca0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pathways.jl
+4
-5
4 additions, 5 deletions
src/pathways.jl
with
4 additions
and
5 deletions
src/pathways.jl
+
4
−
5
View file @
56f55f50
...
@@ -315,9 +315,8 @@ If that gradient tracker does not exist, it will be created.
...
@@ -315,9 +315,8 @@ If that gradient tracker does not exist, it will be created.
This function is used to get the `walker` up to date till the start of a gradient, pulse, or final readout.
This function is used to get the `walker` up to date till the start of a gradient, pulse, or final readout.
"""
"""
function
update_walker_till_time!
(
walker
::
PathwayWalker
,
new_time
::
Float64
,
gradient_key
=
nothing
)
function
update_walker_till_time!
(
walker
::
PathwayWalker
,
new_time
::
VariableType
,
gradient_key
=
nothing
)
# update duration state and pulse time
# update duration state and pulse time
@assert
new_time
>=
walker
.
last_pulse_time
index
=
duration_state_index
(
walker
.
is_transverse
,
walker
.
is_positive
)
index
=
duration_state_index
(
walker
.
is_transverse
,
walker
.
is_positive
)
walker
.
duration_states
[
index
]
=
walker
.
duration_states
[
index
]
+
(
new_time
-
walker
.
last_pulse_time
)
walker
.
duration_states
[
index
]
=
walker
.
duration_states
[
index
]
+
(
new_time
-
walker
.
last_pulse_time
)
walker
.
last_pulse_time
=
new_time
walker
.
last_pulse_time
=
new_time
...
@@ -341,15 +340,14 @@ The `bmat` is updated with the outer produce of `qvec` with itself multiplied by
...
@@ -341,15 +340,14 @@ The `bmat` is updated with the outer produce of `qvec` with itself multiplied by
When called with the first signature the tracker will be created from scratch if a tracker with that `key` does not exist.
When called with the first signature the tracker will be created from scratch if a tracker with that `key` does not exist.
"""
"""
function
update_gradient_tracker_till_time!
(
walker
::
PathwayWalker
,
key
::
Tuple
,
new_time
::
Float64
)
function
update_gradient_tracker_till_time!
(
walker
::
PathwayWalker
,
key
::
Tuple
,
new_time
::
VariableType
)
if
key
in
keys
(
walker
.
gradient_trackers
)
if
key
in
keys
(
walker
.
gradient_trackers
)
walker
.
gradient_trackers
[
key
]
=
GradientTracker
()
walker
.
gradient_trackers
[
key
]
=
GradientTracker
()
end
end
update_gradient_tracker_till_time!
(
walker
.
gradient_trackers
[
key
],
new_time
)
update_gradient_tracker_till_time!
(
walker
.
gradient_trackers
[
key
],
new_time
)
end
end
function
update_gradient_tracker_till_time!
(
gradient_tracker
::
GradientTracker
,
new_time
::
Float64
)
function
update_gradient_tracker_till_time!
(
gradient_tracker
::
GradientTracker
,
new_time
::
VariableType
)
@assert
new_time
>=
gradient_tracker
.
last_gradient_time
gradient_tracker
.
bmat
+=
(
gradient_tracker
.
bmat
+=
(
(
gradient_tracker
.
qvec
.*
gradient_tracker
.
qvec
'
)
.*
(
gradient_tracker
.
qvec
.*
gradient_tracker
.
qvec
'
)
.*
(
pulse_time
-
gradient_tracker
.
last_gradient_time
)
(
pulse_time
-
gradient_tracker
.
last_gradient_time
)
...
@@ -383,6 +381,7 @@ function update_walker_pulse!(walker::PathwayWalker, pulse_effects::AbstractVect
...
@@ -383,6 +381,7 @@ function update_walker_pulse!(walker::PathwayWalker, pulse_effects::AbstractVect
update_walker_till_time!
(
walker
,
pulse_time
)
update_walker_till_time!
(
walker
,
pulse_time
)
prev_sign
=
walker
.
is_positive
# -transverse, +longitudinal, +transverse, -longitudinal, -transverse, +longitudinal
# -transverse, +longitudinal, +transverse, -longitudinal, -transverse, +longitudinal
ordering
=
[(
true
,
false
),
(
false
,
true
),
(
true
,
true
),
(
false
,
false
),
(
true
,
false
)]
ordering
=
[(
true
,
false
),
(
false
,
true
),
(
true
,
true
),
(
false
,
false
),
(
true
,
false
)]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment