Commit Graph

25 Commits (766fff88f6822077bf7af2d5f482ace921375c4a)

Author SHA1 Message Date
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Sébastien Villemot 22ab507c6c
Global reindentation of Dynare++ 2019-12-20 15:43:17 +01:00
Sébastien Villemot 7cc4aad8b6
Dynare++: update copyright information
— Ondra Kamenik has agreed to the relicensing of utils and parser modules to
  GPL
— add DynareTeam’s copyright, since we have made a lot of modifications
— add proper copyright notices in all files
2019-06-19 15:02:41 +02:00
Sébastien Villemot c7cd325e4e
Dynare++: improvements to comments 2019-05-10 18:41:38 +02:00
Sébastien Villemot 0b9b69f638
Dynare++: various simplifications 2019-04-24 17:47:15 +02:00
Sébastien Villemot 14f85cf448
Dynare++ kord library: various modernizations and improvements
Note that I removed several #define whose purpose was to avoid typing "typename
ctraits<t>::…". Even though this tends to complicates the code, this is
probably safer, especially since the #define was capturing a free variable (t).
2019-03-06 18:43:04 +01:00
Sébastien Villemot 6d99b6d120
Dynare++ kord library: various modernizations and simplifications 2019-03-05 18:35:35 +01:00
Sébastien Villemot 7fd95a6b72
Dynare++ kord library: use modern pseudo-random number generators 2019-03-05 12:29:17 +01:00
Sébastien Villemot b5793ddd22
Dynare++: use std::unique_ptr for storage inside tensor containers 2019-02-20 17:04:34 +01:00
Sébastien Villemot af722f438f
Dynare++: drop remaining "using namespace std" 2019-02-06 19:00:46 +01:00
Sébastien Villemot 8698b4c540
Dynare++: fix computation of IRFs
Since the introduction of the --burn option (in Dynare++ shipped with Dynare
4.3.0), the IRFs reported by Dynare++ were wrong.

The IRFs are computed using a generalized IRF method: the result is
the (average) difference between a simulation with shock and a simulation
without shock. The problem was that the two simulations were not using the same
starting point.

Closes #1634
2019-02-05 17:18:21 +01:00
Sébastien Villemot edda6e3038
Dynare++ multithreading: simplification of mutex interface 2019-01-29 15:53:44 +01:00
Sébastien Villemot 752a02a36c
Dynare++: use C++11 threads (instead of POSIX threads API)
On Windows, this means that a POSIX threads implementation is no longer needed,
since C++11 threads are implemented using native Windows threads.

On GNU/Linux and macOS, POSIX threads are still used under the hood.

A new m4 macro (AX_CXX11_THREAD) is used to add the proper compilation
flags (instead of AX_PTHREAD).
2019-01-28 18:44:24 +01:00
Sébastien Villemot 1ef1dedc65
Refactor GeneralMatrix and ConstGeneralMatrix classes
- Remove the GeneralMatrix(const ConstVector &) constructor, since it is hides
  a memory allocation (copying the ConstVector into a fresh Vector). This
  helped detecting and fixing several unneeded memory allocations. Some other
  memory allocations are now more visible (with an explicit Vector{}
  constructor).

- Add checks in GeneralMatrix(Vector, …) and ConstGeneralMatrix(ConstVector, …)
  constructors for verifying that the {Const,}Vector has unit-stride (this was
  an implicit assumption so far) and is large enough for storing rows*cols
  elements.

- Add GeneralMatrix::operator=(const ConstGeneralMatrix &).

- Delete ConstGeneralMatrix::operator=().
2019-01-24 15:27:23 +01:00
Sébastien Villemot a2f2814cb2
Dynare++: ensure that all calls to BLAS/LAPACK use the correct LD values
Many BLAS/LAPACK calls were making the assumption that LD==rows when passing
matrices. In some cases this was correct (because of implementation details,
in particular because how the copy constructor of GeneralMatrix is implemented).
But in other cases it was a bug.

With this commit, the actual value for LD is systematically used (this fixes
existing bugs and prevent possible future ones if the implementation details
were changed).
2019-01-24 15:27:09 +01:00
Sébastien Villemot fefccd4a1b
Reverts changes mistakenly added to commit f484942154. 2019-01-22 18:21:57 +01:00
Sébastien Villemot f484942154
Update dseries submodule 2019-01-22 18:10:16 +01:00
Sébastien Villemot c711d34d1d
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
  they do not perform memory management, and several {Const,}Vector instances
  can transparently share the same underlying data

- make converting constructor from ConstVector to Vector explicit, since that
  entails memory allocation (but the reverse conversion is almost costless, so
  keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
  TwoDMatrix/ConstTwoDMatrix

- remove the constructors that were extracting a row/column from a matrix, and
  replace them by getRow() and getCol() methods on {Const,}GeneralMatrix

- rename and change the API of the complex version Vector::add(), so that it is
  explicit that it deals with complex numbers

- add constructors that take a MATLAB mxArray
2019-01-22 16:13:22 +01:00
Sébastien Villemot 4a72266d05
Dynare++: use std::unique_ptr for memory management of workers in thread groups 2019-01-14 12:35:46 +01:00
Sébastien Villemot 9656904d41
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
2019-01-09 16:25:31 +01:00
Sébastien Villemot 966a1c2ac0
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
2019-01-09 15:51:19 +01:00
Sébastien Villemot 7e003cc591
Port some constructors to pass-by-value using C++11 move semantics
Performed using modernize-pass-by-value from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-pass-by-value.html
2019-01-09 15:46:04 +01:00
Sébastien Villemot 2024330568
Port to C++11 range-based for loops
Performed using modernize-loop-convert from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-loop-convert.html
2019-01-09 15:44:26 +01:00
Sébastien Villemot 188d6296d7
Dynare++: finish to apply Dynare C++ coding style and extensions (.cc/.hh) 2019-01-08 17:12:05 +01:00
Sébastien Villemot df772325a2
dynare++/kord: move away from CWEB
By the way apply Dynare C++ coding style and extensions (.cc/.hh).
2019-01-04 16:32:05 +01:00