Unverified Commit 5eb76900 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Dynare++: fix bug in the --steps option

This option could crash or give wrong results.

Bug introduced in 6d99b6d1.
The Vector(Vector &) and Vector(const Vector &) constructors are not

Closes: #1804
parent 55850f46
......@@ -154,7 +154,7 @@ Approximation::walkStochSteady()
JournalRecordPair pa(journal);
pa << "Approximation about stochastic steady for sigma=" << sigma_so_far+dsigma << endrec;
Vector last_steady(model.getSteady());
Vector last_steady(const_cast<const Vector &>(model.getSteady()));
// calculate fix-point of the last rule for ‘dsigma’
/* We form the DRFixPoint object from the last rule with σ=dsigma. Then
......@@ -180,7 +180,7 @@ Approximation::walkStochSteady()
minus the old steady state. Then we create StochForwardDerivs object,
which calculates the derivatives of g** expectations at new sigma and
new steady. */
Vector dy(model.getSteady());
Vector dy(const_cast<const Vector &>(model.getSteady()));
dy.add(-1.0, last_steady);
StochForwardDerivs<Storage::fold> hh(ypart, model.nexog(), *rule_ders_ss, mom, dy,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment