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
Willi Mutschler
preprocessor
Commits
2781e3e6
Unverified
Commit
2781e3e6
authored
Feb 10, 2021
by
Sébastien Villemot
Browse files
A few modernizations using clang-tidy
parent
9274675e
Pipeline
#4924
passed with stages
in 2 minutes and 25 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/DynamicModel.cc
View file @
2781e3e6
...
@@ -5995,8 +5995,8 @@ DynamicModel::writeJsonVariableMapping(ostream &output) const
...
@@ -5995,8 +5995,8 @@ DynamicModel::writeJsonVariableMapping(ostream &output) const
auto
[
var
,
eqs
]
=
*
it
;
auto
[
var
,
eqs
]
=
*
it
;
output
<<
R"({"name": ")"
<<
symbol_table
.
getName
(
var
)
<<
R"(", "equations":[)"
;
output
<<
R"({"name": ")"
<<
symbol_table
.
getName
(
var
)
<<
R"(", "equations":[)"
;
bool
first_eq
=
true
;
bool
first_eq
=
true
;
for
(
auto
it2
=
eqs
.
begin
();
it2
!=
eqs
.
end
();
++
it2
)
for
(
int
it2
:
eqs
)
if
(
auto
tmp
=
equation_tags
.
getTagValueByEqnAndKey
(
*
it2
,
"name"
);
if
(
auto
tmp
=
equation_tags
.
getTagValueByEqnAndKey
(
it2
,
"name"
);
!
tmp
.
empty
())
!
tmp
.
empty
())
{
{
if
(
first_eq
)
if
(
first_eq
)
...
...
src/ModelEquationBlock.cc
View file @
2781e3e6
/*
/*
* Copyright © 2010-201
9
Dynare Team
* Copyright © 2010-20
2
1 Dynare Team
*
*
* This file is part of Dynare.
* This file is part of Dynare.
*
*
...
@@ -274,7 +274,7 @@ SteadyStateModel::writeJsonSteadyStateFile(ostream &output, bool transformComput
...
@@ -274,7 +274,7 @@ SteadyStateModel::writeJsonSteadyStateFile(ostream &output, bool transformComput
}
}
if
(
symb_ids
.
size
()
>
1
)
if
(
symb_ids
.
size
()
>
1
)
output
<<
"]"
;
output
<<
"]"
;
output
<<
"
,
\
"
rhs
\
"
:
\
"
"
;
output
<<
R"(
, "rhs":"
)
"
;
def_table
[
i
].
second
->
writeJsonOutput
(
output
,
{},
{},
false
);
def_table
[
i
].
second
->
writeJsonOutput
(
output
,
{},
{},
false
);
output
<<
"
\"
}"
<<
endl
;
output
<<
"
\"
}"
<<
endl
;
}
}
...
...
src/macro/Environment.hh
View file @
2781e3e6
/*
/*
* Copyright © 2019 Dynare Team
* Copyright © 2019
-2021
Dynare Team
*
*
* This file is part of Dynare.
* This file is part of Dynare.
*
*
...
@@ -30,11 +30,11 @@ namespace macro
...
@@ -30,11 +30,11 @@ namespace macro
class
Environment
class
Environment
{
{
private:
private:
const
Environment
*
parent
;
const
Environment
*
parent
{
nullptr
}
;
map
<
string
,
ExpressionPtr
>
variables
;
map
<
string
,
ExpressionPtr
>
variables
;
map
<
string
,
tuple
<
FunctionPtr
,
ExpressionPtr
>>
functions
;
map
<
string
,
tuple
<
FunctionPtr
,
ExpressionPtr
>>
functions
;
public:
public:
Environment
()
:
parent
{
nullptr
}
{
}
Environment
()
=
default
;
Environment
(
const
Environment
*
parent_arg
)
:
parent
{
parent_arg
}
{
}
Environment
(
const
Environment
*
parent_arg
)
:
parent
{
parent_arg
}
{
}
void
define
(
VariablePtr
var
,
ExpressionPtr
value
);
void
define
(
VariablePtr
var
,
ExpressionPtr
value
);
void
define
(
FunctionPtr
func
,
ExpressionPtr
value
);
void
define
(
FunctionPtr
func
,
ExpressionPtr
value
);
...
...
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