Dynare++: fix bug in the --steps option
This option could crash or give wrong results.
Bug introduced in 6d99b6d120
.
The Vector(Vector &) and Vector(const Vector &) constructors are not
equivalent.
Closes: #1804
pac-components
parent
55850f465d
commit
5eb769008b
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue