Commit Graph

38 Commits (7dd2dd5e24a343fbeaf3522ea5e535c27d8b9f95)

Author SHA1 Message Date
Sébastien Villemot d5472d2338
Tighten input sanity checks of various MEX files
Note that the unitary test in lyapunov_solver.m that checks sparse matrix input
had to be removed. Previously, this test was passing by chance (because the
sparse test matrices had actually no zero element, hence the internal double
float storage was the same as in the dense case). Now it consistently fails
with the additional checks in disclyap_fast MEX.
2022-03-18 22:49:46 +01:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Sébastien Villemot c4ca0ef0b2
Fortran MEX: remove useless return statements after calls to mexErrMsgTxt() 2021-06-04 12:58:39 +02:00
Sébastien Villemot dc2695a11f
mjdgges and block_trust_region MEX: optimise by marking some function arguments as contiguous
This avoids unnecessary array copies before calling BLAS/LAPACK functions.
2021-06-04 12:58:36 +02:00
Sébastien Villemot ea18431230
Various improvements to mjdgges MEX 2020-07-30 16:34:33 +02:00
Sébastien Villemot 6e0f104d7e
Bump minimal MATLAB version to R2014a
Ref. #1713
2020-04-07 16:32:32 +02:00
Sébastien Villemot 7e770f69e7
Remove workaround for errors in MEX files
Because at some point throwing exceptions from MEX files (with mexErrMsgTxt())
was not working under Windows 64-bit, we had designed a workaround to avoid
using exceptions.

Most MEX files were returning an error code as their first (or sometimes last)
argument, and that code would have to be checked from the MATLAB code.

Since this workaround is no longer needed, this commit removes it. As a
consequence, the interface of many MEX files is modified.

For some background, see https://www.dynare.org/pipermail/dev/2010-September/000895.html
2020-01-10 18:33:11 +01:00
Sébastien Villemot 89dc67eb46
Convert mjdgges MEX to Fortran 2008 2020-01-09 09:23:07 +01:00
Sébastien Villemot 984c60acb9
Various improvements related to the MEX R2018a API
— Use MX_HAS_INTERLEAVED_COMPLEX for testing for the new API

— Use the typed access functions under the new API, with one exception: we do
  not use mxGetDoubles() instead of mxGetPr(), because it would just complexif
  the code without any value added

For more details, see:
https://fr.mathworks.com/help/matlab/matlab_external/upgrade-mex-files-to-use-interleaved-complex.html
2019-07-09 11:54:12 +02:00
Sébastien Villemot 1d22536bc5
Add back workaround for MKL with DGGES and VSL
The workaround was removed in de159c0480, but it
is still needed for MATLAB R2009b.
2019-05-21 17:28:11 +02:00
Sébastien Villemot de159c0480
mjdgges DLL: convert to C++ (for consistency with other DLLs)
Various modernizations and simplifications.

Also remove a workaround for a LAPACK bug in DGGES (the VSL argument was
apparently referenced even though JOBVSL="N"). Hopefully the bug has been fixed
everywhere now.
2019-04-30 15:54:45 +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 dcac799289
Fix check for QZ eigenvalue criterium
The criterium was previously incorrectly applied to the square absolute value of
eigenvalues. Rather apply it to the absolute value itself (as done in
mjdgges.m and the AIM solver).

