Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marco Ratto
dynare
Commits
afe966d0
Commit
afe966d0
authored
Jan 26, 2022
by
Marco Ratto
Browse files
use Save_files to save different names under parallel execution
parent
59a1c1c8
Changes
3
Hide whitespace changes
Inline
Side-by-side
matlab/optimization/mr_gstep.m
View file @
afe966d0
...
...
@@ -144,11 +144,11 @@ while i<n
end
% penalty=f0;
if
Save_files
save
(
'gstep.mat'
,
'x'
,
'h1'
,
'f0'
)
save
(
[
'gstep
'
int2str
(
Save_files
)
'
.mat'
]
,
'x'
,
'h1'
,
'f0'
)
end
end
if
Save_files
save
(
'gstep.mat'
,
'x'
,
'h1'
,
'f0'
)
save
(
[
'gstep
'
int2str
(
Save_files
)
'
.mat'
]
,
'x'
,
'h1'
,
'f0'
)
end
return
...
...
matlab/optimization/mr_hessian.m
View file @
afe966d0
...
...
@@ -294,7 +294,7 @@ if outer_product_gradient
end
hh1
=
hess_info
.
h1
;
if
Save_files
save
(
'hess.mat'
,
'hessian_mat'
)
save
(
[
'hess
'
int2str
(
Save_files
)
'
.mat'
]
,
'hessian_mat'
)
end
else
hessian_mat
=
[];
...
...
matlab/optimization/newrat.m
View file @
afe966d0
...
...
@@ -134,7 +134,7 @@ if Verbose
end
end
if
Save_files
save
(
'm
1
.mat'
,
'x'
,
'hh'
,
'g'
,
'hhg'
,
'igg'
,
'fval0'
)
save
(
[
'm
'
int2str
(
Save_files
)
'
.mat'
]
,
'x'
,
'hh'
,
'g'
,
'hhg'
,
'igg'
,
'fval0'
)
end
igrad
=
1
;
...
...
@@ -267,11 +267,11 @@ while norm(gg)>gtol && check==0 && jit<nit
if
norm
(
x
(:,
icount
)
-
xparam1
)
>
1.e-12
&&
analytic_derivation
==
0
try
if
Save_files
save
(
'm
1
.mat'
,
'x'
,
'fval0'
,
'nig'
,
'-append'
)
save
(
[
'm
'
int2str
(
Save_files
)
'
.mat'
]
,
'x'
,
'fval0'
,
'nig'
,
'-append'
)
end
catch
if
Save_files
save
(
'm
1
.mat'
,
'x'
,
'fval0'
,
'nig'
)
save
(
[
'm
'
int2str
(
Save_files
)
'
.mat'
]
,
'x'
,
'fval0'
,
'nig'
)
end
end
[
dum
,
gg
,
htol0
,
igg
,
hhg
,
h1
,
hess_info
]
=
mr_hessian
(
xparam1
,
func0
,
penalty
,
flagit
,
htol
,
hess_info
,
bounds
,
prior_std
,
Save_files
,
varargin
{:});
...
...
@@ -316,12 +316,12 @@ while norm(gg)>gtol && check==0 && jit<nit
disp_verbose
([
'Elapsed time for iteration '
,
num2str
(
t
),
' s.'
],
Verbose
)
g
(:,
icount
+
1
)
=
gg
;
if
Save_files
save
(
'm
1
.mat'
,
'x'
,
'hh'
,
'g'
,
'hhg'
,
'igg'
,
'fval0'
,
'nig'
,
'H'
)
save
(
[
'm
'
int2str
(
Save_files
)
'
.mat'
]
,
'x'
,
'hh'
,
'g'
,
'hhg'
,
'igg'
,
'fval0'
,
'nig'
,
'H'
)
end
end
end
if
Save_files
save
(
'm
1
.mat'
,
'x'
,
'hh'
,
'g'
,
'hhg'
,
'igg'
,
'fval0'
,
'nig'
)
save
(
[
'm
'
int2str
(
Save_files
)
'
.mat'
]
,
'x'
,
'hh'
,
'g'
,
'hhg'
,
'igg'
,
'fval0'
,
'nig'
)
end
if
ftol
>
ftol0
skipline
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment