Add min(,) max(,) and dummy() functions to dynare... Buggy until tomorrow ;-)

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1417 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
adjemian 2007-10-05 19:47:27 +00:00
parent aa9b217788
commit 163c5b4146
12 changed files with 2271 additions and 2049 deletions

View File

@ -319,6 +319,24 @@ DataTree::AddSqRt(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddMaX(NodeID iArg1, NodeID iArg2)
{
return AddBinaryOp(iArg1, oMax, iArg2);
}
NodeID
DataTree::AddMin(NodeID iArg1, NodeID iArg2)
{
return AddBinaryOp(iArg1, oMin, iArg2);
}
NodeID
DataTree::AddDuMmY(NodeID iArg1)
{
return AddUnaryOp(oDummy,iArg1);
}
NodeID
DataTree::AddEqual(NodeID iArg1, NodeID iArg2)
{

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,7 @@ class ParsingDriver;
%token BVAR_PRIOR_MU BVAR_PRIOR_OMEGA BVAR_PRIOR_TAU BVAR_PRIOR_TRAIN
%token BVAR_REPLIC
%token CALIB CALIB_VAR CHECK CONF_SIG CONSTANT CORR COVAR CUTOFF
%token DATAFILE DR_ALGO DROP DSAMPLE DYNASAVE DYNATYPE
%token DATAFILE DR_ALGO DROP DSAMPLE DUMMY DYNASAVE DYNATYPE
%token END ENDVAL EQUAL ESTIMATION ESTIMATED_PARAMS ESTIMATED_PARAMS_BOUNDS ESTIMATED_PARAMS_INIT
%token FILENAME FILTER_STEP_AHEAD FILTERED_VARS FIRST_OBS
%token <string_val> FLOAT_NUMBER
@ -51,8 +51,8 @@ class ParsingDriver;
%token <string_val> INT_NUMBER
%token INV_GAMMA_PDF IRF
%token KALMAN_ALGO KALMAN_TOL
%token LAPLACE LCC_COMPILER LIK_ALGO LIK_INIT LINEAR LOAD_MH_FILE LOGLINEAR MARKOWITZ
%token MH_DROP MH_INIT_SCALE MH_JSCALE MH_MODE MH_NBLOCKS MH_REPLIC MH_RECOVER
%token LAPLACE LCC_COMPILER LIK_ALGO LIK_INIT LINEAR LOAD_MH_FILE LOGLINEAR MARKOWITZ MAX
%token MH_DROP MH_INIT_SCALE MH_JSCALE MH_MODE MH_NBLOCKS MH_REPLIC MH_RECOVER MIN
%token MODE_CHECK MODE_COMPUTE MODE_FILE MODEL MODEL_COMPARISON MSHOCKS
%token MODEL_COMPARISON_APPROXIMATION MODIFIEDHARMONICMEAN MOMENTS_VARENDO
%token <string_val> NAME
@ -281,14 +281,20 @@ expression : '(' expression ')'
{ $$ = driver.add_atan($3); }
| SQRT '(' expression ')'
{ $$ = driver.add_sqrt($3); }
| DUMMY '(' expression ')'
{ $$ = driver.add_dummy($3); }
| MAX '(' expression COMMA expression ')'
{ $$ = driver.add_max($3 , $5); }
| MIN '(' expression COMMA expression ')'
{ $$ = driver.add_min($3 , $5); }
| NAME '(' comma_expression ')'
{ $$ = driver.add_unknown_function($1); }
;
comma_expression : expression
{ driver.add_unknown_function_arg($1); }
| comma_expression COMMA expression
{ driver.add_unknown_function_arg($3); }
/* | comma_expression COMMA expression
{ driver.add_unknown_function_arg($3); }*/
;
initval : INITVAL ';' initval_list END
@ -395,6 +401,12 @@ hand_side : '(' hand_side ')'
{ $$ = driver.add_atan($3); }
| SQRT '(' hand_side ')'
{ $$ = driver.add_sqrt($3); }
| DUMMY '(' expression ')'
{ $$ = driver.add_dummy($3); }
| MAX '(' expression COMMA expression ')'
{ $$ = driver.add_max($3 , $5); }
| MIN '(' expression COMMA expression ')'
{ $$ = driver.add_min($3 , $5); }
;
pound_expression: '#' NAME EQUAL hand_side ';'

View File

@ -260,7 +260,10 @@ int sigma_e = 0;
<DYNARE_STATEMENT,DYNARE_BLOCK>asinh {return token::ASINH;}
<DYNARE_STATEMENT,DYNARE_BLOCK>acosh {return token::ACOSH;}
<DYNARE_STATEMENT,DYNARE_BLOCK>atanh {return token::ATANH;}
<DYNARE_STATEMENT,DYNARE_BLOCK>sqrt {return token::SQRT;}
<DYNARE_STATEMENT,DYNARE_BLOCK>sqrt {return token::SQRT;}
<DYNARE_STATEMENT,DYNARE_BLOCK>max {return token::MAX;}
<DYNARE_STATEMENT,DYNARE_BLOCK>min {return token::MIN;}
<DYNARE_STATEMENT,DYNARE_BLOCK>dummy {return token::DUMMY;}
/* options for GSA module by Marco Ratto */
<DYNARE_STATEMENT>identification {return token::IDENTIFICATION;}

View File

@ -521,6 +521,8 @@ UnaryOpNode::computeDerivative(int varID)
case oSqrt:
t11 = datatree.AddPlus(this, this);
return datatree.AddDivide(darg, t11);
case oDummy:
return datatree.Zero;
}
cerr << "Impossible case!" << endl;
exit(-1);
@ -572,6 +574,8 @@ UnaryOpNode::cost(const temporary_terms_type &temporary_terms, bool is_matlab) c
return cost + 350;
case oSqrt:
return cost + 570;
case oDummy:
return cost + 200;
}
else
// Cost for C files
@ -606,6 +610,8 @@ UnaryOpNode::cost(const temporary_terms_type &temporary_terms, bool is_matlab) c
return cost + 150;
case oSqrt:
return cost + 90;
case oDummy:
return cost + 50;
}
cerr << "Impossible case!" << endl;
exit(-1);
@ -674,10 +680,23 @@ UnaryOpNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
return;
}
if (op_code == oDummy)
{
if (OFFSET(output_type))
output << "double";
output << "(";
arg->writeOutput(output, output_type, temporary_terms);
output << ">0)";
return;
}
// Always put parenthesis around uminus nodes
if (op_code == oUminus)
output << "(";
switch(op_code)
{
case oUminus:
@ -797,6 +816,8 @@ UnaryOpNode::eval_opcode(UnaryOpcode op_code, double v) throw (EvalException)
return(atanh(v));
case oSqrt:
return(sqrt(v));
case oDummy:
return(double (v>0));
}
// Impossible
throw EvalException();
@ -899,8 +920,22 @@ BinaryOpNode::computeDerivative(int varID)
t15 = datatree.AddPlus(t12, t14);
return datatree.AddTimes(t15, this);
}
case oMax:
t11 = datatree.AddMinus(arg1,arg2);
t12 = datatree.AddDuMmY(t11);
t13 = datatree.AddTimes(t12,darg1);
t14 = datatree.AddMinus(datatree.One,t12);
t15 = datatree.AddTimes(t14,darg2);
return datatree.AddPlus(t15,t13);
case oMin:
t11 = datatree.AddMinus(arg2,arg1);
t12 = datatree.AddDuMmY(t11);
t13 = datatree.AddTimes(t12,darg1);
t14 = datatree.AddMinus(datatree.One,t12);
t15 = datatree.AddTimes(t14,darg2);
return datatree.AddPlus(t15,t13);
case oEqual:
return datatree.AddMinus(darg1, darg2);
return datatree.AddMinus(darg1, darg2);
}
cerr << "Impossible case!" << endl;
exit(-1);
@ -919,6 +954,8 @@ BinaryOpNode::precedence(ExprNodeOutputType output_type, const temporary_terms_t
case oEqual:
case oPlus:
case oMinus:
case oMax:
case oMin:
return 0;
case oTimes:
case oDivide:
@ -928,7 +965,7 @@ BinaryOpNode::precedence(ExprNodeOutputType output_type, const temporary_terms_t
// In C, power operator is of the form pow(a, b)
return 100;
else
return 3;
return 3;
}
cerr << "Impossible case!" << endl;
exit(-1);
@ -953,6 +990,9 @@ BinaryOpNode::cost(const temporary_terms_type &temporary_terms, bool is_matlab)
case oMinus:
case oTimes:
return cost + 90;
case oMax:
case oMin:
return cost + 110;
case oDivide:
return cost + 990;
case oPower:
@ -968,6 +1008,9 @@ BinaryOpNode::cost(const temporary_terms_type &temporary_terms, bool is_matlab)
case oMinus:
case oTimes:
return cost + 4;
case oMax:
case oMin:
return cost + 5;
case oDivide:
return cost + 15;
case oPower:
@ -1047,6 +1090,16 @@ BinaryOpNode::eval_opcode(double v1, BinaryOpcode op_code, double v2) throw (Eva
return(v1 / v2);
case oPower:
return(pow(v1, v2));
case oMax:
if(v1<v2)
return( v2);
else
return( v1);
case oMin:
if(v1>v2)
return( v2);
else
return( v1);
case oEqual:
default:
throw EvalException();
@ -1099,9 +1152,20 @@ BinaryOpNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
}
// Treat special case of power operator in C
if (op_code == oPower && (!OFFSET(output_type)))
if ((op_code == oPower && !OFFSET(output_type)) || op_code == oMax || op_code == oMin )
{
output << "pow(";
switch (op_code)
{
case oPower:
output << "pow(";
break;
case oMax:
output << "max(";
break;
case oMin:
output << "min(";
break;
}
arg1->writeOutput(output, output_type, temporary_terms);
output << ",";
arg2->writeOutput(output, output_type, temporary_terms);

View File

@ -1149,6 +1149,24 @@ ParsingDriver::add_sqrt(NodeID arg1)
return data_tree->AddSqRt(arg1);
}
NodeID
ParsingDriver::add_max(NodeID arg1, NodeID arg2)
{
return data_tree->AddMaX(arg1,arg2);
}
NodeID
ParsingDriver::add_min(NodeID arg1, NodeID arg2)
{
return data_tree->AddMin(arg1,arg2);
}
NodeID
ParsingDriver::add_dummy(NodeID arg1)
{
return data_tree->AddDuMmY(arg1);
}
void
ParsingDriver::add_unknown_function_arg(NodeID arg)
{

View File

@ -109,6 +109,12 @@ public:
NodeID AddATanH(NodeID iArg1);
//! Adds "sqrt(arg)" to model tree
NodeID AddSqRt(NodeID iArg1);
//! Adds "max(arg1,arg2)" to model tree
NodeID AddMaX(NodeID iArg1, NodeID iArg2);
//! Adds "min(arg1,arg2)" to model tree
NodeID AddMin(NodeID iArg1, NodeID iArg2);
//! Adds "dummy(arg1)" to model tree
NodeID AddDuMmY(NodeID iArg1);
//! Adds "arg1=arg2" to model tree
NodeID AddEqual(NodeID iArg1, NodeID iArg2);
void AddLocalParameter(const string &name, NodeID value) throw (LocalParameterException);

View File

@ -153,167 +153,170 @@ namespace yy
DR_ALGO = 281,
DROP = 282,
DSAMPLE = 283,
DYNASAVE = 284,
DYNATYPE = 285,
END = 286,
ENDVAL = 287,
EQUAL = 288,
ESTIMATION = 289,
ESTIMATED_PARAMS = 290,
ESTIMATED_PARAMS_BOUNDS = 291,
ESTIMATED_PARAMS_INIT = 292,
FILENAME = 293,
FILTER_STEP_AHEAD = 294,
FILTERED_VARS = 295,
FIRST_OBS = 296,
FLOAT_NUMBER = 297,
FORECAST = 298,
GAMMA_PDF = 299,
GCC_COMPILER = 300,
GRAPH = 301,
HISTVAL = 302,
HP_FILTER = 303,
HP_NGRID = 304,
INITVAL = 305,
INT_NUMBER = 306,
INV_GAMMA_PDF = 307,
IRF = 308,
KALMAN_ALGO = 309,
KALMAN_TOL = 310,
LAPLACE = 311,
LCC_COMPILER = 312,
LIK_ALGO = 313,
LIK_INIT = 314,
LINEAR = 315,
LOAD_MH_FILE = 316,
LOGLINEAR = 317,
MARKOWITZ = 318,
MH_DROP = 319,
MH_INIT_SCALE = 320,
MH_JSCALE = 321,
MH_MODE = 322,
MH_NBLOCKS = 323,
MH_REPLIC = 324,
MH_RECOVER = 325,
MODE_CHECK = 326,
MODE_COMPUTE = 327,
MODE_FILE = 328,
MODEL = 329,
MODEL_COMPARISON = 330,
MSHOCKS = 331,
MODEL_COMPARISON_APPROXIMATION = 332,
MODIFIEDHARMONICMEAN = 333,
MOMENTS_VARENDO = 334,
NAME = 335,
NO_COMPILER = 336,
NOBS = 337,
NOCONSTANT = 338,
NOCORR = 339,
NODIAGNOSTIC = 340,
NOFUNCTIONS = 341,
NOGRAPH = 342,
NOMOMENTS = 343,
NOPRINT = 344,
NORMAL_PDF = 345,
OBSERVATION_TRENDS = 346,
OPTIM = 347,
OPTIM_WEIGHTS = 348,
ORDER = 349,
OSR = 350,
OSR_PARAMS = 351,
PARAMETERS = 352,
PERIODS = 353,
PLANNER_OBJECTIVE = 354,
PREFILTER = 355,
PRESAMPLE = 356,
PRINT = 357,
PRIOR_TRUNC = 358,
PRIOR_ANALYSIS = 359,
POSTERIOR_ANALYSIS = 360,
QZ_CRITERIUM = 361,
RELATIVE_IRF = 362,
REPLIC = 363,
RPLOT = 364,
SHOCKS = 365,
SIGMA_E = 366,
SIMUL = 367,
SIMUL_ALGO = 368,
SIMUL_SEED = 369,
SMOOTHER = 370,
SOLVE_ALGO = 371,
SPARSE_DLL = 372,
STDERR = 373,
STEADY = 374,
STOCH_SIMUL = 375,
TEX = 376,
RAMSEY_POLICY = 377,
PLANNER_DISCOUNT = 378,
TEX_NAME = 379,
UNIFORM_PDF = 380,
UNIT_ROOT_VARS = 381,
USE_DLL = 382,
VALUES = 383,
VAR = 384,
VAREXO = 385,
VAREXO_DET = 386,
VAROBS = 387,
XLS_SHEET = 388,
XLS_RANGE = 389,
COMMA = 390,
MINUS = 391,
PLUS = 392,
DIVIDE = 393,
TIMES = 394,
UMINUS = 395,
POWER = 396,
EXP = 397,
LOG = 398,
LOG10 = 399,
SIN = 400,
COS = 401,
TAN = 402,
ASIN = 403,
ACOS = 404,
ATAN = 405,
SINH = 406,
COSH = 407,
TANH = 408,
ASINH = 409,
ACOSH = 410,
ATANH = 411,
SQRT = 412,
DYNARE_SENSITIVITY = 413,
IDENTIFICATION = 414,
MORRIS = 415,
STAB = 416,
REDFORM = 417,
PPRIOR = 418,
PRIOR_RANGE = 419,
PPOST = 420,
ILPTAU = 421,
GLUE = 422,
MORRIS_NLIV = 423,
MORRIS_NTRA = 424,
NSAM = 425,
LOAD_REDFORM = 426,
LOAD_RMSE = 427,
LOAD_STAB = 428,
ALPHA2_STAB = 429,
KSSTAT = 430,
LOGTRANS_REDFORM = 431,
THRESHOLD_REDFORM = 432,
KSSTAT_REDFORM = 433,
ALPHA2_REDFORM = 434,
NAMENDO = 435,
NAMLAGENDO = 436,
NAMEXO = 437,
RMSE = 438,
LIK_ONLY = 439,
VAR_RMSE = 440,
PFILT_RMSE = 441,
ISTART_RMSE = 442,
ALPHA_RMSE = 443,
ALPHA2_RMSE = 444
DUMMY = 284,
DYNASAVE = 285,
DYNATYPE = 286,
END = 287,
ENDVAL = 288,
EQUAL = 289,
ESTIMATION = 290,
ESTIMATED_PARAMS = 291,
ESTIMATED_PARAMS_BOUNDS = 292,
ESTIMATED_PARAMS_INIT = 293,
FILENAME = 294,
FILTER_STEP_AHEAD = 295,
FILTERED_VARS = 296,
FIRST_OBS = 297,
FLOAT_NUMBER = 298,
FORECAST = 299,
GAMMA_PDF = 300,
GCC_COMPILER = 301,
GRAPH = 302,
HISTVAL = 303,
HP_FILTER = 304,
HP_NGRID = 305,
INITVAL = 306,
INT_NUMBER = 307,
INV_GAMMA_PDF = 308,
IRF = 309,
KALMAN_ALGO = 310,
KALMAN_TOL = 311,
LAPLACE = 312,
LCC_COMPILER = 313,
LIK_ALGO = 314,
LIK_INIT = 315,
LINEAR = 316,
LOAD_MH_FILE = 317,
LOGLINEAR = 318,
MARKOWITZ = 319,
MAX = 320,
MH_DROP = 321,
MH_INIT_SCALE = 322,
MH_JSCALE = 323,
MH_MODE = 324,
MH_NBLOCKS = 325,
MH_REPLIC = 326,
MH_RECOVER = 327,
MIN = 328,
MODE_CHECK = 329,
MODE_COMPUTE = 330,
MODE_FILE = 331,
MODEL = 332,
MODEL_COMPARISON = 333,
MSHOCKS = 334,
MODEL_COMPARISON_APPROXIMATION = 335,
MODIFIEDHARMONICMEAN = 336,
MOMENTS_VARENDO = 337,
NAME = 338,
NO_COMPILER = 339,
NOBS = 340,
NOCONSTANT = 341,
NOCORR = 342,
NODIAGNOSTIC = 343,
NOFUNCTIONS = 344,
NOGRAPH = 345,
NOMOMENTS = 346,
NOPRINT = 347,
NORMAL_PDF = 348,
OBSERVATION_TRENDS = 349,
OPTIM = 350,
OPTIM_WEIGHTS = 351,
ORDER = 352,
OSR = 353,
OSR_PARAMS = 354,
PARAMETERS = 355,
PERIODS = 356,
PLANNER_OBJECTIVE = 357,
PREFILTER = 358,
PRESAMPLE = 359,
PRINT = 360,
PRIOR_TRUNC = 361,
PRIOR_ANALYSIS = 362,
POSTERIOR_ANALYSIS = 363,
QZ_CRITERIUM = 364,
RELATIVE_IRF = 365,
REPLIC = 366,
RPLOT = 367,
SHOCKS = 368,
SIGMA_E = 369,
SIMUL = 370,
SIMUL_ALGO = 371,
SIMUL_SEED = 372,
SMOOTHER = 373,
SOLVE_ALGO = 374,
SPARSE_DLL = 375,
STDERR = 376,
STEADY = 377,
STOCH_SIMUL = 378,
TEX = 379,
RAMSEY_POLICY = 380,
PLANNER_DISCOUNT = 381,
TEX_NAME = 382,
UNIFORM_PDF = 383,
UNIT_ROOT_VARS = 384,
USE_DLL = 385,
VALUES = 386,
VAR = 387,
VAREXO = 388,
VAREXO_DET = 389,
VAROBS = 390,
XLS_SHEET = 391,
XLS_RANGE = 392,
COMMA = 393,
MINUS = 394,
PLUS = 395,
DIVIDE = 396,
TIMES = 397,
UMINUS = 398,
POWER = 399,
EXP = 400,
LOG = 401,
LOG10 = 402,
SIN = 403,
COS = 404,
TAN = 405,
ASIN = 406,
ACOS = 407,
ATAN = 408,
SINH = 409,
COSH = 410,
TANH = 411,
ASINH = 412,
ACOSH = 413,
ATANH = 414,
SQRT = 415,
DYNARE_SENSITIVITY = 416,
IDENTIFICATION = 417,
MORRIS = 418,
STAB = 419,
REDFORM = 420,
PPRIOR = 421,
PRIOR_RANGE = 422,
PPOST = 423,
ILPTAU = 424,
GLUE = 425,
MORRIS_NLIV = 426,
MORRIS_NTRA = 427,
NSAM = 428,
LOAD_REDFORM = 429,
LOAD_RMSE = 430,
LOAD_STAB = 431,
ALPHA2_STAB = 432,
KSSTAT = 433,
LOGTRANS_REDFORM = 434,
THRESHOLD_REDFORM = 435,
KSSTAT_REDFORM = 436,
ALPHA2_REDFORM = 437,
NAMENDO = 438,
NAMLAGENDO = 439,
NAMEXO = 440,
RMSE = 441,
LIK_ONLY = 442,
VAR_RMSE = 443,
PFILT_RMSE = 444,
ISTART_RMSE = 445,
ALPHA_RMSE = 446,
ALPHA2_RMSE = 447
};
};

