Commit Graph

332 Commits (74ef3457b4805099ee9885b34173a0d0fd6aca61)

Author SHA1 Message Date
Sébastien Villemot 82cd95a653
Remove some unnecessary headers 2019-05-02 15:30:33 +02:00
Houtan Bastani bf89cedd88
fix compilation of static/dynamic files on macOS 2019-04-24 17:40:50 +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 c628f21245
JSON: output derivatives at an arbitrary order
Backward incompatible change: the temporary terms for 3rd order are now stored
in "temporary_terms_third_derivative" (without the final "s"; same for external
functions), for consistency with the name of the slot for the derivatives
themselves ("third_derivative").

Ref dynare#217
2019-04-18 17:13:16 +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 58adbdeddd
Compatibility fix with MATLAB ≤ R2011a 2019-03-26 15:41:48 +01:00
Sébastien Villemot fd6e700ec7
Simplification: use std::max when computing maxima 2019-03-21 17:24:49 +01: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
Houtan Bastani f1d1c1e1c1
trend_component_model: simplify AR 2019-03-15 12:27:32 +01:00
Houtan Bastani a3c08f932e
simplify code to find autoregressive matrix for VARs 2019-03-15 12:26:59 +01:00
Houtan Bastani 69e7763490
pac: change vectors that store additive parts 2019-03-07 12:57:47 +01:00
Houtan Bastani 2201907245
pac: support additive elements whether optimizing agents are present or not 2019-03-07 12:36:08 +01:00
Houtan Bastani 9b1b4113d9
pac: keep order of variables in ec part of pac equation and add scaling factor to output 2019-03-07 11:31:45 +01:00
Houtan Bastani b0dac547e9
shorten writing of istarget output 2019-03-07 11:31:45 +01:00
Houtan Bastani 9963686e72
handle additive terms when PAC equation does NOT have non/optimizing agents 2019-03-05 12:20:45 +01:00
Houtan Bastani 341b9c6667
pac_model: allow diff as argument to growth option 2019-02-28 19:22:34 +01:00
Houtan Bastani 5f013756f2 find additive parts to pac equation 2019-02-27 23:12:05 +01:00
Stéphane Adjemian (Charybdis) 2312ce13dc
Changed non_optimizing_behaviour.type field to non_optimizing_behaviour.isendo.
The elements are logicals true/false (true iff corresponding variable is an endogenous variable).
2019-02-27 15:35:19 +01:00
Houtan Bastani ec21208ed7
pac: specify type of variables in non optimizing part of equation 2019-02-27 15:10:48 +01:00
Houtan Bastani 64f55e4a5e
pac: declare endogenous variables needed by pac model consistent expectation before the creation of auxiliary variables 2019-02-25 15:29:46 +01:00
Houtan Bastani 36b2ae5026
pac: model consistent expectation: add 1 to max lag from pac equation to obtain correct `m` for substitution 2019-02-25 10:48:53 +01:00
Stéphane Adjemian (Charybdis) 6a34603f91
Conform to spelling used in Matlab codes. 2019-02-22 12:31:58 +01:00
Houtan Bastani d8c9bbc353
ensure that h1/h0_param_indices are created regardless of whether there are parameters or not 2019-02-22 11:52:07 +01:00
Sébastien Villemot 7d16fff786
Further simplifications 2019-02-21 12:16:22 +01:00
Sébastien Villemot be023bdab9
Simplification: the [] operator already inserts the new element
See https://en.cppreference.com/w/cpp/container/map/operator_at
2019-02-21 12:15:50 +01:00
Houtan Bastani f41e681122
use emplace instead of insert and emplace_back instead of push_back 2019-02-21 10:59:53 +01:00
Houtan Bastani 520c7fc9b2
use auto instead of specific initializer 2019-02-21 10:52:59 +01:00
Houtan Bastani 469a328cfc
replace make_pair and make_tuple 2019-02-21 10:42:10 +01:00
Houtan Bastani b09b50472b
pac: fix writing to use modstruct instead of M_ 2019-02-20 16:46:52 +01:00
Houtan Bastani f88682d683
pac: output model type in M_.pac.(model_name) 2019-02-20 16:43:24 +01:00
Houtan Bastani 5e1521f42b
don’t save unnecessary pac model info 2019-02-20 16:38:44 +01:00
Houtan Bastani 240aba6709
move pac info out of pac expectation node 2019-02-20 15:35:13 +01:00
Houtan Bastani 34756833ae
pac: output info into substructures based on pac model name & equation tag 2019-02-19 18:32:42 +01:00
Houtan Bastani fc6d04b015
create A0 and A0star matrices for trend component models 2019-02-19 12:26:30 +01:00
Houtan Bastani 0ea84fa9a4
pac: allow steady state growth and model consistent expectation substitution in pac equation 2019-02-18 15:11:45 +01:00
Houtan Bastani f4837e6c94
fix AR and EC matrices when `equation = C` results in a simplified equation 2019-02-14 17:09:57 +01:00
Houtan Bastani d922ae8ffc
pac_model: permit lag on growth option 2019-01-25 14:52:26 +01:00
Sébastien Villemot e7c9c26d2d
More modernizations with clang-tidy 2019-01-15 11:08:47 +01:00
Sébastien Villemot 01385d1f80
Simplify implementation of nopreprocessoroutput option
Simply redirect cout to /dev/null, instead of propagating a boolean
everywhere.
2018-12-20 17:08:45 +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 66a766b0b7
Small modernization 2018-12-04 18:41:04 +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 67ac4bf8ea
Allow diff() and log() in "expression" option of var_expectation_model 2018-11-29 16:01:49 +01:00
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
Houtan Bastani 41af0841c3
extend nopreprocessoroutput option to substitution output 2018-11-28 11:53:50 +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 fa039b8c41
Fix bug in block decomposition with treatment of varexo_det 2018-11-23 17:39:18 +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 fc9cc2dc50
Output symmetric elements in derivatives of hessian w.r.t. parameters
The preprocessor now writes all the symmetric elements in the "hp"
matrix (derivatives of the hessian w.r.t. parameters), for consistency with all
other derivatives output.

