Commit Graph

2450 Commits (0bb233d291ea1ade8ac2ebfea2e70b9a58d1bb44)

Author SHA1 Message Date
Houtan Bastani 0bb233d291
fix bug causing auxiliary variables for pac growth parameters not to contain their original symbol id 2019-11-07 14:17:49 -05:00
Sébastien Villemot 10ed67f6f0 Merge branch 'master' into 'master'
introduce variableMapping, default equation name tags in M_ and JSON output

See merge request Dynare/preprocessor!3
2019-11-07 13:23:21 +00:00
Dóra Kocsis 7a78593df4 introduce variableMapping, default equation name tags in M_ and JSON output 2019-10-30 16:30:51 +01:00
Houtan Bastani fa9c9435ff
add xref for equation tags 2019-10-29 14:05:55 +01:00
Houtan Bastani ef4710cdb1
macro processor: fix for loops 2019-10-29 11:21:09 +01:00
Houtan Bastani 8a789d060f
aesthetic fix: for conformity to the rest of the code, prefer `const auto` to `auto const` 2019-10-29 11:20:27 +01:00
Houtan Bastani 4866bb5902
macro processor: use C++17 structured bindings in for loops 2019-10-29 11:20:21 +01:00
Houtan Bastani 217dadabbd
Use `if` statements with initializers allowed by C++17 2019-10-29 11:20:13 +01:00
Houtan Bastani 361e99bee5
simplify code 2019-10-28 17:25:40 +01:00
Houtan Bastani 7b13ee1b3a
macro processor: remove unused variable 2019-10-24 17:52:32 +02:00
Sébastien Villemot d839aea08b
Drop unused functions for writing C and C++ output
These functions should have been deleted in
946d105c04.
2019-10-24 10:54:46 +02:00
Sébastien Villemot ecdca502aa
Modernization: stop using make_pair() and make_tuple()
In many cases, they can be replaced by the curly braces syntax.

Otherwise, we can now use the pair() and tuple() constructors, without the need
to specify template parameters, thanks to class template argument
deduction (new in C++17).
2019-10-24 10:49:13 +02:00
Sébastien Villemot 2a127b1f23
VAR/TCM models: use lag-equivalence relationship to compute maximum lags
This is made possible by the getLagEquivalenceClass() method introduced in the
previous commit.

Previously, the static version of the LHS expressions was used.

As a consequence, drop ModFile::diff_static_model, now useless.
2019-10-22 16:04:24 +02:00
Sébastien Villemot 8a83e08e79
Fix bug with diff or unary ops that have same static representation
Previously, for testing whether two diff() expressions or two unary ops were
the lead/lag of each other, the preprocessor would test whether they have the
same static representation. This is ok for simple expressions (e.g.
diff(x(-1))), but not for more complex ones (e.g. diff(x-y) and diff(x(-1)-y)
should not be given the same auxiliary variable).

This commit fixes this by properly constructing the equivalence relationship
and choosing a representative within each equivalence class. See the comments
above lag_equivalence_table_t in ExprNode.hh for more details.

Closes #27
2019-10-22 15:01:06 +02:00
Sébastien Villemot c5d223a79b
Fix semantics of ExprNode::maxLag(), maxLead() and maxLagWithDiffsExpanded() with constants
Those methods can return a negative value in some cases. For example,
maxLead(x₋₁) = −1.

But constants were always returning a value of zero, which means that we had
inconsistent behaviour like maxLead(x₋₁ + 2) = 0.

This commits fixes the behaviour by making these methods return the smallest
possible integer when called on constants.
2019-10-22 11:35:11 +02:00
Sébastien Villemot 37cc0a0d2f
CI: use our homemade cache for Boost MSYS2 binaries, to avoid useless downloads
The cache in ~/tarballs on the runner is shared with the jobs of the main
dynare repository that create the Windows and macOS packages.

Also use better options for wget.
2019-10-17 16:15:53 +02:00
Sébastien Villemot 12eaf0b8dd
CI: store Boost version in a variable 2019-10-17 15:53:41 +02:00
Sébastien Villemot c30e52dc43
CI: various simplifications 2019-10-17 15:51:35 +02:00
Sébastien Villemot d38ac48cfa
Create set_auxiliary_series routine in use_dll, block/bytecode and julia modes
Closes #34
2019-10-17 15:03:26 +02:00
Stéphane Adjemian (Charybdis) 33d123e74e Added compilation of the preprocessor for all targets...
Windows{32,64}, Linux{32,64} and macOS{64}, also generates
informations required by the Julia package.
2019-10-15 15:59:05 +02:00
Houtan Bastani 7306132644
remove unused headers 2019-10-11 11:44:39 +02:00
Houtan Bastani 8211edc4e8
fix typo 2019-10-10 15:31:03 +02:00
Houtan Bastani 9e454debb5
support external functions in MATLAB namespace. closes dynare#1639 2019-10-09 14:49:05 +02:00
Houtan Bastani 4e1b1e4405
fix typo in parser 2019-10-08 15:36:30 +02:00
Houtan Bastani f77413ebb8
remove unused argument to function 2019-10-08 11:22:29 +02:00
Houtan Bastani fac9e4436c
fix bug in `fast` option: printing temporary terms hid changes in model when the temporary term changed as the temporary terms themselves were not printed. closes dynare#1661
Furthermore, modifications to model local variables were not taken into account.