View File

@ -207,7 +207,8 @@ enum UnaryOpcode
oAcosh,
oAsinh,
oAtanh,
oSqrt
oSqrt,
oDummy
};
//! Unary operator node
@ -245,7 +246,9 @@ enum BinaryOpcode
oTimes,
oDivide,
oPower,
oEqual
oEqual,
oMax,
oMin
};
//! Binary operator node

View File

@ -354,6 +354,12 @@ public:
NodeID add_atanh(NodeID arg1);
//! Writes token "sqrt(arg1)" to model tree
NodeID add_sqrt(NodeID arg1);
//! Writes token "max(arg1,arg2)" to model tree
NodeID add_max(NodeID arg1, NodeID arg2);
//! Writes token "min(arg1,arg2)" to model tree
NodeID add_min(NodeID arg1, NodeID arg2);
//! Writes token "dummy(arg1)" to model tree
NodeID add_dummy(NodeID arg1);
//! Adds an unknwon function argument
void add_unknown_function_arg(NodeID arg);
//! Adds an unknown function call node

View File

@ -1,11 +1,30 @@
#ifndef SIMULATE_HH_INCLUDED
#define SIMULATE_HH_INCLUDED
typedef struct IM_compact
{
int size, u_init, u_finish, nb_endo;
int *u, *Var, *Equ, *Var_Index, *Equ_Index, *Var_dyn_Index;
};
#ifndef SIMULATE_HH_INCLUDED
#define SIMULATE_HH_INCLUDED
#include <math>
#include <stack>
#include <set>
#include <vector>
#include <math.h>
#include <iostream>
#include <fstream>
//#include "pctimer_h.hh"
#include <time.h>
#include <string>
#include <map>
#include <algorithm>
#include "CodeInterpreter.hh"
#include "SymbolTableTypes.hh"
#include "mex.h"
#include "ExprNode.hh"
#define pow_ pow
//#define pow pow1
// typedef struct IM_compact
// {
// int size, u_init, u_finish, nb_endo;
// int *u, *Var, *Equ, *Var_Index, *Equ_Index, *Var_dyn_Index;
// };
typedef struct Variable_l
{
int* Index;
@ -47,22 +66,7 @@ typedef long double longd;
#else
typedef double longd;
#endif
#include <stack>
#include <set>
#include <vector>
#include <math.h>
#include <iostream>
#include <fstream>
//#include "pctimer_h.hh"
#include <time.h>
#include <string>
#include <map>
#include <algorithm>
#include "CodeInterpreter.hh"
#include "SymbolTableTypes.hh"
#include "mex.h"
#define pow_ pow
//#define pow pow1
using namespace std;
@ -217,11 +221,11 @@ class Interpreter
longd *g1, *r;
bool GaussSeidel;
public :
Interpreter::Interpreter();
Interpreter();
void compute_blocks(string file_name, string bin_basename);
};
std::fstream SaveCode, SaveCode_swp;
#endif // SIMULATE_HH_INCLUDED

