diff --git a/dynare++/integ/cc/quadrature.hh b/dynare++/integ/cc/quadrature.hh index 83a75149823e754e15bdb356c4124459ab7aeba0..61df4a58e9fe79f36c1f360fcf31439509d62b17 100644 --- a/dynare++/integ/cc/quadrature.hh +++ b/dynare++/integ/cc/quadrature.hh @@ -184,9 +184,9 @@ public: /* Just for debugging. */ void - savePoints(const string &fname, int level) const + savePoints(const std::string &fname, int level) const { - ofstream fd{fname, std::ios::out | std::ios::trunc}; + std::ofstream fd{fname, std::ios::out | std::ios::trunc}; if (fd.fail()) { // todo: raise diff --git a/dynare++/integ/cc/quasi_mcarlo.hh b/dynare++/integ/cc/quasi_mcarlo.hh index ad45955c2bc28d1e33a3d122bb64659c8005f4b5..65d92bfed86c1f69884c9e2fad5cf688c2da6756 100644 --- a/dynare++/integ/cc/quasi_mcarlo.hh +++ b/dynare++/integ/cc/quasi_mcarlo.hh @@ -83,7 +83,7 @@ private: protected: int num; int maxn; - vector<RadicalInverse> ri; + std::vector<RadicalInverse> ri; const PermutationScheme &per; Vector pt; public: diff --git a/dynare++/integ/cc/smolyak.hh b/dynare++/integ/cc/smolyak.hh index 83d0103e6816489aeb77f10769f0e4c78f5e32fd..3330e4ab2f392f76b88542f3102039a23b282332 100644 --- a/dynare++/integ/cc/smolyak.hh +++ b/dynare++/integ/cc/smolyak.hh @@ -101,9 +101,9 @@ class SmolyakQuadrature : public QuadratureImpl<smolpit> friend class smolpit; int level; const OneDQuadrature &uquad; - vector<IntSequence> levels; - vector<IntSequence> levpoints; - vector<int> cumevals; + std::vector<IntSequence> levels; + std::vector<IntSequence> levpoints; + std::vector<int> cumevals; PascalTriangle psc; public: SmolyakQuadrature(int d, int l, const OneDQuadrature &uq); diff --git a/dynare++/integ/src/quadrature-points.cc b/dynare++/integ/src/quadrature-points.cc index 10cc3225783fcbfc2431dcd73f7c6ef0d647a37c..3fd284e1cd7ec92f107b0f1b83a721f73e292510 100644 --- a/dynare++/integ/src/quadrature-points.cc +++ b/dynare++/integ/src/quadrature-points.cc @@ -22,8 +22,8 @@ struct QuadParams { - string outname; - string vcovname; + std::string outname; + std::string vcovname; int max_level{3}; double discard_weight{0.0}; QuadParams(int argc, char **argv); @@ -60,7 +60,7 @@ QuadParams::QuadParams(int argc, char **argv) case opt_max_level: try { - max_level = std::stoi(string{optarg}); + max_level = std::stoi(std::string{optarg}); } catch (const std::invalid_argument &e) { @@ -70,7 +70,7 @@ QuadParams::QuadParams(int argc, char **argv) case opt_discard_weight: try { - discard_weight = std::stod(string{optarg}); + discard_weight = std::stod(std::string{optarg}); } catch (const std::invalid_argument &e) { diff --git a/dynare++/integ/testing/tests.cc b/dynare++/integ/testing/tests.cc index b8ae2f8e4457ea7f82516163c014af4eb5275d35..a91e882b94ab41c7eeb1613a0ea5661c5cdffb5c 100644 --- a/dynare++/integ/testing/tests.cc +++ b/dynare++/integ/testing/tests.cc @@ -165,11 +165,11 @@ Function1Trans::eval(const Vector &point, const ParameterSignal &sig, Vector &ou // with time information class WallTimer { - string mes; + std::string mes; std::chrono::time_point<std::chrono::high_resolution_clock> start; bool new_line; public: - WallTimer(string m, bool nl = true) + WallTimer(std::string m, bool nl = true) : mes{m}, start{std::chrono::high_resolution_clock::now()}, new_line{nl} { } @@ -189,10 +189,10 @@ public: class TestRunnable { public: - const string name; + const std::string name; int dim; // dimension of the solved problem int nvar; // number of variable of the solved problem - TestRunnable(string name_arg, int d, int nv) + TestRunnable(std::string name_arg, int d, int nv) : name{move(name_arg)}, dim(d), nvar(nv) { } @@ -211,7 +211,7 @@ protected: bool TestRunnable::test() const { - cout << "Running test <" << name << ">" << endl; + std::cout << "Running test <" << name << ">" << std::endl; bool passed; { WallTimer tim("Wall clock time ", false); @@ -286,7 +286,7 @@ TestRunnable::product_normal_moments(const GeneralMatrix &m, int imom, int level // check against theoretical moments UNormalMoments moments(imom, msq); prod_out.add(-1.0, (moments.get(Symmetry(imom)))->getData()); - std::cout << "\tError: " << std::setw(16) << std::setprecision(12) << prod_out.getMax() << endl; + std::cout << "\tError: " << std::setw(16) << std::setprecision(12) << prod_out.getMax() << std::endl; return prod_out.getMax() < 1.e-7; } diff --git a/dynare++/kord/decision_rule.cc b/dynare++/kord/decision_rule.cc index 7afc2b97aa695e9399d5c829b0457e2b7fd2a8a5..930bf801c29895694ed950811a114904037fe81f 100644 --- a/dynare++/kord/decision_rule.cc +++ b/dynare++/kord/decision_rule.cc @@ -437,7 +437,7 @@ RTSimResultsStats::writeMat(mat_t *fd, const char *lname) } IRFResults::IRFResults(const DynamicModel &mod, const DecisionRule &dr, - const SimResults &control, vector<int> ili, + const SimResults &control, std::vector<int> ili, Journal &journal) : model(mod), irf_list_ind(std::move(ili)) { @@ -639,6 +639,6 @@ GenShockRealization::get(int n, Vector &out) Vector r(numShocks()); RandomShockRealization::get(n, r); for (int j = 0; j < numShocks(); j++) - if (!isfinite(out[j])) + if (!std::isfinite(out[j])) out[j] = r[j]; } diff --git a/dynare++/kord/decision_rule.hh b/dynare++/kord/decision_rule.hh index 532c5ec2203feb396833ff11b23291081b294a77..359447fb813ccbb8f50be813cbf0934596f4f387 100644 --- a/dynare++/kord/decision_rule.hh +++ b/dynare++/kord/decision_rule.hh @@ -728,9 +728,9 @@ protected: int num_y; int num_per; int num_burn; - vector<TwoDMatrix *> data; - vector<ExplicitShockRealization *> shocks; - vector<ConstVector> start; + std::vector<TwoDMatrix *> data; + std::vector<ExplicitShockRealization *> shocks; + std::vector<ConstVector> start; public: SimResults(int ny, int nper, int nburn = 0) : num_y(ny), num_per(nper), num_burn(nburn) @@ -902,12 +902,12 @@ public: class DynamicModel; class IRFResults { - vector<SimResultsIRF *> irf_res; + std::vector<SimResultsIRF *> irf_res; const DynamicModel &model; - vector<int> irf_list_ind; + std::vector<int> irf_list_ind; public: IRFResults(const DynamicModel &mod, const DecisionRule &dr, - const SimResults &control, vector<int> ili, + const SimResults &control, std::vector<int> ili, Journal &journal); ~IRFResults(); void writeMat(mat_t *fd, const char *prefix) const; diff --git a/dynare++/kord/journal.cc b/dynare++/kord/journal.cc index 1c5fc5e0859557de263b1d93b06ce635f2b69b54..825f730374fc4933b23f93bd37188a21cfe484ee 100644 --- a/dynare++/kord/journal.cc +++ b/dynare++/kord/journal.cc @@ -204,7 +204,7 @@ JournalRecordPair::~JournalRecordPair() writePrefixForEnd(flash); journal << prefix_end; journal << mes; - journal << endl; + journal << std::endl; journal.flush(); } @@ -213,7 +213,7 @@ endrec(JournalRecord &rec) { rec.journal << rec.prefix; rec.journal << rec.mes; - rec.journal << endl; + rec.journal << std::endl; rec.journal.flush(); rec.journal.incrementOrd(); return rec; diff --git a/dynare++/kord/journal.hh b/dynare++/kord/journal.hh index 380da538a94724bc323e2108396789c92694e674..a32ff385b6b5db009abfc75fccb7fac4d5b32ff3 100644 --- a/dynare++/kord/journal.hh +++ b/dynare++/kord/journal.hh @@ -39,13 +39,13 @@ struct SystemResourcesFlash void diff(const SystemResourcesFlash &pre); }; -class Journal : public ofstream +class Journal : public std::ofstream { int ord; int depth; public: Journal(const char *fname) - : ofstream(fname), ord(0), depth(0) + : std::ofstream(fname), ord(0), depth(0) { printHeader(); } diff --git a/dynare++/src/dynare3.cc b/dynare++/src/dynare3.cc index ebbf90654d1c2cb7f57d5e3c9522fd587fd032bc..86d3ee12f53dba677c4711cbd4165b9948289cd2 100644 --- a/dynare++/src/dynare3.cc +++ b/dynare++/src/dynare3.cc @@ -19,10 +19,10 @@ /**************************************************************************************/ /* DynareNameList class */ /**************************************************************************************/ -vector<int> -DynareNameList::selectIndices(const vector<const char *> &ns) const +std::vector<int> +DynareNameList::selectIndices(const std::vector<const char *> &ns) const { - vector<int> res; + std::vector<int> res; for (auto n : ns) { int j = 0; @@ -30,7 +30,7 @@ DynareNameList::selectIndices(const vector<const char *> &ns) const j++; if (j == getNum()) throw DynareException(__FILE__, __LINE__, - string("Couldn't find name for ") + n + std::string("Couldn't find name for ") + n +" in DynareNameList::selectIndices"); res.push_back(j); } @@ -47,7 +47,7 @@ Dynare::Dynare(const char *modname, int ord, double sstol, Journal &jr) { std::ifstream f{modname}; if (f.fail()) - throw DynareException(__FILE__, __LINE__, string{"Could not open model file "}+modname); + throw DynareException(__FILE__, __LINE__, std::string{"Could not open model file "}+modname); std::ostringstream buffer; buffer << f.rdbuf(); diff --git a/dynare++/src/dynare3.hh b/dynare++/src/dynare3.hh index fc6f0a0734235c3c9c2857feb5ab7e9b5700658d..6a7fa48463f751b870d6add4b049297154807d2a 100644 --- a/dynare++/src/dynare3.hh +++ b/dynare++/src/dynare3.hh @@ -20,7 +20,7 @@ class Dynare; class DynareNameList : public NameList { - vector<const char *> names; + std::vector<const char *> names; public: DynareNameList(const Dynare &dynare); int @@ -36,12 +36,12 @@ public: /** This for each string of the input vector calculates its index * in the names. And returns the resulting vector of indices. If * the name cannot be found, then an exception is raised. */ - vector<int> selectIndices(const vector<const char *> &ns) const; + std::vector<int> selectIndices(const std::vector<const char *> &ns) const; }; class DynareExogNameList : public NameList { - vector<const char *> names; + std::vector<const char *> names; public: DynareExogNameList(const Dynare &dynare); int @@ -58,7 +58,7 @@ public: class DynareStateNameList : public NameList { - vector<const char *> names; + std::vector<const char *> names; public: DynareStateNameList(const Dynare &dynare, const DynareNameList &dnl, const DynareExogNameList &denl); diff --git a/dynare++/src/main.cc b/dynare++/src/main.cc index cd92a3bda69f2044f305df00989057f3358bb5a5..8e33c65198e3859045c8d0990b71fe6e7a2d2741 100644 --- a/dynare++/src/main.cc +++ b/dynare++/src/main.cc @@ -43,7 +43,7 @@ main(int argc, char **argv) // make dynare object Dynare dynare(params.modname, params.order, params.ss_tol, journal); // make list of shocks for which we will do IRFs - vector<int> irf_list_ind; + std::vector<int> irf_list_ind; if (params.do_irfs_all) for (int i = 0; i < dynare.nexog(); i++) irf_list_ind.push_back(i); diff --git a/dynare++/tl/cc/equivalence.cc b/dynare++/tl/cc/equivalence.cc index 070bf00a153d38094355064e8bc655d6f67b5aa5..0b84089eb6c5bab1dcf003f7f664043aa57096e3 100644 --- a/dynare++/tl/cc/equivalence.cc +++ b/dynare++/tl/cc/equivalence.cc @@ -313,7 +313,7 @@ EquivalenceSet::EquivalenceSet(int num) : n(num), equis() { - list<Equivalence> added; + std::list<Equivalence> added; Equivalence first(n); equis.push_back(first); addParents(first, added); @@ -359,7 +359,7 @@ EquivalenceSet::has(const Equivalence &e) const void EquivalenceSet::addParents(const Equivalence &e, - list<Equivalence> &added) + std::list<Equivalence> &added) { if (e.numClasses() == 2 || e.numClasses() == 1) return; @@ -396,7 +396,7 @@ EquivalenceSet::print(const char *prefix) const /* Construct the bundle. |nmax| is a maximum size of underlying set. */ EquivalenceBundle::EquivalenceBundle(int nmax) { - nmax = max(nmax, 1); + nmax = std::max(nmax, 1); generateUpTo(nmax); } diff --git a/dynare++/tl/cc/equivalence.hh b/dynare++/tl/cc/equivalence.hh index 3f81cae54f6efbe2e34ac30ea9d857fbdcfc566e..34bc6114099aedb960f564891f4accf5a847f098 100644 --- a/dynare++/tl/cc/equivalence.hh +++ b/dynare++/tl/cc/equivalence.hh @@ -44,8 +44,6 @@ #include <vector> #include <list> -using namespace std; - /* Here is the abstraction for an equivalence class. We implement it as |vector<int>|. We have a constructor for empty class, copy constructor. What is important here is the ordering operator @@ -55,7 +53,7 @@ using namespace std; class OrdSequence { - vector<int> data; + std::vector<int> data; public: OrdSequence() : data() { @@ -68,7 +66,7 @@ public: bool operator==(const OrdSequence &s) const; int operator[](int i) const; bool operator<(const OrdSequence &s) const; - const vector<int> & + const std::vector<int> & getData() const { return data; @@ -97,10 +95,10 @@ class Equivalence { private: int n; - list<OrdSequence> classes; + std::list<OrdSequence> classes; public: - using const_seqit = list<OrdSequence>::const_iterator; - using seqit = list<OrdSequence>::iterator; + using const_seqit = std::list<OrdSequence>::const_iterator; + using seqit = std::list<OrdSequence>::iterator; /* The first constructor constructs $\{\{0\},\{1\},\ldots,\{n-1\}\}$. @@ -183,9 +181,9 @@ protected: class EquivalenceSet { int n; - list<Equivalence> equis; + std::list<Equivalence> equis; public: - using const_iterator = list<Equivalence>::const_iterator; + using const_iterator = std::list<Equivalence>::const_iterator; EquivalenceSet(int num); void print(const char *prefix) const; const_iterator @@ -200,7 +198,7 @@ public: } private: bool has(const Equivalence &e) const; - void addParents(const Equivalence &e, list<Equivalence> &added); + void addParents(const Equivalence &e, std::list<Equivalence> &added); }; /* The equivalence bundle class only encapsulates |EquivalenceSet|s @@ -212,7 +210,7 @@ private: class EquivalenceBundle { - vector<EquivalenceSet> bundle; + std::vector<EquivalenceSet> bundle; public: EquivalenceBundle(int nmax); ~EquivalenceBundle() = default; diff --git a/dynare++/tl/cc/fine_container.hh b/dynare++/tl/cc/fine_container.hh index 7ed6a13083599392e4d7b4b9c864975810fe1a7a..e69f8b26e9a9a980a1c2e04388456b2f1d0c8f51 100644 --- a/dynare++/tl/cc/fine_container.hh +++ b/dynare++/tl/cc/fine_container.hh @@ -39,8 +39,8 @@ class SizeRefinement { - vector<int> rsizes; - vector<int> ind_map; + std::vector<int> rsizes; + std::vector<int> ind_map; int new_nc; public: SizeRefinement(const IntSequence &s, int nc, int max); diff --git a/dynare++/tl/cc/int_sequence.cc b/dynare++/tl/cc/int_sequence.cc index e2f3804a8f34a342b9cce48cea426bd1553ed9e7..21d2676b2d4e53496adc33d3d2f567295a564404 100644 --- a/dynare++/tl/cc/int_sequence.cc +++ b/dynare++/tl/cc/int_sequence.cc @@ -29,7 +29,7 @@ IntSequence::IntSequence(const Symmetry &sy, const IntSequence &se) constructed sequence must be $(1,1)$, meaning that we picked one $y$ and one $u$. */ -IntSequence::IntSequence(const Symmetry &sy, const vector<int> &se) +IntSequence::IntSequence(const Symmetry &sy, const std::vector<int> &se) : data(new int[sy.num()]), length(sy.num()), destroy(true) { TL_RAISE_IF(sy.dimen() <= se[se.size()-1], @@ -102,7 +102,7 @@ IntSequence::operator==(const IntSequence &s) const bool IntSequence::operator<(const IntSequence &s) const { - int len = min(size(), s.size()); + int len = std::min(size(), s.size()); int i = 0; while (i < len && operator[](i) == s[i]) diff --git a/dynare++/tl/cc/int_sequence.hh b/dynare++/tl/cc/int_sequence.hh index dd52ddbf8a14dd7e62b8290857aef02abc14cfe1..a99449caa99ed432cd0c05c09c04e30bb90ea4f5 100644 --- a/dynare++/tl/cc/int_sequence.hh +++ b/dynare++/tl/cc/int_sequence.hh @@ -28,7 +28,6 @@ #include <cstring> #include <vector> -using namespace std; /* The implementation of |IntSequence| is straightforward. It has a pointer |data|, a |length| of the data, and a flag |destroy|, whether @@ -74,7 +73,7 @@ public: { memcpy(data, s.data+i1, sizeof(int)*length); } - IntSequence(const Symmetry &sy, const vector<int> &se); + IntSequence(const Symmetry &sy, const std::vector<int> &se); IntSequence(const Symmetry &sy, const IntSequence &se); IntSequence(int i, const IntSequence &s); IntSequence(int i, const IntSequence &s, int pos); diff --git a/dynare++/tl/cc/kron_prod.cc b/dynare++/tl/cc/kron_prod.cc index 6191cccdbe6ee6c4f3f6663e96fe21e8cb1704db..16e4c8edb82b724e3e1878eb29ee300e24157e90 100644 --- a/dynare++/tl/cc/kron_prod.cc +++ b/dynare++/tl/cc/kron_prod.cc @@ -340,7 +340,7 @@ KronProdAll::multRows(const IntSequence &irows) const Vector *last = nullptr; ConstVector *row; - vector<Vector *> to_delete; + std::vector<Vector *> to_delete; for (int i = 0; i < dimen(); i++) { int j = dimen()-1-i; diff --git a/dynare++/tl/cc/permutation.cc b/dynare++/tl/cc/permutation.cc index b5d7a5efb2f420fff0433cf41bcb1dd5e20afeb2..2bae2777167da08163fa9171fab13d5a001e432f 100644 --- a/dynare++/tl/cc/permutation.cc +++ b/dynare++/tl/cc/permutation.cc @@ -103,13 +103,13 @@ PermutationSet::~PermutationSet() delete [] pers; } -vector<const Permutation *> +std::vector<const Permutation *> PermutationSet::getPreserving(const IntSequence &s) const { TL_RAISE_IF(s.size() != order, "Wrong sequence length in PermutationSet::getPreserving"); - vector<const Permutation *> res; + std::vector<const Permutation *> res; IntSequence tmp(s.size()); for (int i = 0; i < size; i++) { @@ -125,7 +125,7 @@ PermutationSet::getPreserving(const IntSequence &s) const PermutationBundle::PermutationBundle(int nmax) { - nmax = max(nmax, 1); + nmax = std::max(nmax, 1); generateUpTo(nmax); } diff --git a/dynare++/tl/cc/permutation.hh b/dynare++/tl/cc/permutation.hh index e6bcc3ac2a3d1693566c25cc8b7384b753bb51ef..a8206d9b59ed924a146b962a190227844d4ba704 100644 --- a/dynare++/tl/cc/permutation.hh +++ b/dynare++/tl/cc/permutation.hh @@ -155,7 +155,7 @@ public: { return *(pers[i]); } - vector<const Permutation *> getPreserving(const IntSequence &s) const; + std::vector<const Permutation *> getPreserving(const IntSequence &s) const; }; /* The permutation bundle encapsulates all permutations sets up to some @@ -163,7 +163,7 @@ public: class PermutationBundle { - vector<PermutationSet *> bundle; + std::vector<PermutationSet *> bundle; public: PermutationBundle(int nmax); ~PermutationBundle(); diff --git a/dynare++/tl/cc/ps_tensor.cc b/dynare++/tl/cc/ps_tensor.cc index b72118cebd26a19b60309a6128d56fa55b414b7e..bd86d5176f285ec4f4dd707a058655bde19ccc61 100644 --- a/dynare++/tl/cc/ps_tensor.cc +++ b/dynare++/tl/cc/ps_tensor.cc @@ -215,7 +215,7 @@ UPSTensor::fillFromSparseTwo(const FSSparseTensor &t, const IntSequence &ss, } const PermutationSet &pset = tls.pbundle->get(coor.size()); - vector<const Permutation *> pp = pset.getPreserving(coor); + std::vector<const Permutation *> pp = pset.getPreserving(coor); Permutation unsort(coor); zeros(); diff --git a/dynare++/tl/cc/pyramid_prod.cc b/dynare++/tl/cc/pyramid_prod.cc index 4cc5c8af75530db66ce23dc9294f82b2e3e6572e..1bfcd7925a255bf0f3627d7ef2d20632ab951d9f 100644 --- a/dynare++/tl/cc/pyramid_prod.cc +++ b/dynare++/tl/cc/pyramid_prod.cc @@ -19,7 +19,7 @@ USubTensor::USubTensor(const TensorDimens &bdims, const TensorDimens &hdims, const FGSContainer &cont, - const vector<IntSequence> &lst) + const std::vector<IntSequence> &lst) : URTensor(lst.size(), hdims.getNVX()[0], hdims.dimen()) { TL_RAISE_IF(!hdims.getNVX().isConstant(), @@ -31,7 +31,7 @@ USubTensor::USubTensor(const TensorDimens &bdims, if (it.numClasses() == hdims.dimen()) { Permutation per(it); - vector<const FGSTensor *> ts + std::vector<const FGSTensor *> ts = cont.fetchTensors(bdims.getSym(), it); for (int i = 0; i < (int) lst.size(); i++) { @@ -58,10 +58,10 @@ USubTensor::USubTensor(const TensorDimens &bdims, |i|-th column. */ void -USubTensor::addKronColumn(int i, const vector<const FGSTensor *> &ts, +USubTensor::addKronColumn(int i, const std::vector<const FGSTensor *> &ts, const IntSequence &pindex) { - vector<ConstVector> tmpcols; + std::vector<ConstVector> tmpcols; int lastdim = 0; for (auto t : ts) { diff --git a/dynare++/tl/cc/pyramid_prod.hh b/dynare++/tl/cc/pyramid_prod.hh index 11ba39612fb1a38c3ee0b0bf6ac55592080a5039..9038ebaa9a4089dd75cf5b39371e38b350366f03 100644 --- a/dynare++/tl/cc/pyramid_prod.hh +++ b/dynare++/tl/cc/pyramid_prod.hh @@ -54,8 +54,6 @@ #include <vector> -using namespace std; - /* Here we define the new tensor for representing $[G]_S^{\gamma_1\ldots\gamma_l}$. It allows a construction from container of folded general symmetry tensors |cont|, and set of @@ -66,8 +64,8 @@ class USubTensor : public URTensor { public: USubTensor(const TensorDimens &bdims, const TensorDimens &hdims, - const FGSContainer &cont, const vector<IntSequence> &lst); - void addKronColumn(int i, const vector<const FGSTensor *> &ts, + const FGSContainer &cont, const std::vector<IntSequence> &lst); + void addKronColumn(int i, const std::vector<const FGSTensor *> &ts, const IntSequence &pindex); }; diff --git a/dynare++/tl/cc/rfs_tensor.cc b/dynare++/tl/cc/rfs_tensor.cc index d4193e655bbcb48df8163d57dfd7c77e454629c1..944af83c851d82faaaed71015e37f26371365652 100644 --- a/dynare++/tl/cc/rfs_tensor.cc +++ b/dynare++/tl/cc/rfs_tensor.cc @@ -115,7 +115,7 @@ URTensor::getOffset(const IntSequence &v) const /* Here we construct $v_1\otimes v_2\otimes\ldots\otimes v_n$, where $v_1,v_2,\ldots,v_n$ are stored in |vector<ConstVector>|. */ -URSingleTensor::URSingleTensor(const vector<ConstVector> &cols) +URSingleTensor::URSingleTensor(const std::vector<ConstVector> &cols) : URTensor(1, cols[0].length(), cols.size()) { if (dimen() == 1) diff --git a/dynare++/tl/cc/rfs_tensor.hh b/dynare++/tl/cc/rfs_tensor.hh index c935ed6f95b5eed3288556a12acfb1b2e6a0ede4..26717a579a26fd2ad1287c4c4c0a50a3ec9cc059 100644 --- a/dynare++/tl/cc/rfs_tensor.hh +++ b/dynare++/tl/cc/rfs_tensor.hh @@ -131,7 +131,7 @@ public: : URTensor(1, nvar, d) { } - URSingleTensor(const vector<ConstVector> &cols); + URSingleTensor(const std::vector<ConstVector> &cols); URSingleTensor(const ConstVector &v, int d); URSingleTensor(const URSingleTensor &ut) diff --git a/dynare++/tl/cc/sparse_tensor.hh b/dynare++/tl/cc/sparse_tensor.hh index ef703478b9d8ac61acf8e1798efcb179386de413..5cef0f9d9f04c53219e44f32b23a39435e9c8e63 100644 --- a/dynare++/tl/cc/sparse_tensor.hh +++ b/dynare++/tl/cc/sparse_tensor.hh @@ -31,8 +31,6 @@ #include <map> -using namespace std; - // |ltseq| predicate struct ltseq { @@ -50,8 +48,8 @@ struct ltseq class SparseTensor { public: - using Item = pair<int, double>; - using Map = multimap<IntSequence, Item, ltseq>; + using Item = std::pair<int, double>; + using Map = std::multimap<IntSequence, Item, ltseq>; using const_iterator = Map::const_iterator; protected: using iterator = Map::iterator; diff --git a/dynare++/tl/cc/symmetry.hh b/dynare++/tl/cc/symmetry.hh index ea3ee57a7a6a6b28b27b203f3f0b8231370b6e88..542f15da3bd76b3e9220e8c9e16a198bacf68e00 100644 --- a/dynare++/tl/cc/symmetry.hh +++ b/dynare++/tl/cc/symmetry.hh @@ -215,7 +215,7 @@ public: symmetries from the given equivalence and outer symmetry. A permutation might optionally permute the classes of the equivalence. */ -class InducedSymmetries : public vector<Symmetry> +class InducedSymmetries : public std::vector<Symmetry> { public: InducedSymmetries(const Equivalence &e, const Symmetry &s); diff --git a/dynare++/tl/cc/t_container.cc b/dynare++/tl/cc/t_container.cc index f9603269e30c753d5c7e245430eae3b3f28a31b5..d9202d66d75a34cf420cf29c620c724b6fa897a3 100644 --- a/dynare++/tl/cc/t_container.cc +++ b/dynare++/tl/cc/t_container.cc @@ -41,7 +41,7 @@ UGSContainer::multAndAdd(const UGSTensor &t, UGSTensor &out) const { if (it.numClasses() == l) { - vector<const UGSTensor *> ts + std::vector<const UGSTensor *> ts = fetchTensors(out.getSym(), it); KronProdAllOptim kp(l); for (int i = 0; i < l; i++) @@ -89,7 +89,7 @@ FGSContainer::multAndAdd(const UGSTensor &t, FGSTensor &out) const { if (it.numClasses() == l) { - vector<const FGSTensor *> ts + std::vector<const FGSTensor *> ts = fetchTensors(out.getSym(), it); KronProdAllOptim kp(l); for (int i = 0; i < l; i++) @@ -106,7 +106,7 @@ FGSContainer::multAndAdd(const UGSTensor &t, FGSTensor &out) const (excluding). If there are not |num| of such indices, the shorter vector is returned. */ Tensor::index -FGSContainer::getIndices(int num, vector<IntSequence> &out, +FGSContainer::getIndices(int num, std::vector<IntSequence> &out, const Tensor::index &start, const Tensor::index &end) { diff --git a/dynare++/tl/cc/t_container.hh b/dynare++/tl/cc/t_container.hh index 0547fb39b5e22d655392284ebf3ebbc28e2e7fbd..a467e5ad4d79a6668f3b687147341986fe7b3591 100644 --- a/dynare++/tl/cc/t_container.hh +++ b/dynare++/tl/cc/t_container.hh @@ -96,7 +96,7 @@ class TensorContainer protected: using _const_ptr = const _Ttype *; using _ptr = _Ttype *; - using _Map = map<Symmetry, _ptr, ltsym>; + using _Map = std::map<Symmetry, _ptr, ltsym>; using _mvtype = typename _Map::value_type; public: using iterator = typename _Map::iterator; @@ -262,9 +262,9 @@ public: /* Output to the Memory Map. */ void - writeMMap(map<string, ConstTwoDMatrix> &mm, const string &prefix) const + writeMMap(std::map<std::string, ConstTwoDMatrix> &mm, const std::string &prefix) const { - ostringstream lname; + std::ostringstream lname; for (const_iterator it = begin(); it != end(); ++it) { lname.str(prefix); @@ -280,10 +280,10 @@ public: through all equivalence classes, calculate implied symmetry, and fetch its tensor storing it in the same order to the vector. */ - vector<_const_ptr> + std::vector<_const_ptr> fetchTensors(const Symmetry &rsym, const Equivalence &e) const { - vector<_const_ptr> res(e.numClasses()); + std::vector<_const_ptr> res(e.numClasses()); int i = 0; for (auto it = e.begin(); it != e.end(); ++it, i++) @@ -377,7 +377,7 @@ public: void multAndAdd(const FGSTensor &t, FGSTensor &out) const; void multAndAdd(const UGSTensor &t, FGSTensor &out) const; private: - static Tensor::index getIndices(int num, vector<IntSequence> &out, + static Tensor::index getIndices(int num, std::vector<IntSequence> &out, const Tensor::index &start, const Tensor::index &end); }; diff --git a/dynare++/tl/cc/t_polynomial.hh b/dynare++/tl/cc/t_polynomial.hh index 58dd7a57b41917f9f51870730bd7725a75e12cbd..f1d258ee2e908796f743dcfdb750313d576369cd 100644 --- a/dynare++/tl/cc/t_polynomial.hh +++ b/dynare++/tl/cc/t_polynomial.hh @@ -340,7 +340,7 @@ public: if (_Tparent::check(Symmetry(d))) { _Ttype *ten = _Tparent::get(Symmetry(d)); - ten->mult((double) max((d-k), 0)); + ten->mult((double) std::max((d-k), 0)); } } } diff --git a/mex/sources/k_order_perturbation/dynamic_dll.cc b/mex/sources/k_order_perturbation/dynamic_dll.cc index 762702e1bbc0d2a1191a01a2fa6c234ba2340b1d..60904e82c189695a3e077cf5d142b750799ad369 100644 --- a/mex/sources/k_order_perturbation/dynamic_dll.cc +++ b/mex/sources/k_order_perturbation/dynamic_dll.cc @@ -21,9 +21,9 @@ #include <sstream> -DynamicModelDLL::DynamicModelDLL(const string &modName) noexcept(false) +DynamicModelDLL::DynamicModelDLL(const std::string &modName) noexcept(false) { - string fName; + std::string fName; #if !defined(__CYGWIN32__) && !defined(_WIN32) fName = "./"; #endif @@ -57,7 +57,7 @@ DynamicModelDLL::DynamicModelDLL(const string &modName) noexcept(false) dynamicHinstance = dlopen(fName.c_str(), RTLD_NOW); if (dynamicHinstance == nullptr) { - cerr << dlerror() << endl; + std::cerr << dlerror() << std::endl; throw 1; } ntt = (int *) dlsym(dynamicHinstance, "ntt"); @@ -76,7 +76,7 @@ DynamicModelDLL::DynamicModelDLL(const string &modName) noexcept(false) || dynamic_g3_tt == nullptr || dynamic_g3 == nullptr) { dlclose(dynamicHinstance); // Free the library - cerr << dlerror() << endl; + std::cerr << dlerror() << std::endl; throw 2; } #endif @@ -84,7 +84,7 @@ DynamicModelDLL::DynamicModelDLL(const string &modName) noexcept(false) } catch (int i) { - ostringstream msg; + std::ostringstream msg; msg << "Error when loading " << fName << " ("; if (i == 1) msg << "can't dynamically load the file"; @@ -105,7 +105,7 @@ DynamicModelDLL::~DynamicModelDLL() auto result = FreeLibrary(dynamicHinstance); if (result == 0) { - cerr << "Can't free the *_dynamic DLL" << endl; + std::cerr << "Can't free the *_dynamic DLL" << std::endl; exit(EXIT_FAILURE); } #else diff --git a/mex/sources/k_order_perturbation/dynamic_dll.hh b/mex/sources/k_order_perturbation/dynamic_dll.hh index f79aae54cd8305b68725106b38431310817cf69c..9385afa35c726be2fb7782f5f71495ad28948280 100644 --- a/mex/sources/k_order_perturbation/dynamic_dll.hh +++ b/mex/sources/k_order_perturbation/dynamic_dll.hh @@ -61,7 +61,7 @@ private: public: // construct and load Dynamic model DLL - explicit DynamicModelDLL(const string &fname) noexcept(false); + explicit DynamicModelDLL(const std::string &fname) noexcept(false); virtual ~DynamicModelDLL(); void eval(const Vector &y, const Vector &x, const Vector ¶ms, const Vector &ySteady, diff --git a/mex/sources/k_order_perturbation/dynamic_m.cc b/mex/sources/k_order_perturbation/dynamic_m.cc index 45c720d5548168b0ef1d9e44d07f4f4f10589f3c..6e37c3f544be8c736ef7cc06f6819d96a48b4bda 100644 --- a/mex/sources/k_order_perturbation/dynamic_m.cc +++ b/mex/sources/k_order_perturbation/dynamic_m.cc @@ -19,7 +19,7 @@ #include "dynamic_m.hh" -DynamicModelMFile::DynamicModelMFile(const string &modName) noexcept(false) : +DynamicModelMFile::DynamicModelMFile(const std::string &modName) noexcept(false) : DynamicMFilename{modName + ".dynamic"} { } diff --git a/mex/sources/k_order_perturbation/dynamic_m.hh b/mex/sources/k_order_perturbation/dynamic_m.hh index a0b890d1243c114d9ad0467296450a1501164ffd..48c2b396bb04ed8c00fe6754325b0310866491cf 100644 --- a/mex/sources/k_order_perturbation/dynamic_m.hh +++ b/mex/sources/k_order_perturbation/dynamic_m.hh @@ -32,11 +32,11 @@ class DynamicModelMFile : public DynamicModelAC { private: - const string DynamicMFilename; + const std::string DynamicMFilename; const static int nlhs_dynamic = 4; const static int nrhs_dynamic = 5; public: - explicit DynamicModelMFile(const string &modName) noexcept(false); + explicit DynamicModelMFile(const std::string &modName) noexcept(false); virtual ~DynamicModelMFile() = default; void eval(const Vector &y, const Vector &x, const Vector ¶ms, const Vector &ySteady, Vector &residual, TwoDMatrix *g1, TwoDMatrix *g2, TwoDMatrix *g3) noexcept(false); diff --git a/mex/sources/k_order_perturbation/k_ord_dynare.cc b/mex/sources/k_order_perturbation/k_ord_dynare.cc index 6da182bb890ae598be85fb8d3569b6b5844e28a4..36d2b2634165494db52d518651a0753660a0d308 100644 --- a/mex/sources/k_order_perturbation/k_ord_dynare.cc +++ b/mex/sources/k_order_perturbation/k_ord_dynare.cc @@ -33,13 +33,13 @@ /* Dynare DynamicModel class */ /**************************************************************************************/ -KordpDynare::KordpDynare(const vector<string> &endo, int num_endo, - const vector<string> &exo, int nexog, int npar, +KordpDynare::KordpDynare(const std::vector<std::string> &endo, int num_endo, + const std::vector<std::string> &exo, int nexog, int npar, Vector &ysteady, TwoDMatrix &vcov, Vector &inParams, int nstat, int npred, int nforw, int nboth, const int jcols, const Vector &nnzd, const int nsteps, int norder, - Journal &jr, unique_ptr<DynamicModelAC> dynamicModelFile_arg, double sstol, - const vector<int> &var_order, const TwoDMatrix &llincidence, double criterium) noexcept(false) : + Journal &jr, std::unique_ptr<DynamicModelAC> dynamicModelFile_arg, double sstol, + const std::vector<int> &var_order, const TwoDMatrix &llincidence, double criterium) noexcept(false) : nStat{nstat}, nBoth{nboth}, nPred{npred}, nForw{nforw}, nExog{nexog}, nPar{npar}, nYs{npred + nboth}, nYss{nboth + nforw}, nY{num_endo}, nJcols{jcols}, NNZD{nnzd}, nSteps{nsteps}, nOrder{norder}, journal{jr}, ySteady{ysteady}, params{inParams}, vCov{vcov}, @@ -54,13 +54,13 @@ KordpDynare::KordpDynare(const vector<string> &endo, int num_endo, md.insert(new FSSparseTensor(iord, nY+nYs+nYss+nExog, nY)); } -KordpDynare::KordpDynare(const vector<string> &endo, int num_endo, - const vector<string> &exo, int nexog, int npar, +KordpDynare::KordpDynare(const std::vector<std::string> &endo, int num_endo, + const std::vector<std::string> &exo, int nexog, int npar, Vector &ysteady, TwoDMatrix &vcov, Vector &inParams, int nstat, int npred, int nforw, int nboth, const int jcols, const Vector &nnzd, const int nsteps, int norder, - Journal &jr, unique_ptr<DynamicModelAC> dynamicModelFile_arg, double sstol, - const vector<int> &var_order, const TwoDMatrix &llincidence, double criterium, + Journal &jr, std::unique_ptr<DynamicModelAC> dynamicModelFile_arg, double sstol, + const std::vector<int> &var_order, const TwoDMatrix &llincidence, double criterium, TwoDMatrix *g1_arg, TwoDMatrix *g2_arg, TwoDMatrix *g3_arg) noexcept(false) : nStat{nstat}, nBoth{nboth}, nPred{npred}, nForw{nforw}, nExog{nexog}, nPar{npar}, nYs{npred + nboth}, nYss{nboth + nforw}, nY{num_endo}, nJcols{jcols}, NNZD{nnzd}, nSteps{nsteps}, @@ -159,7 +159,7 @@ KordpDynare::calcDerivativesAtSteady() * populateDerivatives to sparse Tensor and fit it in the Derivatives Container *******************************************************************************/ void -KordpDynare::populateDerivativesContainer(const TwoDMatrix &g, int ord, const vector<int> &vOrder) +KordpDynare::populateDerivativesContainer(const TwoDMatrix &g, int ord, const std::vector<int> &vOrder) { // model derivatives FSSparseTensor instance FSSparseTensor *mdTi = (new FSSparseTensor(ord, nJcols, nY)); @@ -186,7 +186,7 @@ KordpDynare::populateDerivativesContainer(const TwoDMatrix &g, int ord, const ve else if (ord == 2) { int nJcols1 = nJcols-nExog; - vector<int> revOrder(nJcols1); + std::vector<int> revOrder(nJcols1); for (int i = 0; i < nJcols1; i++) revOrder[vOrder[i]] = i; for (int i = 0; i < g.nrows(); i++) @@ -216,7 +216,7 @@ KordpDynare::populateDerivativesContainer(const TwoDMatrix &g, int ord, const ve { int nJcols1 = nJcols-nExog; int nJcols2 = nJcols*nJcols; - vector<int> revOrder(nJcols1); + std::vector<int> revOrder(nJcols1); for (int i = 0; i < nJcols1; i++) revOrder[vOrder[i]] = i; for (int i = 0; i < g.nrows(); i++) @@ -311,7 +311,7 @@ KordpDynare::ReorderDynareJacobianIndices() noexcept(false) // create temporary square 2D matrix size nEndo x nEndo (sparse) // for the lag, current and lead blocks of the jacobian JacobianIndices.resize(nJcols); - vector <int> tmp(nY); + std::vector<int> tmp(nY); int i, j, rjoff = nJcols-nExog-1; for (int ll_row = 0; ll_row < ll_Incidence.nrows(); ll_row++) @@ -341,7 +341,7 @@ KordpDynare::ReorderDynareJacobianIndices() noexcept(false) /* DynareNameList class */ /**************************************************************************************/ -DynareNameList::DynareNameList(const KordpDynare &dynare, const vector<string> &names_arg) : names(names_arg) +DynareNameList::DynareNameList(const KordpDynare &dynare, const std::vector<std::string> &names_arg) : names(names_arg) { } @@ -349,7 +349,7 @@ DynareStateNameList::DynareStateNameList(const KordpDynare &dynare, const Dynare const DynareNameList &denl) { for (int i = 0; i < dynare.nys(); i++) - names.push_back(string{dnl.getName(i+dynare.nstat())}); + names.push_back(std::string{dnl.getName(i+dynare.nstat())}); for (int i = 0; i < dynare.nexog(); i++) - names.push_back(string{denl.getName(i)}); + names.push_back(std::string{denl.getName(i)}); } diff --git a/mex/sources/k_order_perturbation/k_ord_dynare.hh b/mex/sources/k_order_perturbation/k_ord_dynare.hh index 35d00e20f39e7cdbc8c78bd95d7307d569d473bf..49cc1d96ec58ca3e15b214782281e3a6ee372ef2 100644 --- a/mex/sources/k_order_perturbation/k_ord_dynare.hh +++ b/mex/sources/k_order_perturbation/k_ord_dynare.hh @@ -42,9 +42,9 @@ class KordpDynare; /*////////////////////////////////////////////*/ class DynareNameList : public NameList { - vector<string> names; + std::vector<std::string> names; public: - DynareNameList(const KordpDynare &dynare, const vector<string> &names_arg); + DynareNameList(const KordpDynare &dynare, const std::vector<std::string> &names_arg); int getNum() const { @@ -59,7 +59,7 @@ public: class DynareStateNameList : public NameList { - vector<string> names; + std::vector<std::string> names; public: DynareStateNameList(const KordpDynare &dynare, const DynareNameList &dnl, const DynareNameList &denl); @@ -110,30 +110,30 @@ class KordpDynare : public DynamicModel DynareNameList dnl, denl; DynareStateNameList dsnl; const double ss_tol; - const vector<int> &varOrder; + const std::vector<int> &varOrder; const TwoDMatrix &ll_Incidence; double qz_criterium; - vector<int> JacobianIndices; + std::vector<int> JacobianIndices; TwoDMatrix *g1p; TwoDMatrix *g2p; TwoDMatrix *g3p; public: - KordpDynare(const vector<string> &endo, int num_endo, - const vector<string> &exo, int num_exo, int num_par, + KordpDynare(const std::vector<std::string> &endo, int num_endo, + const std::vector<std::string> &exo, int num_exo, int num_par, Vector &ySteady, TwoDMatrix &vCov, Vector ¶ms, int nstat, int nPred, int nforw, int nboth, const int nJcols, const Vector &NNZD, const int nSteps, const int ord, - Journal &jr, unique_ptr<DynamicModelAC> dynamicModelFile_arg, double sstol, - const vector<int> &varOrder, const TwoDMatrix &ll_Incidence, + Journal &jr, std::unique_ptr<DynamicModelAC> dynamicModelFile_arg, double sstol, + const std::vector<int> &varOrder, const TwoDMatrix &ll_Incidence, double qz_criterium) noexcept(false); - KordpDynare(const vector<string> &endo, int num_endo, - const vector<string> &exo, int num_exo, int num_par, + KordpDynare(const std::vector<std::string> &endo, int num_endo, + const std::vector<std::string> &exo, int num_exo, int num_par, Vector &ySteady, TwoDMatrix &vCov, Vector ¶ms, int nstat, int nPred, int nforw, int nboth, const int nJcols, const Vector &NNZD, const int nSteps, const int ord, - Journal &jr, unique_ptr<DynamicModelAC> dynamicModelFile_arg, double sstol, - const vector<int> &varOrder, const TwoDMatrix &ll_Incidence, + Journal &jr, std::unique_ptr<DynamicModelAC> dynamicModelFile_arg, double sstol, + const std::vector<int> &varOrder, const TwoDMatrix &ll_Incidence, double qz_criterium, TwoDMatrix *g1_arg, TwoDMatrix *g2_arg, TwoDMatrix *g3_arg) noexcept(false); virtual ~KordpDynare(); @@ -234,7 +234,7 @@ public: void evaluateSystem(Vector &out, const ConstVector &yym, const ConstVector &yy, const ConstVector &yyp, const Vector &xx) noexcept(false); void calcDerivativesAtSteady(); - unique_ptr<DynamicModelAC> dynamicModelFile; + std::unique_ptr<DynamicModelAC> dynamicModelFile; DynamicModel * clone() const { @@ -245,7 +245,7 @@ public: private: void ReorderDynareJacobianIndices() noexcept(false); - void populateDerivativesContainer(const TwoDMatrix &g, int ord, const vector<int> &vOrder); + void populateDerivativesContainer(const TwoDMatrix &g, int ord, const std::vector<int> &vOrder); }; #endif diff --git a/mex/sources/k_order_perturbation/k_order_perturbation.cc b/mex/sources/k_order_perturbation/k_order_perturbation.cc index 7b119a00d4023f58c1d69f917c95d42d4a7f34e6..f374e564160b84382c9641cdd08f986bc6756dc5 100644 --- a/mex/sources/k_order_perturbation/k_order_perturbation.cc +++ b/mex/sources/k_order_perturbation/k_order_perturbation.cc @@ -49,7 +49,7 @@ // hence a rather low level approach is needed /////////////////////////////////////////////////////// void -DynareMxArrayToString(const mxArray *mxFldp, const int len, const int width, vector<string> &out) +DynareMxArrayToString(const mxArray *mxFldp, const int len, const int width, std::vector<std::string> &out) { char *cNamesCharStr = mxArrayToString(mxFldp); @@ -91,7 +91,7 @@ extern "C" { if (!mxIsChar(mFname)) DYN_MEX_FUNC_ERR_MSG_TXT("Input must be of type char."); - string fName = mxArrayToString(mFname); + std::string fName = mxArrayToString(mFname); int kOrder; mxArray *mxFldp = mxGetField(options_, 0, "order"); @@ -152,7 +152,7 @@ extern "C" { if (npar != nEndo) DYN_MEX_FUNC_ERR_MSG_TXT("Incorrect number of input var_order vars."); - vector<int> var_order_vp(nEndo); + std::vector<int> var_order_vp(nEndo); for (int v = 0; v < nEndo; v++) var_order_vp[v] = (int) (*(dparams++)); @@ -164,7 +164,7 @@ extern "C" { TwoDMatrix llincidence(nrows, npar, Vector{mxFldp}); if (npar != nEndo) { - ostringstream strstrm; + std::ostringstream strstrm; strstrm << "dynare:k_order_perturbation " << "Incorrect length of lead lag incidences: ncol=" << npar << " != nEndo=" << nEndo; DYN_MEX_FUNC_ERR_MSG_TXT(strstrm.str().c_str()); } @@ -179,13 +179,13 @@ extern "C" { mxFldp = mxGetField(M_, 0, "var_order_endo_names"); const int nendo = (int) mxGetM(mxFldp); const int widthEndo = (int) mxGetN(mxFldp); - vector<string> endoNames; + std::vector<std::string> endoNames; DynareMxArrayToString(mxFldp, nendo, widthEndo, endoNames); mxFldp = mxGetField(M_, 0, "exo_names"); const int nexo = (int) mxGetM(mxFldp); const int widthExog = (int) mxGetN(mxFldp); - vector<string> exoNames; + std::vector<std::string> exoNames; DynareMxArrayToString(mxFldp, nexo, widthExog, exoNames); if ((nEndo != nendo) || (nExog != nexo)) @@ -227,11 +227,11 @@ extern "C" { jName += ".jnl"; Journal journal(jName.c_str()); - unique_ptr<DynamicModelAC> dynamicModelFile; + std::unique_ptr<DynamicModelAC> dynamicModelFile; if (use_dll == 1) - dynamicModelFile = make_unique<DynamicModelDLL>(fName); + dynamicModelFile = std::make_unique<DynamicModelDLL>(fName); else - dynamicModelFile = make_unique<DynamicModelMFile>(fName); + dynamicModelFile = std::make_unique<DynamicModelMFile>(fName); // intiate tensor library tls.init(kOrder, nStat+2*nPred+3*nBoth+2*nForw+nExog); @@ -239,7 +239,7 @@ extern "C" { // make KordpDynare object KordpDynare dynare(endoNames, nEndo, exoNames, nExog, nPar, ySteady, vCov, modParams, nStat, nPred, nForw, nBoth, - jcols, NNZD, nSteps, kOrder, journal, move(dynamicModelFile), + jcols, NNZD, nSteps, kOrder, journal, std::move(dynamicModelFile), sstol, var_order_vp, llincidence, qz_criterium, g1m, g2m, g3m); @@ -250,8 +250,8 @@ extern "C" { app.walkStochSteady(); /* Write derivative outputs into memory map */ - map<string, ConstTwoDMatrix> mm; - app.getFoldDecisionRule().writeMMap(mm, string()); + std::map<std::string, ConstTwoDMatrix> mm; + app.getFoldDecisionRule().writeMMap(mm, std::string()); // get latest ysteady ySteady = dynare.getSteady(); @@ -259,7 +259,7 @@ extern "C" { if (kOrder == 1) { /* Set the output pointer to the output matrix ysteady. */ - map<string, ConstTwoDMatrix>::const_iterator cit = mm.begin(); + auto cit = mm.begin(); ++cit; plhs[1] = mxCreateDoubleMatrix((*cit).second.numRows(), (*cit).second.numCols(), mxREAL); @@ -271,7 +271,7 @@ extern "C" { if (kOrder >= 2) { int ii = 1; - for (map<string, ConstTwoDMatrix>::const_iterator cit = mm.begin(); + for (auto cit = mm.begin(); ((cit != mm.end()) && (ii < nlhs)); ++cit) { plhs[ii] = mxCreateDoubleMatrix((*cit).second.numRows(), (*cit).second.numCols(), mxREAL); @@ -312,7 +312,7 @@ extern "C" { catch (const KordException &e) { e.print(); - ostringstream strstrm; + std::ostringstream strstrm; strstrm << "dynare:k_order_perturbation: Caught Kord exception: " << e.get_message(); DYN_MEX_FUNC_ERR_MSG_TXT(strstrm.str().c_str()); } @@ -328,13 +328,13 @@ extern "C" { } catch (const DynareException &e) { - ostringstream strstrm; + std::ostringstream strstrm; strstrm << "dynare:k_order_perturbation: Caught KordDynare exception: " << e.message(); DYN_MEX_FUNC_ERR_MSG_TXT(strstrm.str().c_str()); } catch (const ogu::Exception &e) { - ostringstream strstrm; + std::ostringstream strstrm; strstrm << "dynare:k_order_perturbation: Caught general exception: " << e.message(); DYN_MEX_FUNC_ERR_MSG_TXT(strstrm.str().c_str()); }