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


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

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

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

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


desc
@Extensive test of image-image operations.
@


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

//
// $Log: test105.c,v $
// Revision 1.3  1994/08/24  00:30:59  monica
// int main & exit(0)
//
//Revision 1.2  1994/08/18  22:17:06  thoth
//incomplete updating.
//
// Revision 1.1  93/03/10  13:57:00  thoth
// Initial revision
// 

#include "IntPS.h"
#include "../new-image/VectorI.h"
#include "IntDI.h"
#define NEED_CLUE
#include "test-ops.h"

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

int main()
{
  IA_Set<IA_Point<int> > 	ps(IA_Point<int> (0,0), IA_Point<int> (63,63));
  IntDI	vi1(IA_Image<IA_Point<int> ,int>(RandomDI<int>(ps,-200,200)).restrict(ps)),
	vi2(IA_Image<IA_Point<int> ,int>(RandomDI<int>(ps,1,100)).restrict(ps));
  IntDI ci1(ps,-4), ci2(ps, 84);
  IntDI	oi1(CopyDI<int>(IA_Image<IA_Point<int> ,int>(RandomDI<int>(ps,-200,200)).restrict(ps))),
	oi2(CopyDI<int>(IA_Image<IA_Point<int> ,int>(RandomDI<int>(ps,1,100)).restrict(ps)));

  // What follows are some assertions.  I hope they work.  If not, we\'re hosed
  if ( vi1-vi2 != -(vi2-vi1) ) {
      cout << "a-b != -(b-a)\n";
  }
  if ( (vi1-vi2)+(vi2-vi1) != 0 ) {
      cout << "(a-b) + (b-a) != 0\n";
  }

  if ( (vi2*oi1)/vi2 != oi1 ) {
      cout << " a*b/a != b\n";
  }

  cout << (long)vi1.type() << ", "
       << (long)IA_VectorI<IA_Point<int> , int>::s_type()
       << endl;

#define TEST_WHATEVER(what,op)		\
  cout << "testing " #what << endl;	\
  test_ ## what(vi1,vi2,vi1 op vi2);	\
  test_ ## what(vi2,vi2,vi2 op vi2);	\
  test_ ## what(vi1,ci2,vi1 op ci2);	\
  test_ ## what(vi1,oi2,vi1 op oi2);	\
  test_ ## what(ci1,vi2,ci1 op vi2);	\
  test_ ## what(ci1,ci2,ci1 op ci2);	\
  test_ ## what(ci2,ci2,ci2 op ci2);	\
  test_ ## what(ci1,oi2,ci1 op oi2);	\
  test_ ## what(oi1,vi2,oi1 op vi2);	\
  test_ ## what(oi1,ci2,oi1 op ci2);	\
  test_ ## what(oi1,oi2,oi1 op oi2);	\
  test_ ## what(oi2,oi2,oi2 op oi2);

  TEST_WHATEVER(plus,+)
  TEST_WHATEVER(minus,-)
  TEST_WHATEVER(mult,*)
  TEST_WHATEVER(divide,/)
  TEST_WHATEVER(equal,==)

#undef TEST_WHATEVER
#define TEST_WHATEVER(what,func)	\
  cout << "testing " #what << endl;	\
  test_ ## what(vi1,vi2,func(vi1,vi2));	\
  test_ ## what(vi1,vi1,func(vi1,vi1));	\
  test_ ## what(vi1,ci2,func(vi1,ci2));	\
  test_ ## what(vi1,oi2,func(vi1,oi2));	\
  test_ ## what(ci1,vi2,func(ci1,vi2));	\
  test_ ## what(ci1,ci2,func(ci1,ci2));	\
  test_ ## what(ci1,ci1,func(ci1,ci1));	\
  test_ ## what(ci1,oi2,func(ci1,oi2));	\
  test_ ## what(oi1,vi2,func(oi1,vi2));	\
  test_ ## what(oi1,ci2,func(oi1,ci2));	\
  test_ ## what(oi1,oi2,func(oi1,oi2));	\
  test_ ## what(oi1,oi1,func(oi1,oi1));

  TEST_WHATEVER(pweq, pwise_eq)
  TEST_WHATEVER(strictne, strict_ne)

  exit(0);
}
@


1.3
log
@int main & exit(0)
@
text
@d2 1
a2 1
static char test105_rcsid[] = "$Id: test105.c,v 1.2 1994/08/18 22:17:06 thoth Exp monica $";
d6 3
d16 1
a16 1
#include "IntPointSet.h"
d22 1
a22 1
typedef IA_IntDiscreteImage	IntDI;
d26 3
a28 3
  IA_IntPointSet	ps(IA_IntPoint(0,0), IA_IntPoint(63,63));
  IntDI	vi1(IA_Image<IA_IntPoint,int>(RandomDI<int>(ps,-200,200)).restrict(ps)),
	vi2(IA_Image<IA_IntPoint,int>(RandomDI<int>(ps,1,100)).restrict(ps));
d30 2
a31 2
  IntDI	oi1(CopyDI<int>(IA_Image<IA_IntPoint,int>(RandomDI<int>(ps,-200,200)).restrict(ps))),
	oi2(CopyDI<int>(IA_Image<IA_IntPoint,int>(RandomDI<int>(ps,1,100)).restrict(ps)));
d46 1
a46 1
       << (long)IA_VectorI<IA_IntPoint, int>::s_type()
@


1.2
log
@incomplete updating.
@
text
@d2 1
a2 1
static char test105_rcsid[] = "$Id: test105.c,v 1.1 93/03/10 13:57:00 thoth Exp $";
d5 4
a8 1
// $Log:	test105.c,v $
d85 2
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
static char test105_rcsid[] = "$Id: test103.c,v 1.1 93/02/20 16:49:59 thoth Exp $";
d5 4
a8 1
// $Log:	test103.c,v $
d11 2
a12 1
#include "IntDiscreteImage.h"
d20 3
a22 3
  IA_IntPointSet	ps(IntPoint(0,0), IntPoint(63,63));
  IntDI	vi1(IA_DiscreteImage<int>(RandomDI<int>(ps,-200,200)).restrict(ps)),
	vi2(IA_DiscreteImage<int>(RandomDI<int>(ps,1,100)).restrict(ps));
d24 2
a25 2
  IntDI	oi1(CopyDI<int>(IA_DiscreteImage<int>(RandomDI<int>(ps,-200,200)).restrict(ps))),
	oi2(CopyDI<int>(IA_DiscreteImage<int>(RandomDI<int>(ps,1,100)).restrict(ps)));
d38 4
@
