Sébastien Villemot
e9341c7153
Implement option "expression" of var_expectation_model
...
The data structure written in the driver file is changed also in the case of
the "variable" option.
2018-11-28 17:33:59 +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
cac65b071e
Fix visibility of matchVTCTPHelper method in subclasses of ExprNode
2018-11-28 14:18:08 +01:00
Sébastien Villemot
16a97a96fd
Rewrite engine for matching the non-optimizing agents part in PAC
...
The engine is now more robust and should reject any expression that does not
conform to the expected form. It is also able to deal with more cases, such as
terms appearing with a minus sign, or variables in the middle of a
three-factors product.
BTW, use a std::tuple for storing the result of the matching inside
PacExpectationNode, and change the order of components within the
structure (variable first, scalar last).
2018-11-27 19:03:35 +01:00
Sébastien Villemot
003df49e7d
Remove useless "virtual" keyword in various ExprNode methods
2018-11-27 09:50:41 +01:00
Sébastien Villemot
1089a223c4
Clean up default constructors/destructors
2018-10-11 17:08:44 +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
215283005e
No longer store symbol type in VariableNode
...
This facilitates switching variable types on the fly. In particular, this
allows removing the hack in DynamicModel::updateAfterVariableChange() that way
basically recreating all the nodes after the type change.
2018-10-10 12:34:05 +02:00
Sébastien Villemot
6d26dc2349
Remove implicitly-defined copy/move constructors/assignments in several classes
2018-10-04 18:08:17 +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
Houtan Bastani
c9f5cef99b
write AST in JSON
2018-09-18 17:48:04 +02:00
Houtan Bastani
eb74d48393
trend_component_model: replace `trends` option with `targets`
2018-09-13 12:21:23 +02:00
Houtan Bastani
dc9ecbb49a
fix bug in columns of EC matrix
2018-09-12 17:56:30 +02:00
Houtan Bastani
f71c861d5e
output EC matrix in file for trend component models
2018-09-10 17:44:04 +02:00
Houtan Bastani
f5e5dea1be
support hard-coded parameters and parameter expressions in AR matrix
2018-09-07 10:14:18 +02:00
Houtan Bastani
acc197f539
output AR matrix in file
2018-09-06 18:00:05 +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
Sébastien Villemot
004d909621
Use smart pointers for storage of ExprNode in DataTree class
...
- BTW, store them in a std::vector rather than std::list
- incidentally, fix issue in VariableNode::removeTrendLeadLag where expression
sharing was possibly violated when creating a new VariableNode
2018-09-05 18:28:32 +02:00
Houtan Bastani
9f0c30740e
introduce epilogue block
2018-09-05 12:31:49 +02:00
Houtan Bastani
8584323563
provide information on order of ec.vars
2018-09-04 10:39:05 +02:00
Houtan Bastani
fde836d7fe
trend_component_model: find trend_vars associated with equation
2018-08-31 14:24:44 +02:00
Houtan Bastani
948e8cb6e4
fix bug in creation of ec vars for pac equation
2018-08-28 16:00:25 +02:00
Houtan Bastani
d3bd6ace90
pac: print optimizing share parameter
2018-08-13 17:00:47 +02:00
Houtan Bastani
edc242d471
preprocessor: find optimizing shares of agents in PAC equation
2018-08-13 14:34:57 +02:00
Houtan Bastani
c5c61f99ba
fix bug with max_lag reported for PAC equation
2018-08-13 12:12:20 +02:00
Sébastien Villemot
f3c2a1bf87
New var_expectation_model statement and re-design of var_expectation operator
...
Given a previously declared var_model, the var_expectation_model statement is
used to declare a way of forming expectations with this VAR (possibly using a
finite or infinite discounted sum). The var_expectation operator now takes a
single argument, the name of the var_expectation_model.
For the moment, this only works when the var_model is using equations
explicitly declared in the model block.
2018-08-02 08:39:09 +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
946d105c04
Remove C and C++ preprocessor output types
...
This code is broken since the temporary terms array changes. It is probably not
worth maintaining it.
2018-07-17 16:52:11 +02:00
Sébastien Villemot
b8a5dfdc39
Replace several usages of C macroprocessor with C++ constructs
2018-07-17 16:36:58 +02:00
Houtan Bastani
b8ae9f6935
Fix max lags for var
2018-06-11 15:18:06 +02:00
Houtan Bastani
84c2dc5f36
transform_unary_ops now introduces aux variables/equations for all unary ops specified by UnaryOpNode::createAuxVarForUnaryOpNode()
...
In the absence of this option, if a var_model statement(s) is present, then aux vars/eqs are created for the same types of unary operators but only for equations specified in the var_model statement
In the absence of both this option and var_model statements, no unary op auxiliary variables are created
diffs continue to be substituted everywhere; for the moment auxiliary variables are created for diffs of expressions. A forthcoming change will allow auxiliary variables created for diffs of expressions to be linked with their lagged expressions as is currently the case for diffs of variables
2018-06-07 17:16:12 +02:00
Houtan Bastani
a30f8f365e
Only create auxiliary variables for diffs that appear in VAR equations or equations that have pac_expectations in them
...
Otherwise, substitute the diff (i.e. `diff(x)` -> `x-x(-1)`)
2018-06-05 18:39:13 +02:00
Sébastien Villemot
7d9cd718fc
Replace more typedefs by using
...
Those were not automatically replaced by clang-tidy, I don’t know why…
2018-06-04 15:03:31 +02:00
Sébastien Villemot
182c53273e
Remove useless spaces in type qualifiers
...
In C++11, it is no longer necessary to put a space between two consecutive ">".
2018-06-04 15:03:31 +02:00
Sébastien Villemot
f8cc3ae355
Port to C++11 using keyword
...
Performed using modernize-use-using from clang-tidy.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-using.html
2018-06-04 15:03:31 +02:00
Sébastien Villemot
bf891b7d72
Port towards C++11 override
...
Performed using modernize-use-override from clang-tidy.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html
2018-06-04 15:03:31 +02:00
Sébastien Villemot
e73ebc7033
Port to C++11 noexcept keyword
...
Performed using modernize-use-noexcept from clang-tidy.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-noexcept.html
2018-06-04 15:03:31 +02:00
Sébastien Villemot
dcfc598196
Remove redundant void arguments
...
Performed using modernize-redundant-void-arg from clang-tidy.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-redundant-void-arg.html
2018-06-04 15:02:57 +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
28582c4a4b
Merge branch 'temporary_terms_array'
2018-06-04 11:40:49 +02:00
Houtan Bastani
9166cda225
remove code that is no longer used in creation of auxiliary variables for diff operator
2018-05-31 18:44:06 +02:00
Houtan Bastani
1b952a12e6
fix bug in var max lag and simplify code
2018-05-31 15:36:03 +02:00
Sébastien Villemot
59e427cf66
Merge branch 'master' into temporary_terms_array
2018-05-30 17:20:48 +02:00
Houtan Bastani
0aea4f0cc4
introduce dynare command transform_unary_ops to create auxiliary variables for certain unary ops. This will be used for VARs and VECMs but can also be used for OLS, for example
2018-05-30 16:48:08 +02:00
Houtan Bastani
856f6f508a
Revert "create aux vars for certain unary ops contained in diff operator"
...
This reverts commit f600a65c0e
.
2018-05-30 15:50:42 +02:00
Houtan Bastani
922d0551a8
Revert "fixes to auxiliary variable creation for unary ops in diff operators"
...
This reverts commit 48031b99f6
.
2018-05-30 15:50:26 +02:00
Houtan Bastani
48031b99f6
fixes to auxiliary variable creation for unary ops in diff operators
2018-05-30 14:42:00 +02:00
Sébastien Villemot
0b617ceb4b
Merge branch 'master' into temporary_terms_array
2018-05-29 17:25:11 +02:00
Sébastien Villemot
e1f65b3390
Fix bug in external functions with temporary terms array
...
Given that temporary terms are separated in several functions (residuals,
jacobian, …), we must make sure that all temporary terms derived from a given
external function call are assigned just after that call, and not in an other
function.
2018-05-29 17:07:18 +02:00
Houtan Bastani
f600a65c0e
create aux vars for certain unary ops contained in diff operator
2018-05-29 17:00:56 +02:00