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
William Gatt
dynare
Commits
b1fc34ef
Commit
b1fc34ef
authored
7 years ago
by
Michel Juillard
Browse files
Options
Downloads
Patches
Plain Diff
fix bug when there are constraints both on ramsey policy instrument and on
other variables
parent
211a07c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/lmmcp/get_complementarity_conditions.m
+8
-4
8 additions, 4 deletions
matlab/lmmcp/get_complementarity_conditions.m
with
8 additions
and
4 deletions
matlab/lmmcp/get_complementarity_conditions.m
+
8
−
4
View file @
b1fc34ef
...
@@ -52,6 +52,10 @@ end
...
@@ -52,6 +52,10 @@ end
etags
=
M
.
equations_tags
;
etags
=
M
.
equations_tags
;
for
i
=
1
:
size
(
etags
,
1
)
for
i
=
1
:
size
(
etags
,
1
)
if
strcmp
(
etags
{
i
,
2
},
'mcp'
)
if
strcmp
(
etags
{
i
,
2
},
'mcp'
)
eq_nbr
=
etags
{
i
,
1
};
if
ramsey_policy
eq_nbr
=
eq_nbr
+
M
.
ramsey_eq_nbr
;
end
str
=
etags
{
i
,
3
};
str
=
etags
{
i
,
3
};
kop
=
strfind
(
etags
{
i
,
3
},
'<'
);
kop
=
strfind
(
etags
{
i
,
3
},
'<'
);
if
~
isempty
(
kop
)
if
~
isempty
(
kop
)
...
@@ -61,8 +65,8 @@ for i=1:size(etags,1)
...
@@ -61,8 +65,8 @@ for i=1:size(etags,1)
'not recognized'
],
etags
{
i
,
3
},
strtrim
(
str
(
1
:
kop
-
1
))))
'not recognized'
],
etags
{
i
,
3
},
strtrim
(
str
(
1
:
kop
-
1
))))
end
end
ub
(
k
)
=
str2num
(
str
(
kop
+
1
:
end
));
ub
(
k
)
=
str2num
(
str
(
kop
+
1
:
end
));
eq_index
(
e
tags
{
i
,
1
}
)
=
k
;
eq_index
(
e
q_nbr
)
=
k
;
eq_index
(
k
)
=
e
tags
{
i
,
1
}
;
eq_index
(
k
)
=
e
q_nbr
;
else
else
kop
=
strfind
(
etags
{
i
,
3
},
'>'
);
kop
=
strfind
(
etags
{
i
,
3
},
'>'
);
if
~
isempty
(
kop
)
if
~
isempty
(
kop
)
...
@@ -72,8 +76,8 @@ for i=1:size(etags,1)
...
@@ -72,8 +76,8 @@ for i=1:size(etags,1)
'not recognized'
],
etags
{
i
,
3
},
strtrim
(
str
(
1
:
kop
-
1
))))
'not recognized'
],
etags
{
i
,
3
},
strtrim
(
str
(
1
:
kop
-
1
))))
end
end
lb
(
k
)
=
str2num
(
str
(
kop
+
1
:
end
));
lb
(
k
)
=
str2num
(
str
(
kop
+
1
:
end
));
eq_index
(
e
tags
{
i
,
1
}
)
=
k
;
eq_index
(
e
q_nbr
)
=
k
;
eq_index
(
k
)
=
e
tags
{
i
,
1
}
;
eq_index
(
k
)
=
e
q_nbr
;
else
else
error
(
sprintf
([
'Complementarity condition %s can
''
t be '
...
error
(
sprintf
([
'Complementarity condition %s can
''
t be '
...
'parsed'
],
etags
{
i
,
3
}))
'parsed'
],
etags
{
i
,
3
}))
...
...
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