From e9474ae9ccd5bb5f0898a04c2269af1d24195a72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien.villemot@ens.fr>
Date: Wed, 20 Oct 2010 14:55:28 +0200
Subject: [PATCH] Histval: fixed bug for exogenous introduced in previous
 commit

---
 NumericalInitialization.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/NumericalInitialization.cc b/NumericalInitialization.cc
index e15f2724..1a16c232 100644
--- a/NumericalInitialization.cc
+++ b/NumericalInitialization.cc
@@ -194,13 +194,15 @@ HistValStatement::writeOutput(ostream &output, const string &basename) const
 
       SymbolType type = symbol_table.getType(symb_id);
 
-      // For a lag greater than 1, lookup for auxiliary variable
-      if ((type == eEndogenous || type == eExogenous) && lag < 0)
+      // For a lag greater than 1 on endo, or for any exo, lookup for auxiliary variable
+      if ((type == eEndogenous && lag < 0) || type == eExogenous)
         {
           try
             {
+              // This function call must remain the 1st statement in this block
               symb_id = symbol_table.searchAuxiliaryVars(symb_id, lag);
               lag = 0;
+              type == eEndogenous;
             }
           catch (SymbolTable::SearchFailedException &e)
             {
-- 
GitLab