diff options
Diffstat (limited to 'linear.c')
-rw-r--r-- | linear.c | 74 |
1 files changed, 37 insertions, 37 deletions
@@ -28,14 +28,14 @@ void DoLU(void) LUStruct *loclustruct; /* Local pointer to global data */ char *errorcontext; int systemerror; -fardouble *a; -fardouble *b; -fardouble *abase; -fardouble *bbase; +double *a; +double *b; +double *abase; +double *bbase; LUdblptr ptra; int n; int i; -ulong accumtime; +unsigned long accumtime; double iterations; /* @@ -54,9 +54,9 @@ errorcontext="FPU:LU"; ** derived from. (I.E., we'll simply copy these arrays ** into the others. */ -a=(fardouble *)AllocateMemory(sizeof(double) * LUARRAYCOLS * LUARRAYROWS, +a=(double *)AllocateMemory(sizeof(double) * LUARRAYCOLS * LUARRAYROWS, &systemerror); -b=(fardouble *)AllocateMemory(sizeof(double) * LUARRAYROWS, +b=(double *)AllocateMemory(sizeof(double) * LUARRAYROWS, &systemerror); n=LUARRAYROWS; @@ -65,7 +65,7 @@ n=LUARRAYROWS; ** algorithm. This removes the allocation routine from the ** timing. */ -LUtempvv=(fardouble *)AllocateMemory(sizeof(double)*LUARRAYROWS, +LUtempvv=(double *)AllocateMemory(sizeof(double)*LUARRAYROWS, &systemerror); /* @@ -84,18 +84,18 @@ if(loclustruct->adjust==0) loclustruct->numarrays=0; for(i=1;i<=MAXLUARRAYS;i++) { - abase=(fardouble *)AllocateMemory(sizeof(double) * + abase=(double *)AllocateMemory(sizeof(double) * LUARRAYCOLS*LUARRAYROWS*(i+1),&systemerror); if(systemerror) { ReportError(errorcontext,systemerror); - LUFreeMem(a,b,(fardouble *)NULL,(fardouble *)NULL); + LUFreeMem(a,b,(double *)NULL,(double *)NULL); ErrorExit(); } - bbase=(fardouble *)AllocateMemory(sizeof(double) * + bbase=(double *)AllocateMemory(sizeof(double) * LUARRAYROWS*(i+1),&systemerror); if(systemerror) { ReportError(errorcontext,systemerror); - LUFreeMem(a,b,abase,(fardouble *)NULL); + LUFreeMem(a,b,abase,(double *)NULL); ErrorExit(); } if(DoLUIteration(a,b,abase,bbase,i)>global_min_ticks) @@ -105,8 +105,8 @@ if(loclustruct->adjust==0) /* ** Not enough arrays...free them all and try again */ - FreeMemory((farvoid *)abase,&systemerror); - FreeMemory((farvoid *)bbase,&systemerror); + FreeMemory((void *)abase,&systemerror); + FreeMemory((void *)bbase,&systemerror); } /* ** Were we able to do it? @@ -122,20 +122,20 @@ else ** Don't need to adjust -- just allocate the proper ** number of arrays and proceed. */ - abase=(fardouble *)AllocateMemory(sizeof(double) * + abase=(double *)AllocateMemory(sizeof(double) * LUARRAYCOLS*LUARRAYROWS*loclustruct->numarrays, &systemerror); if(systemerror) { ReportError(errorcontext,systemerror); - LUFreeMem(a,b,(fardouble *)NULL,(fardouble *)NULL); + LUFreeMem(a,b,(double *)NULL,(double *)NULL); ErrorExit(); } - bbase=(fardouble *)AllocateMemory(sizeof(double) * + bbase=(double *)AllocateMemory(sizeof(double) * LUARRAYROWS*loclustruct->numarrays,&systemerror); if(systemerror) { ReportError(errorcontext,systemerror); - LUFreeMem(a,b,abase,(fardouble *)NULL); + LUFreeMem(a,b,abase,(double *)NULL); ErrorExit(); } } @@ -169,17 +169,17 @@ return; *************** ** Release memory associated with LU benchmark. */ -static void LUFreeMem(fardouble *a, fardouble *b, - fardouble *abase,fardouble *bbase) +static void LUFreeMem(double *a, double *b, + double *abase,double *bbase) { int systemerror; -FreeMemory((farvoid *)a,&systemerror); -FreeMemory((farvoid *)b,&systemerror); -FreeMemory((farvoid *)LUtempvv,&systemerror); +FreeMemory((void *)a,&systemerror); +FreeMemory((void *)b,&systemerror); +FreeMemory((void *)LUtempvv,&systemerror); -if(abase!=(fardouble *)NULL) FreeMemory((farvoid *)abase,&systemerror); -if(bbase!=(fardouble *)NULL) FreeMemory((farvoid *)bbase,&systemerror); +if(abase!=(double *)NULL) FreeMemory((void *)abase,&systemerror); +if(bbase!=(double *)NULL) FreeMemory((void *)bbase,&systemerror); return; } @@ -190,15 +190,15 @@ return; ** An iteration refers to the repeated solution of several ** identical matrices. */ -static ulong DoLUIteration(fardouble *a,fardouble *b, - fardouble *abase, fardouble *bbase, - ulong numarrays) +static unsigned long DoLUIteration(double *a,double *b, + double *abase, double *bbase, + unsigned long numarrays) { -fardouble *locabase; -fardouble *locbbase; +double *locabase; +double *locbbase; LUdblptr ptra; /* For converting ptr to 2D array */ -ulong elapsed; -ulong j,i; /* Indexes */ +unsigned long elapsed; +unsigned long j,i; /* Indexes */ /* @@ -250,7 +250,7 @@ double rcon; /* Random constant */ ** Reset random number generator */ /* randnum(13L); */ -randnum((int32)13); +randnum((int32_t)13); /* ** Build an identity matrix. @@ -259,11 +259,11 @@ randnum((int32)13); */ for(i=0;i<n;i++) { /* b[i]=(double)(abs_randwc(100L)+1L); */ - b[i]=(double)(abs_randwc((int32)100)+(int32)1); + b[i]=(double)(abs_randwc((int32_t)100)+(int32_t)1); for(j=0;j<n;j++) if(i==j) /* a[i][j]=(double)(abs_randwc(1000L)+1L); */ - a[i][j]=(double)(abs_randwc((int32)1000)+(int32)1); + a[i][j]=(double)(abs_randwc((int32_t)1000)+(int32_t)1); else a[i][j]=(double)0.0; } @@ -307,8 +307,8 @@ for(i=0;i<8*n;i++) */ /* k=abs_randwc((long)n); */ /* k1=abs_randwc((long)n); */ - k=abs_randwc((int32)n); - k1=abs_randwc((int32)n); + k=abs_randwc((int32_t)n); + k1=abs_randwc((int32_t)n); if(k!=k1) { if(k<k1) rcon=(double)1.0; |