Bytecode: C++17 modernization / convert the remaining enums to enum classes

time-shift
Sébastien Villemot 2021-02-01 12:10:47 +01:00
parent 1bb5612474
commit c050325e3d
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
4 changed files with 177 additions and 177 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright © 2007-2020 Dynare Team * Copyright © 2007-2021 Dynare Team
* *
* This file is part of Dynare. * This file is part of Dynare.
* *
@ -490,43 +490,43 @@ public:
if (!steady_state) if (!steady_state)
switch (EQN_type) switch (EQN_type)
{ {
case TemporaryTerm: case ExpressionType::TemporaryTerm:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "temporary term " << EQN_equation+1 << " in block " << EQN_block+1 << " at time " << it_; Error_loc << "temporary term " << EQN_equation+1 << " in block " << EQN_block+1 << " at time " << it_;
else else
Error_loc << "temporary term " << EQN_equation+1 << " at time " << it_; Error_loc << "temporary term " << EQN_equation+1 << " at time " << it_;
break; break;
case ModelEquation: case ExpressionType::ModelEquation:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "equation " << EQN_equation+1 << " in block " << EQN_block+1 << " at time " << it_; Error_loc << "equation " << EQN_equation+1 << " in block " << EQN_block+1 << " at time " << it_;
else else
Error_loc << "equation " << EQN_equation+1 << " at time " << it_; Error_loc << "equation " << EQN_equation+1 << " at time " << it_;
break; break;
case FirstEndoDerivative: case ExpressionType::FirstEndoDerivative:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_; Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_;
else else
Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_; Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_;
break; break;
case FirstOtherEndoDerivative: case ExpressionType::FirstOtherEndoDerivative:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to other endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_; Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to other endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_;
else else
Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to other endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_; Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to other endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_;
break; break;
case FirstExoDerivative: case ExpressionType::FirstExoDerivative:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_; Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_;
else else
Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_; Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_;
break; break;
case FirstExodetDerivative: case ExpressionType::FirstExodetDerivative:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to deterministic exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_; Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to deterministic exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_;
else else
Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to deterministic exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_; Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to deterministic exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_;
break; break;
case FirstParamDerivative: case ExpressionType::FirstParamDerivative:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to parameter " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_; Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to parameter " << get_variable(SymbolType::endogenous, EQN_dvar1) << " at time " << it_;
else else
@ -538,43 +538,43 @@ public:
else else
switch (EQN_type) switch (EQN_type)
{ {
case TemporaryTerm: case ExpressionType::TemporaryTerm:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "temporary term " << EQN_equation+1 << " in block " << EQN_block+1; Error_loc << "temporary term " << EQN_equation+1 << " in block " << EQN_block+1;
else else
Error_loc << "temporary term " << EQN_equation+1; Error_loc << "temporary term " << EQN_equation+1;
break; break;
case ModelEquation: case ExpressionType::ModelEquation:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "equation " << EQN_equation+1 << " in block " << EQN_block+1; Error_loc << "equation " << EQN_equation+1 << " in block " << EQN_block+1;
else else
Error_loc << "equation " << EQN_equation+1; Error_loc << "equation " << EQN_equation+1;
break; break;
case FirstEndoDerivative: case ExpressionType::FirstEndoDerivative:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1); Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1);
else else
Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1); Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1);
break; break;
case FirstOtherEndoDerivative: case ExpressionType::FirstOtherEndoDerivative:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to other endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1); Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to other endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1);
else else
Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to other endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1); Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to other endogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1);
break; break;
case FirstExoDerivative: case ExpressionType::FirstExoDerivative:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1); Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1);
else else
Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1); Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1);
break; break;
case FirstExodetDerivative: case ExpressionType::FirstExodetDerivative:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to deterministic exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1); Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to deterministic exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1);
else else
Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to deterministic exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1); Error_loc << "first order derivative of equation " << EQN_equation+1 << " with respect to deterministic exogenous variable " << get_variable(SymbolType::endogenous, EQN_dvar1);
break; break;
case FirstParamDerivative: case ExpressionType::FirstParamDerivative:
if (EQN_block_number > 1) if (EQN_block_number > 1)
Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to parameter " << get_variable(SymbolType::endogenous, EQN_dvar1); Error_loc << "first order derivative of equation " << EQN_equation+1 << " in block " << EQN_block+1 << " with respect to parameter " << get_variable(SymbolType::endogenous, EQN_dvar1);
else else
@ -599,7 +599,7 @@ public:
double v1f, v2f, v3f = 0.0; double v1f, v2f, v3f = 0.0;
bool go_on = true; bool go_on = true;
double ll; double ll;
ExpressionType equation_type = TemporaryTerm; ExpressionType equation_type = ExpressionType::TemporaryTerm;
size_t found; size_t found;
double *jacob = NULL, *jacob_other_endo = NULL, *jacob_exo = NULL, *jacob_exo_det = NULL; double *jacob = NULL, *jacob_other_endo = NULL, *jacob_exo = NULL, *jacob_exo_det = NULL;
ExternalFunctionType function_type = ExternalFunctionType::withoutDerivative; ExternalFunctionType function_type = ExternalFunctionType::withoutDerivative;
@ -623,61 +623,61 @@ public:
#endif #endif
switch (it_code->first) switch (it_code->first)
{ {
case FNUMEXPR: case Tags::FNUMEXPR:
switch (static_cast<FNUMEXPR_ *>(it_code->second)->get_expression_type()) switch (static_cast<FNUMEXPR_ *>(it_code->second)->get_expression_type())
{ {
case TemporaryTerm: case ExpressionType::TemporaryTerm:
equation_type = TemporaryTerm; equation_type = ExpressionType::TemporaryTerm;
break; break;
case ModelEquation: case ExpressionType::ModelEquation:
equation_type = ModelEquation; equation_type = ExpressionType::ModelEquation;
break; break;
case FirstEndoDerivative: case ExpressionType::FirstEndoDerivative:
equation_type = FirstEndoDerivative; equation_type = ExpressionType::FirstEndoDerivative;
break; break;
case FirstOtherEndoDerivative: case ExpressionType::FirstOtherEndoDerivative:
equation_type = FirstOtherEndoDerivative; equation_type = ExpressionType::FirstOtherEndoDerivative;
break; break;
case FirstExoDerivative: case ExpressionType::FirstExoDerivative:
equation_type = FirstExoDerivative; equation_type = ExpressionType::FirstExoDerivative;
break; break;
case FirstExodetDerivative: case ExpressionType::FirstExodetDerivative:
equation_type = FirstExodetDerivative; equation_type = ExpressionType::FirstExodetDerivative;
break; break;
case FirstParamDerivative: case ExpressionType::FirstParamDerivative:
equation_type = FirstParamDerivative; equation_type = ExpressionType::FirstParamDerivative;
break; break;
case SecondEndoDerivative: case ExpressionType::SecondEndoDerivative:
equation_type = SecondEndoDerivative; equation_type = ExpressionType::SecondEndoDerivative;
break; break;
case SecondExoDerivative: case ExpressionType::SecondExoDerivative:
equation_type = SecondExoDerivative; equation_type = ExpressionType::SecondExoDerivative;
break; break;
case SecondExodetDerivative: case ExpressionType::SecondExodetDerivative:
equation_type = SecondExodetDerivative; equation_type = ExpressionType::SecondExodetDerivative;
break; break;
case SecondParamDerivative: case ExpressionType::SecondParamDerivative:
equation_type = SecondExodetDerivative; equation_type = ExpressionType::SecondExodetDerivative;
break; break;
case ThirdEndoDerivative: case ExpressionType::ThirdEndoDerivative:
equation_type = ThirdEndoDerivative; equation_type = ExpressionType::ThirdEndoDerivative;
break; break;
case ThirdExoDerivative: case ExpressionType::ThirdExoDerivative:
equation_type = ThirdExoDerivative; equation_type = ExpressionType::ThirdExoDerivative;
break; break;
case ThirdExodetDerivative: case ExpressionType::ThirdExodetDerivative:
equation_type = ThirdExodetDerivative; equation_type = ExpressionType::ThirdExodetDerivative;
break; break;
case ThirdParamDerivative: case ExpressionType::ThirdParamDerivative:
equation_type = ThirdExodetDerivative; equation_type = ExpressionType::ThirdExodetDerivative;
break; break;
default: default:
ostringstream tmp; ostringstream tmp;
tmp << " in print_expression, expression type " << static_cast<FNUMEXPR_ *>(it_code->second)->get_expression_type() << " not implemented yet\n"; tmp << " in print_expression, expression type " << static_cast<int>(static_cast<FNUMEXPR_ *>(it_code->second)->get_expression_type()) << " not implemented yet\n";
throw FatalExceptionHandling(tmp.str()); throw FatalExceptionHandling(tmp.str());
} }
break; break;
case FLDV: case Tags::FLDV:
//load a variable in the processor //load a variable in the processor
switch (static_cast<SymbolType>(static_cast<FLDV_ *>(it_code->second)->get_type())) switch (static_cast<SymbolType>(static_cast<FLDV_ *>(it_code->second)->get_type()))
{ {
@ -753,8 +753,8 @@ public:
mexPrintf("FLDV: Unknown variable type\n"); mexPrintf("FLDV: Unknown variable type\n");
} }
break; break;
case FLDSV: case Tags::FLDSV:
case FLDVS: case Tags::FLDVS:
//load a variable in the processor //load a variable in the processor
switch (static_cast<SymbolType>(static_cast<FLDSV_ *>(it_code->second)->get_type())) switch (static_cast<SymbolType>(static_cast<FLDSV_ *>(it_code->second)->get_type()))
{ {
@ -775,7 +775,7 @@ public:
Stack.push(get_variable(SymbolType::endogenous, var)); Stack.push(get_variable(SymbolType::endogenous, var));
if (compute) if (compute)
{ {
if (it_code->first == FLDSV) if (it_code->first == Tags::FLDSV)
{ {
if (evaluate) if (evaluate)
Stackf.push(ya[var]); Stackf.push(ya[var]);
@ -813,7 +813,7 @@ public:
mexPrintf("FLDSV: Unknown variable type\n"); mexPrintf("FLDSV: Unknown variable type\n");
} }
break; break;
case FLDT: case Tags::FLDT:
//load a temporary variable in the processor //load a temporary variable in the processor
var = static_cast<FLDT_ *>(it_code->second)->get_pos(); var = static_cast<FLDT_ *>(it_code->second)->get_pos();
#ifdef DEBUG #ifdef DEBUG
@ -825,7 +825,7 @@ public:
if (compute) if (compute)
Stackf.push(T[var*(periods+y_kmin+y_kmax)+it_]); Stackf.push(T[var*(periods+y_kmin+y_kmax)+it_]);
break; break;
case FLDST: case Tags::FLDST:
//load a temporary variable in the processor //load a temporary variable in the processor
var = static_cast<FLDST_ *>(it_code->second)->get_pos(); var = static_cast<FLDST_ *>(it_code->second)->get_pos();
#ifdef DEBUG #ifdef DEBUG
@ -837,7 +837,7 @@ public:
if (compute) if (compute)
Stackf.push(T[var]); Stackf.push(T[var]);
break; break;
case FLDU: case Tags::FLDU:
//load u variable in the processor //load u variable in the processor
var = static_cast<FLDU_ *>(it_code->second)->get_pos(); var = static_cast<FLDU_ *>(it_code->second)->get_pos();
#ifdef DEBUG #ifdef DEBUG
@ -850,7 +850,7 @@ public:
if (compute) if (compute)
Stackf.push(u[var]); Stackf.push(u[var]);
break; break;
case FLDSU: case Tags::FLDSU:
//load u variable in the processor //load u variable in the processor
var = static_cast<FLDSU_ *>(it_code->second)->get_pos(); var = static_cast<FLDSU_ *>(it_code->second)->get_pos();
#ifdef DEBUG #ifdef DEBUG
@ -862,7 +862,7 @@ public:
if (compute) if (compute)
Stackf.push(u[var]); Stackf.push(u[var]);
break; break;
case FLDR: case Tags::FLDR:
var = static_cast<FLDR_ *>(it_code->second)->get_pos(); var = static_cast<FLDR_ *>(it_code->second)->get_pos();
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FLDSR_ var=%d", var); mexPrintf("FLDSR_ var=%d", var);
@ -873,7 +873,7 @@ public:
if (compute) if (compute)
Stackf.push(r[var]); Stackf.push(r[var]);
break; break;
case FLDZ: case Tags::FLDZ:
//load 0 in the processor //load 0 in the processor
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FLDZ_"); mexPrintf("FLDZ_");
@ -884,7 +884,7 @@ public:
if (compute) if (compute)
Stackf.push(0.0); Stackf.push(0.0);
break; break;
case FLDC: case Tags::FLDC:
//load a numerical constant in the processor //load a numerical constant in the processor
ll = static_cast<FLDC_ *>(it_code->second)->get_value(); ll = static_cast<FLDC_ *>(it_code->second)->get_value();
tmp_out.str(""); tmp_out.str("");
@ -896,7 +896,7 @@ public:
if (compute) if (compute)
Stackf.push(ll); Stackf.push(ll);
break; break;
case FSTPV: case Tags::FSTPV:
//load a variable in the processor //load a variable in the processor
go_on = false; go_on = false;
switch (static_cast<SymbolType>(static_cast<FSTPV_ *>(it_code->second)->get_type())) switch (static_cast<SymbolType>(static_cast<FSTPV_ *>(it_code->second)->get_type()))
@ -983,7 +983,7 @@ public:
mexPrintf("FSTPV: Unknown variable type\n"); mexPrintf("FSTPV: Unknown variable type\n");
} }
break; break;
case FSTPSV: case Tags::FSTPSV:
go_on = false; go_on = false;
//load a variable in the processor //load a variable in the processor
switch (static_cast<SymbolType>(static_cast<FSTPSV_ *>(it_code->second)->get_type())) switch (static_cast<SymbolType>(static_cast<FSTPSV_ *>(it_code->second)->get_type()))
@ -1044,7 +1044,7 @@ public:
mexPrintf("FSTPSV: Unknown variable type\n"); mexPrintf("FSTPSV: Unknown variable type\n");
} }
break; break;
case FSTPT: case Tags::FSTPT:
go_on = false; go_on = false;
//store in a temporary variable from the processor //store in a temporary variable from the processor
var = static_cast<FSTPT_ *>(it_code->second)->get_pos(); var = static_cast<FSTPT_ *>(it_code->second)->get_pos();
@ -1060,7 +1060,7 @@ public:
Stackf.pop(); Stackf.pop();
} }
break; break;
case FSTPST: case Tags::FSTPST:
go_on = false; go_on = false;
//store in a temporary variable from the processor //store in a temporary variable from the processor
var = static_cast<FSTPST_ *>(it_code->second)->get_pos(); var = static_cast<FSTPST_ *>(it_code->second)->get_pos();
@ -1076,7 +1076,7 @@ public:
Stackf.pop(); Stackf.pop();
} }
break; break;
case FSTPU: case Tags::FSTPU:
go_on = false; go_on = false;
//store in u variable from the processor //store in u variable from the processor
var = static_cast<FSTPU_ *>(it_code->second)->get_pos(); var = static_cast<FSTPU_ *>(it_code->second)->get_pos();
@ -1093,7 +1093,7 @@ public:
Stackf.pop(); Stackf.pop();
} }
break; break;
case FSTPSU: case Tags::FSTPSU:
go_on = false; go_on = false;
//store in u variable from the processor //store in u variable from the processor
var = static_cast<FSTPSU_ *>(it_code->second)->get_pos(); var = static_cast<FSTPSU_ *>(it_code->second)->get_pos();
@ -1109,7 +1109,7 @@ public:
Stackf.pop(); Stackf.pop();
} }
break; break;
case FSTPR: case Tags::FSTPR:
go_on = false; go_on = false;
//store in residual variable from the processor //store in residual variable from the processor
var = static_cast<FSTPR_ *>(it_code->second)->get_pos(); var = static_cast<FSTPR_ *>(it_code->second)->get_pos();
@ -1125,7 +1125,7 @@ public:
Stackf.pop(); Stackf.pop();
} }
break; break;
case FSTPG: case Tags::FSTPG:
go_on = false; go_on = false;
//store in derivative (g) variable from the processor //store in derivative (g) variable from the processor
var = static_cast<FSTPG_ *>(it_code->second)->get_pos(); var = static_cast<FSTPG_ *>(it_code->second)->get_pos();
@ -1141,7 +1141,7 @@ public:
Stackf.pop(); Stackf.pop();
} }
break; break;
case FSTPG2: case Tags::FSTPG2:
go_on = false; go_on = false;
//store in derivative (g) variable from the processor //store in derivative (g) variable from the processor
eq = static_cast<FSTPG2_ *>(it_code->second)->get_row(); eq = static_cast<FSTPG2_ *>(it_code->second)->get_row();
@ -1158,7 +1158,7 @@ public:
Stackf.pop(); Stackf.pop();
} }
break; break;
case FSTPG3: case Tags::FSTPG3:
//store in derivative (g) variable from the processor //store in derivative (g) variable from the processor
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FSTPG3\n"); mexPrintf("FSTPG3\n");
@ -1178,7 +1178,7 @@ public:
pos_col = static_cast<FSTPG3_ *>(it_code->second)->get_col_pos(); pos_col = static_cast<FSTPG3_ *>(it_code->second)->get_col_pos();
switch (equation_type) switch (equation_type)
{ {
case FirstEndoDerivative: case ExpressionType::FirstEndoDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("Endo eq=%d, pos_col=%d, size=%d\n", eq, pos_col, size); mexPrintf("Endo eq=%d, pos_col=%d, size=%d\n", eq, pos_col, size);
#endif #endif
@ -1188,14 +1188,14 @@ public:
tmp_out << "/*jacob(" << eq << ", " << pos_col << " var= " << var << ")*/ jacob(" << eq+size*pos_col+1 << ") = " << Stack.top(); tmp_out << "/*jacob(" << eq << ", " << pos_col << " var= " << var << ")*/ jacob(" << eq+size*pos_col+1 << ") = " << Stack.top();
Stack.pop(); Stack.pop();
break; break;
case FirstOtherEndoDerivative: case ExpressionType::FirstOtherEndoDerivative:
if (compute) if (compute)
jacob_other_endo[eq + size*pos_col] = r; jacob_other_endo[eq + size*pos_col] = r;
tmp_out.str(""); tmp_out.str("");
tmp_out << "jacob_other_endo(" << eq+size*pos_col+1 << ") = " << Stack.top(); tmp_out << "jacob_other_endo(" << eq+size*pos_col+1 << ") = " << Stack.top();
Stack.pop(); Stack.pop();
break; break;
case FirstExoDerivative: case ExpressionType::FirstExoDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("Exo eq=%d, pos_col=%d, size=%d\n", eq, pos_col, size); mexPrintf("Exo eq=%d, pos_col=%d, size=%d\n", eq, pos_col, size);
#endif #endif
@ -1205,7 +1205,7 @@ public:
tmp_out << "/*jacob_exo(" << eq << ", " << pos_col << " var=" << var << ")*/ jacob_exo(" << eq+size*pos_col+1 << ") = " << Stack.top(); tmp_out << "/*jacob_exo(" << eq << ", " << pos_col << " var=" << var << ")*/ jacob_exo(" << eq+size*pos_col+1 << ") = " << Stack.top();
Stack.pop(); Stack.pop();
break; break;
case FirstExodetDerivative: case ExpressionType::FirstExodetDerivative:
if (compute) if (compute)
jacob_exo_det[eq + size*pos_col] = r; jacob_exo_det[eq + size*pos_col] = r;
tmp_out.str(""); tmp_out.str("");
@ -1214,7 +1214,7 @@ public:
break; break;
default: default:
ostringstream tmp; ostringstream tmp;
tmp << " in compute_block_time, variable " << EQN_type << " not used yet\n"; tmp << " in compute_block_time, variable " << static_cast<int>(EQN_type) << " not used yet\n";
//throw FatalExceptionHandling(tmp.str()); //throw FatalExceptionHandling(tmp.str());
mexPrintf("%s", tmp.str().c_str()); mexPrintf("%s", tmp.str().c_str());
} }
@ -1224,7 +1224,7 @@ public:
tmp_out.str(""); tmp_out.str("");
#endif #endif
break; break;
case FBINARY: case Tags::FBINARY:
op = static_cast<FBINARY_ *>(it_code->second)->get_op_type(); op = static_cast<FBINARY_ *>(it_code->second)->get_op_type();
v2 = Stack.top(); v2 = Stack.top();
Stack.pop(); Stack.pop();
@ -1559,7 +1559,7 @@ public:
; ;
} }
break; break;
case FUNARY: case Tags::FUNARY:
op = static_cast<FUNARY_ *>(it_code->second)->get_op_type(); op = static_cast<FUNARY_ *>(it_code->second)->get_op_type();
v1 = Stack.top(); v1 = Stack.top();
Stack.pop(); Stack.pop();
@ -1723,7 +1723,7 @@ public:
; ;
} }
break; break;
case FTRINARY: case Tags::FTRINARY:
op = static_cast<FTRINARY_ *>(it_code->second)->get_op_type(); op = static_cast<FTRINARY_ *>(it_code->second)->get_op_type();
v3 = Stack.top(); v3 = Stack.top();
Stack.pop(); Stack.pop();
@ -1760,7 +1760,7 @@ public:
mexPrintf("Error unknown Trinary operator=%d\n", op); mexEvalString("drawnow;"); mexPrintf("Error unknown Trinary operator=%d\n", op); mexEvalString("drawnow;");
} }
break; break;
case FCALL: case Tags::FCALL:
{ {
#ifdef DEBUG #ifdef DEBUG
mexPrintf("------------------------------\n"); mexPrintf("------------------------------\n");
@ -2010,7 +2010,7 @@ public:
#endif #endif
break; break;
} }
case FSTPTEF: case Tags::FSTPTEF:
go_on = false; go_on = false;
var = static_cast<FSTPTEF_ *>(it_code->second)->get_number(); var = static_cast<FSTPTEF_ *>(it_code->second)->get_number();
#ifdef DEBUG #ifdef DEBUG
@ -2047,7 +2047,7 @@ public:
mexEvalString("drawnow;"); mexEvalString("drawnow;");
#endif #endif
break; break;
case FLDTEF: case Tags::FLDTEF:
var = static_cast<FLDTEF_ *>(it_code->second)->get_number(); var = static_cast<FLDTEF_ *>(it_code->second)->get_number();
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FLDTEF\n"); mexPrintf("FLDTEF\n");
@ -2072,7 +2072,7 @@ public:
#endif #endif
break; break;
case FSTPTEFD: case Tags::FSTPTEFD:
{ {
go_on = false; go_on = false;
unsigned int indx = static_cast<FSTPTEFD_ *>(it_code->second)->get_indx(); unsigned int indx = static_cast<FSTPTEFD_ *>(it_code->second)->get_indx();
@ -2098,7 +2098,7 @@ public:
Stack.pop(); Stack.pop();
} }
break; break;
case FLDTEFD: case Tags::FLDTEFD:
{ {
unsigned int indx = static_cast<FLDTEFD_ *>(it_code->second)->get_indx(); unsigned int indx = static_cast<FLDTEFD_ *>(it_code->second)->get_indx();
unsigned int row = static_cast<FLDTEFD_ *>(it_code->second)->get_row(); unsigned int row = static_cast<FLDTEFD_ *>(it_code->second)->get_row();
@ -2119,7 +2119,7 @@ public:
Stack.push(tmp_out.str()); Stack.push(tmp_out.str());
} }
break; break;
case FSTPTEFDD: case Tags::FSTPTEFDD:
{ {
go_on = false; go_on = false;
unsigned int indx = static_cast<FSTPTEFDD_ *>(it_code->second)->get_indx(); unsigned int indx = static_cast<FSTPTEFDD_ *>(it_code->second)->get_indx();
@ -2149,7 +2149,7 @@ public:
} }
break; break;
case FLDTEFDD: case Tags::FLDTEFDD:
{ {
unsigned int indx = static_cast<FLDTEFDD_ *>(it_code->second)->get_indx(); unsigned int indx = static_cast<FLDTEFDD_ *>(it_code->second)->get_indx();
unsigned int row = static_cast<FLDTEFDD_ *>(it_code->second)->get_row(); unsigned int row = static_cast<FLDTEFDD_ *>(it_code->second)->get_row();
@ -2171,17 +2171,17 @@ public:
Stack.push(tmp_out.str()); Stack.push(tmp_out.str());
} }
break; break;
case FJMPIFEVAL: case Tags::FJMPIFEVAL:
tmp_out.str(""); tmp_out.str("");
tmp_out << "if (~evaluate)"; tmp_out << "if (~evaluate)";
go_on = false; go_on = false;
break; break;
case FJMP: case Tags::FJMP:
tmp_out.str(""); tmp_out.str("");
tmp_out << "else"; tmp_out << "else";
go_on = false; go_on = false;
break; break;
case FCUML: case Tags::FCUML:
if (compute) if (compute)
{ {
v1f = Stackf.top(); v1f = Stackf.top();
@ -2198,16 +2198,16 @@ public:
tmp_out << v1 << " + " << v2; tmp_out << v1 << " + " << v2;
Stack.push(tmp_out.str()); Stack.push(tmp_out.str());
break; break;
case FENDBLOCK: case Tags::FENDBLOCK:
case FENDEQU: case Tags::FENDEQU:
go_on = false; go_on = false;
break; break;
case FOK: case Tags::FOK:
break; break;
default: default:
ostringstream tmp; ostringstream tmp;
mexPrintf("Error it_code->first=%d unknown\n", it_code->first); mexEvalString("drawnow;"); mexPrintf("Error it_code->first=%d unknown\n", it_code->first); mexEvalString("drawnow;");
tmp << " in print_expression, unknown opcode " << it_code->first << "!! FENDEQU=" << FENDEQU << "\n"; tmp << " in print_expression, unknown opcode " << static_cast<int>(it_code->first) << "!! FENDEQU=" << static_cast<int>(Tags::FENDEQU) << "\n";
throw FatalExceptionHandling(tmp.str()); throw FatalExceptionHandling(tmp.str());
} }
it_code++; it_code++;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright © 2013-2020 Dynare Team * Copyright © 2013-2021 Dynare Team
* *
* This file is part of Dynare. * This file is part of Dynare.
* *
@ -147,121 +147,121 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
switch (it_code->first) switch (it_code->first)
{ {
case FNUMEXPR: case Tags::FNUMEXPR:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FNUMEXPR\n"); mexPrintf("FNUMEXPR\n");
#endif #endif
it_code_expr = it_code; it_code_expr = it_code;
switch (static_cast<FNUMEXPR_ *>(it_code->second)->get_expression_type()) switch (static_cast<FNUMEXPR_ *>(it_code->second)->get_expression_type())
{ {
case TemporaryTerm: case ExpressionType::TemporaryTerm:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("TemporaryTerm\n"); mexPrintf("TemporaryTerm\n");
#endif #endif
EQN_type = TemporaryTerm; EQN_type = ExpressionType::TemporaryTerm;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
#ifdef DEBUG #ifdef DEBUG
mexPrintf("EQN_equation=%d\n", EQN_equation); mexEvalString("drawnow;"); mexPrintf("EQN_equation=%d\n", EQN_equation); mexEvalString("drawnow;");
#endif #endif
break; break;
case ModelEquation: case ExpressionType::ModelEquation:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("ModelEquation\n"); mexPrintf("ModelEquation\n");
#endif #endif
EQN_type = ModelEquation; EQN_type = ExpressionType::ModelEquation;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
break; break;
case FirstEndoDerivative: case ExpressionType::FirstEndoDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FirstEndoDerivative\n"); mexPrintf("FirstEndoDerivative\n");
#endif #endif
EQN_type = FirstEndoDerivative; EQN_type = ExpressionType::FirstEndoDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1(); EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1();
break; break;
case FirstOtherEndoDerivative: case ExpressionType::FirstOtherEndoDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FirstOtherEndoDerivative\n"); mexPrintf("FirstOtherEndoDerivative\n");
#endif #endif
EQN_type = FirstOtherEndoDerivative; EQN_type = ExpressionType::FirstOtherEndoDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1(); EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1();
break; break;
case FirstExoDerivative: case ExpressionType::FirstExoDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FirstExoDerivative\n"); mexPrintf("FirstExoDerivative\n");
#endif #endif
EQN_type = FirstExoDerivative; EQN_type = ExpressionType::FirstExoDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1(); EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1();
break; break;
case FirstExodetDerivative: case ExpressionType::FirstExodetDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FirstExodetDerivative\n"); mexPrintf("FirstExodetDerivative\n");
#endif #endif
EQN_type = FirstExodetDerivative; EQN_type = ExpressionType::FirstExodetDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1(); EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1();
break; break;
case FirstParamDerivative: case ExpressionType::FirstParamDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FirstParamDerivative\n"); mexPrintf("FirstParamDerivative\n");
#endif #endif
EQN_type = FirstParamDerivative; EQN_type = ExpressionType::FirstParamDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
break; break;
case SecondEndoDerivative: case ExpressionType::SecondEndoDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("SecondEndoDerivative\n"); mexPrintf("SecondEndoDerivative\n");
#endif #endif
EQN_type = SecondEndoDerivative; EQN_type = ExpressionType::SecondEndoDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1(); EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1();
EQN_dvar2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable2(); EQN_dvar2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable2();
EQN_lag2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag2(); EQN_lag2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag2();
break; break;
case SecondExoDerivative: case ExpressionType::SecondExoDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("SecondExoDerivative\n"); mexPrintf("SecondExoDerivative\n");
#endif #endif
EQN_type = SecondExoDerivative; EQN_type = ExpressionType::SecondExoDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1(); EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1();
EQN_dvar2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable2(); EQN_dvar2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable2();
EQN_lag2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag2(); EQN_lag2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag2();
break; break;
case SecondExodetDerivative: case ExpressionType::SecondExodetDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("SecondExodetDerivative\n"); mexPrintf("SecondExodetDerivative\n");
#endif #endif
EQN_type = SecondExodetDerivative; EQN_type = ExpressionType::SecondExodetDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1(); EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1();
EQN_dvar2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable2(); EQN_dvar2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable2();
EQN_lag2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag2(); EQN_lag2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag2();
break; break;
case SecondParamDerivative: case ExpressionType::SecondParamDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("SecondParamDerivative\n"); mexPrintf("SecondParamDerivative\n");
#endif #endif
EQN_type = SecondParamDerivative; EQN_type = ExpressionType::SecondParamDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
EQN_dvar2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable2(); EQN_dvar2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable2();
break; break;
case ThirdEndoDerivative: case ExpressionType::ThirdEndoDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("ThirdEndoDerivative\n"); mexPrintf("ThirdEndoDerivative\n");
#endif #endif
EQN_type = ThirdEndoDerivative; EQN_type = ExpressionType::ThirdEndoDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1(); EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1();
@ -270,11 +270,11 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
EQN_dvar3 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable3(); EQN_dvar3 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable3();
EQN_lag3 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag3(); EQN_lag3 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag3();
break; break;
case ThirdExoDerivative: case ExpressionType::ThirdExoDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("ThirdExoDerivative\n"); mexPrintf("ThirdExoDerivative\n");
#endif #endif
EQN_type = ThirdExoDerivative; EQN_type = ExpressionType::ThirdExoDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1(); EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1();
@ -283,11 +283,11 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
EQN_dvar3 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable3(); EQN_dvar3 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable3();
EQN_lag3 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag3(); EQN_lag3 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag3();
break; break;
case ThirdExodetDerivative: case ExpressionType::ThirdExodetDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("ThirdExodetDerivative\n"); mexPrintf("ThirdExodetDerivative\n");
#endif #endif
EQN_type = ThirdExodetDerivative; EQN_type = ExpressionType::ThirdExodetDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1(); EQN_lag1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag1();
@ -296,11 +296,11 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
EQN_dvar3 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable3(); EQN_dvar3 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable3();
EQN_lag3 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag3(); EQN_lag3 = static_cast<FNUMEXPR_ *>(it_code->second)->get_lag3();
break; break;
case ThirdParamDerivative: case ExpressionType::ThirdParamDerivative:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("ThirdParamDerivative\n"); mexPrintf("ThirdParamDerivative\n");
#endif #endif
EQN_type = ThirdParamDerivative; EQN_type = ExpressionType::ThirdParamDerivative;
EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation(); EQN_equation = static_cast<FNUMEXPR_ *>(it_code->second)->get_equation();
EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1(); EQN_dvar1 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable1();
EQN_dvar2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable2(); EQN_dvar2 = static_cast<FNUMEXPR_ *>(it_code->second)->get_dvariable2();
@ -308,7 +308,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
break; break;
} }
break; break;
case FLDV: case Tags::FLDV:
//load a variable in the processor //load a variable in the processor
switch (static_cast<SymbolType>(static_cast<FLDV_ *>(it_code->second)->get_type())) switch (static_cast<SymbolType>(static_cast<FLDV_ *>(it_code->second)->get_type()))
{ {
@ -361,7 +361,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
mexPrintf("FLDV: Unknown variable type\n"); mexPrintf("FLDV: Unknown variable type\n");
} }
break; break;
case FLDSV: case Tags::FLDSV:
//load a variable in the processor //load a variable in the processor
switch (static_cast<SymbolType>(static_cast<FLDSV_ *>(it_code->second)->get_type())) switch (static_cast<SymbolType>(static_cast<FLDSV_ *>(it_code->second)->get_type()))
{ {
@ -409,7 +409,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
mexPrintf("FLDSV: Unknown variable type\n"); mexPrintf("FLDSV: Unknown variable type\n");
} }
break; break;
case FLDVS: case Tags::FLDVS:
//load a variable in the processor //load a variable in the processor
switch (static_cast<SymbolType>(static_cast<FLDVS_ *>(it_code->second)->get_type())) switch (static_cast<SymbolType>(static_cast<FLDVS_ *>(it_code->second)->get_type()))
{ {
@ -451,7 +451,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
mexPrintf("FLDVS: Unknown variable type\n"); mexPrintf("FLDVS: Unknown variable type\n");
} }
break; break;
case FLDT: case Tags::FLDT:
//load a temporary variable in the processor //load a temporary variable in the processor
var = static_cast<FLDT_ *>(it_code->second)->get_pos(); var = static_cast<FLDT_ *>(it_code->second)->get_pos();
#ifdef DEBUG #ifdef DEBUG
@ -460,7 +460,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
Stack.push(T[var*(periods+y_kmin+y_kmax)+it_]); Stack.push(T[var*(periods+y_kmin+y_kmax)+it_]);
break; break;
case FLDST: case Tags::FLDST:
//load a temporary variable in the processor //load a temporary variable in the processor
var = static_cast<FLDST_ *>(it_code->second)->get_pos(); var = static_cast<FLDST_ *>(it_code->second)->get_pos();
#ifdef DEBUG #ifdef DEBUG
@ -472,7 +472,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
tmp_out << " T[" << var << "](" << T[var] << ")"; tmp_out << " T[" << var << "](" << T[var] << ")";
#endif #endif
break; break;
case FLDU: case Tags::FLDU:
//load u variable in the processor //load u variable in the processor
var = static_cast<FLDU_ *>(it_code->second)->get_pos(); var = static_cast<FLDU_ *>(it_code->second)->get_pos();
var += Per_u_; var += Per_u_;
@ -482,7 +482,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
Stack.push(u[var]); Stack.push(u[var]);
break; break;
case FLDSU: case Tags::FLDSU:
//load u variable in the processor //load u variable in the processor
var = static_cast<FLDSU_ *>(it_code->second)->get_pos(); var = static_cast<FLDSU_ *>(it_code->second)->get_pos();
#ifdef DEBUG #ifdef DEBUG
@ -491,7 +491,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
Stack.push(u[var]); Stack.push(u[var]);
break; break;
case FLDR: case Tags::FLDR:
//load u variable in the processor //load u variable in the processor
var = static_cast<FLDR_ *>(it_code->second)->get_pos(); var = static_cast<FLDR_ *>(it_code->second)->get_pos();
#ifdef DEBUG #ifdef DEBUG
@ -499,7 +499,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
Stack.push(r[var]); Stack.push(r[var]);
break; break;
case FLDZ: case Tags::FLDZ:
//load 0 in the processor //load 0 in the processor
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FLDZ\n"); mexPrintf("FLDZ\n");
@ -509,7 +509,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
tmp_out << " 0"; tmp_out << " 0";
#endif #endif
break; break;
case FLDC: case Tags::FLDC:
//load a numerical constant in the processor //load a numerical constant in the processor
ll = static_cast<FLDC_ *>(it_code->second)->get_value(); ll = static_cast<FLDC_ *>(it_code->second)->get_value();
#ifdef DEBUG #ifdef DEBUG
@ -519,7 +519,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
Stack.push(ll); Stack.push(ll);
break; break;
case FSTPV: case Tags::FSTPV:
//load a variable in the processor //load a variable in the processor
switch (static_cast<SymbolType>(static_cast<FSTPV_ *>(it_code->second)->get_type())) switch (static_cast<SymbolType>(static_cast<FSTPV_ *>(it_code->second)->get_type()))
{ {
@ -569,7 +569,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
mexPrintf("FSTPV: Unknown variable type\n"); mexPrintf("FSTPV: Unknown variable type\n");
} }
break; break;
case FSTPSV: case Tags::FSTPSV:
//load a variable in the processor //load a variable in the processor
switch (static_cast<SymbolType>(static_cast<FSTPSV_ *>(it_code->second)->get_type())) switch (static_cast<SymbolType>(static_cast<FSTPSV_ *>(it_code->second)->get_type()))
{ {
@ -603,7 +603,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
mexPrintf("FSTPSV: Unknown variable type\n"); mexPrintf("FSTPSV: Unknown variable type\n");
} }
break; break;
case FSTPT: case Tags::FSTPT:
//store in a temporary variable from the processor //store in a temporary variable from the processor
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FSTPT\n"); mexPrintf("FSTPT\n");
@ -618,7 +618,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
Stack.pop(); Stack.pop();
break; break;
case FSTPST: case Tags::FSTPST:
//store in a temporary variable from the processor //store in a temporary variable from the processor
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FSTPST\n"); mexPrintf("FSTPST\n");
@ -635,7 +635,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
Stack.pop(); Stack.pop();
break; break;
case FSTPU: case Tags::FSTPU:
//store in u variable from the processor //store in u variable from the processor
var = static_cast<FSTPU_ *>(it_code->second)->get_pos(); var = static_cast<FSTPU_ *>(it_code->second)->get_pos();
var += Per_u_; var += Per_u_;
@ -651,7 +651,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
Stack.pop(); Stack.pop();
break; break;
case FSTPSU: case Tags::FSTPSU:
//store in u variable from the processor //store in u variable from the processor
var = static_cast<FSTPSU_ *>(it_code->second)->get_pos(); var = static_cast<FSTPSU_ *>(it_code->second)->get_pos();
#ifdef DEBUG #ifdef DEBUG
@ -666,7 +666,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
Stack.pop(); Stack.pop();
break; break;
case FSTPR: case Tags::FSTPR:
//store in residual variable from the processor //store in residual variable from the processor
var = static_cast<FSTPR_ *>(it_code->second)->get_pos(); var = static_cast<FSTPR_ *>(it_code->second)->get_pos();
#ifdef DEBUG #ifdef DEBUG
@ -682,7 +682,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
Stack.pop(); Stack.pop();
break; break;
case FSTPG: case Tags::FSTPG:
//store in derivative (g) variable from the processor //store in derivative (g) variable from the processor
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FSTPG\n"); mexPrintf("FSTPG\n");
@ -698,13 +698,13 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
Stack.pop(); Stack.pop();
break; break;
case FSTPG2: case Tags::FSTPG2:
//store in the jacobian matrix //store in the jacobian matrix
rr = Stack.top(); rr = Stack.top();
if (EQN_type != FirstEndoDerivative) if (EQN_type != ExpressionType::FirstEndoDerivative)
{ {
ostringstream tmp; ostringstream tmp;
tmp << " in compute_block_time, impossible case " << EQN_type << " not implement in static jacobian\n"; tmp << " in compute_block_time, impossible case " << static_cast<int>(EQN_type) << " not implement in static jacobian\n";
throw FatalExceptionHandling(tmp.str()); throw FatalExceptionHandling(tmp.str());
} }
eq = static_cast<FSTPG2_ *>(it_code->second)->get_row(); eq = static_cast<FSTPG2_ *>(it_code->second)->get_row();
@ -715,7 +715,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
jacob[eq + size*var] = rr; jacob[eq + size*var] = rr;
break; break;
case FSTPG3: case Tags::FSTPG3:
//store in derivative (g) variable from the processor //store in derivative (g) variable from the processor
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FSTPG3 Evaluate=%d\n", evaluate); mexPrintf("FSTPG3 Evaluate=%d\n", evaluate);
@ -730,7 +730,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
rr = Stack.top(); rr = Stack.top();
switch (EQN_type) switch (EQN_type)
{ {
case FirstEndoDerivative: case ExpressionType::FirstEndoDerivative:
eq = static_cast<FSTPG3_ *>(it_code->second)->get_row(); eq = static_cast<FSTPG3_ *>(it_code->second)->get_row();
var = static_cast<FSTPG3_ *>(it_code->second)->get_col(); var = static_cast<FSTPG3_ *>(it_code->second)->get_col();
lag = static_cast<FSTPG3_ *>(it_code->second)->get_lag(); lag = static_cast<FSTPG3_ *>(it_code->second)->get_lag();
@ -741,7 +741,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
jacob[eq + size*pos_col] = rr; jacob[eq + size*pos_col] = rr;
break; break;
case FirstOtherEndoDerivative: case ExpressionType::FirstOtherEndoDerivative:
//eq = static_cast<FSTPG3_ *>(it_code->second)->get_row(); //eq = static_cast<FSTPG3_ *>(it_code->second)->get_row();
eq = EQN_equation; eq = EQN_equation;
var = static_cast<FSTPG3_ *>(it_code->second)->get_col(); var = static_cast<FSTPG3_ *>(it_code->second)->get_col();
@ -753,7 +753,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
jacob_other_endo[eq + size*pos_col] = rr; jacob_other_endo[eq + size*pos_col] = rr;
break; break;
case FirstExoDerivative: case ExpressionType::FirstExoDerivative:
//eq = static_cast<FSTPG3_ *>(it_code->second)->get_row(); //eq = static_cast<FSTPG3_ *>(it_code->second)->get_row();
eq = EQN_equation; eq = EQN_equation;
var = static_cast<FSTPG3_ *>(it_code->second)->get_col(); var = static_cast<FSTPG3_ *>(it_code->second)->get_col();
@ -765,7 +765,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
jacob_exo[eq + size*pos_col] = rr; jacob_exo[eq + size*pos_col] = rr;
break; break;
case FirstExodetDerivative: case ExpressionType::FirstExodetDerivative:
//eq = static_cast<FSTPG3_ *>(it_code->second)->get_row(); //eq = static_cast<FSTPG3_ *>(it_code->second)->get_row();
eq = EQN_equation; eq = EQN_equation;
var = static_cast<FSTPG3_ *>(it_code->second)->get_col(); var = static_cast<FSTPG3_ *>(it_code->second)->get_col();
@ -780,7 +780,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
break; break;
default: default:
ostringstream tmp; ostringstream tmp;
tmp << " in compute_block_time, variable " << EQN_type << " not used yet\n"; tmp << " in compute_block_time, variable " << static_cast<int>(EQN_type) << " not used yet\n";
throw FatalExceptionHandling(tmp.str()); throw FatalExceptionHandling(tmp.str());
} }
// #ifdef DEBUG // #ifdef DEBUG
@ -791,7 +791,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
Stack.pop(); Stack.pop();
break; break;
case FBINARY: case Tags::FBINARY:
op = static_cast<FBINARY_ *>(it_code->second)->get_op_type(); op = static_cast<FBINARY_ *>(it_code->second)->get_op_type();
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FBINARY, op=%d\n", op); mexPrintf("FBINARY, op=%d\n", op);
@ -947,7 +947,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
} }
} }
break; break;
case FUNARY: case Tags::FUNARY:
op = static_cast<FUNARY_ *>(it_code->second)->get_op_type(); op = static_cast<FUNARY_ *>(it_code->second)->get_op_type();
v1 = Stack.top(); v1 = Stack.top();
Stack.pop(); Stack.pop();
@ -1096,7 +1096,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
} }
} }
break; break;
case FTRINARY: case Tags::FTRINARY:
op = static_cast<FTRINARY_ *>(it_code->second)->get_op_type(); op = static_cast<FTRINARY_ *>(it_code->second)->get_op_type();
v3 = Stack.top(); v3 = Stack.top();
Stack.pop(); Stack.pop();
@ -1128,10 +1128,10 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
} }
break; break;
case FPUSH: case Tags::FPUSH:
break; break;
case FCALL: case Tags::FCALL:
{ {
#ifdef DEBUG #ifdef DEBUG
mexPrintf("------------------------------\n"); mexPrintf("------------------------------\n");
@ -1344,7 +1344,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
} }
} }
break; break;
case FSTPTEF: case Tags::FSTPTEF:
var = static_cast<FSTPTEF_ *>(it_code->second)->get_number(); var = static_cast<FSTPTEF_ *>(it_code->second)->get_number();
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FSTPTEF\n"); mexPrintf("FSTPTEF\n");
@ -1357,7 +1357,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
Stack.pop(); Stack.pop();
break; break;
case FLDTEF: case Tags::FLDTEF:
var = static_cast<FLDTEF_ *>(it_code->second)->get_number(); var = static_cast<FLDTEF_ *>(it_code->second)->get_number();
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FLDTEF\n"); mexPrintf("FLDTEF\n");
@ -1367,7 +1367,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
#endif #endif
Stack.push(TEF[var-1]); Stack.push(TEF[var-1]);
break; break;
case FSTPTEFD: case Tags::FSTPTEFD:
{ {
unsigned int indx = static_cast<FSTPTEFD_ *>(it_code->second)->get_indx(); unsigned int indx = static_cast<FSTPTEFD_ *>(it_code->second)->get_indx();
unsigned int row = static_cast<FSTPTEFD_ *>(it_code->second)->get_row(); unsigned int row = static_cast<FSTPTEFD_ *>(it_code->second)->get_row();
@ -1387,7 +1387,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
} }
break; break;
case FLDTEFD: case Tags::FLDTEFD:
{ {
unsigned int indx = static_cast<FLDTEFD_ *>(it_code->second)->get_indx(); unsigned int indx = static_cast<FLDTEFD_ *>(it_code->second)->get_indx();
unsigned int row = static_cast<FLDTEFD_ *>(it_code->second)->get_row(); unsigned int row = static_cast<FLDTEFD_ *>(it_code->second)->get_row();
@ -1400,7 +1400,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
Stack.push(TEFD[make_pair(indx, row-1)]); Stack.push(TEFD[make_pair(indx, row-1)]);
} }
break; break;
case FSTPTEFDD: case Tags::FSTPTEFDD:
{ {
unsigned int indx = static_cast<FSTPTEFDD_ *>(it_code->second)->get_indx(); unsigned int indx = static_cast<FSTPTEFDD_ *>(it_code->second)->get_indx();
unsigned int row = static_cast<FSTPTEFDD_ *>(it_code->second)->get_row(); unsigned int row = static_cast<FSTPTEFDD_ *>(it_code->second)->get_row();
@ -1421,7 +1421,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
} }
break; break;
case FLDTEFDD: case Tags::FLDTEFDD:
{ {
unsigned int indx = static_cast<FLDTEFDD_ *>(it_code->second)->get_indx(); unsigned int indx = static_cast<FLDTEFDD_ *>(it_code->second)->get_indx();
unsigned int row = static_cast<FLDTEFDD_ *>(it_code->second)->get_row(); unsigned int row = static_cast<FLDTEFDD_ *>(it_code->second)->get_row();
@ -1435,28 +1435,28 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
Stack.push(TEFDD[make_pair(indx, make_pair(row-1, col-1))]); Stack.push(TEFDD[make_pair(indx, make_pair(row-1, col-1))]);
} }
break; break;
case FCUML: case Tags::FCUML:
v1 = Stack.top(); v1 = Stack.top();
Stack.pop(); Stack.pop();
v2 = Stack.top(); v2 = Stack.top();
Stack.pop(); Stack.pop();
Stack.push(v1+v2); Stack.push(v1+v2);
break; break;
case FENDBLOCK: case Tags::FENDBLOCK:
//it's the block end //it's the block end
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FENDBLOCK\n"); mexPrintf("FENDBLOCK\n");
#endif #endif
go_on = false; go_on = false;
break; break;
case FBEGINBLOCK: case Tags::FBEGINBLOCK:
mexPrintf("Impossible case in Bytecode\n"); mexPrintf("Impossible case in Bytecode\n");
break; break;
case FENDEQU: case Tags::FENDEQU:
if (no_derivative) if (no_derivative)
go_on = false; go_on = false;
break; break;
case FJMPIFEVAL: case Tags::FJMPIFEVAL:
if (evaluate) if (evaluate)
{ {
#ifdef DEBUG #ifdef DEBUG
@ -1466,14 +1466,14 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
it_code += static_cast<FJMPIFEVAL_ *>(it_code->second)->get_pos() /* - 1*/; it_code += static_cast<FJMPIFEVAL_ *>(it_code->second)->get_pos() /* - 1*/;
} }
break; break;
case FJMP: case Tags::FJMP:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FJMP length=%d\n", static_cast<FJMP_ *>(it_code->second)->get_pos()); mexPrintf("FJMP length=%d\n", static_cast<FJMP_ *>(it_code->second)->get_pos());
mexEvalString("drawnow;"); mexEvalString("drawnow;");
#endif #endif
it_code += static_cast<FJMP_ *>(it_code->second)->get_pos() /*- 1 */; it_code += static_cast<FJMP_ *>(it_code->second)->get_pos() /*- 1 */;
break; break;
case FOK: case Tags::FOK:
op = static_cast<FOK_ *>(it_code->second)->get_arg(); op = static_cast<FOK_ *>(it_code->second)->get_arg();
if (Stack.size() > 0) if (Stack.size() > 0)
{ {
@ -1484,7 +1484,7 @@ Evaluate::compute_block_time(const int Per_u_, const bool evaluate, /*const int
break; break;
default: default:
ostringstream tmp; ostringstream tmp;
tmp << " in compute_block_time, unknown opcode " << it_code->first << "\n"; tmp << " in compute_block_time, unknown opcode " << static_cast<int>(it_code->first) << "\n";
throw FatalExceptionHandling(tmp.str()); throw FatalExceptionHandling(tmp.str());
} }
#ifdef DEBUG #ifdef DEBUG

View File

@ -1,5 +1,5 @@
/* /*
* Copyright © 2007-2020 Dynare Team * Copyright © 2007-2021 Dynare Team
* *
* This file is part of Dynare. * This file is part of Dynare.
* *
@ -551,7 +551,7 @@ Interpreter::print_a_block()
bool space = false; bool space = false;
while (go_on) while (go_on)
{ {
if (it_code->first == FENDBLOCK) if (it_code->first == Tags::FENDBLOCK)
{ {
go_on = false; go_on = false;
it_code++; it_code++;
@ -652,7 +652,7 @@ Interpreter::MainLoop(string bin_basename, CodeLoad code, bool evaluate, int blo
{ {
switch (it_code->first) switch (it_code->first)
{ {
case FBEGINBLOCK: case Tags::FBEGINBLOCK:
Block_Count++; Block_Count++;
#ifdef DEBUG #ifdef DEBUG
mexPrintf("---------------------------------------------------------\n"); mexPrintf("---------------------------------------------------------\n");
@ -745,14 +745,14 @@ Interpreter::MainLoop(string bin_basename, CodeLoad code, bool evaluate, int blo
} }
break; break;
case FEND: case Tags::FEND:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FEND\n"); mexPrintf("FEND\n");
#endif #endif
go_on = false; go_on = false;
it_code++; it_code++;
break; break;
case FDIMT: case Tags::FDIMT:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FDIMT size=%d\n", static_cast<FDIMT_ *>(it_code->second)->get_size()); mexPrintf("FDIMT size=%d\n", static_cast<FDIMT_ *>(it_code->second)->get_size());
#endif #endif
@ -768,7 +768,7 @@ Interpreter::MainLoop(string bin_basename, CodeLoad code, bool evaluate, int blo
else else
it_code++; it_code++;
break; break;
case FDIMST: case Tags::FDIMST:
#ifdef DEBUG #ifdef DEBUG
mexPrintf("FDIMST size=%d\n", static_cast<FDIMST_ *>(it_code->second)->get_size()); mexPrintf("FDIMST size=%d\n", static_cast<FDIMST_ *>(it_code->second)->get_size());
#endif #endif
@ -798,7 +798,7 @@ Interpreter::MainLoop(string bin_basename, CodeLoad code, bool evaluate, int blo
break; break;
default: default:
ostringstream tmp; ostringstream tmp;
tmp << " in compute_blocks, unknown command " << it_code->first << " (block=" << Block_Count << ")\n"; tmp << " in compute_blocks, unknown command " << static_cast<int>(it_code->first) << " (block=" << Block_Count << ")\n";
throw FatalExceptionHandling(tmp.str()); throw FatalExceptionHandling(tmp.str());
} }
} }

@ -1 +1 @@
Subproject commit ce09f6620a260af855d310d664da5e85cd5f759e Subproject commit 07391e0f9fdc8e697131cd3e292d6c9f23afd63b