Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
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
Sébastien Villemot
dynare
Commits
8954a682
Verified
Commit
8954a682
authored
1 year ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
Bytecode: error out when using det_cond_forecast with perfect_foresight shocks
They’re not implemented in bytecode. Closes: #1884
parent
13c9acba
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mex/sources/bytecode/bytecode.cc
+17
-1
17 additions, 1 deletion
mex/sources/bytecode/bytecode.cc
with
17 additions
and
1 deletion
mex/sources/bytecode/bytecode.cc
+
17
−
1
View file @
8954a682
/*
* Copyright © 2007-202
3
Dynare Team
* Copyright © 2007-202
4
Dynare Team
*
* This file is part of Dynare.
*
...
...
@@ -262,6 +262,22 @@ mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[])
if
(
!
shock_str_date_
)
mexErrMsgTxt
(
"The extended_path description structure does not contain the member: shock_str_date_"
);
mxArray
*
shock_perfect_foresight_
=
mxGetField
(
extended_path_struct
,
0
,
"shock_perfect_foresight_"
);
if
(
!
shock_perfect_foresight_
)
mexErrMsgTxt
(
"The extended_path description structure does not contain the member: "
"shock_perfect_foresight_"
);
// Check that there is no 'perfect_foresight' shocks, which are not implemented
double
*
constrained_pf
=
mxGetPr
(
constrained_perfect_foresight_
);
double
*
shock_pf
=
mxGetPr
(
shock_perfect_foresight_
);
if
(
auto
is_pf
=
[](
double
v
)
{
return
v
!=
0
;
};
any_of
(
constrained_pf
,
constrained_pf
+
mxGetNumberOfElements
(
constrained_perfect_foresight_
),
is_pf
)
||
any_of
(
shock_pf
,
shock_pf
+
mxGetNumberOfElements
(
shock_perfect_foresight_
),
is_pf
))
mexErrMsgTxt
(
"Shocks of type 'perfect_foresight' are not supported with the bytecode option."
);
int
nb_constrained
=
mxGetM
(
constrained_vars_
)
*
mxGetN
(
constrained_vars_
);
int
nb_controlled
=
0
;
mxArray
*
options_cond_fcst_
=
mxGetField
(
extended_path_struct
,
0
,
"options_cond_fcst_"
);
...
...
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