Document how functions with a kink are differentiated

Also add a warning in the documentation and in the preprocessor about the usage
of some functions (max, min, abs, sign, comparison operators) in a stochastic
context.

Closes #355
issue#70
Sébastien Villemot 2013-05-17 14:14:15 +02:00
parent 94e6f569b8
commit ddaedb5ee3
1 changed files with 13 additions and 0 deletions

View File

@ -250,6 +250,19 @@ ModFile::checkPass()
cerr << "ERROR: marking equations as [static] or [dynamic] is not possible with ramsey_policy or discretionary_policy" << endl;
exit(EXIT_FAILURE);
}
if (stochastic_statement_present &&
(dynamic_model.isUnaryOpUsed(oSign)
|| dynamic_model.isUnaryOpUsed(oAbs)
|| dynamic_model.isBinaryOpUsed(oMax)
|| dynamic_model.isBinaryOpUsed(oMin)
|| dynamic_model.isBinaryOpUsed(oGreater)
|| dynamic_model.isBinaryOpUsed(oLess)
|| dynamic_model.isBinaryOpUsed(oGreaterEqual)
|| dynamic_model.isBinaryOpUsed(oLessEqual)
|| dynamic_model.isBinaryOpUsed(oEqualEqual)
|| dynamic_model.isBinaryOpUsed(oDifferent)))
warnings << "WARNING: you are using a function (max, min, abs, sign) or an operator (<, >, <=, >=, ==, !=) which is unsuitable for a stochastic context; see the reference manual, section about \"Expressions\", for more details." << endl;
}
void