Commit Graph

306 Commits (3d2125287ac7a740bfac068d11357d6e1d04fa14)

Author SHA1 Message Date
Houtan Bastani 1918a56a70 fix bug in 539fddc9f6 2018-08-22 12:56:16 +02:00
Houtan Bastani 539fddc9f6 introduce var model table 2018-08-22 12:15:02 +02:00
Houtan Bastani 6015b0e57b fixes to trend component model 2018-08-22 12:15:02 +02:00
Houtan Bastani 0d5dd11106 fix typo 2018-08-20 10:50:28 +02:00
Houtan Bastani afe0e475b1 trend_component_model statement 2018-08-17 16:52:48 +02:00
Houtan Bastani 618147a126 fix typo 2018-08-16 11:09:54 +02:00
Stéphane Adjemian(Charybdis) 74b693a1ec Cosmetic change. 2018-08-14 16:46:43 +02:00
Stéphane Adjemian(Charybdis) adbeb49b29 Do not print non optimizing behaviour field in PAC if empty. 2018-08-14 16:45:01 +02:00
Houtan Bastani ac850f5187 pac: stop processing of PAC equation if optimizing share parameter is hard-coded 2018-08-13 17:22:28 +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
Houtan Bastani d657f77149 fix typo :) 2018-08-09 13:27:05 +02:00
Houtan Bastani 719630a53c macroprocessor: allow looping over tuples. #5 2018-08-08 17:23:33 +02:00
Houtan Bastani ca066ea398 macroprocessor: introduce shortcut for Cartesion product (^). #5 2018-08-08 15:58:49 +02:00
Houtan Bastani d9c0568075 macroprocessor: introduce Cartesion product. #5 2018-08-08 15:11:06 +02:00
Houtan Bastani e24cabe3a5 var_expectation: print type specific id for discount index 2018-08-08 14:59:50 +02:00
Houtan Bastani 27d088da7e macroprocessor: fix bug in set difference introduced in 5f1465f9 2018-08-08 14:35:09 +02:00
Houtan Bastani 428b5023d3 macroprocessor: intersection operator. #5 2018-08-08 14:15:39 +02:00
Houtan Bastani 039b27bbaf macroprocessor: union operator. #5 2018-08-08 14:12:04 +02:00
Houtan Bastani 1285473aa1 macroprocessor: introduce tuple type. #5 2018-08-07 17:36:13 +02:00
Houtan Bastani 88a0162202 macroprocessor: remove terminals not used in grammar 2018-08-07 17:19:45 +02:00
Stéphane Adjemian(Charybdis) b20da7c43f Fixed timing issue in VAR_EXPECTATION expansion. 2018-08-06 21:36:52 +02:00
Stéphane Adjemian(Charybdis) 32da131a77 Added associated index in M_.endo_names for expected variable. 2018-08-04 19:50:12 +02:00
Stéphane Adjemian(Charybdis) ed32caeb46 Added missing field in VAR_EXPECTATION_MODEL description (variable). 2018-08-04 12:03:53 +02:00
Stéphane Adjemian(Charybdis) 022395aaf6 Fixed param_indices vector for VAR_EXPECTATION_MODEL. 2018-08-04 11:46:31 +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 8a03532c78 ParsingDriver: factorize code to check symbol types 2018-08-01 10:47:56 +02:00
Sébastien Villemot 122e154764 PlannerObjectiveStatement now owns its model_tree
By the way, error out if the planner_objective statement is used two times.
2018-07-31 13:00:41 +02:00
Sébastien Villemot 0a063eecc1 More smart pointers 2018-07-31 13:00:39 +02:00
Sébastien Villemot 66a712253a Macroprocessor: cosmetic change 2018-07-31 12:02:26 +02:00
Sébastien Villemot df01e52859 Use new syntax for various Bison options 2018-07-31 12:02:26 +02:00
Sébastien Villemot 4302307f7d Force Emacs to use C++ mode when opening Bison and Flex files 2018-07-31 12:02:24 +02:00
Sébastien Villemot 7280c92642 Use variant semantic values in the Bison parser
We can therefore manipulate objects by value rather than by pointers, which
saves a lot of memory manipulations (and avoid potential segfaults and memory
leaks).

Note that there is no default action ("$$ = $1") when using the variant type,
so we add them explicitly.
2018-07-31 11:48:08 +02:00
Sébastien Villemot 725b91e5d6 Several fixes to computing tasks statements
- store objects whose persistence is not guaranteed (e.g. strings) as values
  instead of references (to avoid possible segfaults)
- on the contrary, always store the SymbolTable as a reference, since its
  persistence is guaranteed, and we don't want to copy it
- use pass-by-value in constructors whenever possible
- remove useless const keyword when passing by value
2018-07-31 10:51:28 +02:00
Sébastien Villemot 107ad1432b Fix various Bison warnings 2018-07-30 19:38:46 +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 9cf3e034de Macroprocessor: allow empty arrays
This is now easy to implement, thanks to the refactoring allowing any type of
objects in arrays.

