head	1.2;
access
	thoth
	monica;
symbols;
locks; strict;
comment	@// @;


1.2
date	94.11.17.21.45.26;	author monica;	state Exp;
branches;
next	1.1;

1.1
date	94.08.18.03.11.30;	author monica;	state Exp;
branches;
next	;


desc
@initial log
@


1.2
log
@added testing for float
@
text
@/*  $RCS$
    $Log: vs-util.c,v $
// Revision 1.1  1994/08/18  03:11:30  monica
// Initial revision
//
 * 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 "Set.h"
#include <rand48.h>

template <class IA_ValueType>
IA_ValueType make_random_value(IA_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 (IA_ValueType) (bottom +  randlong() % range);
}

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

/* template <class IA_ValueType>
void op(ostream& os, const IA_Set<IA_Type>& vs) {
    IA_SetIter<IA_ValueType> next(vs);
    IA_ValueType x;

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


1.1
log
@Initial revision
@
text
@d2 4
a5 1
    $Log:	valueset-utils.c,v $
d18 1
@
