From e75e6a12dbb0537b519e171248ebf2c229cb8dc3 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Tue, 24 Sep 2013 16:01:35 +0200
Subject: [PATCH] estim_params: remove short-circuit ops, #476

---
 preprocessor/ComputingTasks.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc
index 129bfff9ed..01be77d71b 100644
--- a/preprocessor/ComputingTasks.cc
+++ b/preprocessor/ComputingTasks.cc
@@ -625,16 +625,16 @@ EstimatedParamsInitStatement::writeOutput(ostream &output, const string &basenam
         {
           if (symb_type == eExogenous)
             {
-              output << "tmp1 = find((estim_params_.corrx(:,1)==" << symb_id << " && estim_params_.corrx(:,2)==" << symbol_table.getTypeSpecificID(it->name2)+1 << ") || "
-                     <<             "(estim_params_.corrx(:,2)==" << symb_id << " && estim_params_.corrx(:,1)==" << symbol_table.getTypeSpecificID(it->name2)+1 << "));" << endl;
+              output << "tmp1 = find((estim_params_.corrx(:,1)==" << symb_id << " & estim_params_.corrx(:,2)==" << symbol_table.getTypeSpecificID(it->name2)+1 << ") | "
+                     <<             "(estim_params_.corrx(:,2)==" << symb_id << " & estim_params_.corrx(:,1)==" << symbol_table.getTypeSpecificID(it->name2)+1 << "));" << endl;
               output << "estim_params_.corrx(tmp1,3) = ";
               it->init_val->writeOutput(output);
               output << ";" << endl;
             }
           else if (symb_type == eEndogenous)
             {
-              output << "tmp1 = find((estim_params_.corrn(:,1)==" << symb_id << " && estim_params_.corrn(:,2)==" << symbol_table.getTypeSpecificID(it->name2)+1 << ") || "
-                     <<             "(estim_params_.corrn(:,2)==" << symb_id << " && estim_params_.corrn(:,1)==" << symbol_table.getTypeSpecificID(it->name2)+1 << "));" << endl;
+              output << "tmp1 = find((estim_params_.corrn(:,1)==" << symb_id << " & estim_params_.corrn(:,2)==" << symbol_table.getTypeSpecificID(it->name2)+1 << ") | "
+                     <<             "(estim_params_.corrn(:,2)==" << symb_id << " & estim_params_.corrn(:,1)==" << symbol_table.getTypeSpecificID(it->name2)+1 << "));" << endl;
               output << "estim_params_.corrn(tmp1,3) = ";
               it->init_val->writeOutput(output);
               output << ";" << endl;
-- 
GitLab