Commit Graph

3104 Commits (d2ef8446969f0e70d00c939998174ff7b762b312)

Author SHA1 Message Date
Sébastien Villemot d2ef844696
Macro processor slides: minor improvements 2022-05-24 12:20:29 +02:00
Sébastien Villemot edf75e48a3 Merge branch 'tolx_steady' into 'master'
Add tolx-option for steady

See merge request Dynare/preprocessor!60
2022-05-23 10:07:09 +00:00
Sébastien Villemot cec47cc78c
Implement bytecode compilation of 2nd deriv of external functions 2022-05-20 12:35:38 +02:00
Sébastien Villemot d1a3b227fd
Fix bug in bytecode compilation of 1st deriv of external functions 2022-05-20 12:35:23 +02:00
Sébastien Villemot 03dc9837d0
Comment improvement 2022-05-20 12:27:22 +02:00
Sébastien Villemot 171cd65566
Fix bytecode compilation of external function nodes 2022-05-20 11:43:02 +02:00
Johannes Pfeifer 1dbf9c8041 Add tolx-option for steady 2022-05-19 22:43:41 +02:00
Sébastien Villemot 591b5e5f9e
Always create bytecode output
And, symmetrically, when the “bytecode” option is requested by the user, always
create the .m static/dynamic files.

The “bytecode” option therefore no longer modifies the preprocessor output.
2022-05-19 14:49:46 +02:00
Sébastien Villemot af88f50d44
Forbid multiple identical clauses in “occbin_constraints” block
Closes: #97
2022-05-19 14:36:15 +02:00
Sébastien Villemot 0284b249f5
Remove unused “bytecode” argument in {Static,Dynamic}Model::computingPass() 2022-05-19 14:10:22 +02:00
Sébastien Villemot 25a32b1a32
Cosmetics 2022-05-19 12:27:44 +02:00
Sébastien Villemot 17ba60e587
Mark copy constructor and assignment of ModelTree as protected
This limits the risk of slicing.

The same is not possible for DataTree, since that base class is directly used
in some places.
2022-05-19 12:27:39 +02:00
Sébastien Villemot 2483639f4d
Fix bug introduced in 3516894a71 related to new estimation syntax 2022-05-18 19:27:00 +02:00
Sébastien Villemot 3516894a71
JSON output: fix handling of vector value options
The vectors were previously stored as strings internally, which would not
necessarily contain the commas which are required in JSON (but not in
MATLAB/Octave). The fix consists in internally storing those options as
std::vector.

Closes: #96
2022-05-18 17:44:36 +02:00
Sébastien Villemot 5b50c10229
Simplify OptionsList::writeJsonOutput() 2022-05-18 16:33:49 +02:00
Sébastien Villemot 29c683c6ad
JSON output: add missing comma for paired numerical options 2022-05-18 16:33:49 +02:00
Sébastien Villemot d64682f346
JSON output: fix possible spurious commas in vector of int or string options 2022-05-18 16:33:49 +02:00
Sébastien Villemot 2c92057d75
Activate more compiler warnings with -Wextra
However, disable -Wunused-parameter which creates too many false positives in
polymorphic methods.

Also, only disable -Wdangling-else instead of the whole of -Wparentheses.
2022-05-18 16:33:49 +02:00
Sébastien Villemot 2795207802
No longer delete move constructor/assignment operator
We follow the advice given by Josuttis in his book about move semantics.

Deleting those member fuctions can be a bug if we want to allow copy semantics,
because overload resolution will no longer fallback to the copy
constructor/assignment operator when given an rvalue.

