Commit 4b86df05 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Preprocessor: remove MATLAB short-circuit operators

They emit a warning under Octave
parent 5dd9c844
......@@ -1910,7 +1910,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
mDynamicModelFile << " g1=[];g2=[];g3=[];\n";
mDynamicModelFile << " y=" << dynamic_basename << "_" << block + 1 << "(y, x, params, steady_state, 0, y_kmin, periods);\n";
mDynamicModelFile << " tmp = y(:,M_.block_structure.block(" << block + 1 << ").variable);\n";
mDynamicModelFile << " if(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " if(isnan(tmp) || isinf(tmp))\n";
mDynamicModelFile << " disp(['Inf or Nan value during the evaluation of block " << block <<"']);\n";
mDynamicModelFile << " return;\n";
mDynamicModelFile << " end;\n";
......@@ -1938,7 +1938,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
mDynamicModelFile << " g1=[];g2=[];g3=[];\n";
mDynamicModelFile << " " << dynamic_basename << "_" << block + 1 << "(y, x, params, steady_state, 0, y_kmin, periods);\n";
mDynamicModelFile << " tmp = y(:,M_.block_structure.block(" << block + 1 << ").variable);\n";
mDynamicModelFile << " if(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " if(isnan(tmp) || isinf(tmp))\n";
mDynamicModelFile << " disp(['Inf or Nan value during the evaluation of block " << block <<"']);\n";
mDynamicModelFile << " return;\n";
mDynamicModelFile << " end;\n";
......@@ -1968,7 +1968,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
<<", options_.periods, " << blocks_linear[block]
<<", blck_num, y_kmin, options_.maxit_, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo, 1, 1, 0);\n";
mDynamicModelFile << " tmp = y(:,M_.block_structure.block(" << block + 1 << ").variable);\n";
mDynamicModelFile << " if(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " if(isnan(tmp) || isinf(tmp))\n";
mDynamicModelFile << " disp(['Inf or Nan value during the resolution of block " << block <<"']);\n";
mDynamicModelFile << " return;\n";
mDynamicModelFile << " end;\n";
......@@ -1998,7 +1998,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
<<", options_.periods, " << blocks_linear[block]
<<", blck_num, y_kmin, options_.maxit_, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo, 1, 1, 0);\n";
mDynamicModelFile << " tmp = y(:,M_.block_structure.block(" << block + 1 << ").variable);\n";
mDynamicModelFile << " if(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " if(isnan(tmp) || isinf(tmp))\n";
mDynamicModelFile << " disp(['Inf or Nan value during the resolution of block " << block <<"']);\n";
mDynamicModelFile << " return;\n";
mDynamicModelFile << " end;\n";
......@@ -2028,7 +2028,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
<<", " << blocks_linear[block]
<<", blck_num, y_kmin, options_.maxit_, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo);\n";
mDynamicModelFile << " tmp = y(:,M_.block_structure.block(" << block + 1 << ").variable);\n";
mDynamicModelFile << " if(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " if(isnan(tmp) || isinf(tmp))\n";
mDynamicModelFile << " disp(['Inf or Nan value during the resolution of block " << block <<"']);\n";
mDynamicModelFile << " return;\n";
mDynamicModelFile << " end;\n";
......
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