Commit Graph

17 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 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 b9f92b69be
Dynare++: replace some uses of std::vector by a lighter std::unique_ptr 2019-04-30 12:58:21 +02:00
Sébastien Villemot c9bdc2c885
Dynare++: simplify methods for getting number of columns and rows of a matrix
Previously there were GeneralMatrix::numRows() and TwoDMatrix::nrows() for doing
the same thing (and same for columns and Const versions).

Merge these two into GeneralMatrix::nrows().
2019-04-16 12:44:02 +02:00
Sébastien Villemot 44b40bbf09
Dynare++: improvements to comments
[skip ci]
2019-03-28 18:59:34 +01:00
Sébastien Villemot 5958848145
Dynare++: improve comments using Unicode (first batch)
[skip ci]
2019-03-27 19:22:51 +01:00
Sébastien Villemot 449553e7b6
Dynare++: various improvements 2019-03-08 15:32:30 +01:00
Sébastien Villemot 1639f75a3c
Dynare++: improve interface to not-in-place matrix multiplications 2019-02-26 18:59:45 +01:00
Sébastien Villemot e3967bda9a
Dynare++: improve interface to matrix transpose 2019-02-26 18:59:45 +01:00
Sébastien Villemot 3ce051d819
Dynare++ sylvester equation solver: various simplifications and improvements
In particular, the test binary now errors out in case of test failure.
2019-01-25 18:43:21 +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 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 f655c170b6
Dynare++ / sylvester equation solver: second batch of modernizations 2019-01-17 10:20:49 +01:00
Sébastien Villemot 197cbea919
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
2019-01-09 16:16:29 +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