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
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
b299983a8b
Fix the notmpterms option in the presence of external functions
2019-08-14 15:28:41 +02:00
Sébastien Villemot
0988a1f755
Generated LaTeX files are now under <basename>/latex/
2019-07-11 17:33:53 +02:00
Sébastien Villemot
ac9d352a2c
use_dll under MATLAB: link only to libraries that are really needed
2019-07-11 16:11:24 +02:00
Sébastien Villemot
176732ee2c
ModelTree: pass argument by const-reference rather than by value in some methods
2019-07-05 18:41:13 +02:00
Sébastien Villemot
271a579808
Remove symmetric elements in 3rd derivatives
2019-06-17 15:28:33 +02:00
Houtan Bastani
33c2f9b88b
move macOS compiler to gcc-9
2019-05-08 14:58:45 +02:00
Houtan Bastani
21fe0f4bdc
avoid cast warnings when compiling boost headers
2019-04-23 14:57:03 +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
43906691d3
JSON: simplification of method for writing temporary terms
2019-04-18 17:10:39 +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
bbab112d65
Support for output of arbitrary derivation order (in MATLAB and DLL modes)
...
Does not work for Julia mode, neither with block and bytecode.
Note: in DLL mode, the number of temporary terms in no longer given in the
‘ntt’ symbol; it must be computed using ‘M_.dynamic_tmp_nbr’.
Ref dynare#217
2019-04-12 18:13:50 +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
d9f7ac4c9b
Fix bug introduced in 7d16fff786
...
Here, emplace() and insert() are not interchangeable because this is a std::set of
std::vector<int>, and we really want the initializer-list constructor of
std::vector (and not the two int's constructor).
Fixes the test deterministic_simulations/lola_solve_one_boundary.mod
2019-03-08 18:57:17 +01:00
Sébastien Villemot
7d16fff786
Further simplifications
2019-02-21 12:16:22 +01:00
Houtan Bastani
469a328cfc
replace make_pair and make_tuple
2019-02-21 10:42:10 +01:00
Houtan Bastani
02ae0af3e5
change map type for readability
2019-01-29 17:43:17 +01:00
Houtan Bastani
f5df7e7567
when an equation is of the form `X` = `constant`, replace all occurrences of `X` in other equations with `constant`
2019-01-28 15:32:12 +01:00
Stéphane Adjemia (Scylla)
8b81474a2e
On macOS use gcc-7 from homebrew instead of gcc-clang.
...
To install this version of gcc:
~$ brew install gcc@7
Does not seem to work with gcc-8 (missing headers…).
2018-12-20 14:38:37 +01:00
Sébastien Villemot
a08ce3de2b
Yet more simplifactions using std::tuple
2018-12-03 16:07:13 +01:00
Sébastien Villemot
571b5d0816
Computation of temporary terms generalized to any derivation order
2018-11-30 12:22:13 +01:00
Sébastien Villemot
b88e0de53f
Remove useless accessor methods for data members that are const in ExprNode classes
...
Those const data members are simply made public.
2018-11-28 14:35:30 +01:00
Sébastien Villemot
d733f3fb5a
Various simplifications and modernizations of the block/bytecode part
2018-11-23 17:19:59 +01:00
Sébastien Villemot
e3a3992c1c
Derivation engine w.r.t. parameters generalized to any order
...
Also, no longer compute two times symmetric elements in derivation w.r.t.
parameters at order 2, for consistency with derivation w.r.t. endogenous.
It is therefore now necessary to duplicate them in the output to keep behavior
unchanged.
2018-11-22 17:13:55 +01:00
Sébastien Villemot
6fa115aedd
Derivation engine w.r.t. endogenous generalized to any order
2018-11-22 17:13:55 +01:00
Sébastien Villemot
b7d50560f8
Move ModelTree constructor up in the file for clarity
2018-11-22 17:13:55 +01:00
Sébastien Villemot
b524e19cde
Remove duplicate storage of temp terms for params derivs in ModelTree
2018-11-16 18:26:36 +01:00
Sébastien Villemot
e9b5f239df
Properly deal with model local variables in params derivatives file
...
Closes #13
2018-11-16 18:26:11 +01:00
Sébastien Villemot
3d2125287a
Temporary terms: various simplifications and added comments
2018-11-16 17:11:06 +01:00
Sébastien Villemot
e89dd9cb8b
Make storage of derivatives ready for k-order
...
This is the first step towards computing k-order derivatives.
Ref Dynare/dynare#217, #10
2018-11-15 17:48:46 +01:00
Sébastien Villemot
4a974bb428
The preprocessor now compiles the MEX when use_dll is specified
...
New options "mexext" and "matlabroot" are introduced, so that the preprocessor
knows where to find MATLAB and which architecture to compile for.
Only recent gcc is now supported. A set of optimization flags is used so that
compilation goes reasonably fast on large models.
Consequently, options "msvc", "mingw" and "cygwin" have been removed.
2018-10-26 18:09:13 +02:00
Sébastien Villemot
52ce0d8ba9
Fix bug with discretionary_policy
...
Since, in this case, there are less equations than endogenous, the
variable_reordered structure was not filled with enough element, leading to an
invalid memory read when printing M_.state_var.
Ref #637
2018-10-10 17:08:01 +02:00
Sébastien Villemot
63a5ffb761
Rename ExprNode::cloneDynamic into ExprNode::clone, for clarity
2018-10-10 13:08:11 +02:00
Sébastien Villemot
f2cf86b734
Add copy constructors / assignment operators for the DataTree class hierarchy
...
In particular, it is necessary to turn back DataTree::AddVariable() into a
non-virtual method, because it is called from DataTree's constructor. Enforcing
the absence of leads/lags is now done using a new boolean DataTree::is_static.
Take advantage of the new copy constructor for handling
PlannerObjectiveStatement more elegantly.
Unfortunately it is not possible to implement *move* constructor / assigment
operators, because the reference ExprNode::datatree is not mutable.
2018-10-10 12:53:55 +02:00
Sébastien Villemot
c47b6e6e4c
Fix bug with notmpterms option
...
Commit c6cb9aa1b8
was not the right fix.
2018-10-05 17:14:27 +02: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
15d026e54e
C output: split generated function into several smaller subfunctions
...
This mimicks the structure of M-functions (though the logic for filling the
temporary terms vector is a bit different).
This change implied a modification in the way we compute the checksum in case
of block decomposition (the temporary terms for the C output are not correctly
computed in that case).
2018-10-01 16:04:01 +02:00
Ferhat Mihoubi
139e3efa82
Adds a new model option "linear_decomposition" that creates a block composed of the non-linear equations o the model
2018-09-28 14:54:52 +02:00
Sébastien Villemot
c6cb9aa1b8
Fix bug in option notmpterms with model local variables
...
Since model local variables are now treated as temporary terms, they must be
marked as such even when option notmpterms is present.
2018-09-25 15:57:56 +02:00
Houtan Bastani
85dbb649b7
move trend_component_table and var_model_table to DynamicModel as they are only used there
2018-09-14 17:04:06 +02:00
Sébastien Villemot
e19a14869e
Convert ExprNodeOutputType into a class enum
...
Incidentally, replace the IS_* macros by inline functions.
2018-09-05 18:28:32 +02:00
Houtan Bastani
539fddc9f6
introduce var model table
2018-08-22 12:15:02 +02:00
Houtan Bastani
afe0e475b1
trend_component_model statement
2018-08-17 16:52:48 +02:00
Sébastien Villemot
edddc9d8ca
C++11: convert NodeTreeReference to a class enum
2018-07-18 16:35:19 +02:00
Sébastien Villemot
4ad0e500d4
C++11: convert {Unary,Binary,Trinary}Opcode to class enums
2018-07-18 16:18:26 +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
b8a5dfdc39
Replace several usages of C macroprocessor with C++ constructs
2018-07-17 16:36:58 +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