Previously it was only writing one of the two symmetric elements, when indices
of endogenous were different.
2018-11-22 17:51:14 +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 33994dde03
Optimization for use_dll at 2nd and 3rd order
When creating the sparse matrix (in MATLAB or C mode), since storage is in
column-major order, output the first column, then the second, then the third.
This gives a significant performance boost in use_dll mode (at both compilation
and runtime), because it facilitates memory accesses and expression reusage.
2018-11-19 16:03:47 +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
Houtan Bastani bef7c2a193 remove need to declare equations nonstationary 2018-10-24 16:04:51 +02:00
Sébastien Villemot ac94ad906e Various fixes for silencing errors and warnings under Clang 6 2018-10-11 11:21:58 +02:00
Sébastien Villemot bcdfb43fd3 Replate DynamicModel::toStatic() by a converting constructor in StaticModel
It is therefore now possible to write:

  static_model = static_cast<StaticModel>(dynamic_model);
2018-10-10 17:08:54 +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 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 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 5e6b8f0a6b No longer test for __MINGW32__ macro, testing for _WIN32 is enough
Closes: Dynare/dynare#1315
2018-10-02 16:50:07 +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
Houtan Bastani 63a334cfd3 fix typo 2018-09-27 10:47:13 +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 7282b7bf32 fix bug in filling of var AR matrix 2018-09-25 15:47:52 +02:00
Houtan Bastani c9f5cef99b write AST in JSON 2018-09-18 17:48:04 +02:00
Houtan Bastani 9f9c8fdfbf fix typo 2018-09-18 14:50:54 +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
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 0376f7f173 fix bugs in creation of AR/EC matrices 2018-09-12 11:57:14 +02:00
Houtan Bastani aa120abd02 simplify code 2018-09-12 11:57:14 +02:00
Houtan Bastani f71c861d5e output EC matrix in file for trend component models 2018-09-10 17:44:04 +02:00
Houtan Bastani 46709ada3f output AR matrix in file for trend component models 2018-09-10 14:51:33 +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
Houtan Bastani 8584323563 provide information on order of ec.vars 2018-09-04 10:39:05 +02:00
Houtan Bastani 27c9a9a5e0 store LHS of trend equation in trend_vars 2018-09-03 17:25:42 +02:00
Houtan Bastani 7a438a3ce7 ensure that trend_variable found is actually a trend variable as declared in the trend_component_model statement 2018-09-03 15:05:30 +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 d5d6e8beb0 simplify updating of RHS variables for trend component and var models 2018-08-23 13:57:27 +02:00
Houtan Bastani 16f10d954f don’t rely on scope: clean up iterator names 2018-08-23 13:03:52 +02:00
Houtan Bastani 0af91c26f8 aesthetic fix 2018-08-22 15:12:17 +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
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
Houtan Bastani 0dffee4650 fix typo 2018-08-13 11:08:58 +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 45cd8e6853 Fix regression in nested diffs introduced in 90d8b579
See McModelTeam/McModelProject/issues/97.
2018-07-30 12:53:23 +02:00
Sébastien Villemot b9ee0bb204 aux_equations may diverge from those in the main model
aux_equations only contain the definition of auxiliary variables, and
may diverge from those in the main model (equations), if other model
transformations applied subsequently. This is not a problem, since
aux_equations is only used for regenerating the values of auxiliaries
given the others.

