Commit Graph

21 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 09b8397f44
Dynare++: improvements to comments (last batch!)
[skip ci]
2019-06-11 16:58:32 +02:00
Sébastien Villemot 4c11e9e9ec
Dynare++ kord and MEX: various modernizations and improvements 2019-03-07 19:46:15 +01:00
Sébastien Villemot 598f0193d5
Dynare++ kord library: make test failures fatal
Required an increase for the error tolerance of SW-like models tests.

By the way, decrease the tolerance for the small model.
2019-03-07 11:34:30 +01: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 58bdee12c3
Dynare++ tensor library: refactor static stuff
- encapsulate it more clearly
- make it thread safe
- put back the Pascal triangle initialization stuff removed in 9512a32ad0
2019-02-21 19:00:50 +01:00
Sébastien Villemot b72857d4ce
Dynare++: the get() method of tensor containers now return a reference
Previously it was returning a pointer, which is non-standard for containers,
and was leading to ugly dereferencing everywhere.
2019-02-20 18:06:58 +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 e91f48f2ce
Dynare++: modernize kord tests 2019-02-14 15:47:58 +01:00
Sébastien Villemot db6df6c73c
Dynare++ kord test: use modern pseudo-random number generator 2019-02-14 11:45:15 +01:00
Sébastien Villemot 49f85ceaca
Dynare++: rollback the std::shared_ptr change in Vector and ConstVector
The performance cost is too high to warrant the change.
2019-02-14 11:29:18 +01:00
Sébastien Villemot 8dbc08e2c2
Dynare++: display real time elapsed in kord tests
Previously, only CPU time was displayed, which is misleading with
multithreading.
2019-02-13 18:31:03 +01:00
Sébastien Villemot 1f7d3beddc
Dynare++ tensor library: modernize the Symmetry class
We now use a initializer list constructor for creating symmetries of the form
$y^n$, $y^n u^m$, $y^nu^m\sigma^k$.

The constructor taking a single integer is used to initialize a symmetry of a
given length.

Similar changes are made to IntSequence.

This behavior is similar to std::vector.
2019-02-11 16:45:07 +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 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 60fd92ddce
Port to C++11 override keyword
Performed using modernize-use-override from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html
2019-01-09 16:26:42 +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 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