home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume21 / cloops / part01 / valid.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-25  |  1.1 KB  |  42 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.  
  22. Void valid(vx,map,l,bl,x,bu,n)
  23. Float vx[], x[], bl, bu;
  24. Int map[], *l, n;
  25. {
  26.   Int k, m;
  27.  
  28.   m= 0;
  29.   for (k = 0; k < n; k++) {
  30.     if ((x[k] < bl) || (x[k] > bu)) {
  31.       /*printf("k = %d, bl = %f, bu = %f, x[k] = %f\n", k, bl, bu, x[k]);*/
  32.       continue;
  33.     }
  34.  
  35.     map[m] = k;
  36.     vx[m] = x[k];
  37.     m++;
  38.   }
  39.   *l = m;
  40.   return;
  41. }
  42.