Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dynare
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
122
Issues
122
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dynare
dynare
Commits
b92baacf
Commit
b92baacf
authored
Nov 06, 2017
by
Houtan Bastani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preprocessor: JSON: place local variables in one list. Closes
#1495
parent
d3c4477f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
preprocessor/ModelTree.cc
preprocessor/ModelTree.cc
+15
-19
No files found.
preprocessor/ModelTree.cc
View file @
b92baacf
...
...
@@ -1453,12 +1453,20 @@ ModelTree::writeJsonModelLocalVariables(ostream &output, deriv_node_temp_terms_t
for
(
size_t
i
=
0
;
i
<
equations
.
size
();
i
++
)
equations
[
i
]
->
collectVariables
(
eModelLocalVariable
,
used_local_vars
);
output
<<
"
\"
external_functions_model_local_variables
\"
: ["
;
for
(
set
<
int
>::
const_iterator
it
=
used_local_vars
.
begin
();
it
!=
used_local_vars
.
end
();
++
it
)
output
<<
"
\"
model_local_variables
\"
: ["
;
bool
printed
=
false
;
for
(
vector
<
int
>::
const_iterator
it
=
local_variables_vector
.
begin
();
it
!=
local_variables_vector
.
end
();
it
++
)
if
(
used_local_vars
.
find
(
*
it
)
!=
used_local_vars
.
end
())
{
if
(
printed
)
output
<<
", "
;
else
printed
=
true
;
int
id
=
*
it
;
vector
<
string
>
efout
;
expr_t
value
=
local_variables_table
.
find
(
*
it
)
->
second
;
expr_t
value
=
local_variables_table
.
find
(
id
)
->
second
;
value
->
writeJsonExternalFunctionOutput
(
efout
,
tt
,
tef_terms
);
for
(
vector
<
string
>::
const_iterator
it1
=
efout
.
begin
();
it1
!=
efout
.
end
();
it1
++
)
{
...
...
@@ -1466,21 +1474,9 @@ ModelTree::writeJsonModelLocalVariables(ostream &output, deriv_node_temp_terms_t
output
<<
", "
;
output
<<
*
it1
;
}
}
output
<<
"]"
<<
",
\"
model_local_variables
\"
: ["
;
bool
printed
=
false
;
for
(
vector
<
int
>::
const_iterator
it
=
local_variables_vector
.
begin
();
it
!=
local_variables_vector
.
end
();
it
++
)
if
(
used_local_vars
.
find
(
*
it
)
!=
used_local_vars
.
end
())
{
int
id
=
*
it
;
expr_t
value
=
local_variables_table
.
find
(
id
)
->
second
;
if
(
printed
)
if
(
!
efout
.
empty
()
)
output
<<
", "
;
else
printed
=
true
;
/* We append underscores to avoid name clashes with "g1" or "oo_" (see
also VariableNode::writeOutput) */
...
...
Write
Preview
Markdown
is supported
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