Commit 594a538d authored by Houtan Bastani's avatar Houtan Bastani
Browse files

modify to use MEX macro instead of ORIGDLL

parent 40070687
......@@ -107,7 +107,7 @@ C LOCALS
id1 = max(1,d(1))
Z0 = Z
delta = 1.D-3
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -107,7 +107,7 @@ C LOCALS
id1 = max(d(1),1)
Z0 = Z
delta = 1.D-3
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -70,7 +70,7 @@ C EXTERNAL SUBROUTINES
ALLOCATE(c(ny,max(nz,1),ns(1)),H(ny,nx,ns(2)),
1 G(ny,nu,ns(3)),a(nx,ns(4)),F(nx,nx,ns(5)),R(nx,nu,ns(6))) !,HRG(ny,nu),HRGRH(ny,ny))
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -218,7 +218,7 @@ C
IF (engEvalString(ep, 'clear success;'//
& '[C,H,G,A,F,R]='//TRIM(mfile)//'( ny,nz,nx,'//
& 'nu,ns,theta);'//'success=1;') .ne. 0) then ! engEvalString failed
#if defined(ORIGDLL)
#if defined(MEX)
CALL GETERRSTR(matlaberror)
#else
#endif
......@@ -244,7 +244,7 @@ C
#endif
IF (C_ptr .eq. 0) then ! engEvalString failed
buffer=buffer1
#if defined(ORIGDLL)
#if defined(MEX)
CALL GETERRSTR(matlaberror)
#else
#endif
......
......@@ -73,7 +73,7 @@ C EXTERNAL SUBROUTINES
ALLOCATE(R(nx,nu,ns(6)),c(ny,max(nz,1),ns(1)),H(ny,nx,ns(2)),
1 G(ny,nu,ns(3)),a(nx,ns(4)),F(nx,nx,ns(5)))
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -110,7 +110,7 @@ C LOCALS
DATA EPS/1.D-14/,ONE/1.0D0/,ZERO/0.0D0/
DOUBLE PRECISION genunf,LEMMA4,MARKOVP
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -101,7 +101,7 @@ C LOCALS
DATA EPS/1.D-14/,ONE/1.0D0/,ZERO/0.0D0/
DOUBLE PRECISION genunf,LEMMA4,MARKOVP
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -72,7 +72,7 @@ C LOCALS
1 Xdd(max(d(1),1),nx),Pdd(max(d(1),1),nx,nx),LIKE(max(d(1),1)),
1 XT(nx),PT(nx,nx),INN0(ny))
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -71,7 +71,7 @@ C LOCALS
1 Xdd(max(d(1),1),nx),Pdd(max(d(1),1),nx,nx),LIKE(max(d(1),1)),
1 XT(nx),PT(nx,nx))
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -34,7 +34,11 @@ C
C You should have received a copy of the GNU General Public License
C along with DMM. If not, see <http://www.gnu.org/licenses/>.
C --------------------------------------------------------------------------------------
#if defined(MEX)
SUBROUTINE DMMMAIN(FILEIN)
#else
PROGRAM DMM
#endif
#if defined(__CYGWIN32__) || defined(_WIN32)
#ifdef __INTEL_COMPILER
USE dfwin
......@@ -93,8 +97,10 @@ C TIME
IT1(1:3) = DATE_ITIME(1:3)
IT1(4:7) = DATE_ITIME(5:8)
#if !defined(MEX)
C GET the namelist specified by FILEIN
CALL GETARG(1,FILEIN) ! load name of input file
#endif
C CHECK FILEIN
IF (TRIM(FILEIN).EQ.'') THEN
......@@ -135,15 +141,13 @@ C Assign the name of the matlab file
ALLOCATE( c(ny,max(nz,1),ns(1)),H(ny,nx,ns(2)),
1 G(ny,nu,ns(3)),a(nx,ns(4)),F(nx,nx,ns(5)),R(nx,nu,ns(6)),
1 theta(nt))
#if defined(ORIGDLL)
#if defined(MEX)
CALL SETFILEM(mfile,pathmfile) ! ONLY THE FIRST TIME
#else
#endif
theta(:) = 1.D0
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
DEALLOCATE(c,H,G,a,F,R,theta)
ENDIF
......
......@@ -46,7 +46,7 @@ C LOCALS
ALLOCATE(R(nx,nu,ns(6)),c(ny,max(nz,1),ns(1)),H(ny,nx,ns(2)),
1 G(ny,nu,ns(3)),a(nx,ns(4)),F(nx,nx,ns(5)))
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -85,7 +85,7 @@ C Using Hessian from E04UCF
1 XT(0:nobs,nx),PT(0:nobs,nx,nx),Xdd(max(d(1),1),nx),
1 Pdd(max(d(1),1),nx,nx))
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......@@ -123,7 +123,7 @@ C Using Hessian from E04UCF
DO 1000 I=1,NFREE
THETAV(I) = THETAV(I) + P(I)
theta(IFREE(I)) = THETAV(I)
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -88,7 +88,7 @@ C ------------------------------------------------------------
IFAIL = 0
CALL SYMINV(LTR,NFREE,LTR,W,J,IFAIL,RMAX)
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......@@ -135,7 +135,7 @@ C -----------
ELSE
psi(I-NFT) = PAR(I)
ENDIF
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -87,7 +87,7 @@ C ------------------------------------------------------------
IFAIL = 0
CALL SYMINV(LTR,NFREE,LTR,W,J,IFAIL,RMAX)
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......@@ -135,7 +135,7 @@ C -----------
ELSE
psi(I-NFT) = PAR(I)
ENDIF
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -49,7 +49,7 @@ C LOCALS
3 Pdd(max(d(1),1),nx,nx))
C computes the log-posterior
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -49,7 +49,7 @@ C LOCALS
C computes the log-posterior
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -92,7 +92,7 @@ C EXTERNAL SUBROUTINES
3 Xdd(MAX(d(1),1),nx),Pdd(MAX(d(1),1),nx,nx),
3 WORK((nx+2)*(nx+1)/2),FP(nx,nx),WORK1(64*nx),UP(nu) )
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -77,7 +77,7 @@ C EXTERNAL FUNCTIONS
3 Xdd(MAX(d(1),1),nx),Pdd(MAX(d(1),1),nx,nx),
3 WORK((nx+2)*(nx+1)/2),FP(nx,nx),WORK1(64*nx),UP(nu) )
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
......@@ -76,7 +76,7 @@ C EXTERNAL FUNCTIONS
3 Xdd(MAX(d(1),1),nx),Pdd(MAX(d(1),1),nx,nx),
3 WORK((nx+2)*(nx+1)/2),FP(nx,nx),WORK1(64*nx),UP(nu) )
#if defined(ORIGDLL)
#if defined(MEX)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment