1 /* $Id: $ */
2 
3 /* Copyright (C) 1997 Sverre Hvammen Johansen,
4  * Department of Informatics, University of Oslo.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2.
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 "random.h"
21 
22 /******************************************************************************
23                                                       PROCEDURE HISTO	     */
24 
25 void
__rhisto(A,B,c,d)26 __rhisto (A, B, c, d)
27      __arrp A,
28        B;
29      double c,
30        d;
31 {
32   long j;
33   if (A->h.dim != 1 || B->h.dim != 1)
34     __rerror ("Histo: Multi dimensional array");
35   if (A->limits[0].size != B->limits[0].size + 1)
36     __rerror ("Histo: Illegal size of arrays");
37   for (j = 0; j < B->limits[0].size; j++)
38     if (c <= ARRELEM (B, j))
39       break;
40   ARRELEM (A, j) += d;
41 }
42