From c090a815facddbb4c2b2c8af30797e966fd40170 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien.villemot@ens.fr>
Date: Tue, 9 Feb 2010 14:32:40 +0100
Subject: [PATCH] k_order_perturbation: give a value to model residuals,
 otherwise valgrind logs are cluttered with unitialized value errors (cherry
 picked from commit cf8f793c5599d46bcf77722e45d26965fcb34be8)

---
 mex/sources/k_order_perturbation/k_ord_dynare.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mex/sources/k_order_perturbation/k_ord_dynare.cc b/mex/sources/k_order_perturbation/k_ord_dynare.cc
index ab82077413..2622a7de17 100644
--- a/mex/sources/k_order_perturbation/k_ord_dynare.cc
+++ b/mex/sources/k_order_perturbation/k_ord_dynare.cc
@@ -126,14 +126,16 @@ KordpDynare::solveDeterministicSteady()
 void
 KordpDynare::evaluateSystem(Vector &out, const Vector &yy, const Vector &xx) throw (DynareException)
 {
-  // Nothing to do, this method is only implemented to complete the interface of DynamicModel
+  // This method is only called when checking the residuals at steady state (Approximation::check), so return zero residuals
+  out.zeros();
 }
 
 void
 KordpDynare::evaluateSystem(Vector &out, const Vector &yym, const Vector &yy,
                             const Vector &yyp, const Vector &xx) throw (DynareException)
 {
-  // Nothing to do, this method is only implemented to complete the interface of DynamicModel
+  // This method is only called when checking the residuals at steady state (Approximation::check), so return zero residuals
+  out.zeros();
 }
 
 /************************************************
-- 
GitLab