Commit Graph

75 Commits (7dd2dd5e24a343fbeaf3522ea5e535c27d8b9f95)

Author SHA1 Message Date
Sébastien Villemot 8a0eb76b1b
Use operator""s to replace some calls to std::string constructor
By the way, remove other unnecessary calls to that constructor.
2022-06-22 12:51:08 +02:00
Sébastien Villemot ce2c1e0d30
No longer use C++ UTF-8 string literals
They don’t bring any added value, and break compilation in C++20 mode (because
they are then of type “const char8_t *” which is distinct from “const char *”).
2022-05-04 18:32:52 +02:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Sébastien Villemot 3dc9087f55
Dynare++: update copyright years 2020-11-18 17:31:17 +01:00
Sébastien Villemot 22ab507c6c
Global reindentation of Dynare++ 2019-12-20 15:43:17 +01:00
Sébastien Villemot d69fadc362
Dynare++: improvements to comments 2019-06-19 17:35:01 +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
Houtan Bastani a29896a6d5
Undo change in cb5b756927, preferring const to constexpr 2019-05-08 15:26:17 +02:00
Houtan Bastani cb5b756927
sqrt is not a constexpr
see: http://open-std.org/JTC1/SC22/WG21/docs/papers/2017/p0533r0.pdf
2019-05-08 13:01:34 +02:00
Sébastien Villemot 26778ea666
Dynare++: drop unmaintained R stuff 2019-04-26 14:44:36 +02:00
Sébastien Villemot 0b9b69f638
Dynare++: various simplifications 2019-04-24 17:47:15 +02:00
Sébastien Villemot 9a869560e6
Dynare++ main: various modernizations 2019-04-23 19:14:51 +02:00
Sébastien Villemot f5e2bfc30a
Ask GCC to warn about C-style casts (-Wold-style-cast)
Adapt the code accordingly.
2019-04-23 13:03:20 +02:00
Sébastien Villemot 3915299334
Dynare++ parser: various modernizations 2019-04-19 17:28:16 +02:00
Sébastien Villemot 5a261c1960
Dynare++: modernize Bison and Flex stuff 2019-04-17 18:52:12 +02:00
Sébastien Villemot f953374dba
More Unicode copyright symbol 2019-04-16 14:34:05 +02:00
Sébastien Villemot 57848930c6
Use Unicode copyright symbol (in UTF-8 encoding)
Do not use it in MATLAB source files, since unfortunately the MATLAB editor
does not support UTF-8.
2019-04-16 11:42:16 +02:00
Sébastien Villemot 9554065db7
Dynare++ standalone: fix bug when parsing approximation order
It was not possible to set a 2-digit order (i.e. ≥ 10).

Not sure that it was a real problem in practice, given the computational limits.
2019-04-15 18:33:51 +02:00
Sébastien Villemot 3cfb9ed6d2
Dynare++: fix typos 2019-04-15 18:32:51 +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 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 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 5fcf563c61
Dynare++: factorize and optimize code for integer exponentiation
There were two implementations of integer exponentiation. Merge them into a new
file under utils/cc/.

By the way, optimize it using exponentiation by squaring.
2019-02-19 15:50:07 +01:00
Sébastien Villemot 08a91079ce
Dynare++: change default # of threads to # logical CPUs divided by 2
Having twice less threads seems to give a better performance, probably because
BLAS is parallel.
2019-02-13 18:29:34 +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 af722f438f
Dynare++: drop remaining "using namespace std" 2019-02-06 19:00:46 +01:00
Sébastien Villemot a122927872
Dynare++: another change related to default number of threads
Forgotten in commit 733308807.
2019-01-29 20:31:06 +01:00
Sébastien Villemot 733308807d
Dynare++: by default, use as many threads as there are logical CPUs
The former default was 2 threads, since Dynare++ was written at a time when
hyper-threading was being generalized (but multiple cores were not).
2019-01-29 16:34:25 +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 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 2a82177304
Dynare++: enforce C++ Emacs mode for bison/flex files 2019-01-15 19:03:58 +01:00
Sébastien Villemot d5fcfb6566
Remove class MemoryFile, rather rely on C++ I/O streams 2019-01-10 17:52:02 +01:00
Sébastien Villemot a8f12c5b76
A few more modernizations with clang-tidy 2019-01-10 14:50:49 +01:00
Sébastien Villemot 6076a4ff0c
Remove Emacs local mode variable
No longer needed now that files have C++-specific extensions.
2019-01-10 14:26:14 +01:00
Sébastien Villemot 922014c2fa
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
2019-01-09 17:21:14 +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 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 7df31f68d9
Port to C++ delete keyword
Performed using modernize-use-equals-delete from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-delete.html
2019-01-09 16:23:04 +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 cbcd0a6950
Port to C++11 default members initializers
Performed using modernize-use-default-member-init from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-default-member-init.html
2019-01-09 15:58:45 +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 f9df2bee2f
Use C++11 unordered_{map,set} instead of boost's 2019-01-08 17:38:21 +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 ce1ef47093
dynare++ / tensor library (TL): move away from CWEB
By the way apply Dynare C++ coding style and extensions (.cc/.hh).
2019-01-08 16:09:25 +01:00