Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
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
Container registry
Model registry
Operate
Environments
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
Dynare
dynare
Commits
aca148e8
Verified
Commit
aca148e8
authored
1 year ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
Minor simplification
parent
ff2b8512
No related branches found
No related tags found
No related merge requests found
Pipeline
#9484
canceled
1 year ago
Stage: build
Stage: test
Stage: pkg
Stage: sign
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/perfect-foresight-models/solve_block_decomposed_problem.m
+30
-34
30 additions, 34 deletions
...perfect-foresight-models/solve_block_decomposed_problem.m
with
30 additions
and
34 deletions
matlab/perfect-foresight-models/solve_block_decomposed_problem.m
+
30
−
34
View file @
aca148e8
...
...
@@ -62,8 +62,8 @@ for blk = 1:nblocks
y_index
=
M_
.
block_structure
.
block
(
blk
)
.
variable
(
end
-
M_
.
block_structure
.
block
(
blk
)
.
mfs
+
1
:
end
);
fh_dynamic
=
str2func
(
sprintf
(
'%s.sparse.block.dynamic_%d'
,
M_
.
fname
,
blk
));
if
M_
.
block_structure
.
block
(
blk
)
.
Simulation_Type
==
1
||
...
% evaluateForward
M_
.
block_structure
.
block
(
blk
)
.
Simulation_Type
==
2
% evaluateBackward
switch
M_
.
block_structure
.
block
(
blk
)
.
Simulation_Type
case
{
1
,
2
}
% evaluate
{Forward,
Backward
}
if
M_
.
block_structure
.
block
(
blk
)
.
Simulation_Type
==
1
range
=
M_
.
maximum_lag
+
1
:
M_
.
maximum_lag
+
options_
.
periods
;
else
...
...
@@ -88,14 +88,10 @@ for blk = 1:nblocks
success
=
true
;
maxblkerror
=
0
;
iter
=
[];
elseif
M_
.
block_structure
.
block
(
blk
)
.
Simulation_Type
==
3
||
...
% solveForwardSimple
M_
.
block_structure
.
block
(
blk
)
.
Simulation_Type
==
4
||
...
% solveBackwardSimple
M_
.
block_structure
.
block
(
blk
)
.
Simulation_Type
==
6
||
...
% solveForwardComplete
M_
.
block_structure
.
block
(
blk
)
.
Simulation_Type
==
7
% solveBackwardComplete
case
{
3
,
4
,
6
,
7
}
% solve{Forward,Backward}{Simple,Complete}
is_forward
=
M_
.
block_structure
.
block
(
blk
)
.
Simulation_Type
==
3
||
M_
.
block_structure
.
block
(
blk
)
.
Simulation_Type
==
6
;
[
y
,
T
,
success
,
maxblkerror
,
iter
]
=
solve_one_boundary
(
fh_dynamic
,
y
,
exo_simul
,
M_
.
params
,
steady_state
,
T
,
y_index
,
M_
.
block_structure
.
block
(
blk
)
.
NNZDerivatives
,
options_
.
periods
,
M_
.
block_structure
.
block
(
blk
)
.
is_linear
,
blk
,
M_
.
maximum_lag
,
options_
.
simul
.
maxit
,
options_
.
dynatol
.
f
,
cutoff
,
options_
.
stack_solve_algo
,
is_forward
,
true
,
false
,
M_
,
options_
);
elseif
M_
.
block_structure
.
block
(
blk
)
.
Simulation_Type
==
5
||
...
% solveTwoBoundariesSimple
M_
.
block_structure
.
block
(
blk
)
.
Simulation_Type
==
8
% solveTwoBoundariesComplete
case
{
5
,
8
}
% solveTwoBoundaries{Simple,Complete}
[
y
,
T
,
success
,
maxblkerror
,
iter
]
=
solve_two_boundaries
(
fh_dynamic
,
y
,
exo_simul
,
M_
.
params
,
steady_state
,
T
,
y_index
,
M_
.
block_structure
.
block
(
blk
)
.
NNZDerivatives
,
options_
.
periods
,
M_
.
block_structure
.
block
(
blk
)
.
is_linear
,
blk
,
M_
.
maximum_lag
,
options_
.
simul
.
maxit
,
options_
.
dynatol
.
f
,
cutoff
,
options_
.
stack_solve_algo
,
options_
,
M_
);
end
...
...
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