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
5670d393
Verified
Commit
5670d393
authored
2 years ago
by
Johannes Pfeifer
Committed by
Sébastien Villemot
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dynare_solve: deal with Dulmage-Mendelsohn decomposition returns a non-square block
Related to
#1851
(manually cherry picked from commit
5788f1bc
)
parent
748ef8b5
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/dynare_solve.m
+23
-5
23 additions, 5 deletions
matlab/dynare_solve.m
with
23 additions
and
5 deletions
matlab/dynare_solve.m
+
23
−
5
View file @
5670d393
...
@@ -311,11 +311,29 @@ elseif ismember(options.solve_algo, [2, 12, 4])
...
@@ -311,11 +311,29 @@ elseif ismember(options.solve_algo, [2, 12, 4])
dprintf
(
'DYNARE_SOLVE (solve_algo=2|4|12): solving block %u with trust_region routine.'
,
i
);
dprintf
(
'DYNARE_SOLVE (solve_algo=2|4|12): solving block %u with trust_region routine.'
,
i
);
end
end
end
end
[
x
,
errorflag
]
=
solver
(
f
,
x
,
j1
(
j
),
j2
(
j
),
jacobian_flag
,
...
blockcolumns
=
s
(
i
+
1
)
-
s
(
i
);
options
.
gstep
,
...
if
blockcolumns
~=
blocklength
tolf
,
options
.
solve_tolx
,
...
%non-square-block in DM; check whether initial value is solution
maxit
,
options
.
debug
,
args
{:});
[
fval_check
,
fjac
]
=
feval
(
f
,
x
,
args
{:});
fre
=
true
;
if
norm
(
fval_check
(
j1
(
j
)))
<
tolf
errorflag
=
false
;
errorcode
=
0
;
continue
end
end
if
blockcolumns
>=
blocklength
%(under-)determined block
[
x
,
errorflag
,
errorcode
]
=
solver
(
f
,
x
,
j1
(
j
),
j2
(
j
),
jacobian_flag
,
...
options
.
gstep
,
...
tolf
,
options
.
solve_tolx
,
maxit
,
...
options
.
debug
,
args
{:});
fre
=
true
;
else
fprintf
(
'\nDYNARE_SOLVE (solve_algo=2|4|12): the Dulmage-Mendelsohn decomposition returned a non-square block. This means that the Jacobian is singular. You may want to try another value for solve_algo.\n'
)
%overdetermined block
errorflag
=
true
;
errorcode
=
0
;
end
if
errorflag
if
errorflag
return
return
end
end
...
...
This diff is collapsed.
Click to expand it.
Sébastien Villemot
@sebastien
mentioned in commit
25a80d01
·
2 years ago
mentioned in commit
25a80d01
mentioned in commit 25a80d01edfd2a287a67d5a1672934a9449f9ad1
Toggle commit list
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