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-bf33cf982152time-shift
parent
ec4cc46845
commit
adc5d60e23
|
@ -52,6 +52,8 @@ end
|
||||||
% mwSize and mwIndex appeared in Matlab 7.3
|
% mwSize and mwIndex appeared in Matlab 7.3
|
||||||
if matlab_ver_less_than('7.3')
|
if matlab_ver_less_than('7.3')
|
||||||
COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -DMWTYPES_NOT_DEFINED' ];
|
COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -DMWTYPES_NOT_DEFINED' ];
|
||||||
|
elseif matlab_ver_less_than('7.8')
|
||||||
|
COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -DMWSIGNEDINDEX_NOT_DEFINED' ];
|
||||||
end
|
end
|
||||||
|
|
||||||
% Large array dims for 64 bits platforms appeared in Matlab 7.3
|
% Large array dims for 64 bits platforms appeared in Matlab 7.3
|
||||||
|
|
|
@ -20,6 +20,10 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "mex.h"
|
#include "mex.h"
|
||||||
|
|
||||||
|
#ifdef MWSIGNEDINDEX_NOT_DEFINED
|
||||||
|
# define mwSignedIndex int
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NO_LAPACK_H
|
#ifdef NO_LAPACK_H
|
||||||
# if defined(__linux__) || defined(OCTAVE)
|
# if defined(__linux__) || defined(OCTAVE)
|
||||||
# define dgges dgges_
|
# define dgges dgges_
|
||||||
|
@ -32,26 +36,26 @@ void dgges(char *, char *, char *, int (*)(), int *, double *, int *, double *,
|
||||||
|
|
||||||
double criterium;
|
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);
|
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)
|
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 *alphar, *alphai, *beta, *work, *par, *pai, *pb, *per, *pei;
|
||||||
double *junk;
|
double *junk;
|
||||||
int *bwork;
|
mwSignedIndex *bwork;
|
||||||
|
|
||||||
one = 1;
|
one = 1;
|
||||||
i_n = (int)*n;
|
i_n = (mwSignedIndex)*n;
|
||||||
alphar = mxCalloc(i_n,sizeof(double));
|
alphar = mxCalloc(i_n,sizeof(double));
|
||||||
alphai = mxCalloc(i_n,sizeof(double));
|
alphai = mxCalloc(i_n,sizeof(double));
|
||||||
beta = mxCalloc(i_n,sizeof(double));
|
beta = mxCalloc(i_n,sizeof(double));
|
||||||
lwork = 16*i_n+16;
|
lwork = 16*i_n+16;
|
||||||
work = mxCalloc(lwork,sizeof(double));
|
work = mxCalloc(lwork,sizeof(double));
|
||||||
bwork = mxCalloc(i_n,sizeof(int));
|
bwork = mxCalloc(i_n,sizeof(mwSignedIndex));
|
||||||
/* made necessary by bug in Lapack */
|
/* made necessary by bug in Lapack */
|
||||||
junk = mxCalloc(i_n*i_n,sizeof(double));
|
junk = mxCalloc(i_n*i_n,sizeof(double));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue