Commit Graph

35 Commits (74ef3457b4805099ee9885b34173a0d0fd6aca61)

Author SHA1 Message Date
Sébastien Villemot 74ef3457b4
Use secure URL for link to GNU licenses 2021-06-09 17:21:00 +02:00
Sébastien Villemot c2d47fb48e
Julia: remove driver file
The Julia code now uses the JSON output for retrieving the information that
previously was in the driver file.
2021-04-19 17:02:41 +02:00
MichelJuillard 6662d8014e
fix writeJsonOutput for load_params_and_steady_state 2021-04-01 17:05:13 +02:00
MichelJuillard ed4c36a267 add first_simulation_period to the lexer
(cherry picked from commit c8575e11d2f81ad606ab50849c52127653699a93)
2020-05-14 14:36:35 +00:00
Sébastien Villemot c4a9f93d40
Do not allow the estimation of a parameter that appears in “planner_discount”
Ref. dynare#1173
2020-02-04 17:49:53 +01:00
Sébastien Villemot e2d5a83592
Global reindentation 2019-12-20 16:59:30 +01:00
Sébastien Villemot d1d244086d
Remove spurious spaces within parentheses in generated MATLAB code 2019-12-18 17:35:25 +01:00
Sébastien Villemot 031c0cff5f
Various code simplifications and modernizations 2019-12-16 19:42:59 +01:00
Houtan Bastani 0ff7a9d2ab
introduce command line options: `exclude_eqs` and `include_eqs`
Allows for the inclusion/exclusion of a set of equations, specified either on the command line or in a text file.

If the equation has a single endogenous variable on the LHS, then the equation is moved. If not, if the equation has an `endogenous` tag then that variable is removed along with this equation. If not, then an error is thrown.

As a command line argument, `exclude_eqs` can take the form (same syntax for `include_eqs`):
* `exclude_eqs=eq1 to remove all equations declared as `[name=eq1]`
* `exclude_eqs=[eq 1, eq 2]` to remove all equations declared as `[name=eq 1]` or `[name=eq 2]`
* `exclude_eqs=[tagname=X]` to remove all equations declared as `[tagname=X]`
* `exclude_eqs=[tagname=(X, Y)]` to remove all equations declared as `[tagname=X]` or `[tagname=Y]`

When declared in a file, the file should be of the form:
```
eq 1
eq 2
```
to remove all equations declared as `[name=eq 1]` or `[name=eq 2]`.

It should be of the form:
```
tagname=
X
Y
```
to remove all equations declared as `[tagname=X]` or `[tagname=Y]`.
2019-11-26 14:16:00 +01: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 2c6fa34a1f
C++17: use structured bindings instead of std::tie whenever possible 2019-09-11 16:40:19 +02:00
Sébastien Villemot deb41a2a8f
Fix comment in previous commit 2019-07-11 18:39:32 +02:00
Sébastien Villemot e7b619c0ef
Fix handling of underflows and overflows in load_params_and_steady_state
Basically revert the change made in 30c205f418,
since it lead to preprocessor crashes (via C++ exceptions).
2019-07-11 18:35:42 +02:00
Sébastien Villemot b73d554ad2
Use Unicode copyright symbol (in UTF-8 encoding) 2019-04-16 11:35:31 +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
Sébastien Villemot 78583135df
Use true/false instead of 1/0 for boolean options
This is more elegant, and makes it easier to distinguish them from integer
options.
2019-03-19 15:15:10 +01:00
Sébastien Villemot 3d42e6468d
Octave compatibility fix 2019-02-25 16:56:11 +01:00
Houtan Bastani 9c95bfa33f
fix typos 2019-01-18 12:48:45 +01:00
Houtan Bastani 027b59b449
fix typos 2019-01-18 12:36:19 +01:00
Sébastien Villemot f2b0bdf0a2
Fix bug when histval is used and there is no auxiliary variable
Problem introduced in a69c65361c.
2018-12-20 17:45:54 +01:00
Sébastien Villemot b2e3a481e3
Fix for histval with auxiliary lead variables corresponding to non-linear terms
The M_.params structure was not correctly passed to
dynamic_set_auxiliary_series.m, leading to crashes if a parameter was needed to
compute an auxiliary variable (typically an auxiliayr lead variable
corresponding to a non-linear term in stochastic setup).
2018-12-20 15:05:18 +01:00
Sébastien Villemot a69c65361c
Fix ramsey_policy with histval
Since 38152c34a4, the M_.endo_histval variable is
generated via dynamic_set_auxiliary_dseries.m. But the latter file does not
handle auxiliary variables for Lagrange multiplier. We therefore now set them
by hand (at an initial value of zero).
2018-12-20 15:05:18 +01:00
Sébastien Villemot 9e66627375
Fix for histval block in the presence of auxiliary lead variables
Since 38152c34a4, the M_.endo_histval variable is
generated via dynamic_set_auxiliary_dseries.m. The problem is that, for
auxiliary variables corresponding to a lead, this will generate a NaN in
M_.endo_histval. This is conceptually correct, since such variables are never
used as initial conditions, but this is inconsistent with what we do with the
"initval" block, and leads to crashes in some routines where we fail when there
is a NaN. Therefore, replace these with a zero, as it used to be.
2018-12-20 15:05:17 +01:00
Sébastien Villemot 38152c34a4
Make histval compatible with diff operator
The idea is to make use of the dynamic_set_auxiliary_dseries.m file to generate
the initial conditions for all auxiliary variables, including the diffs.

Also remove the check done by the preprocessor for the lags in histval, since
it does not work correctly with the diff operator.
2018-12-11 17:32:05 +01:00
Sébastien Villemot a08ce3de2b
Yet more simplifactions using std::tuple 2018-12-03 16:07:13 +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
Sébastien Villemot d6055c1407 C++11: convert SymbolType to a class enum 2018-07-17 18:55:26 +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 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 1e56c73377 Port to C++11 nullptr keyword
Performed using modernize-use-nullptr from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
2018-06-04 15:03:31 +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