Commit Graph

31 Commits (43b24facb98cdddc3db1e81bbca349b25f8b20af)

Author SHA1 Message Date
Sébastien Villemot 4ef9245a95
MEX files: remove calls to virtual method during construction
Such calls may bypass virtual dispatch.

Automatically detected by clang-tidy with
clang-analyzer-optin.cplusplus.VirtualCall check.
2023-12-07 18:34:38 +01:00
Sébastien Villemot 91c677ca7f
MEX files: drop C++ preprocessor directives now obsolete
Dynare++ is no longer distributed as a standalone binary.
2023-12-07 17:57:01 +01:00
Sébastien Villemot 91f2dcdfe1
MEX files: use “auto” when initializing with a template cast to avoid duplicating the type name
Automatically detected by clang-tidy with modernize-use-auto check.
2023-12-06 22:24:56 +01:00
Sébastien Villemot de476ad5ac
MEX files: use a braced initializer list instead of repeating the return type
Automatically detected by clang-tidy with modernize-return-braced-init-list
check.
2023-12-06 22:24:55 +01:00
Sébastien Villemot 123f909b67
MEX files: use pass-by-value + std::move when possible in constructors
Automatically detected by clang-tidy with modernize-pass-by-value check.
2023-12-06 22:24:55 +01:00
Sébastien Villemot fd9a89ab38
MEX files: use default member initialization when possible
Automatically detected by clang-tidy with modernize-use-default-member-init
check.
2023-12-06 22:24:55 +01:00
Sébastien Villemot 15b6e6e6b3
MEX files: no longer use “virtual” keyword when overriding a method
Automatically detected by clang-tidy with modernize-use-override check.
2023-12-06 22:24:55 +01:00
Sébastien Villemot 9d98811cfc
MEX files: use transparent functor for std::multiplies
Automatically detected by clang-tidy using modernize-use-transparent-functors
check.
2023-12-06 22:24:55 +01:00
Sébastien Villemot 8953007440
MEX files: remove unused variables or values
Automatically detected by clang-tidy using
clang-diagnostic-unused-but-set-variable, clang-analyzer-deadcode.DeadStores
and clang-diagnostic-unused-const-variable checks.
2023-12-06 22:24:55 +01:00
Sébastien Villemot d82eecfd39
C++11 modernization: use std::array and std::vector instead of C arrays
Automatically detected by clang-tidy using modernize-avoid-c-arrays check.
2023-12-06 22:24:52 +01:00
Sébastien Villemot 11c1f6175e
Add [[nodiscard]] attribute to various functions
Automatically detected using clang-tidy with modernize-use-nodiscard check.
2023-12-05 15:44:23 +01:00
Sébastien Villemot bc6840ff6f
MEX libkorder: make destructor of SparseTensor class virtual
That class is a base class, so it must have a virtual destructor to avoid
memory leaks.

Issue detected by clang-tidy with
clang-diagnostic-delete-non-abstract-non-virtual-dtor check.
2023-12-04 18:20:43 +01:00
Sébastien Villemot aeec4494b0
MEX libkorder: fix use of moved-from object
Detected by clang-tidy using clang-analyzer-cplusplus.Move check.
2023-12-04 18:20:43 +01:00
Sébastien Villemot bd7703d160
C++ modernization: use a braced initializer list instead when relevant
Automatically detected and fixed using clang-tidy with
modernize-return-braced-init-list check.
2023-12-04 18:20:43 +01:00
Sébastien Villemot a5445c52be
C++ modernization: more uses of auto keyword
Automatically detected and fixed using clang-tidy with modernize-use-auto
check.
2023-12-04 18:20:43 +01:00
Sébastien Villemot 403f20a7f3
C++ modernization: add [[nodiscard]] attribute to various functions
Automatically detected and fixed using clang-tidy with modernize-use-nodiscard
check.
2023-12-04 18:20:42 +01:00
Sébastien Villemot c6a7801ba8
clang-format configuration: set “PackConstructorInitializers: NextLine” 2023-11-30 14:37:05 +01:00
Sébastien Villemot ed332e3ba1
MEX files: reformat C++ source code using clang-format 15 2023-11-29 19:00:51 +01:00
Sébastien Villemot bf9434f95f
Remove warnings about cast between incompatible function types (-Wcast-function-type) under Windows 2023-09-22 14:22:47 +02:00
Sébastien Villemot 70866c7b70
Remove warnings about comparison of integer expressions of different signedness (-Wsign-compare) 2023-09-20 16:48:29 +02:00
Sébastien Villemot e0bc9f29a1
Remove warnings about unused parameters (-Wunused-parameter) 2023-09-20 16:30:02 +02:00
Sébastien Villemot 6dd55726e6
Drop autoconf/automake build system 2023-09-20 15:33:44 +02:00
Sébastien Villemot 9ff1d8556c
libkorder: remove mention of Dynare++ in the journal
By the way, use PACKAGE_VERSION macro (instead of VERSION), for consistency
with the preprocessor.
2023-07-26 16:30:51 +02:00
Normann Rion 710589eb5b Adds pruning in k_order_simul
See issue #1643 about beyond-third-order pruning
2023-07-20 06:58:35 +01:00
Sébastien Villemot 5b8b63924d
Remove unneeded braces 2023-07-19 18:03:18 +02:00
Sébastien Villemot 661e5c7e9f
C++17 modernization: initialization in “if”-statement 2023-07-19 18:03:03 +02:00
Sébastien Villemot 8b945dfd64
libkorder: use infinity instead of large constant in minimization algorith
By the way, also use C++17 initialization within “if” statement.
2023-07-04 11:20:51 +02:00
Sébastien Villemot 1b02026d1c
Fix GCC 13 warning about overloading that hides virtual methods of base class 2023-05-09 21:36:43 +02:00
Sébastien Villemot aeff2bf48d
Fix GCC 13 warning about ambiguity of operator==() in C++20
In C++20, a==b can also be implicitly rewritten as b==a, assuming
commutativity. But if the operator==(const &) is not declared as const, and is
thus asymmetric, this results in an ambiguity because neither of a==b or b==a
is a better match according to the overload resolution rules.
2023-05-09 21:36:41 +02:00
Sébastien Villemot 73e4ced39a
Remove more unused Dynare++ code
In particular, the libkorder library no longer depends on MatIO.
2023-04-17 18:10:36 +02:00
Sébastien Villemot 99cd06c9fd
Move relevant Dynare++ files to mex/sources/libkorder/. Delete the others.
Also move some useful documentation to doc/.
2023-04-17 18:10:35 +02:00