head	1.5;
access;
symbols
	r1_1_beta:1.5
	r1_1_alpha:1.5
	r1_0:1.5
	r0_11:1.5
	r0_10:1.5
	r0_9:1.5
	Eglin_alpha_1:1.5;
locks; strict;
comment	@ * @;


1.5
date	92.12.14.16.19.13;	author jm;	state Exp;
branches;
next	1.4;

1.4
date	92.09.29.15.29.51;	author jm;	state Exp;
branches;
next	1.3;

1.3
date	92.09.16.17.15.24;	author jm;	state Exp;
branches;
next	1.2;

1.2
date	92.09.16.17.01.40;	author jm;	state Exp;
branches;
next	1.1;

1.1
date	92.09.16.16.45.58;	author jm;	state Exp;
branches;
next	;


desc
@ provides utilitary functions to value sets.
@


1.5
log
@ Renamed class ValueSet to IA_ValueSet
@
text
@/*  $RCS$
    $Log:	valueset-utils.c,v $
 * Revision 1.4  92/09/29  15:29:51  jm
 * *** empty log message ***
 * 
 * Revision 1.3  92/09/16  17:15:24  jm
 * *** empty log message ***
 * 
 * Revision 1.2  92/09/16  17:01:40  jm
 * *** empty log message ***
 * 
*/

#include "ValueSet.h"

template <class ValueType>
ValueType make_random_value(ValueType bot, int top ) {

    int   range;
    int bottom = (int) bot;
    
    if (top < bottom) {
        int temp = top;
        top = bottom;
        bottom = temp;
    }
    range = top - bottom + 1;
    
#define randlong()      lrand48()
    
    return (ValueType) (bottom +  randlong() % range);
}

template <class ValueType>
ostream& operator<< (ostream& st, IA_ValueSet<ValueType>& vs) {
    int last_index = vs.size-1;
    st << "<"; 
    if (vs.size > 0) {
	for (int i=0; i < last_index; i++)
	    st << vs.value_array[i] << " ";
	if (vs.size > 0)
	    st << vs.value_array[last_index];
    }
    st << ">" << '\n';
    return st;
}

template <class ValueType>
void op(ostream& os, const IA_ValueSet<ValueType>& vs) {
    IA_ValueSetIter<ValueType> next(vs);
    ValueType x;

    os << "< ";
    while (next(x))
	os << x << " ";
    os << ">\n";
}
@


1.4
log
@*** empty log message ***
@
text
@d3 3
d35 1
a35 1
ostream& operator<< (ostream& st, ValueSet<ValueType>& vs) {
d49 2
a50 2
void op(ostream& os, const ValueSet<ValueType>& vs) {
    ValueSetIter<ValueType> next(vs);
@


1.3
log
@*** empty log message ***
@
text
@d3 3
@


1.2
log
@*** empty log message ***
@
text
@d2 4
a5 1
    $Log$
d31 1
a31 1
    stream << "<"; 
@


1.1
log
@Initial revision
@
text
@d1 3
a3 6
// Emacs: -*- C++ -*-
static char rcsid[] = "$Id$";

// 
// $Log$
//
@
