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


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

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

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


desc
@test of a new restriction method.
@


1.3
log
@updated types
@
text
@// Emacs: -*- C++ -*-
static char test106_rcsid[] = "$Id: test106.c,v 1.2 1994/08/24 00:30:59 monica Exp monica $";

// test of new restriction code.

//
// $Log: test106.c,v $
// Revision 1.2  1994/08/24  00:30:59  monica
// int main & exit(0)
//
//Revision 1.1  1994/02/18  18:43:18  thoth
//Initial revision
//

#include "IntDI.h"
#include "test-ops.h"

typedef IA_Image<IA_Point<int>,int>	IntDI;

double	density=0.5;

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

int main()
{
    IA_Set<IA_Point<int> >	ps(IA_Point<int>(0,0), IA_Point<int>(63,63));
    IA_Set<IA_Point<int> >	ps2(IA_Point<int>(-20,-20), IA_Point<int>(70,70));
    IA_Set<IA_Point<int> >	mess(2, bullshit);
    IA_Set<IA_Point<int> >	temp;
    IntDI	vi1(IntDI(RandomDI<int>(ps,-200,200)).restrict(ps));

    for (int i=0; i<5; i++) {
	temp = ps2&mess;
//	if (vi1.restrict(temp)!=vi1.new_restrict(temp)) {
	if (vi1.restrict(temp)!=vi1.restrict(temp)) {
	    cout << "test failed\n";
	    exit(1);
	}
    }

    cout << "test succeeded\n";
    exit(0);
}
@


1.2
log
@int main & exit(0)
@
text
@d2 1
a2 1
static char test106_rcsid[] = "$Id: test106.c,v 1.1 1994/02/18 18:43:18 thoth Exp monica $";
d8 3
d15 1
a15 1
#include "IntDiscreteImage.h"
d18 1
a18 1
typedef IA_IntDiscreteImage	IntDI;
d22 1
a22 1
int bullshit(const IA_IntPoint &) {
d28 5
a32 5
    IA_IntPointSet	ps(IA_IntPoint(0,0), IA_IntPoint(63,63));
    IA_IntPointSet	ps2(IA_IntPoint(-20,-20), IA_IntPoint(70,70));
    IA_IntPointSet	mess(2, bullshit);
    IA_IntPointSet	temp;
    IntDI	vi1(IA_IntDiscreteImage(RandomDI<int>(ps,-200,200)).restrict(ps));
d36 2
a37 1
	if (vi1.restrict(temp)!=vi1.new_restrict(temp)) {
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
static char test106_rcsid[] = "$Id: test105.c,v 1.1 93/03/10 13:57:00 thoth Exp $";
d7 4
a10 1
// $Log:	test105.c,v $
@