Closes #1632
2019-01-02 16:37:30 +01:00
Sébastien Villemot 7a2aa211bf Make mjdgges DLL compatible with MATLAB interleaved complex API
This API was introduced in MATLAB 9.4 (R2018a), because the internal
representation of complex numbers has changed.
2018-05-14 15:16:09 +02:00
Stéphane Adjemian (Charybdis) 1bf81c9f5a Fixed copyright notices. 2017-05-18 18:36:38 +02:00
Stéphane Adjemian (Charybdis) b4448937cc Fixed indentation of c/h/cc/hh files. 2017-05-16 16:30:27 +02:00
Houtan Bastani e3fbefc616 mjdgges: fix bug where qz_criterium was not taken into account if a threshold argument is also passed 2016-10-27 11:19:34 +02:00
Stéphane Adjemian (Charybdis) 7fc92c96d9 Fixed bug related to the test on the number of input arguments. 2013-06-12 10:21:27 +02:00
Stéphane Adjemian (Charybdis) b81fcbeeb1 Added an option for the threshold level of the 0/0 generalized eigenvalue test.
The option is passed in the fourth input argument of mjdgges. If the
mex is called with less than four arguments, then the threshold level
takes its previous (hardcoded) default value: 1e-6.
2013-06-12 09:46:32 +02:00
Sébastien Villemot c079ace8c3 Remove various compiler warnings 2012-06-08 19:06:03 +02:00
Sébastien Villemot fefe425c61 mjdgges: add missing math.h header (for fabs()) 2011-12-12 10:35:39 +01:00
Michel Juillard b58eaa8e2b introducing new test for 0/0 case in mjdgges 2011-11-18 22:12:36 +01:00
Sébastien Villemot ebcc9d8f91 Fix crash of mjdgges when options_.qz_criterium = [] 2011-09-28 16:00:36 +02:00
Sébastien Villemot 02652f6eb8 Updated copyright notices 2011-02-04 17:27:33 +01:00
Sébastien Villemot cc2a9d90ac Global reindentation of MEX source files 2011-02-04 16:53:12 +01:00
Houtan Bastani 7b0d6da920 mjdgges: remove instances of mexErrMsgTxt 2010-09-23 10:44:59 +02:00
Michel Juillard 894ed518c8 mjdgges.c: eliminates bogus imaginary NaNs in eigenvalues 2010-05-14 15:03:15 +02:00
sebastien f3549b4c64 Beautified MEX source code
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3251 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-12-16 17:18:38 +00:00
sebastien dde3f3795f Build system:
* Simplified the way we deal with various Octave/MATLAB contexts from MEX files:
  - only three defines: MATLAB_MEX_FILE, MATLAB_VERSION (hex number) and OCTAVE_MEX_FILE
  - one header for MEX files: dynmex.h
  - headers for BLAS and LAPACK: dynblas.h and dynlapack.h (used from Dynare++ and the MEX files)
* Merged the two sources trees of sylvester library


git-svn-id: https://www.dynare.org/svn/dynare/trunk@3006 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-01 14:17:02 +00:00
michel 9fa3457791 4.1: fixing again compatibility for Matlab 7.8
adding matlab_versions_compatibility.h to start factorizing necessary code

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2577 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-09 13:36:06 +00:00
michel 25aa38f9c4 4.1: fixed problem with mwSignedIndex. Despite the fact that mwSignedIndex appeared
in Matlab version 7.3, Matlab Lapack library only uses it from version 7.8
     (needs to be merged in 4.0)


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2565 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-07 21:13:05 +00:00
sebastien 604f465992 trunk mjdgges.c: Octave doesn't define mwSignedIndex (but it does for mwSize and mwIndex...)
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2541 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-03-31 08:58:57 +00:00
sebastien 535274d3ad trunk:
- build_matlab.m: mwSignedIndex actually appeared in Matlab 7.3 (like mwSize and mwIndex)
- mjdgges.c: use a typedef instead of a #define for mwSignedIndex


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2540 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-03-31 08:49:36 +00:00
michel adc5d60e23 v4.1: fixed build_matlab.m and mjdgges.c for Matlab (7.8) r2009a
added new macro NWSIGNEDINDEX_NOT_DEFINED (necessary in 64bit environments)


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2539 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-03-30 20:13:22 +00:00
sebastien c633f68b12 v4 mex/sources: added copyright+license header to all remaining files
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1973 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-07-31 09:10:29 +00:00
sebastien d3e739d9be v4 mex: fixed compilation for Octave/Windows/MSVC2008
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1904 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-06-27 23:22:52 +00:00
sebastien 66c5c66e2f v4 mex: cleanups related to Blas and Lapack function calls
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1894 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-06-23 21:58:45 +00:00
michel 80eb1faab2 moving mex directory
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1690 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-02-04 21:31:12 +00:00