To fix, take checksum of model local variables, temporary terms, and equations

Also, use existing functions to print these to a stringstream instead of repeating print functionality in this function
2019-10-07 18:55:20 +02:00
Houtan Bastani 6e92f79c13
simplify isChecksumMatching, move to filesystem::path 2019-10-07 17:43:45 +02:00
Houtan Bastani 6191c69d74
move to hash algorithm defined since C++11 for calculating checksums. dynare#1661 2019-10-07 17:43:16 +02:00
Houtan Bastani 979453815c
simplify initialization of `hasModelChanged` variable in writing of output 2019-10-07 11:32:02 +02:00
Stéphane Adjemian (Charybdis) 14b6cb6bee Fixed logic for output language. 2019-10-07 09:28:49 +02:00
Houtan Bastani 7b4616e853
fix cross compilation due to bug in MinGW 8.3.0
implicit conversion from `filesystem::path` to `string` not supported even though it's in the standard
2019-10-04 14:41:48 +02:00
Houtan Bastani 1291320053
macro processor: handle empty files 2019-10-04 11:18:03 +02:00
Houtan Bastani 125adff59c
macro processor: insert path instead of string as the path has already been created 2019-10-04 11:10:21 +02:00
Houtan Bastani 2ce6e411b4
remove unused headers 2019-10-04 10:57:36 +02:00
Houtan Bastani 2f6f0d8cf6
use filesystem::path instead of string to hold include paths passed on the command line 2019-10-04 10:57:36 +02:00
Houtan Bastani 0b3cd3ec90
pac: fix parsing of linear combination for growth option 2019-10-03 18:26:09 +02:00
Houtan Bastani 031bc62f3a
macro processor: use filesystem after move to C++17, closes #31
ancillary to this change is the move of `paths` out of the Driver class into an argument to parsing/evaluation #32
2019-10-03 14:24:47 +02:00
Houtan Bastani d7e70a4063
macro processor: fix bug: interpret @#include at node level instead of at the Driver level 2019-10-02 17:39:11 +02:00
Houtan Bastani 310f3936fe
macro processor: fix bug: interpret @#includepath at node level instead of at the Driver level 2019-10-02 17:39:05 +02:00
Houtan Bastani db52e02158
capitalize MATLAB 2019-10-02 14:04:31 +02:00
Houtan Bastani 93077bbcdd
macro processor: fix bug in range when start point == end point 2019-10-02 10:22:46 +02:00
Houtan Bastani 5e54761201
clarify error message in bfcfbac66d. #29 2019-09-30 14:27:58 +02:00
Houtan Bastani bfcfbac66d
change error message when trying to write unused endogenous variable. #29 2019-09-30 14:21:37 +02:00
Houtan Bastani 12bf59ea28
remove unused line. #29 2019-09-30 14:21:37 +02:00
Houtan Bastani e3c23df9b8
fix spacing and typos 2019-09-30 14:21:36 +02:00
Houtan Bastani 6d783ec9cd
add comment 2019-09-30 14:09:49 +02:00
Houtan Bastani 1fcd305015
allow for expressions as upper bound for irf_calibration and moment_calibration. Closes #12 2019-09-30 12:22:59 +02:00
Sébastien Villemot f66e6a7f35
Fix check for unused endos in the presence of PAC model-consistent expectations
Since commit 64f55e4a5e, in the presence of PAC
model-consistent expectations, some endogenous variables are added to the
symbol table at the beginning of ModFile::transformPass(), while their defining
equations are added at a later point.

But commit 7c3f981eac has introduced a check that
verifies that all endogenous are used in equations. That check happens after
the above mentioned endogenous are created, but after their defining equations
are added. Hence it fails.

The fix consists in creating those endogenous after the check. Incidently, they
are no longer part of the saved original model, but this is a good thing.
2019-09-25 12:00:40 +02:00
Houtan Bastani d3db73b7e4
remove unused symbols 2019-09-25 11:36:03 +02:00
Sébastien Villemot b0ac4a4e51
Cosmetic change 2019-09-24 18:47:43 +02:00