diff --git a/dynare++/integ/cc/product.cc b/dynare++/integ/cc/product.cc index c79422419..891af46dc 100644 --- a/dynare++/integ/cc/product.cc +++ b/dynare++/integ/cc/product.cc @@ -4,8 +4,7 @@ #include "symmetry.hh" prodpit::prodpit() - : prodq(nullptr), jseq(nullptr), - sig(nullptr), p(nullptr) + { } diff --git a/dynare++/integ/cc/product.hh b/dynare++/integ/cc/product.hh index 812c469cc..a381c8973 100644 --- a/dynare++/integ/cc/product.hh +++ b/dynare++/integ/cc/product.hh @@ -38,13 +38,13 @@ class ProductQuadrature; class prodpit { protected: - const ProductQuadrature *prodq; + const ProductQuadrature *prodq{nullptr}; int level{0}; int npoints{0}; - IntSequence *jseq; + IntSequence *jseq{nullptr}; bool end_flag{true}; - ParameterSignal *sig; - Vector *p; + ParameterSignal *sig{nullptr}; + Vector *p{nullptr}; double w; public: prodpit(); diff --git a/dynare++/integ/cc/quasi_mcarlo.cc b/dynare++/integ/cc/quasi_mcarlo.cc index 9c7f9a6f1..4d0167a93 100644 --- a/dynare++/integ/cc/quasi_mcarlo.cc +++ b/dynare++/integ/cc/quasi_mcarlo.cc @@ -162,7 +162,7 @@ HaltonSequence::print() const } qmcpit::qmcpit() - : spec(nullptr), halton(nullptr), sig(nullptr) + { } @@ -225,7 +225,7 @@ qmcpit::weight() const } qmcnpit::qmcnpit() - : qmcpit(), pnt(nullptr) + : qmcpit() { } diff --git a/dynare++/integ/cc/quasi_mcarlo.hh b/dynare++/integ/cc/quasi_mcarlo.hh index 92102c144..6e2477905 100644 --- a/dynare++/integ/cc/quasi_mcarlo.hh +++ b/dynare++/integ/cc/quasi_mcarlo.hh @@ -160,9 +160,9 @@ public: class qmcpit { protected: - const QMCSpecification *spec; - HaltonSequence *halton; - ParameterSignal *sig; + const QMCSpecification *spec{nullptr}; + HaltonSequence *halton{nullptr}; + ParameterSignal *sig{nullptr}; public: qmcpit(); qmcpit(const QMCSpecification &s, int n); @@ -233,7 +233,7 @@ protected: class qmcnpit : public qmcpit { protected: - Vector *pnt; + Vector *pnt{nullptr}; public: qmcnpit(); qmcnpit(const QMCSpecification &spec, int n); diff --git a/dynare++/integ/cc/smolyak.cc b/dynare++/integ/cc/smolyak.cc index b2495fefa..b764c38e5 100644 --- a/dynare++/integ/cc/smolyak.cc +++ b/dynare++/integ/cc/smolyak.cc @@ -4,7 +4,7 @@ #include "symmetry.hh" smolpit::smolpit() - : smolq(nullptr), jseq(nullptr), sig(nullptr), p(nullptr) + { } diff --git a/dynare++/integ/cc/smolyak.hh b/dynare++/integ/cc/smolyak.hh index c0ac0b763..dbfbfd0cf 100644 --- a/dynare++/integ/cc/smolyak.hh +++ b/dynare++/integ/cc/smolyak.hh @@ -40,11 +40,11 @@ class SmolyakQuadrature; class smolpit { protected: - const SmolyakQuadrature *smolq; + const SmolyakQuadrature *smolq{nullptr}; unsigned int isummand{0}; - IntSequence *jseq; - ParameterSignal *sig; - Vector *p; + IntSequence *jseq{nullptr}; + ParameterSignal *sig{nullptr}; + Vector *p{nullptr}; double w; public: smolpit(); diff --git a/dynare++/parser/cc/atom_substitutions.cc b/dynare++/parser/cc/atom_substitutions.cc index c48c059d9..ab1d3f95a 100644 --- a/dynare++/parser/cc/atom_substitutions.cc +++ b/dynare++/parser/cc/atom_substitutions.cc @@ -22,9 +22,8 @@ AtomSubstitutions::AtomSubstitutions(const AtomSubstitutions &as, const FineAtom for (const auto & it : as.old2new) { Tshiftnameset sset; - for (auto itt = it.second.begin(); - itt != it.second.end(); ++itt) - sset.insert(Tshiftname(ns.query((*itt).first), (*itt).second)); + for (const auto & itt : it.second) + sset.insert(Tshiftname(ns.query(itt.first), itt.second)); old2new.insert(Toldnamemap::value_type(ns.query(it.first), sset)); } } diff --git a/dynare++/parser/cc/fine_atoms.hh b/dynare++/parser/cc/fine_atoms.hh index 5e26951b7..f8cde7b6f 100644 --- a/dynare++/parser/cc/fine_atoms.hh +++ b/dynare++/parser/cc/fine_atoms.hh @@ -201,14 +201,14 @@ namespace ogp * to endogenous variables. It is constructed by * parsing_finished() method, which should be called after all * parsing jobs have been finished. */ - VarOrdering *endo_order; + VarOrdering *endo_order{nullptr}; /** This is the internal ordering of all atoms corresponding * to exogenous variables. It has the same handling as * endo_order. */ - VarOrdering *exo_order; + VarOrdering *exo_order{nullptr}; /** This is the all variables outer ordering. It is * constructed by parsing finished. */ - AllvarOuterOrdering *allvar_order; + AllvarOuterOrdering *allvar_order{nullptr}; /** This vector defines a set of atoms as tree indices used * for differentiation. The order of the atoms in this vector * defines ordering of the derivative tensors. The ordering is @@ -229,9 +229,8 @@ namespace ogp vector exo_atoms_map; public: FineAtoms() - : endo_order(nullptr), exo_order(nullptr), allvar_order(nullptr) - { - } + + = default; FineAtoms(const FineAtoms &fa); /** Deletes endo_order and exo_order. */ ~FineAtoms() override diff --git a/dynare++/parser/cc/matrix_parser.hh b/dynare++/parser/cc/matrix_parser.hh index a59dcb1f9..1f48c4e3f 100644 --- a/dynare++/parser/cc/matrix_parser.hh +++ b/dynare++/parser/cc/matrix_parser.hh @@ -82,7 +82,7 @@ namespace ogp friend class MatrixParser; protected: /** Reference to the matrix parser. */ - const MatrixParser *p; + const MatrixParser *p{nullptr}; /** The index of the pointed item in the matrix parser. */ unsigned int i{0}; /** The column number of the pointed item starting from zero. */ @@ -91,9 +91,8 @@ namespace ogp int r{0}; public: - MPIterator() : p(nullptr) - { - } + MPIterator() + = default; /** Constructs an iterator pointing to the beginning of the * parsed matrix. */ MPIterator(const MatrixParser &mp); diff --git a/dynare++/src/dynare_model.cc b/dynare++/src/dynare_model.cc index ae660fbcc..24b34f80f 100644 --- a/dynare++/src/dynare_model.cc +++ b/dynare++/src/dynare_model.cc @@ -26,9 +26,7 @@ ParsedMatrix::ParsedMatrix(const ogp::MatrixParser &mp) } DynareModel::DynareModel() - : atoms(), eqs(atoms), - pbuilder(nullptr), fbuilder(nullptr), - atom_substs(nullptr), old_atoms(nullptr) + : atoms(), eqs(atoms) { } diff --git a/dynare++/src/dynare_model.hh b/dynare++/src/dynare_model.hh index fa1fc5598..d94e06a59 100644 --- a/dynare++/src/dynare_model.hh +++ b/dynare++/src/dynare_model.hh @@ -98,19 +98,19 @@ namespace ogdyn int t_pldiscount{-1}; /** Pointer to PlannerBuilder, which is created only if the * planner's FOC are added to the model. */ - PlannerBuilder *pbuilder; + PlannerBuilder *pbuilder{nullptr}; /** Pointer to an object which builds auxiliary variables and * equations to rewrite a model containing multiple leads to * an equivalent model having only +1 leads. */ - ForwSubstBuilder *fbuilder; + ForwSubstBuilder *fbuilder{nullptr}; /** Pointer to AtomSubstitutions which are created when the * atoms are being substituted because of multiple lags * etc. It uses also an old copy of atoms, which is * created. */ - ogp::AtomSubstitutions *atom_substs; + ogp::AtomSubstitutions *atom_substs{nullptr}; /** Pointer to a copy of original atoms before substitutions * took place. */ - ogp::SAtoms *old_atoms; + ogp::SAtoms *old_atoms{nullptr}; public: /** Initializes the object to an empty state. */ DynareModel();