Skip to content
Snippets Groups Projects
Commit 81b0ea39 authored by sebastien's avatar sebastien
Browse files

4.0: merged r2539,2540,2541 changesets from trunk (fixes for mjdgges on Matlab...

4.0: merged r2539,2540,2541 changesets from trunk (fixes for mjdgges on Matlab 7.8/R2009a for 64 bits platforms)

git-svn-id: https://www.dynare.org/svn/dynare/branches/4.0@2542 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 90e8a551
Branches
Tags
No related merge requests found
......@@ -49,7 +49,7 @@ else
error('Unsupported platform')
end
% mwSize and mwIndex appeared in Matlab 7.3
% mwSize, mwIndex and mwSignedIndex appeared in Matlab 7.3
if matlab_ver_less_than('7.3')
COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -DMWTYPES_NOT_DEFINED' ];
end
......
......@@ -20,6 +20,10 @@
#include <string.h>
#include "mex.h"
#if defined(MWTYPES_NOT_DEFINED) || defined(OCTAVE)
typedef int mwSignedIndex;
#endif
#ifdef NO_LAPACK_H
# if defined(__linux__) || defined(OCTAVE)
# define dgges dgges_
......@@ -32,26 +36,26 @@ void dgges(char *, char *, char *, int (*)(), int *, double *, int *, double *,
double criterium;
int my_criteria(double *alphar, double *alphai, double *beta)
mwSignedIndex my_criteria(double *alphar, double *alphai, double *beta)
{
return( (*alphar * *alphar + *alphai * *alphai) < criterium * *beta * *beta);
}
void mjdgges(double *a, double *b, double *z, double *n, double *sdim, double *eval_r, double *eval_i, double *info)
{
int i_n, i_info, i_sdim, one, lwork;
mwSignedIndex i_n, i_info, i_sdim, one, lwork;
double *alphar, *alphai, *beta, *work, *par, *pai, *pb, *per, *pei;
double *junk;
int *bwork;
mwSignedIndex *bwork;
one = 1;
i_n = (int)*n;
i_n = (mwSignedIndex)*n;
alphar = mxCalloc(i_n,sizeof(double));
alphai = mxCalloc(i_n,sizeof(double));
beta = mxCalloc(i_n,sizeof(double));
lwork = 16*i_n+16;
work = mxCalloc(lwork,sizeof(double));
bwork = mxCalloc(i_n,sizeof(int));
bwork = mxCalloc(i_n,sizeof(mwSignedIndex));
/* made necessary by bug in Lapack */
junk = mxCalloc(i_n*i_n,sizeof(double));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment