StaticModel: add missing fields in copy constructor and assigment operators
This should have been in commit 0169240f76
.
master
parent
9ecc288f72
commit
98c27fad59
|
@ -36,9 +36,23 @@ StaticModel::StaticModel(SymbolTable &symbol_table_arg,
|
|||
{
|
||||
}
|
||||
|
||||
StaticModel::StaticModel(const StaticModel &m) :
|
||||
ModelTree{m}
|
||||
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) :
|
||||
ModelTree{m},
|
||||
ramsey_multipliers_derivatives{m.ramsey_multipliers_derivatives},
|
||||
ramsey_multipliers_derivatives_sparse_colptr{m.ramsey_multipliers_derivatives_sparse_colptr}
|
||||
{
|
||||
copyHelper(m);
|
||||
}
|
||||
|
||||
StaticModel &
|
||||
|
@ -46,6 +60,11 @@ StaticModel::operator=(const StaticModel &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;
|
||||
}
|
||||
|
||||
|
|
|
@ -117,6 +117,11 @@ private:
|
|||
template<ExprNodeOutputType output_type>
|
||||
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:
|
||||
string
|
||||
modelClassName() const override
|
||||
|
|
Loading…
Reference in New Issue