Commit Graph

2400 Commits (92ad5aad2c5dd0ba4e917ede11baddb674db82c0)

Author SHA1 Message Date
Houtan Bastani 92ad5aad2c
Revert "add info about max endo/exo lag by variable. closes dynare#1596"
This reverts commit 7827d2e04d.
2019-09-24 14:03:38 +02:00
Houtan Bastani 047b3b25bb
add print, noprint options to perfect_foresight_solver 2019-09-12 14:35:29 +02:00
Houtan Bastani 04b6a68aef
new calling structure for stoch_simul, discretionary_policy. dynare#1197 2019-09-11 18:05:40 +02:00
Sébastien Villemot bad0c3cf27
Fix preprocessor failure to rename +<model> directory if /tmp is not on the same filesystem
Bug introduced in 0c755460, that manifested on the Gitlab runners.
2019-09-11 17:03:37 +02:00
Sébastien Villemot 2c6fa34a1f
C++17: use structured bindings instead of std::tie whenever possible 2019-09-11 16:40:19 +02:00
Houtan Bastani 9a5ad17349
suppress sign comparison warnings when compiling with g++-9 2019-09-11 16:25:10 +02:00
Houtan Bastani 6a937689d4
ignore warnings from boost headers when compiling with g++-9 2019-09-11 16:25:10 +02:00
Sébastien Villemot 0c755460b1
Use std::filesystem instead of boost::filesystem
Note that there is no equivalent of boost::filesystem::unique_path(), so I
implemented ModFile::unique_path() which does something similar.
2019-09-11 14:47:48 +02:00
Sébastien Villemot 152b2de5b6
Enforce C++17 at the compiler level 2019-09-11 14:47:48 +02:00
Houtan Bastani 0c1373bc5e
stop processing when certain functions are used in a linear context on endogenous/exogenous variables. closes dynare#1537 2019-09-10 12:37:28 +02:00
Houtan Bastani d1be4f4946
remove duplicates from stoch_simul symbol_list. closes dynare#1519 2019-09-10 11:13:33 +02:00
Houtan Bastani 7827d2e04d
add info about max endo/exo lag by variable. closes dynare#1596 2019-09-09 14:29:22 +02:00
Houtan Bastani 7c3f981eac
stop processing if not all endogenous variables are used in the model block. closes #25 2019-09-05 12:19:21 +02:00
Sébastien Villemot fbf535e819
Fix typo 2019-08-27 14:20:00 +02:00
Houtan Bastani 0df8dd3bc2
include header needed to compile 3a21eda40e with g++
#26
2019-08-26 18:17:41 +02:00
Houtan Bastani 3a21eda40e
macro processor: support @#echomacrovars with symbol_list
closes #26
2019-08-26 18:12:04 +02:00
Houtan Bastani 2b3519e3b0
macro processor: add for syntax for shortcut with filtering comprehension
closes #28
2019-08-26 16:08:31 +02:00
Houtan Bastani def99f9dd3
macro processor: simplify parser code 2019-08-26 15:00:53 +02:00
Houtan Bastani d4ad2cbb5e
macro processor: Expression class has to_string function as well, so no need for cast 2019-08-23 12:07:31 +02:00
Houtan Bastani 7f96d4a1c9
macro processor: remove unnecessary check in Function evaluation
Not necessary because of parser rules for function definition
2019-08-23 11:12:36 +02:00
Sébastien Villemot 8cdbdee315
Various cleanups around the “language” option
— allow “language=matlab” for symmetry (this is the default)
— remove the useless “cuda” and “python” values
— give a more meaningful error message when “output” is used in conjunction
  with “language=matlab”
2019-08-22 17:43:34 +02:00
Sébastien Villemot db6d4fb0cd
Support identification(order=3)
In that case, the preprocessor outputs g4 (4th derivatives of model) and
g3p (1st derivs of g3 w.r.t. parameters).