View File

@ -3997,6 +3997,18 @@ Interpreter::compute_block_time() /*throw(EvalException)*/
Stack.push(pow1(v1, v2));
#ifdef DEBUGC
mexPrintf("pow(%f, %f)\n",v1,v2);
#endif
break;
case oMax:
Stack.push(max(v1, v2));
#ifdef DEBUGC
mexPrintf("max(%f, %f)\n",v1,v2);
#endif
break;
case oMin:
Stack.push(min(v1, v2));
#ifdef DEBUGC
mexPrintf("min(%f, %f)\n",v1,v2);
#endif
break;
case oEqual:
@ -4114,6 +4126,12 @@ Interpreter::compute_block_time() /*throw(EvalException)*/
Stack.push(sqrt(v1));
#ifdef DEBUGC
mexPrintf("sqrt\n");
#endif
break;
case oDummy:
Stack.push(double (v1>0));
#ifdef DEBUGC
mexPrintf("dummy\n");
#endif
break;
default:
@ -4179,6 +4197,7 @@ Interpreter::simulate_a_block(int size,int type, string file_name, string bin_ba
int Block_List_Max_Lag;
int Block_List_Max_Lead;
int giter;
int u_count_int;
double *y_save;
GaussSeidel=false;
@ -4483,7 +4502,7 @@ Interpreter::simulate_a_block(int size,int type, string file_name, string bin_ba
mxFree(r);
mxFree(u);
break;
case SOLVE_TWO_BOUNDARIES_COMPLETE :
case SOLVE_TWO_BOUNDARIES_COMPLETE:
#ifdef DEBUGC
mexPrintf("SOLVE_TWO_BOUNDARIES_COMPLETE\n");
#endif
@ -4507,7 +4526,7 @@ Interpreter::simulate_a_block(int size,int type, string file_name, string bin_ba
#ifdef DEBUGC
mexPrintf("Block_List_Max_Lead=%d\n",Block_List_Max_Lead);
#endif
int u_count_int=get_code_int
u_count_int=get_code_int
#ifdef DEBUGC
mexPrintf("u_count_int=%d\n",u_count_int);
mexPrintf("periods=%d\n",periods);