For example, such a divergence appears when there is an expectation
operator in a ramsey model, see
tests/optimal_policy/nk_ramsey_expectation.mod */
2018-07-27 14:20:36 +02:00
Sébastien Villemot 762f25abe9 Remove useless separate list for diff auxiliary variables
This table serves no useful purpose. It is better to append auxiliary equations
at the time they are created, to avoid messing with the recursive ordering.
2018-07-26 17:41:58 +02:00
Sébastien Villemot 90d8b579cc Fix incorrect recursive ordering of aux vars with diff not used at current period
Ensure that all diff operators appear once with their argument at current
period (i.e. maxLag=0).
If it is not the case, generate the corresponding expressions.

This is necessary to avoid lags of more than one in the auxiliary
equation, which would then be modified by subsequent transformations
(removing lags > 1), which in turn would break the recursive ordering
of auxiliary equations.

See McModelTeam/McModelProject/issues/95 for an example.
2018-07-26 17:41:58 +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 c12088f314 C++11: convert AuxVarType to class enum 2018-07-17 17:38: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 15f5f4f1be use front inserter instead of back inserter for unary/diff auxiliary equations
(cherry picked from commit 6a95831147d942c23fbc3a0a0b1506650eb49b7d)
2018-07-10 12:06:42 +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 b91ed6f78c Move the location of static and dynamic files on the filesystem
- M and MEX files are now under +${MODELNAME}/
- bytecode and C source now under ${MODELNAME}/model/
2018-06-27 15:30:25 +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
Houtan Bastani 2cd3aa95cc When `transform_unary_ops` is passed, only substitute unary operators that appear in VAR equations 2018-06-05 17:41:15 +02:00
Sébastien Villemot 130004ef47 Simplify types for storing derivatives using std::tuple 2018-06-05 15:34:34 +02:00
Sébastien Villemot 7e16307382 Simplify DataTree maps using std::tuple 2018-06-04 17:35:02 +02:00
Sébastien Villemot 608c43450c Replace most calls to make_pair by braced-initializer lists or emplace()/emplace_back() 2018-06-04 16:36:46 +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 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 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 33b1359905 Port to C++11 emplace_back() method on containers
Performed using modernize-use-emplace from clang-tidy.

