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


1.5
date	94.12.08.05.12.10;	author monica;	state Exp;
branches;
next	1.4;

1.4
date	94.11.09.20.25.21;	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	92.10.07.22.45.57;	author thoth;	state Exp;
branches;
next	;


desc
@iterator performance test
@


1.5
log
@removed timings
@
text
@// Emacs: -*- C++ -*-
static char rcsid[] = "$Id: test008.c,v 1.4 1994/11/09 20:25:21 monica Exp monica $";

//
// $Log: test008.c,v $
// Revision 1.4  1994/11/09  20:25:21  monica
// removed include devfrags & any debugging calls to malloc
//
// 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  1992/10/07  22:45:57  thoth
// Initial revision
//
//

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

#include "IntPoint.h"
#include "IntPS.h"
#include "PSIter.h"

#include "gen-test.h"
#include "pt-util.h"
#include "ps-util.h"
// #include "tutil.h"


int main(int argc, char**argv)
{
    unsigned size, width, len, ntimes;

    size = (argc<2) ? 2 : atoi(argv[1]);
    width = (argc<3) ? 512 : atoi(argv[2]);
    len = (argc<4) ? 40 : atoi(argv[3]);
    ntimes = (argc<5) ? 1 : atoi(argv[4]);

    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> >	del;
    del = make_random_pointset(size, len, 0, width-1);

    IA_Set<IA_Point<int> > ps(inf_,sup_);

//    struct rusage	now, later;

    IA_PSIter<IA_Point<int> >	iter(ps);
    IA_Point<int>	ip;
    unsigned	i;

//    getrusage(RUSAGE_SELF ,&now);
    for (i=0; i<ntimes; i++) {
	while (iter(ip))
	    {}
	iter.reset();
    }
//    getrusage(RUSAGE_SELF ,&later);
    cout << "boxy, card = " << ps.card() << "  : ";
//    cout << Ttof(now.ru_utime) << " , ";
//    cout << Ttof(later.ru_utime) << "\n";
//    cout << ( ntimes*ps.card() / (Ttof(later.ru_utime)- Ttof(now.ru_utime)) )
//	 << " points/second\n";

    ps /= del;
    iter = ps;
//    getrusage(RUSAGE_SELF ,&now);
    for (i=0; i<ntimes; i++) {
	while (iter(ip))
	    {}
	iter.reset();
    }
//    getrusage(RUSAGE_SELF ,&later);
    cout << "non-boxy, card = " << ps.card() << "  : ";
//    cout << Ttof(now.ru_utime) << " , ";
//    cout << Ttof(later.ru_utime) << "\n";
//    cout << ( ntimes*ps.card() / (Ttof(later.ru_utime)- Ttof(now.ru_utime)) )
//	 << " points/second\n";

    return 0;

}
@


1.4
log
@removed include devfrags & any debugging calls to malloc
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: test008.c,v 1.3 1994/10/06 01:07:08 monica Exp monica $";
d6 3
d20 3
a22 3
#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
d31 1
a31 1
#include "tutil.h"
d51 1
a51 1
    struct rusage	now, later;
d57 1
a57 1
    getrusage(RUSAGE_SELF ,&now);
d63 1
a63 1
    getrusage(RUSAGE_SELF ,&later);
d65 4
a68 4
    cout << Ttof(now.ru_utime) << " , ";
    cout << Ttof(later.ru_utime) << "\n";
    cout << ( ntimes*ps.card() / (Ttof(later.ru_utime)- Ttof(now.ru_utime)) )
	 << " points/second\n";
d72 1
a72 1
    getrusage(RUSAGE_SELF ,&now);
d78 1
a78 1
    getrusage(RUSAGE_SELF ,&later);
d80 4
a83 4
    cout << Ttof(now.ru_utime) << " , ";
    cout << Ttof(later.ru_utime) << "\n";
    cout << ( ntimes*ps.card() / (Ttof(later.ru_utime)- Ttof(now.ru_utime)) )
	 << " points/second\n";
@


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


1.2
log
@added int main & return 0
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: test008.c,v 1.1 1992/10/07 22:45:57 thoth Exp monica $";
d6 3
d18 1
a18 1
#include "dev-frags.h"
d23 3
a25 3
#include "generic-tests.h"
#include "point-utils.h"
#include "pointset-utils.h"
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: test004.c,v 1.5 92/09/20 17:42:54 thoth Exp $";
d5 3
a7 1
// $Log:	test004.c,v $
d9 1
d17 2
a18 2
#include "IntPointSet.h"
#include "IPSIter.h"
d35 2
a36 2
    IntPoint	inf_(extend_to_point(0,size));
    IntPoint	sup_(extend_to_point(width-1,size));
d38 1
a38 1
    IntPointSet	del;
d41 1
a41 1
    IntPointSet ps(inf_,sup_);
d45 2
a46 2
    IPSIter	iter(ps);
    IntPoint	ip;
d76 3
@
