home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume21 / cloops / part01 / values.c < prev    next >
C/C++ Source or Header  |  1991-07-25  |  2KB  |  92 lines

  1. /*
  2.  * This file is part of the Livermore Loops transliteration into C.
  3.  * Copyright (C) 1991 by Martin Fouts
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 1, or (at your option)
  8.  * any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19.  
  20. #include "types.h"
  21. #include "externs.h"
  22.  
  23. Void vector();
  24.  
  25. Void values(i)
  26. Int i;
  27. {
  28.   Float one9th;
  29.   Int ip1, j, k, joke;
  30.   Int mc, mr, l;
  31.  
  32.   ip1 = i+1;
  33.  
  34.   vector(i);
  35.  
  36.   if (ip1 == 13) {
  37.     s= 1.0;
  38.     for (j = 0; j < 4; j++) {
  39.       for (k = 0; k < 512; k++) {
  40.     p[j][k]  = s;
  41.     s= s + 0.5;
  42.       }
  43.     }
  44.     for (j = 0; j < 96; j++) {
  45.       e[j] = 1;
  46.       f[j] = 1;
  47.     }
  48.   }
  49.   if (ip1 == 14) {
  50.     one9th= 1./9.;
  51.     for (j = 0; j < 1001; j++) {
  52.       joke= (j+1)*one9th;
  53.       if (joke < 1) joke= 1;
  54.       ex[j] = joke;
  55.       rh[joke-1] = joke;
  56.       dex[joke-1] = joke;
  57.     }
  58.  
  59.     for (j = 0; j < 1001; j++) {
  60.       vx[j] = 0.001;
  61.       xx[j] = 2.001;
  62.       grd[j] = 3 + one9th;
  63.     }
  64.   }
  65.   if (ip1 == 16) {
  66.     mc= 2;
  67.     mr= n;
  68.     d[0]= 1.01980486428764;
  69.     for (k = 1; k < 300; k++)
  70.       d[k]= (Float) d[k-1] +  (Float) (1.0e-4 / d[k-1]);
  71.     r= d[mr-1];
  72.     for (l = 0; l < mc; l++) {
  73.       m= ((mr+mr)*l) - 1;
  74.       for (j = 0; j < 2; j++) {
  75.     for (k = 0; k < mr; k++) {
  76.       m= m+1;
  77.       s= (Float)(k+1);
  78.       plan[m]= (Float) r * (Float) ( (Float)(s+1.0)/ (Float) s);
  79.       zone[m]= k+k+1;
  80.     }
  81.  
  82.       }
  83.     }
  84.     k= mr+mr;
  85.     zone[k]= mr-1;
  86.     s= d[mr-2];
  87.     t= d[mr-3];
  88.   }
  89.   return;
  90. }
  91.  
  92.