In particular, this explain why it was not possible to delete the move
assignment operator of the StaticModel class.
2022-05-18 16:33:48 +02:00
Sébastien Villemot c6007aa780
C++17 modernization: use [[fallthrough]] attribute
This disables warnings when -Wimplicit-fallthrough is used (enabled by -Wextra).
2022-05-18 16:33:48 +02:00
Sébastien Villemot 701db61e09
JSON output: fix several bugs related to switch/case fallthrough 2022-05-18 16:33:42 +02:00
Sébastien Villemot ae97c4eb29
Factorization in OptionsList class 2022-05-17 18:08:10 +02:00
Sébastien Villemot 3e94250582
C++17 modernization: use std::optional in ExprNode::getPacOptimizingShareAndExprNodes() 2022-05-16 19:10:16 +02:00
Sébastien Villemot 0eb11d3323
C++17 modernization: use std::optional in expression matching functions 2022-05-16 19:10:16 +02:00
Sébastien Villemot 3496d77eb4
C++17 modernization: use std::optional to store orig diff vars in VAR and TCM
By the way, remove the unused TrendComponentModelTable::getOrigDiffVar() method.
2022-05-16 19:10:16 +02:00
Sébastien Villemot 34aa1d3bb4
Fix comment 2022-05-16 19:10:16 +02:00
Sébastien Villemot 06d05e9a8d
C++17 modernization: use std::optional for SymbolTable::getEquationNumberForMultiplier() 2022-05-16 19:10:16 +02:00
Sébastien Villemot fa7a926143
C++17 modernization: use std::optional for the storage of orig_symb_id and orig_lead_lag in SymbolTable
For the diff and unaryOp auxvar types, these value may be set or unset
depending on the complexity of the expression represented by the auxvar.
2022-05-16 19:10:15 +02:00
Sébastien Villemot 8fd1505ca2
C++17 modernization: use std::optional for “periods” option of “plot_conditional_forecast”
Incidentally, in the JSON output, no longer assign a value to the “periods”
field if not passed by the user (previously the value -1 was output in the JSON
file).
2022-05-16 19:10:15 +02:00
Sébastien Villemot fc037a4352
Simplify printing of booleans using std::boolalpha 2022-05-16 19:10:15 +02:00
Sébastien Villemot 92d3b8166a
C++17 modernization: use std::optional for equation line numbers 2022-05-16 19:10:15 +02:00
Sébastien Villemot 0b51294994
C++17 modernization: use std::optional for trend variables in TCM 2022-05-16 19:10:15 +02:00
Sébastien Villemot fb3b1c301f
endval(learnt_in=…) block: fix treatment of unused endogenous variables 2022-05-06 12:56:24 +02:00
Sébastien Villemot 46a85644d8
C++20 modernization: update comment about workaround for clang 2022-05-04 17:37:58 +02:00
Sébastien Villemot 7bd449d6c3
C++20 modernization: use new std::erase_if function 2022-05-04 17:37:58 +02:00
Sébastien Villemot b42ee40b55
C++20 modernization: use contains() method on containers 2022-05-04 17:37:57 +02:00
Sébastien Villemot 93dcf5031b
Bump to C++20 standard (with GNU extensions)
In practice, for the time being, we limit ourselves to C++20 features available
in GCC 10 and clang 12 (the latter because of the Julia infrastructure).
2022-05-04 17:37:02 +02:00
Sébastien Villemot ef02b79486
Various minor simplifications 2022-05-04 17:36:59 +02:00
Sébastien Villemot e0c3cb72b7
No longer link against libstdc++fs
That requirement was dropped in GCC 9.
2022-05-04 17:11:44 +02:00
Sébastien Villemot 3a820fffa2
New += and *= syntaxes in “endval(learnt_in=…)” blocks
Incidentally, forbid exogenous deterministic variables in “endval” blocks.
2022-05-03 16:52:04 +02:00
Sébastien Villemot 8c07fb5e43
Compatibility fix for GCC 12
Ref. dynare#1852
2022-05-02 17:03:42 +02:00
Sébastien Villemot 32761173e0
Add solve_algo, markowitz, maxit and tolf options to pfwee_setup 2022-04-29 15:53:26 +02:00
Sébastien Villemot 6509bc7d36
Allow “learnt_in=1” for “shocks” and “endval”
In that case, the option has no effect.
2022-04-29 11:17:11 +02:00
Sébastien Villemot 76a16a69a8
New “add” and “multiply” keywords in “shocks(learnt_in=…)” block 2022-04-26 15:21:45 +02:00
Sébastien Villemot dbe14ecfd4
Add checks on the value of the “learnt_in” option of “shocks” and “endval” 2022-04-26 11:45:22 +02:00
Sébastien Villemot e47ea565b9
Use booleans for “exo_det” and “multiplicative” fields of M_.det_shocks 2022-04-26 11:32:07 +02:00
Sébastien Villemot 8e3590ee71
Reject exogenous deterministic variables in a few places where they were erroneously accepted
– heteroskedastic_shocks block
– generate_irfs command
– new estimation syntax
2022-04-21 17:59:04 +02:00
Sébastien Villemot 516f0bf41f
Fix bug in new estimation syntax introduced in 7280c92642 2022-04-21 17:38:41 +02:00
Sébastien Villemot b5a4df1608
New shocks(learnt_in=…) and endval(learnt_in=…) blocks
For use with perfect_foresight_with_expectation_errors_setup.
2022-04-21 17:07:33 +02:00
Sébastien Villemot 54ca5d9cc0
Improve messages during model normalization
– Indicate whether we are trying to normalize the static or dynamic model
– If failed to normalize the static model, suggest to use the “no_static”
  option
– Remove a superfluous error message
2022-04-19 17:11:13 +02:00