home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume21
/
cloops
/
part01
/
values.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-07-25
|
2KB
|
92 lines
/*
* This file is part of the Livermore Loops transliteration into C.
* Copyright (C) 1991 by Martin Fouts
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "types.h"
#include "externs.h"
Void vector();
Void values(i)
Int i;
{
Float one9th;
Int ip1, j, k, joke;
Int mc, mr, l;
ip1 = i+1;
vector(i);
if (ip1 == 13) {
s= 1.0;
for (j = 0; j < 4; j++) {
for (k = 0; k < 512; k++) {
p[j][k] = s;
s= s + 0.5;
}
}
for (j = 0; j < 96; j++) {
e[j] = 1;
f[j] = 1;
}
}
if (ip1 == 14) {
one9th= 1./9.;
for (j = 0; j < 1001; j++) {
joke= (j+1)*one9th;
if (joke < 1) joke= 1;
ex[j] = joke;
rh[joke-1] = joke;
dex[joke-1] = joke;
}
for (j = 0; j < 1001; j++) {
vx[j] = 0.001;
xx[j] = 2.001;
grd[j] = 3 + one9th;
}
}
if (ip1 == 16) {
mc= 2;
mr= n;
d[0]= 1.01980486428764;
for (k = 1; k < 300; k++)
d[k]= (Float) d[k-1] + (Float) (1.0e-4 / d[k-1]);
r= d[mr-1];
for (l = 0; l < mc; l++) {
m= ((mr+mr)*l) - 1;
for (j = 0; j < 2; j++) {
for (k = 0; k < mr; k++) {
m= m+1;
s= (Float)(k+1);
plan[m]= (Float) r * (Float) ( (Float)(s+1.0)/ (Float) s);
zone[m]= k+k+1;
}
}
}
k= mr+mr;
zone[k]= mr-1;
s= d[mr-2];
t= d[mr-3];
}
return;
}