rand_util.c File Reference


Detailed Description

Wrappers around the available random number generators.

#include <config/config.h>
#include <stdio.h>
#include <stdlib.h>
#include <oski/common.h>
#include <oski/mangle.h>
#include "rand_util.h"

Functions

oski_index_t rand_GenIndex (oski_index_t a, oski_index_t b)
 Returns a random integer index in the interval $[a, b]$.
oski_value_t rand_GenValueReal (double a, double b)
 Returns a random pure real scalar in the interval $[a, b]$.
oski_value_t rand_GenValue (double a, double b)
 Returns a random value in the interval $[a, b]$.
static void swap_inds (oski_index_t *p_i, oski_index_t *p_j)
static void swap_vals (oski_value_t *p_i, oski_value_t *p_j)
void rand_PermuteIndices (oski_index_t *ind, oski_index_t len)
 Randomly permute the elements of an array of indices.
void rand_PermuteIndValPairs (oski_index_t *ind, oski_value_t *val, oski_index_t len)
 Randomly permute corresponding (index, value) pairs of elements.


Function Documentation

oski_value_t rand_GenValue double  a,
double  b
 

Returns a random value in the interval $[a, b]$.

If oski_value_t is complex, then the real and imaginary parts each lie in the interval.

oski_value_t rand_GenValueReal double  a,
double  b
 

Returns a random pure real scalar in the interval $[a, b]$.

Thus, if oski_value_t is complex, then the imaginary part is set to 0.


Generated on Wed Sep 19 16:41:23 2007 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.4.6