Manual intervention was needed to transform a NULL into nullptr in SymbolTable.cc.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-emplace.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 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 28582c4a4b Merge branch 'temporary_terms_array' 2018-06-04 11:40:49 +02:00
Houtan Bastani f338e87692 Revert "remove unnecessary code for calculation of max lag when equation have been undiffed"
This reverts commit d7c979a4e6.
2018-06-02 12:17:05 +02:00
Houtan Bastani d7c979a4e6 remove unnecessary code for calculation of max lag when equation have been undiffed 2018-06-01 15:52:40 +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
Houtan Bastani f600a65c0e create aux vars for certain unary ops contained in diff operator 2018-05-29 17:00:56 +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
Sébastien Villemot 33b280b3d5 Remove some ExprNode::writeOutput variants
More precisely, remove those variants where temporary_terms can be specified
without temporary_terms_idxs, in order to make clear that the latter is
expected. For situations where the tt_idxs are not needed (C, block MATLAB), an
empty map has to be explicitly given.
2018-05-29 11:13:55 +02:00
Sébastien Villemot 3f874cfced Remove obsolete function 2018-05-28 16:39:28 +02:00
Houtan Bastani 90c90ca85d pac: undiff: fix bug in erroneous conditional 2018-05-28 15:55:01 +02:00
Houtan Bastani ad19c535ef clarify error messages 2018-05-28 15:54:20 +02:00
Sébastien Villemot dd6799187c Fix derivs w.r.t. parameters with temporary terms array 2018-05-28 15:23:15 +02:00
Sébastien Villemot 8657d4dc98 Fix block decomposition with temporary terms array 2018-05-28 11:58:11 +02:00
Sébastien Villemot 38ed0f2ffc Remove unused writeChainRuleDerivative methods 2018-05-25 17:10:16 +02:00
Sébastien Villemot c7c26190d6 Reactivate use_dll mode 2018-05-25 15:48:55 +02:00
Sébastien Villemot 467604d428 Simplify ExprNode::writeOutput methods
The version with no temporary_terms_idxs argument needs not be virtual, since
it is the same implementation in all derived classes. Rather move it at the
level of the base ExprNode class.
2018-05-25 12:20:25 +02:00
Sébastien Villemot 64323ef730 Add compatibility layer for Matlab/Octave code not using the new temporary terms array interface 2018-05-24 19:35:35 +02:00
Sébastien Villemot 164a6f303b Fix bug in temporary terms array in the presence of model local variables
In the presence of MLVs, the temporary terms indexing was corrupted. The code
was using the implicit assumption that the ExprNodeLess ordering was giving the
same ordering as the temporary terms indexes ordering. But MLVs can be higher
in ExprNodeLess ordering than some other temporary terms, while they have the
lowest temporary terms index, hence the bug.

