head	1.4;
access
	monica
	thoth;
symbols
	Eglin_alpha_1:1.1;
locks
	monica:1.4; strict;
comment	@// @;


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

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

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

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


desc
@test for index(unsigned) method.
@


1.4
log
@removed unneeded includes of system files.
@
text
@// Emacs: -*- C++ -*-
static char rcsid[] = "$Id: test013.c,v 1.3 1994/10/06 01:07:08 monica Exp monica $";

//
// $Log: test013.c,v $
// Revision 1.3  1994/10/06  01:07:08  monica
// updated for DOS file naming
//
// Revision 1.2  1994/08/17  04:12:11  monica
// added int main & return 0
//
// Revision 1.1  1993/01/12  14:46:29  thoth
// Initial revision
//
// Revision 1.1  92/10/07  22:46:07  thoth
// Initial revision
// 
//

#include "IntPS.h"

#include "gen-test.h"

extern "C" {
    double drand48();
}

double	density;

int bullshit(const IA_Point<int> &) {
    return drand48()<density;
}

int main(int argc, char**argv)
{
    unsigned size, width;
    unsigned idx=0;
    
    idx++; size = (argc<idx+1) ? 2 : atoi(argv[idx]);
    idx++; width = (argc<idx+1) ? 10 : atoi(argv[idx]);
    idx++; density = (argc<idx+1) ? 0.5 : atof(argv[idx]);
    
    IA_Point<int>	inf_(extend_to_point(0,size));
    IA_Point<int>	sup_(extend_to_point((int)width-1,(int)size));
    IA_Set<IA_Point<int> > ps(inf_,sup_);
    
    IA_Set<IA_Point<int> >	ps1(size,bullshit);
    
    ps1 &= ps;
    
    test_iter (ps1);

#if 0
    list_ips(cout, ps1);
    for (unsigned i=0; i<ps1.card(); i++) {
	cout << ps1.index(i) << ' ';
    }
    cout << '\n';
#endif

    return 0;

}
@


1.3
log
@updated for DOS file naming
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: test013.c,v 1.2 1994/08/17 04:12:11 monica Exp monica $";
d6 3
a18 4

#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
@


1.2
log
@added int main & return 0
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: test013.c,v 1.1 1993/01/12 14:46:29 thoth Exp monica $";
d6 3
d23 1
a23 1
#include "generic-tests.h"
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: test009.c,v 1.1 92/10/07 22:46:07 thoth Exp Locker: thoth $";
d5 4
a8 1
// $Log:	test009.c,v $
d18 1
a18 1
#include "IntPointSet.h"
d28 1
a28 1
int bullshit(const IntPoint &) {
d41 3
a43 3
    IntPoint	inf_(extend_to_point(0,size));
    IntPoint	sup_(extend_to_point(width-1,size));
    IntPointSet ps(inf_,sup_);
d45 1
a45 1
    IntPointSet	ps1(size,bullshit);
d58 3
@
