Commit Graph

153 Commits (11b1fdcffddfeb1a4e4a6b9546cb7b1fbdf70f43)

Author SHA1 Message Date
Sébastien Villemot 11b1fdcffd Fix implicit narrowing conversions (omitted in previous commit) 2018-07-18 15:12:00 +02:00
Sébastien Villemot d6055c1407 C++11: convert SymbolType to a class enum 2018-07-17 18:55:26 +02:00
Sébastien Villemot c12088f314 C++11: convert AuxVarType to class enum 2018-07-17 17:38:26 +02:00
Sébastien Villemot 89832db1db C++11: convert MatrixForm to a class enum 2018-07-17 17:31:20 +02:00
Sébastien Villemot 946d105c04 Remove C and C++ preprocessor output types
This code is broken since the temporary terms array changes. It is probably not
worth maintaining it.
2018-07-17 16:52:11 +02:00
Sébastien Villemot b8a5dfdc39 Replace several usages of C macroprocessor with C++ constructs 2018-07-17 16:36:58 +02:00
Houtan Bastani 8cf4fedac2 macroprocessor: change type of function arguments 2018-07-11 15:57:51 +02:00
Houtan Bastani 3776e3b890 only allow inline comments on statement lines. #4 2018-07-11 14:31:58 +02:00
Houtan Bastani aea9011745 Revert "macroprocessor: don’t interpret inline comments yet put them to output (ignored by dynare preprocessor, but printed in macro expanded file). #4"
This reverts commit 27e6d92af1.
2018-07-11 12:15:58 +02:00
Houtan Bastani 357320468b Revert "macroprocessor: support Matlab comments. #4"
This reverts commit 066942ef22.
2018-07-11 11:37:58 +02:00
Houtan Bastani a2fef7804e Revert "macroprocessor: support multi-line comments. #4"
This reverts commit 86a08f54ae.
2018-07-11 11:37:40 +02:00
Houtan Bastani 15f5f4f1be use front inserter instead of back inserter for unary/diff auxiliary equations
(cherry picked from commit 6a95831147d942c23fbc3a0a0b1506650eb49b7d)
2018-07-10 12:06:42 +02:00
Sébastien Villemot 7baee73126 Fix bug under MATLAB+Windows when "+" subdirectory is already present
Under MATLAB+Windows (but not under Octave nor under GNU/Linux or macOS), if we
directly remove the "+" subdirectory, then the preprocessor is not able to
recreate it afterwards (presumably because MATLAB maintains some sort of lock
on it). The workaround is to rename it before deleting it.
2018-07-09 18:18:26 +02:00
Houtan Bastani 86a08f54ae macroprocessor: support multi-line comments. #4 2018-07-09 16:55:59 +02:00
Houtan Bastani 066942ef22 macroprocessor: support Matlab comments. #4 2018-07-09 16:55:53 +02:00
Houtan Bastani 27e6d92af1 macroprocessor: don’t interpret inline comments yet put them to output (ignored by dynare preprocessor, but printed in macro expanded file). #4 2018-07-09 16:55:38 +02:00
Houtan Bastani e0bf2b60b6 Modify 19048bdcae to store equation tags for variables declared in equation tags 2018-07-09 14:49:12 +02:00
Houtan Bastani 19048bdcae Allow for the declaration of endogenous, exogenous, parameters on-the-fly in equation tags 2018-07-09 14:39:13 +02:00
Houtan Bastani a7f8eaa336 remove warnings introduced in 244552393b 2018-07-09 11:55:39 +02:00
Houtan Bastani 853cce553f replace ‘typedef’ with ‘using’ 2018-07-09 11:49:17 +02:00
Houtan Bastani 244552393b macroprocessor: add support for functions that return strings. #3 2018-07-04 17:04:22 +02:00
Houtan Bastani a51dd224e4 simplify conversion of int to string 2018-07-04 16:07:16 +02:00
Sébastien Villemot 543e2b16e3 Simplify and modernize ConfigFile
- no longer use pointers
- use pass-by-value when possible
- use range-for loops when possible
2018-07-04 15:56:48 +02:00
Sébastien Villemot 53f83aeb12 No longer use boost::lexical_cast
Most cases can be handled in C++11 by std::stoi() and std::stod().

