Commit Graph

39 Commits (master)

Author SHA1 Message Date
Sébastien Villemot d463607e90
Reformat C++ source code using clang-format 15 2023-11-30 15:58:32 +01:00
Sébastien Villemot f78c428d99
New option “relative_to_initval” to “mshocks” block 2023-10-18 16:16:41 -04:00
Sébastien Villemot f179ec4dac
Use __builtin_unreachable() to silent some GCC warnings
This is cleaner than using exit() or assert() for that purpose.
2023-10-18 14:28:59 -04:00
Sébastien Villemot 6af84b8cac
The “mshocks” block now accepts the “learnt_in=…” option 2023-10-17 15:59:10 -04:00
Sébastien Villemot 895a866bb3
Optimization: use move semantics in more places 2022-10-04 16:00:30 +02:00
Sébastien Villemot 7f1b4fcc20
Refactor OptionsList class
In particular, use a std::variant to store the values of options. This ensures
that a given option name can have only one value (previously, for a given
option name, it was possible to store several values as long as they were of
different types).
2022-09-20 11:56:43 +02:00
Sébastien Villemot c3fc5b1dd7
Enable -Wunused-parameter
As a consequence, add many [[maybe_unused]] attributes for legitimate
cases (mainly in virtual functions).
2022-06-24 17:11:48 +02:00
Sébastien Villemot c94dfb848c
C++20 modernization: use initialization within range-based for loop
In particular, use this feature in many loops which feature a special treatment
for the first iteration, using a boolean variable (replacing iterator
manipulation). By the way, also use std::exchange() to simultaneously test the
value of this variable and update it.
2022-06-07 14:35:59 +02:00
Sébastien Villemot 0b5c88109f
Various simplifications 2022-06-07 14:34:30 +02:00
Sébastien Villemot fc037a4352
Simplify printing of booleans using std::boolalpha 2022-05-16 19:10:15 +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 e47ea565b9
Use booleans for “exo_det” and “multiplicative” fields of M_.det_shocks 2022-04-26 11:32:07 +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 2e696a2e0d
Add shocks(surprise) block (for occbin)
Ref. #68
2021-07-13 21:55:31 +02:00
Sébastien Villemot c3b0ce8e69
shocks/mshocks/conditional_forecast_paths: various cleanups 2021-07-13 17:17:57 +02:00
Sébastien Villemot 824433aa3f
Refactor driver output for heteroskedastic_shocks
Ref. dynare#1791
2021-06-15 12:53:40 +02:00
Sébastien Villemot 74ef3457b4
Use secure URL for link to GNU licenses 2021-06-09 17:21:00 +02:00
Sébastien Villemot b12b254f2c
Add heteroskedastic_filter option and heteroskedastic_shocks block
Ref. dynare!1844, dynare!1851
2021-05-26 18:27:52 +02:00
Sébastien Villemot 638b4c7ac5
Ensure that all statements produce an output in JSON mode 2020-11-26 16:25:22 +01:00
Johannes Pfeifer 98ddbb61ba Method of moments: Preprocessor preparations 2020-07-10 11:18:57 +02:00
Sébastien Villemot e2d5a83592
Global reindentation 2019-12-20 16:59:30 +01:00
Sébastien Villemot 031c0cff5f
Various code simplifications and modernizations 2019-12-16 19:42:59 +01:00
Houtan Bastani 4a1fb239da
Add interface for init2shocks
Dynare/dynare#1650
2019-12-02 13:58:44 +01: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 1907249fac
Ask GCC to warn about C-style casts (-Wold-style-cast)
Adapt the code accordingly.
2019-04-23 12:54:11 +02:00
Sébastien Villemot b73d554ad2
Use Unicode copyright symbol (in UTF-8 encoding) 2019-04-16 11:35:31 +02:00
Houtan Bastani e689032c31
fix bug in 3947903f33 2019-04-12 14:34:25 +02:00
Houtan Bastani 3947903f33
add JSON output for shock_groups 2019-04-12 14:16:42 +02:00
Sébastien Villemot 8a41a75c85
Apply modernize-raw-string-literal from clang-tidy
Use ReplaceShorterLiterals option to enforce replacement of all strings.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-raw-string-literal.html
2019-04-03 16:45:52 +02:00
Houtan Bastani 7b6f23c55a
conditional_forecast_paths: add support to write JSON output 2019-03-29 17:30:39 +01:00
Sébastien Villemot e7c9c26d2d
More modernizations with clang-tidy 2019-01-15 11:08:47 +01:00
Sébastien Villemot 7bb5382428 Always use brace-initializer in constructors
The syntax makes clearer the distinction between a function call and an
initialization. Also, it prevents bugs due to implicit type conversions.
2018-10-04 17:19:18 +02:00
Michel Juillard 680fb72d0d allowing for different number of periods in conditional_forecast_path 2018-09-27 15:19:30 +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 c0ed97d247 Port to C++11 auto keyword
Performed using modernize-use-auto from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html
2018-06-04 15:03:26 +02:00
Sébastien Villemot 20bbbd46c3 Port some constructors to pass-by-value using C++11 move semantics
Performed using modernize-pass-by-value from clang-tidy.

Manual intervention was needed to fix an issue in MacroValue.hh.
Also replace std::move by move, since we import the std namespace.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-pass-by-value.html
2018-06-04 12:35:28 +02:00
Sébastien Villemot 6cf4e6dc0c Port to C++11 range-based for loops
Performed using modernize-loop-convert from clang-tidy.

Manual intervention was needed in MacroValue.cc because of a variable name
capture issue.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-loop-convert.html
2018-06-04 12:26:16 +02:00
Sébastien Villemot 08eedcb448 Add const qualifier for tef_terms in writeOutput method and siblings
Consequently, change various function calls where tef_terms was empty, passing
an (empty) rvalue instead of an lvalue.
2018-05-29 14:22:01 +02:00
Houtan Bastani b504f160ca move files to src directory 2018-02-15 11:48:04 +01:00