Back to index

radiance  4R0+20100331
Functions | Variables
multisamp.c File Reference
#include "copyright.h"
#include <stdlib.h>
#include "random.h"

Go to the source code of this file.

Functions

void multisamp (t, int n, double r)

Variables

static const char RCSid [] = "$Id: multisamp.c,v 2.5 2003/06/07 12:50:20 schorsch Exp $"

Function Documentation

void multisamp ( ,
int  n,
double  r 
)

Definition at line 17 of file multisamp.c.

{
       int    j;
       register int  i, k;
       int    ti[8];
       double s;

       i = n;
       while (i-- > 0)
              ti[i] = 0;
       j = 8;
       while (j--) {
              k = s = r*(1<<n);
              r = s - k;
              i = n;
              while (i-- > 0)
                     ti[i] += ti[i] + ((k>>i) & 1);
       }
       i = n;
       while (i-- > 0)
              t[i] = 1./256. * (ti[i] + frandom());
}

Here is the caller graph for this function:


Variable Documentation

const char RCSid[] = "$Id: multisamp.c,v 2.5 2003/06/07 12:50:20 schorsch Exp $" [static]

Definition at line 2 of file multisamp.c.