Closes DynareTeam/dynare#707
2018-07-25 18:46:55 +02:00
Sébastien Villemot 88fab669c6 Macroprocessor: length() operator called on a string returns the number of characters
Closes DynareTeam/Dynare#1547
2018-07-25 18:42:23 +02:00
Sébastien Villemot 5f1465f9d1 Macroprocessor: replace naked pointers by smart pointers
- use std::unique_ptr for MacroDriver::lexer
- use std::shared_ptr for MacroValue objects constructed by the parser
  This is made possible using Bison 3.0 variant value type.
  Using non-pointer type is not possible since MacroValue is polymorphic.
  Using std::unique_ptr is not possible since the value type must be
  copyable (see
  https://lists.gnu.org/archive/html/bug-bison/2015-03/msg00004.html).
  Define a new type MacroValuePtr == shared_ptr<const MacroValue> for code
  clarity.
  Use the following convention for shared_ptr arguments to functions:
  + if pass-by-value, means that the callee acquires ownership
  + if pass-by-const-reference, the callee does not acquire ownership
- naked pointers are still used for tracking the filename in Bison's location
  type, since we don't have control over that

Also, by the way:
- arrays can now contain elements of any type
- simplify MacroDriver::loop_stack using std::tuple
- toArray() method now fails on function objects
- no need to use const qualifiers, since all MacroValue objects are immutable
- use an exception for detecting division by zero
2018-07-25 18:40:23 +02:00
Sébastien Villemot 372005ed27 Bison: use the %language directive instead of %skeleton for specifying C++ 2018-07-24 14:02:10 +02:00
Sébastien Villemot 937659747a Macroprocessor: error out when length() operator called on a string or an int
Closes DynareTeam/Dynare#1547
2018-07-24 12:49:08 +02:00
Stéphane Adjemian(Charybdis) 49e1c43aed Partially reverted 19048bdca.
There is no reason to associate an exogenous variable or parameter to a
specific equation. For these types the user can use the pipe
notation (|x, |p) in any equations or the usual parameters and varexo statements.
2018-07-19 23:29:27 +02:00
Sébastien Villemot 4a04a38374 C++11: convert ExtendedPreprocessorTypes to class enums 2018-07-18 17:28:26 +02:00
Sébastien Villemot 97868cbd2a Remove unneeded enum keyword 2018-07-18 17:28:26 +02:00
Sébastien Villemot 04b6690d5a C++11: convert ExternalFunctionType to a class enum 2018-07-18 17:28:23 +02:00
Sébastien Villemot 14948401e4 C++11: convert PriorDistributions to a class enum 2018-07-18 16:52:12 +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 11b1fdcffd Fix implicit narrowing conversions (omitted in previous commit) 2018-07-18 15:12:00 +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 89832db1db C++11: convert MatrixForm to a class enum 2018-07-17 17:31:20 +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 8cf4fedac2 macroprocessor: change type of function arguments 2018-07-11 15:57:51 +02:00
Houtan Bastani 3776e3b890 only allow inline comments on statement lines. #4 2018-07-11 14:31:58 +02:00
Houtan Bastani aea9011745 Revert "macroprocessor: don’t interpret inline comments yet put them to output (ignored by dynare preprocessor, but printed in macro expanded file). #4"
This reverts commit 27e6d92af1.
2018-07-11 12:15:58 +02:00
Houtan Bastani 357320468b Revert "macroprocessor: support Matlab comments. #4"
This reverts commit 066942ef22.
2018-07-11 11:37:58 +02:00
Houtan Bastani a2fef7804e Revert "macroprocessor: support multi-line comments. #4"
This reverts commit 86a08f54ae.
2018-07-11 11:37:40 +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 7baee73126 Fix bug under MATLAB+Windows when "+" subdirectory is already present
Under MATLAB+Windows (but not under Octave nor under GNU/Linux or macOS), if we
directly remove the "+" subdirectory, then the preprocessor is not able to
recreate it afterwards (presumably because MATLAB maintains some sort of lock
on it). The workaround is to rename it before deleting it.
2018-07-09 18:18:26 +02:00
Houtan Bastani 86a08f54ae macroprocessor: support multi-line comments. #4 2018-07-09 16:55:59 +02:00
Houtan Bastani 066942ef22 macroprocessor: support Matlab comments. #4 2018-07-09 16:55:53 +02:00
Houtan Bastani 27e6d92af1 macroprocessor: don’t interpret inline comments yet put them to output (ignored by dynare preprocessor, but printed in macro expanded file). #4 2018-07-09 16:55:38 +02:00
Houtan Bastani e0bf2b60b6 Modify 19048bdcae to store equation tags for variables declared in equation tags 2018-07-09 14:49:12 +02:00
Houtan Bastani 19048bdcae Allow for the declaration of endogenous, exogenous, parameters on-the-fly in equation tags 2018-07-09 14:39:13 +02:00
Houtan Bastani a7f8eaa336 remove warnings introduced in 244552393b 2018-07-09 11:55:39 +02:00
Houtan Bastani 853cce553f replace ‘typedef’ with ‘using’ 2018-07-09 11:49:17 +02:00
Houtan Bastani 244552393b macroprocessor: add support for functions that return strings. #3 2018-07-04 17:04:22 +02:00
Houtan Bastani a51dd224e4 simplify conversion of int to string 2018-07-04 16:07:16 +02:00
Sébastien Villemot 543e2b16e3 Simplify and modernize ConfigFile
- no longer use pointers
- use pass-by-value when possible
- use range-for loops when possible
2018-07-04 15:56:48 +02:00
Sébastien Villemot 53f83aeb12 No longer use boost::lexical_cast
Most cases can be handled in C++11 by std::stoi() and std::stod().

For the macroprocessor ArrayMV<T>::print() method, use template
specialization (instead of a lexical_cast to detect between T=int and
T=string).
2018-07-04 15:53:41 +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 5e1d722013 C++11: replace most calls to std::atoi() by std::stoi()
The latter accepts a std::string as argument.
2018-07-04 14:53:08 +02:00
Sébastien Villemot e376267a28 Move json generated files to ${MODFILE}/model/json/ 2018-06-27 16:08:31 +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 45f7e40a88 remove unused library 2018-06-27 13:50:15 +02:00
Houtan Bastani bbb2b067bf prevent compilation warning 2018-06-27 13:45:51 +02:00
Stéphane Adjemian(Charybdis) a2b19cbfff Added missing writeJsonOutput method for VarModelStatement. 2018-06-15 14:56:44 +02:00
Sébastien Villemot 158f027db2 Fix parsing of empty strings in macro-processor
Those were treated as comments.

Incidentally, fix a similar issue in the Dynare parser (which is much less
problematic, since double quotes are not used in the Dynare language).

Closes DynareTeam/dynare#1621
2018-06-14 16:54:31 +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 27320a07f6 update statement loops to use C++11 syntax 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 52d8bd0b17 Stop using namespace boost globally in ModelTree
Otherwise boost::tuple overrides std::tuple.
2018-06-05 15:33:46 +02:00
Houtan Bastani 4d92baaf29 Clean up writing of equation tags in latex file 2018-06-05 14:47:36 +02:00
Sébastien Villemot ae81a6fcad Fix compilation error with bytecode DLL 2018-06-05 11:25:23 +02:00
Houtan Bastani d453e81594 pac_model: write as more output to M_ instead of options_; use rmfield instead of clear 2018-06-05 11:14:03 +02:00
Houtan Bastani 16a049f0d8 Make changes to pac code for C++11 2018-06-05 11:14:03 +02:00
Sébastien Villemot db3f625e80 Fix compilation for Windows hosts 2018-06-05 09:31:19 +02:00
Sébastien Villemot 7e16307382 Simplify DataTree maps using std::tuple 2018-06-04 17:35:02 +02:00
Sébastien Villemot abe44fb063 Replace the use of boost::bind by a lambda 2018-06-04 16:51:36 +02:00
Sébastien Villemot 272d36a37c Remove useless casts of nullptr 2018-06-04 16:39:01 +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 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 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 64eb494298 Port to C++11 syntax for default constructors
Performed using modernize-use-equals-default from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-default.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 a185ecf752 Port to C++11 default members initializers
Performed using modernize-use-default-member-init from clang-tidy.

Manual intervention was needed to remove spurious remaining commas.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-default-member-init.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 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 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 80d1e1e1fd Use C++ header
Performed using modernize-deprecated-headers from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-deprecated-headers.html
2018-06-04 11:59:02 +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 90cf5bfbb1 fix bug in creation of auxiliary variables for unary ops 2018-06-01 15:52:39 +02:00
Houtan Bastani cc65f82fd8 fix typo in a648dc9e50 2018-06-01 15:06:31 +02:00
Houtan Bastani a648dc9e50 clarify error message 2018-05-31 19:23:44 +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 e532ed9bab fix typo 2018-05-30 16:53:16 +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
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 ea3573180a Fix ordering of model local variables 2018-05-28 15:50:29 +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 61dc80bb64 Fix missing temporary terms indexes in hessian and 3rd derivatives of static model 2018-05-28 11:59:36 +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 968e411c31 Make indexing in temporary terms array ready for a (hypothetical future) implementation in C 2018-05-25 15:19:50 +02:00
Sébastien Villemot f4b633b199 Factorize code for writing temporary terms identifiers (Tnnn)
Incidentally fix bug when a trinary operator becomes a temporary term with
block decomposition (without bytecode).

Also add a safety check to ensure that, if a temporary term is detected, its
index is indeed present in temporary_terms_idxs.
2018-05-25 14:53:48 +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 143e0888b6 Clean generated files for temporary terms array interface 2018-05-24 19:35:35 +02:00
Sébastien Villemot bb4b5993b0 Simplify code for model local variables 2018-05-24 19:35:35 +02:00