For the macroprocessor ArrayMV<T>::print() method, use template
specialization (instead of a lexical_cast to detect between T=int and
T=string).
2018-07-04 15:53:41 +02:00
Sébastien Villemot 30c205f418 C++11: replace calls to std::atof() by std::stod() 2018-07-04 14:53:13 +02:00
Sébastien Villemot 5e1d722013 C++11: replace most calls to std::atoi() by std::stoi()
The latter accepts a std::string as argument.
2018-07-04 14:53:08 +02:00
Sébastien Villemot e376267a28 Move json generated files to ${MODFILE}/model/json/ 2018-06-27 16:08:31 +02:00
Sébastien Villemot 988a9f6e2d std::open and std::fstream constructor accept a std::string for filename in C++11 2018-06-27 15:30:45 +02:00
Sébastien Villemot b91ed6f78c Move the location of static and dynamic files on the filesystem
- M and MEX files are now under +${MODELNAME}/
- bytecode and C source now under ${MODELNAME}/model/
2018-06-27 15:30:25 +02:00
Houtan Bastani 45f7e40a88 remove unused library 2018-06-27 13:50:15 +02:00
Houtan Bastani bbb2b067bf prevent compilation warning 2018-06-27 13:45:51 +02:00
Stéphane Adjemian(Charybdis) a2b19cbfff Added missing writeJsonOutput method for VarModelStatement. 2018-06-15 14:56:44 +02:00
Sébastien Villemot 158f027db2 Fix parsing of empty strings in macro-processor
Those were treated as comments.

Incidentally, fix a similar issue in the Dynare parser (which is much less
problematic, since double quotes are not used in the Dynare language).

Closes DynareTeam/dynare#1621
2018-06-14 16:54:31 +02:00
Houtan Bastani b8ae9f6935 Fix max lags for var 2018-06-11 15:18:06 +02:00
Houtan Bastani 84c2dc5f36 transform_unary_ops now introduces aux variables/equations for all unary ops specified by UnaryOpNode::createAuxVarForUnaryOpNode()
In the absence of this option, if a var_model statement(s) is present, then aux vars/eqs are created for the same types of unary operators but only for equations specified in the var_model statement

In the absence of both this option and var_model statements, no unary op auxiliary variables are created

diffs continue to be substituted everywhere; for the moment auxiliary variables are created for diffs of expressions. A forthcoming change will allow auxiliary variables created for diffs of expressions to be linked with their lagged expressions as is currently the case for diffs of variables
2018-06-07 17:16:12 +02:00
Houtan Bastani a30f8f365e Only create auxiliary variables for diffs that appear in VAR equations or equations that have pac_expectations in them
Otherwise, substitute the diff (i.e. `diff(x)` -> `x-x(-1)`)
2018-06-05 18:39:13 +02:00
Houtan Bastani 27320a07f6 update statement loops to use C++11 syntax 2018-06-05 18:39:13 +02:00
Houtan Bastani 2cd3aa95cc When `transform_unary_ops` is passed, only substitute unary operators that appear in VAR equations 2018-06-05 17:41:15 +02:00
Sébastien Villemot 130004ef47 Simplify types for storing derivatives using std::tuple 2018-06-05 15:34:34 +02:00
Sébastien Villemot 52d8bd0b17 Stop using namespace boost globally in ModelTree
Otherwise boost::tuple overrides std::tuple.
2018-06-05 15:33:46 +02:00
Houtan Bastani 4d92baaf29 Clean up writing of equation tags in latex file 2018-06-05 14:47:36 +02:00
Sébastien Villemot ae81a6fcad Fix compilation error with bytecode DLL 2018-06-05 11:25:23 +02:00
Houtan Bastani d453e81594 pac_model: write as more output to M_ instead of options_; use rmfield instead of clear 2018-06-05 11:14:03 +02:00
Houtan Bastani 16a049f0d8 Make changes to pac code for C++11 2018-06-05 11:14:03 +02:00
Sébastien Villemot db3f625e80 Fix compilation for Windows hosts 2018-06-05 09:31:19 +02:00
Sébastien Villemot 7e16307382 Simplify DataTree maps using std::tuple 2018-06-04 17:35:02 +02:00
Sébastien Villemot abe44fb063 Replace the use of boost::bind by a lambda 2018-06-04 16:51:36 +02:00
Sébastien Villemot 272d36a37c Remove useless casts of nullptr 2018-06-04 16:39:01 +02:00
Sébastien Villemot 608c43450c Replace most calls to make_pair by braced-initializer lists or emplace()/emplace_back() 2018-06-04 16:36:46 +02:00
Sébastien Villemot 7d9cd718fc Replace more typedefs by using
Those were not automatically replaced by clang-tidy, I don’t know why…
2018-06-04 15:03:31 +02:00