estim_params: remove short-circuit ops, #476

issue#70
Houtan Bastani 2013-09-24 16:01:35 +02:00
parent e85770ba0b
commit cd50a2bcb3
1 changed files with 4 additions and 4 deletions

View File

@ -625,16 +625,16 @@ EstimatedParamsInitStatement::writeOutput(ostream &output, const string &basenam
{ {
if (symb_type == eExogenous) if (symb_type == eExogenous)
{ {
output << "tmp1 = find((estim_params_.corrx(:,1)==" << symb_id << " && estim_params_.corrx(:,2)==" << symbol_table.getTypeSpecificID(it->name2)+1 << ") || " 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; << "(estim_params_.corrx(:,2)==" << symb_id << " & estim_params_.corrx(:,1)==" << symbol_table.getTypeSpecificID(it->name2)+1 << "));" << endl;
output << "estim_params_.corrx(tmp1,3) = "; output << "estim_params_.corrx(tmp1,3) = ";
it->init_val->writeOutput(output); it->init_val->writeOutput(output);
output << ";" << endl; output << ";" << endl;
} }
else if (symb_type == eEndogenous) else if (symb_type == eEndogenous)
{ {
output << "tmp1 = find((estim_params_.corrn(:,1)==" << symb_id << " && estim_params_.corrn(:,2)==" << symbol_table.getTypeSpecificID(it->name2)+1 << ") || " 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; << "(estim_params_.corrn(:,2)==" << symb_id << " & estim_params_.corrn(:,1)==" << symbol_table.getTypeSpecificID(it->name2)+1 << "));" << endl;
output << "estim_params_.corrn(tmp1,3) = "; output << "estim_params_.corrn(tmp1,3) = ";
it->init_val->writeOutput(output); it->init_val->writeOutput(output);
output << ";" << endl; output << ";" << endl;