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
Dóra Kocsis
dynare
Commits
83afb256
Commit
83afb256
authored
Apr 03, 2012
by
Houtan Bastani
Browse files
bug fix: output not correct for corr(a,b).prior statement
parent
74476d12
Changes
2
Hide whitespace changes
Inline
Side-by-side
preprocessor/ComputingTasks.cc
View file @
83afb256
...
...
@@ -1864,13 +1864,13 @@ BasicPriorStatement::writeCommonOutputHelper(ostream &output, const string &fiel
}
void
BasicPriorStatement
::
writePriorOutput
(
ostream
&
output
,
string
&
lhs_field
)
const
BasicPriorStatement
::
writePriorOutput
(
ostream
&
output
,
string
&
lhs_field
,
const
string
&
name2
)
const
{
if
(
subsample_name
.
empty
())
lhs_field
+=
".prior(1)"
;
else
{
output
<<
"subsamples_indx = get_existing_subsamples_indx('"
<<
name
<<
"','');"
<<
endl
output
<<
"subsamples_indx = get_existing_subsamples_indx('"
<<
name
<<
"','
"
<<
name2
<<
"
');"
<<
endl
<<
"eisind = get_subsamples_range_indx(subsamples_indx, '"
<<
subsample_name
<<
"');"
<<
endl
;
lhs_field
+=
".subsample_prior(eisind)"
;
}
...
...
@@ -1893,7 +1893,7 @@ PriorStatement::writeOutput(ostream &output, const string &basename) const
output
<<
"eifind = get_new_or_existing_ei_index('parameter_prior_index', '"
<<
name
<<
"', '');"
<<
endl
<<
"estimation_info.parameter_prior_index(eifind) = {'"
<<
name
<<
"'};"
<<
endl
;
writePriorOutput
(
output
,
lhs_field
);
writePriorOutput
(
output
,
lhs_field
,
""
);
}
StdPriorStatement
::
StdPriorStatement
(
const
string
&
name_arg
,
...
...
@@ -1917,7 +1917,7 @@ StdPriorStatement::writeOutput(ostream &output, const string &basename) const
<<
"estimation_info."
<<
lhs_field
<<
"_prior_index(eifind) = {'"
<<
name
<<
"'};"
<<
endl
;
lhs_field
=
"estimation_info."
+
lhs_field
+
"(eifind)"
;
writePriorOutput
(
output
,
lhs_field
);
writePriorOutput
(
output
,
lhs_field
,
""
);
}
CorrPriorStatement
::
CorrPriorStatement
(
const
string
&
name_arg1
,
const
string
&
name_arg2
,
...
...
@@ -1957,7 +1957,7 @@ CorrPriorStatement::writeOutput(ostream &output, const string &basename) const
<<
name
<<
":"
<<
name1
<<
"'};"
<<
endl
;
lhs_field
=
"estimation_info."
+
lhs_field
+
"_corr(eifind)"
;
writePriorOutput
(
output
,
lhs_field
);
writePriorOutput
(
output
,
lhs_field
,
name1
);
}
PriorEqualStatement
::
PriorEqualStatement
(
const
string
&
to_declaration_type_arg
,
...
...
preprocessor/ComputingTasks.hh
View file @
83afb256
...
...
@@ -634,7 +634,7 @@ protected:
void
get_base_name
(
const
SymbolType
symb_type
,
string
&
lhs_field
)
const
;
void
writeCommonOutput
(
ostream
&
output
,
const
string
&
lhs_field
)
const
;
void
writeCommonOutputHelper
(
ostream
&
output
,
const
string
&
field
,
const
string
&
lhs_field
)
const
;
void
writePriorOutput
(
ostream
&
output
,
string
&
lhs_field
)
const
;
void
writePriorOutput
(
ostream
&
output
,
string
&
lhs_field
,
const
string
&
name2
)
const
;
};
class
PriorStatement
:
public
BasicPriorStatement
...
...
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