Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
preprocessor
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
preprocessor
Commits
98c27fad
Verified
Commit
98c27fad
authored
1 year ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
StaticModel: add missing fields in copy constructor and assigment operators
This should have been in commit
0169240f
.
parent
9ecc288f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/StaticModel.cc
+20
-1
20 additions, 1 deletion
src/StaticModel.cc
src/StaticModel.hh
+5
-0
5 additions, 0 deletions
src/StaticModel.hh
with
25 additions
and
1 deletion
src/StaticModel.cc
+
20
−
1
View file @
98c27fad
...
@@ -36,9 +36,23 @@ StaticModel::StaticModel(SymbolTable &symbol_table_arg,
...
@@ -36,9 +36,23 @@ StaticModel::StaticModel(SymbolTable &symbol_table_arg,
{
{
}
}
void
StaticModel
::
copyHelper
(
const
StaticModel
&
m
)
{
auto
f
=
[
this
](
const
ExprNode
*
e
)
{
return
e
->
clone
(
*
this
);
};
for
(
const
auto
&
it
:
m
.
ramsey_multipliers_derivatives_temporary_terms
)
ramsey_multipliers_derivatives_temporary_terms
.
insert
(
f
(
it
));
for
(
const
auto
&
it
:
m
.
ramsey_multipliers_derivatives_temporary_terms_idxs
)
ramsey_multipliers_derivatives_temporary_terms_idxs
.
emplace
(
f
(
it
.
first
),
it
.
second
);
}
StaticModel
::
StaticModel
(
const
StaticModel
&
m
)
:
StaticModel
::
StaticModel
(
const
StaticModel
&
m
)
:
ModelTree
{
m
}
ModelTree
{
m
},
ramsey_multipliers_derivatives
{
m
.
ramsey_multipliers_derivatives
},
ramsey_multipliers_derivatives_sparse_colptr
{
m
.
ramsey_multipliers_derivatives_sparse_colptr
}
{
{
copyHelper
(
m
);
}
}
StaticModel
&
StaticModel
&
...
@@ -46,6 +60,11 @@ StaticModel::operator=(const StaticModel &m)
...
@@ -46,6 +60,11 @@ StaticModel::operator=(const StaticModel &m)
{
{
ModelTree
::
operator
=
(
m
);
ModelTree
::
operator
=
(
m
);
ramsey_multipliers_derivatives
=
m
.
ramsey_multipliers_derivatives
;
ramsey_multipliers_derivatives_sparse_colptr
=
m
.
ramsey_multipliers_derivatives_sparse_colptr
;
copyHelper
(
m
);
return
*
this
;
return
*
this
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/StaticModel.hh
+
5
−
0
View file @
98c27fad
...
@@ -117,6 +117,11 @@ private:
...
@@ -117,6 +117,11 @@ private:
template
<
ExprNodeOutputType
output_type
>
template
<
ExprNodeOutputType
output_type
>
void
writeRamseyMultipliersDerivativesHelper
(
ostream
&
output
)
const
;
void
writeRamseyMultipliersDerivativesHelper
(
ostream
&
output
)
const
;
//! Internal helper for the copy constructor and assignment operator
/*! Copies all the structures that contain ExprNode*, by the converting the
pointers into their equivalent in the new tree */
void
copyHelper
(
const
StaticModel
&
m
);
protected
:
protected
:
string
string
modelClassName
()
const
override
modelClassName
()
const
override
...
...
This diff is collapsed.
Click to expand it.
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