Ref #10
2019-08-22 17:02:40 +02:00
Sébastien Villemot 1491b2d225
Give better names to ostringstream variables storing derivs w.r.t. params. 2019-08-22 17:02:39 +02:00
Houtan Bastani 6ced2aaedb
macro processor: fix bug in array power: disallow reals that are not integers 2019-08-22 15:44:31 +02:00
Houtan Bastani 8da3dc5c6b
macro processor: add noexcept to functions 2019-08-21 18:25:08 +02:00
Houtan Bastani 48466f0e10
macro processor: remove double evaluations of ExpressionPtr 2019-08-21 18:07:40 +02:00
Houtan Bastani 92f18f58f5
macro processor: comment If class 2019-08-21 18:04:09 +02:00
Sébastien Villemot 4594fdd0fd
More comment improvements in relation to diff operator expansion/substitution 2019-08-20 18:22:02 +02:00
Houtan Bastani cfc7a1467b
macro processor: fix error message 2019-08-20 15:21:41 +02:00
Houtan Bastani 6e523aaf28
macro processor: add immutable Range class, making Array immutable 2019-08-20 15:21:41 +02:00
Houtan Bastani 6c72980580
macro processor: replace uses of make_pair 2019-08-20 14:29:44 +02:00
Houtan Bastani 16080f2bb8
macro processor: make Variable class immutable 2019-08-20 11:16:33 +02:00
Houtan Bastani b3ec807b90
macro processor: move changes from `cd99bb3af9c8ef6fd881fa0457121894f8edd14e` to the header file 2019-08-19 18:31:18 +02:00
Sébastien Villemot 9b9c5beb5c
Ensure that unary ops aux vars are never created when there is a lead
The transformation would be incorrect because of the expectation operator.

There was already a safety check, but it was not entirely correct. For example,
if “exp(y)” was appearing before “exp(y(+1))”, the check would not catch the
problem, because it happened after the substitution table had been filled. So
we now do the check before filling that table.
2019-08-19 18:27:57 +02:00
Sébastien Villemot 3941278832
Add more comments in routines for aux vars for unary ops / diff operators
By the way, do some small code simplifications.
2019-08-19 18:27:57 +02:00
Sébastien Villemot 8e9f6e4c57
Improve some function prototypes for better distinction between input and output arguments 2019-08-19 18:27:57 +02:00
Houtan Bastani cd99bb3af9
macro processor: Make @#include and @#includepath immutable 2019-08-19 18:20:53 +02:00
Houtan Bastani 588896b509
doc: update macro processor doc for `@#elseif` and `defined` 2019-08-19 15:23:51 +02:00
Houtan Bastani b77f6ecd94
macro processor: add `defined` operator 2019-08-19 15:14:51 +02:00
Houtan Bastani 8ebd2a1735
macro processor: support `@#elseif` directive 2019-08-19 15:14:43 +02:00
Sébastien Villemot 75b000a0b5
Macro processor: ensure that all read-accessors return a const reference
Useless copies are thus avoided in some situations.
2019-08-14 17:36:10 +02:00
Sébastien Villemot 8c1e48a09e
Add a few more calls to std::move() 2019-08-14 17:27:31 +02:00
Sébastien Villemot c4f331c74c
Macro processor: make more node classes immutable
Since the node classes are stored and copied as std::shared_ptr, a given class
instance can actually be shared by two different expressions. Hence, in order
to prevent weird bugs, it’s necessary to make these classes immutable.

This commit deals with the easy cases.

The remaining (and more complex) ones are:
— Variable
— Array
— Include
— IncludePath
2019-08-14 17:14:42 +02:00
Sébastien Villemot 46a7cf5db7
Macro processor: fix the use of move semantics in constructor
In particular, remove the const keyword before arguments passed-by-value,
because otherwise they can't be moved (since they are immutable).

Also add a few missing calls to std::move(), and remove some calls to
std::move() when they are useless (on class enums, which are fundamental
types.)
2019-08-14 16:43:45 +02:00
Sébastien Villemot 37e7a6d1c1
Now that we require Bison ≥ 3.2, the stack.hh and position.hh files are no longer generated 2019-08-14 15:36:31 +02:00
Sébastien Villemot b299983a8b
Fix the notmpterms option in the presence of external functions 2019-08-14 15:28:41 +02:00
Sébastien Villemot ecad2dfb10
Avoid running bison and flex multiple times when doing parallel builds 2019-08-14 11:22:33 +02:00
Sébastien Villemot 30aaf93ca7
Bison 3.2 now generates a default semantic action with variants
The minimal required version of Bison is bumped to 3.2, so that we can rely on
those default actions.
2019-08-14 11:22:33 +02:00
Houtan Bastani 2c6a290fb3
remove unnecessary declaration 2019-08-13 13:17:08 -04:00
Houtan Bastani bb13b93d59
aesthetic fix 2019-08-13 12:37:34 -04:00