head	1.7;
access
	monica
	thoth
	fjsoria
	ljr;
symbols
	Eglin_alpha_1:1.2;
locks
	monica:1.7; strict;
comment	@// @;


1.7
date	94.12.23.00.06.12;	author ljr;	state Exp;
branches;
next	1.6;

1.6
date	94.12.20.05.21.06;	author monica;	state Exp;
branches;
next	1.5;

1.5
date	94.11.29.19.22.17;	author fjsoria;	state Exp;
branches;
next	1.4;

1.4
date	94.10.06.02.02.14;	author monica;	state Exp;
branches;
next	1.3;

1.3
date	94.08.21.15.21.14;	author monica;	state Exp;
branches;
next	1.2;

1.2
date	93.01.20.11.39.33;	author thoth;	state Exp;
branches;
next	1.1;

1.1
date	92.09.30.10.53.03;	author thoth;	state Exp;
branches;
next	;


desc
@a place for pointset utilities that come in handy during testing.
@


1.7
log
@Changed rand48.h include guard to IA_NEED_CUSTOM_RAND48_H.
@
text
@// Emacs: -*- C++ -*-
static char rcsid[] = "$Id: ps-util.c,v 1.6 1994/12/20 05:21:06 monica Exp ljr $";

//
// $Log: ps-util.c,v $
// Revision 1.6  1994/12/20  05:21:06  monica
// replaced inclusion of rand48.h with ifdef block
//
// Revision 1.5  1994/11/29  19:22:17  fjsoria
// no changes
//
// Revision 1.4  1994/10/06  02:02:14  monica
// updated for DOS filename convention
//
// Revision 1.3  1994/08/21  15:21:14  monica
// updated for file name shortening (DblPoint, etc)
//
// Revision 1.2  1993/01/20  11:39:33  thoth
// Random pointset is a test of the IA_PSPred template.
//
// Revision 1.1  92/09/30  10:53:03  thoth
// Initial revision
// 
//

#include "ps-util.h"
#include "pt-util.h"

#ifdef IA_NEED_CUSTOM_RAND48_H
#include "rand48.h"
#else
#include <rand48.h>
#endif

// #include <rand48.h>


IA_ClosurePS<IA_Point<int> > *Random_PS::clone_self() const
{
    return new Random_PS(dimen,density);
}

int Random_PS::contains(const IA_Point<int> &) const
{
    return drand48()<density;
}


IA_Set<IA_Point<int> >
make_random_pointset(unsigned dimen, unsigned card, int bottom, int top)
{
    IA_Point<int>	*arr=new IA_Point<int>[card];

    for (unsigned i=0; i<card; i++)
	arr[i] = make_random_point(dimen, bottom, top);
    return IA_Set<IA_Point<int> >(dimen, arr,card);
}


@


1.6
log
@replaced inclusion of rand48.h with ifdef block
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: ps-util.c,v 1.5 1994/11/29 19:22:17 fjsoria Exp monica $";
d6 3
d28 2
a29 1
#ifdef __BCPLUSPLUS__
@


1.5
log
@no changes
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: ps-util.c,v 1.4 1994/10/06 02:02:14 monica Exp fjsoria $";
d6 3
d25 3
d29 3
@


1.4
log
@updated for DOS filename convention
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: ps-util.c,v 1.3 1994/08/21 15:21:14 monica Exp monica $";
d6 3
a23 9
IA_Set<IA_Point<int> >
make_random_pointset(unsigned dimen, unsigned card, int bottom, int top)
{
    IA_Point<int>	*arr=new IA_Point<int>[card];

    for (unsigned i=0; i<card; i++)
	arr[i] = make_random_point(dimen, bottom, top);
    return IA_Set<IA_Point<int> >(dimen, arr,card);
}
d36 4
d41 4
@


1.3
log
@updated for file name shortening (DblPoint, etc)
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: pointset-utils.c,v 1.2 1993/01/20 11:39:33 thoth Exp monica $";
d5 4
a8 1
// $Log: pointset-utils.c,v $
d17 2
a18 2
#include "pointset-utils.h"
#include "point-utils.h"
@


1.2
log
@Random pointset is a test of the IA_PSPred template.
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: pointset-utils.c,v 1.1 92/09/30 10:53:03 thoth Exp Locker: thoth $";
d5 4
a8 1
// $Log:	pointset-utils.c,v $
d18 1
a18 1
IntPointSet
d21 1
a21 1
    IntPoint	*arr=new IntPoint[card];
d25 1
a25 1
    return IntPointSet(dimen, arr,card);
d28 1
a28 1
IA_PSPred<IntPoint> *Random_PS::clone_self() const
d33 1
a33 1
int Random_PS::contains(const IntPoint &) const
d37 5
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: test004.C,v 1.2 92/08/25 15:38:43 thoth Exp Locker: thoth $";
d5 4
a8 1
// $Log:	test004.C,v $
d13 1
d23 10
@