Fix this by no longer relying on the ExprNodeLess ordering, and rather use a
full map<ExprNode *, int> for ModelTree::temporary_terms_idxs. By the way,
simplify the code by removing a few useless data structures (e.g.
ModelTree::temporary_terms_idxs_*).
2018-05-24 19:35:21 +02:00
Sébastien Villemot a9bfd1223b Fix assertions that check the length of temporary terms vectors
Model local variables had been omitted in the length computations.
2018-05-24 17:04:16 +02:00
Sébastien Villemot 41d7496b46 Fix bug in wrapper functions (*_{dynamic,static}_resid_g1{,_g2,_g2_g3}.m)
The last argument (T_flag) was missing in the function definitions (but it was
used in some function calls).
2018-05-23 17:34:00 +02:00
Sébastien Villemot 3fa14031a2 Fix bug in *_{dynamic,static}_resid_g1_g2_g3.m functions 2018-05-22 12:02:48 +02:00
Houtan Bastani 732a317030 Merge branch 'master' into temporary_terms_array 2018-05-18 16:40:12 +02:00
Houtan Bastani 3d946ec8b7 var: check for leaded/contemporaneous variables 2018-05-16 12:17:06 +02:00
Houtan Bastani 912261e5fc pac: separate params into EC and AR 2018-05-04 15:26:21 +02:00
Houtan Bastani d686275da1 fix bug with predetermined variables used in model local variables 2018-04-18 14:29:40 +02:00
Houtan Bastani 7ac33099f8 support undiff in pac model 2018-04-17 16:56:27 +02:00
Houtan Bastani 09e73f3bb4 var_model: fix lag info when diff present 2018-04-17 16:55:55 +02:00
Houtan Bastani fb8d9258d0 add pac_model statement 2018-04-04 11:48:59 +02:00
Stéphane Adjemian(Charybdis) b52ded0eb4 Fixed doc headers for static and dynamic julia modules. 2018-03-29 09:31:25 +00:00
Stéphane Adjemian(Charybdis) 849936d81b Same as bce9b66312 for matlab output. 2018-03-28 19:14:43 +02:00
Stéphane Adjemian(Charybdis) bce9b66312 Added arrays providing the number of temp terms in Julia modules...
... For static and dynamic models.
2018-03-28 17:50:58 +02:00
Houtan Bastani ec215e2a44 separate temporary terms: WIP 2018-03-28 16:41:48 +02:00
Houtan Bastani 7cbd7b6e1e Revert "Added new routine for the dynamic model (only computes the jacobian)."
This reverts commit 84c6bf5daf.
2018-03-28 16:14:15 +02:00
Houtan Bastani 80060fb9ef Merge remote-tracking branch 'origin/declare_vars_in_model_block' 2018-03-19 17:05:03 +01:00
Stéphane Adjemian(Charybdis) deb77be8f1 Fixed bug.
Preprocessor was not returning an error when some of the exogenous
variables were not used in the model.
2018-03-13 09:20:14 +01:00
Stéphane Adjemian(Charybdis) 84c6bf5daf Added new routine for the dynamic model (only computes the jacobian). 2018-03-10 10:20:50 +01:00
Houtan Bastani 5d339b69de simplify pac_expectation code 2018-03-07 15:04:07 +01:00
Houtan Bastani 81f2258228 var_model: store max lag info 2018-03-06 15:17:39 +01:00
Houtan Bastani a69c53b0c8 clean up var_model code 2018-03-06 14:42:11 +01:00
Houtan Bastani 03f88931c6 Merge branch 'diff' 2018-03-05 13:08:09 +01:00
Stéphane Adjemian(Charybdis) 051f41c5f7 Shortened a function name. 2018-03-04 16:54:11 +01:00
Houtan Bastani 204457cd86 explicitly close output streams 2018-03-02 18:39:16 +01:00
Houtan Bastani feb5b93eea create function to calculate aux vars as dseries 2018-03-02 17:50:35 +01:00
Houtan Bastani 583734f515 new diff equations not added to aux_equations 2018-03-02 16:40:19 +01:00
Houtan Bastani 9885fbacff diff: substitute auxiliary variables starting from the least lagged 2018-03-02 12:32:01 +01:00
Stéphane Adjemian(Charybdis) 02ef145aa5 Fixed initialization of state_var for julia. 2018-03-01 15:55:14 +01:00
Stéphane Adjemian(Charybdis) 250106f1d2 Cosmetic change. 2018-03-01 09:58:04 +01:00
Houtan Bastani 1e20717f58 fix bug in substitution of diff operator 2018-02-28 17:33:00 +01:00
Houtan Bastani a1437ac982 Merge remote-tracking branch 'dynare-preprocessor-github/master' into other-master 2018-02-26 12:09:58 +01:00
Houtan Bastani b504f160ca move files to src directory 2018-02-15 11:48:04 +01:00