head	2.16;
access;
symbols
	bobbase:2.15
	bob:2.15.1
	r2_1:2.15
	r2_0:2.15
	r1_1_beta:2.15
	r1_1_alpha:2.14
	r1_0:2.14
	r0_11:2.14
	r0_10:2.14
	r0_9:2.14
	Eglin_alpha_1:2.13;
locks; strict;
comment	@# @;


2.16
date	94.12.08.14.37.17;	author thoth;	state Exp;
branches;
next	2.15;

2.15
date	94.07.25.16.42.26;	author thoth;	state Exp;
branches
	2.15.1.1;
next	2.14;

2.14
date	93.09.15.12.26.03;	author thoth;	state Exp;
branches;
next	2.13;

2.13
date	93.05.26.17.00.24;	author rjj;	state Exp;
branches;
next	2.12;

2.12
date	93.04.29.21.52.44;	author rjj;	state Exp;
branches;
next	2.11;

2.11
date	93.04.06.22.31.31;	author rjj;	state Exp;
branches;
next	2.10;

2.10
date	93.04.05.23.24.59;	author rjj;	state Exp;
branches;
next	2.9;

2.9
date	92.09.01.20.42.58;	author rjj;	state Exp;
branches;
next	2.8;

2.8
date	92.08.27.22.50.45;	author rjj;	state Exp;
branches;
next	2.7;

2.7
date	92.08.23.13.36.41;	author thoth;	state Exp;
branches;
next	2.6;

2.6
date	92.08.20.22.01.28;	author rjj;	state Exp;
branches;
next	2.5;

2.5
date	92.07.29.23.41.39;	author fischer;	state Exp;
branches;
next	2.4;

2.4
date	92.07.29.02.51.14;	author fischer;	state Exp;
branches;
next	2.3;

2.3
date	92.07.28.07.10.10;	author fischer;	state Exp;
branches;
next	2.2;

2.2
date	92.07.27.06.26.01;	author fischer;	state Exp;
branches;
next	2.1;

2.1
date	92.07.19.06.11.57;	author fischer;	state Exp;
branches;
next	2.0;

2.0
date	92.07.19.05.28.58;	author fischer;	state Exp;
branches;
next	;

2.15.1.1
date	94.12.08.14.34.09;	author thoth;	state Exp;
branches;
next	;


desc
@Part of m4 preprocessor defines, see also Point.cc.m4 and Point.h.m4
@


2.16
log
@*** empty log message ***
@
text
@divert(-1)
#        Copyright 1993, Center for Computer Vision and Visualization,
#        University of Florida.  All rights reserved.

#
# $Log: defines.m4,v $

#
# This is a set of m4 macros and defines for turning Point.C.m4 and Point.h.m4
# into the files IntPoint.{C,h} and FloatPoint.{C,h}.
#
# usage: "/local/gnu/m4 -DFLOATPOINT defines.m4 Point.C.m4 > FloatPoint.C"
#        "/local/gnu/m4 -DINTPOINT defines.m4 Point.h.m4 > IntPoint.h"
# etc.
#
# There are some gotchas using m4, however!  If the program text (or this file)
# uses m4 predefined macro keywords,  they must be quoted -- here's the list:
#
# `builtin'	`changecom'	`changequote'	`debugfile'	`debugmode'	`decr'
# `define'	`defn'		`divert'	`divnum'	`dnl'
# `dumpdef'
# `errprint'	`esyscmd'	`eval'		`file'		`format'	`ifdef'
# `ifelse'	`include'	`incr'		`index'		`indir'		`len'
# `line'	`m4exit'	`m4wrap'	`maketemp'	`patsubst'	`popdef'
# `pushdef'	`regexp'	`shift'		`sinclude'	`substr'	`syscmd'
# `sysval'	`traceoff'	`traceon'	`translit'	`undefine'
# `undivert'
#
# There where two problems I had: variables names `len' and `index'. I 
# changed them rather than quoting them.
#
# Additionally, if a defined macro appears in the program text followed
# by parens, say `POINT_TYPE(...)',  then everything in the parens will 
# disappear. This is the case for all the constructors.  My solution: precede
# the left paren immediately by a space.
#
# It's rather worth the effort to get the code in a form debuggers can read
# it (and that includes you, gentle reader).
#
#						Fischer
divert

ifdef(`INTPOINT', `
define(`POINT_TYPE', `IA_Point<int>')
define(`TYPE', `int')
define(`POINT', `IA_Point')
')

ifdef(`DOUBLEPOINT', `
define(`POINT_TYPE', `IA_Point<double>')
define(`TYPE', `double')
define(`POINT', `IA_Point')

define(`IPOINT', `IA_Point<int>')
')

divert(-1)
#//////////////////////////////////////////////////////////////
#//
#// A R I T H E M I T I C   P O I N T   D E F I N I T I O N S
#//
#//////////////////////////////////////////////////////////////
divert
define(`COMPOUND_ARITH_ASSIGN_POINT', `  
POINT_TYPE& POINT_TYPE::operator $1= (const POINT_TYPE& rhs) {
    if (this->dim() != rhs.dim()) {  
	ia_throw(IA::POINT_INDEX_MISMATCH, __FILE__, __LINE__);  
	return *this;  
    }  
    if (this->dim() == 0) {  
	ia_throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
	return *this;  
    }  
#ifdef NO_LOOP_UNROLLING
    for (unsigned i = 0; i < this->dim(); i++)  
	this->coordinates[i] $1= rhs.coordinates[i];  
#else
    switch (this->dim()) {
    case 5: this->coordinates[4] $1= rhs.coordinates[4];  
    case 4: this->coordinates[3] $1= rhs.coordinates[3];  
    case 3: this->coordinates[2] $1= rhs.coordinates[2];  
    case 2: this->coordinates[1] $1= rhs.coordinates[1];  
    case 1: this->coordinates[0] $1= rhs.coordinates[0];  
    case 0: break;
    default:
	    {
		for (unsigned i = 0; i < this->dim(); i++)  
		    coordinates[i] $1= rhs.coordinates[i];  
	    }
    }
#endif
    return *this;  
}')


define(`COMPOUND_ARITH_ASSIGN_NUMBER', `  
POINT_TYPE& POINT_TYPE::operator $1= (TYPE rhs) { 
    if (this->dim() == 0) {  
	ia_throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
	return *this;  
    }  
#ifdef NO_LOOP_UNROLLING
    for (unsigned i = 0; i < this->dim(); i++)  
	this->coordinates[i] $1= rhs;  
#else
    switch (this->dim()) {
    case 5: this->coordinates[4] $1= rhs;  
    case 4: this->coordinates[3] $1= rhs;  
    case 3: this->coordinates[2] $1= rhs;  
    case 2: this->coordinates[1] $1= rhs;  
    case 1: this->coordinates[0] $1= rhs;  
    case 0: break;
    default:
	    {
		for (unsigned i = 0; i < this->dim(); i++)  
		    this->coordinates[i] $1= rhs;  
	    }
    }
#endif
    return *this;  
}')

define(`ARITH_POINT_POINT', `
POINT_TYPE POINT_TYPE::operator $1 (const POINT_TYPE& rhs) const  
{ 
   POINT_TYPE result_point = *this;    
   return result_point $1= rhs;  
}')

define(`ARITH_POINT_NUMBER', `
POINT_TYPE POINT_TYPE::operator $1 (TYPE rhs) const
{ 
    POINT_TYPE result_point = *this;
    return result_point $1= rhs; 
}')

define(`ARITH_NUMBER_POINT', `
POINT_TYPE operator $1 (TYPE lhs, const POINT_TYPE& rhs)  
{ 
  POINT_TYPE result_point = extend_to_point (lhs, rhs.dim()); 
  return result_point $1= rhs;  
}')

divert(-1)
//
// IntPoint double ops
//
divert
define(`ARITH_INTPOINT_DOUBLE', `
POINT_TYPE operator $1 (const IPOINT& lhs, TYPE rhs)
{
    POINT_TYPE result_point = lhs;
    return result_point $1= rhs;
}')
 
define(`ARITH_DOUBLE_INTPOINT', `
POINT_TYPE operator $1 (TYPE lhs, const IPOINT& rhs)
{
  POINT_TYPE result_point = rhs;
  return result_point $1= lhs;
}')

divert(-1)
#//////////////////////////////////////////////////////////////
#//
#// L A T T I C E   P O I N T   D E F I N I T I O N S
#//
#//////////////////////////////////////////////////////////////
divert
define(`LATTICE_POINT_POINT', ` 
int POINT_TYPE::operator $1 (const POINT_TYPE& rhs) const  
{  
    if (this->dim() == 0 || rhs.dim() == 0) {  
	ia_throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
	return  0;  
    }	  
    if (this->dim() != rhs.dim())  
	return  0;  

#ifdef NO_LOOP_UNROLLING    
    for (unsigned i = 0; i < this->dim() ; i++)
	if (! (this->coordinates[i] $1 rhs.coordinates[i])) return 0;  
#else
    switch (this->dim()) {
    case 5: if (! (this->coordinates[4] $1 rhs.coordinates[4])) return 0;  
    case 4: if (! (this->coordinates[3] $1 rhs.coordinates[3])) return 0;  
    case 3: if (! (this->coordinates[2] $1 rhs.coordinates[2])) return 0;  
    case 2: if (! (this->coordinates[1] $1 rhs.coordinates[1])) return 0;  
    case 1: if (! (this->coordinates[0] $1 rhs.coordinates[0])) return 0;  
    case 0: break;
    default: 
	    {
		for (unsigned i = 0; i < this->dim() ; i++)   
		    if (! (this->coordinates[i] $1 rhs.coordinates[i]))
			return 0;  
	    }
    }
#endif
    return 1;  
}')


define(`LATTICE_POINT_NUMBER', `
int  POINT_TYPE::operator $1 (TYPE rhs) const
{  
    if (this->dim() == 0) {
	ia_throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
	return  0;  
    }	  

#ifdef NO_LOOP_UNROLLING
    for (unsigned int i = 0; i < this->dim(); i++)  
	if (! (this->coordinates[i] $1 rhs)) return  0;  
#else
    switch (this->dim()) {
    case 5: if (! (this->coordinates[4] $1 rhs)) return  0;  
    case 4: if (! (this->coordinates[3] $1 rhs)) return  0;  
    case 3: if (! (this->coordinates[2] $1 rhs)) return  0;  
    case 2: if (! (this->coordinates[1] $1 rhs)) return  0;  
    case 1: if (! (this->coordinates[0] $1 rhs)) return  0;
    case 0: break;
    default:
	    {
		for (unsigned int i = 0; i < this->dim(); i++)  
		    if (! (this->coordinates[i] $1 rhs)) return  0;  
	    }
    }
#endif  
    return  1;  
}')


define(`LATTICE_NUMBER_POINT', ` 
int operator $1 (TYPE lhs, const POINT_TYPE& rhs)  
{  
    if (rhs.dim() == 0) {  
	ia_throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
	return  0;  
    }	  

#ifdef NO_LOOP_UNROLLING
    for (unsigned int i = 0; i < rhs.dim(); i++)  
	if (! (lhs $1 rhs.coordinates[i])) return  0;  
#else
    switch (rhs.dim()) {
    case 5: if (! (lhs $1 rhs.coordinates[4])) return  0;  
    case 4: if (! (lhs $1 rhs.coordinates[3])) return  0;  
    case 3: if (! (lhs $1 rhs.coordinates[2])) return  0;  
    case 2: if (! (lhs $1 rhs.coordinates[1])) return  0;  
    case 1: if (! (lhs $1 rhs.coordinates[0])) return  0;
    case 0: break;
    default:
	    {
		for (unsigned int i = 0; i < rhs.dim(); i++)  
		    if (! (lhs $1 rhs.coordinates[i])) return  0;  
	    }
    }
#endif  

    return  1;  
}')


define(`LATTICE_INTPOINT_DOUBLE', ` 
int POINT_TYPE::operator $1  (double rhs) const
{  
    if (this->dim() == 0) {  
	ia_throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
	return  0;  
    }	  

#ifdef NO_LOOP_UNROLLING
    for (unsigned int i = 0; i < this->dim(); i++)  
	if (! (this->coordinates[i] $1 rhs)) return  0;  
#else
    switch (this->dim()) {
    case 5: if (! (this->coordinates[4] $1 rhs)) return  0;  
    case 4: if (! (this->coordinates[3] $1 rhs)) return  0;  
    case 3: if (! (this->coordinates[2] $1 rhs)) return  0;  
    case 2: if (! (this->coordinates[1] $1 rhs)) return  0;  
    case 1: if (! (this->coordinates[0] $1 rhs)) return  0;
    case 0: break;
    default:
	    {
		for (unsigned int i = 0; i < this->dim(); i++)  
		    if (! (this->coordinates[i] $1 rhs)) return  0;  
	    }
    }
#endif
    return  1;  
}')


define(`LATTICE_DOUBLE_INTPOINT', `
int operator $1 (double lhs, const POINT_TYPE& rhs)  
{  
    if (rhs.dim() == 0) {  
	ia_throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
	return  0;  
    }	  

#ifdef NO_LOOP_UNROLLING
    for (unsigned int i = 0; i < rhs.dim(); i++)  
	if (! (lhs $1 rhs.coordinates[i]))  
	    return  0;  

#else
    switch (rhs.dim()) {
    case 5: if (! (lhs $1 rhs.coordinates[4])) return  0;  
    case 4: if (! (lhs $1 rhs.coordinates[3])) return  0;  
    case 3: if (! (lhs $1 rhs.coordinates[2])) return  0;  
    case 2: if (! (lhs $1 rhs.coordinates[1])) return  0;  
    case 1: if (! (lhs $1 rhs.coordinates[0])) return  0;
    case 0: break;
    default:
	    {
		for (unsigned int i = 0; i < rhs.dim(); i++)  
		    if (! (lhs $1 rhs.coordinates[i])) return  0;  
	    }
    }
#endif    
    return  1;  
}')

divert(-1)
#//////////////////////////////////////////////////////////////
#//
#// B I T W I S E   P O I N T   D E F I N I T I O N S
#//
#//////////////////////////////////////////////////////////////
divert
define(`COMPOUND_BITWISE_ASSIGN_POINT', `  
POINT_TYPE& POINT_TYPE::operator $1= (const POINT_TYPE& rhs) {  
    if (this->dim() != rhs.dim()) {  
	ia_throw(IA::POINT_INDEX_MISMATCH, __FILE__, __LINE__);  
	return *this;  
    }  
    if (this->dim() == 0) {  
	ia_throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
	return *this;  
    }  
#ifdef NO_LOOP_UNROLLING
    for (unsigned i = 0; i < this->dim(); i++)  
	this->coordinates[i] $1= rhs.coordinates[i];  
#else
    switch (this->dim()) {
    case 5: this->coordinates[4] $1= rhs.coordinates[4];  
    case 4: this->coordinates[3] $1= rhs.coordinates[3];  
    case 3: this->coordinates[2] $1= rhs.coordinates[2];  
    case 2: this->coordinates[1] $1= rhs.coordinates[1];  
    case 1: this->coordinates[0] $1= rhs.coordinates[0];  
    case 0: break;
    default:
	    {
		for (unsigned i = 0; i < this->dim(); i++)  
		    this->coordinates[i] $1= rhs.coordinates[i];  
	    }
    }
#endif
    return *this;  
}')


define(`COMPOUND_BITWISE_ASSIGN_NUMBER', `  
POINT_TYPE& POINT_TYPE::operator $1= (int rhs) {
    if (this->dim() == 0) {  
	ia_throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
	return *this;  
    }  
#ifdef NO_LOOP_UNROLLING
    for (unsigned i = 0; i < this->dim(); i++)  
	this->coordinates[i] $1= rhs;
#else
    switch (this->dim()) {
    case 5: this->coordinates[4] $1= rhs;
    case 4: this->coordinates[3] $1= rhs;
    case 3: this->coordinates[2] $1= rhs;
    case 2: this->coordinates[1] $1= rhs;
    case 1: this->coordinates[0] $1= rhs;
    case 0: break;
    default:
	    {
		for (unsigned i = 0; i < this->dim(); i++)  
		    this->coordinates[i] $1= rhs;
	    }
    }
#endif
    return *this;  
}')


define(`BITWISE_POINT_POINT', `
POINT_TYPE POINT_TYPE::operator $1 (const POINT_TYPE& rhs) const  
{ 
   POINT_TYPE result_point = *this;    
   return result_point $1= rhs;  
}')


define(`BITWISE_POINT_NUMBER', `
POINT_TYPE POINT_TYPE::operator $1 (int rhs) const
{ 
   POINT_TYPE result_point = *this;    
   return result_point $1= rhs;  
}')


define(`BITWISE_NUMBER_POINT', `
POINT_TYPE operator $1 (int lhs, const POINT_TYPE& rhs) {
    POINT_TYPE result_point = extend_to_point (lhs, rhs.dim());  
    return result_point $1= rhs;  
}')

divert(-1)
#//////////////////////////////////////////////////////////////
#//
#// O T H E R   P O I N T   D E F I N I T I O N S
#//
#//////////////////////////////////////////////////////////////
#
#
# The "FRIEND_SELECT_BINARY" macro takes two args, the name, and a logical 
# comparison operation: ie, could use "min" and "<" to construct something
# that returns a point that is the minimum value, elementwise, in two points.
# The "FRIEND_SELECT_UNARY" is similar, but extracts the element in the point
# that satisfies the condition.
divert


define(`FRIEND_SELECT_BINARY',`
// $1 returns an empty POINT_TYPE if passed two empty points.

POINT_TYPE $1 (const POINT_TYPE& lhs, const POINT_TYPE& rhs) 
{ 
    if (lhs.dim() != rhs.dim()) {  
	ia_throw(IA::POINT_INDEX_MISMATCH, __FILE__, __LINE__);  
	return POINT_TYPE ();  
    }  

    POINT_TYPE p = rhs;

#ifdef NO_LOOP_UNROLLING
    for (unsigned i = 0; i < p.dim(); i++) 
	p.coordinates[i]
	    = (lhs.coordinates[i] $2 rhs.coordinates[i])
		?  lhs.coordinates[i] : rhs.coordinates[i];
#else
    switch (p.dim()) {
    case 5: p.coordinates[4] =	
	(lhs.coordinates[4] $2 rhs.coordinates[4])
	    ? lhs.coordinates[4] : rhs.coordinates[4];
    case 4: p.coordinates[3] = 
	(lhs.coordinates[3] $2 rhs.coordinates[3])
	    ? lhs.coordinates[3] : rhs.coordinates[3];
    case 3: p.coordinates[2] = 
	(lhs.coordinates[2] $2 rhs.coordinates[2])
	    ? lhs.coordinates[2] : rhs.coordinates[2];
    case 2: p.coordinates[1] = 
	(lhs.coordinates[1] $2 rhs.coordinates[1])
	    ? lhs.coordinates[1] : rhs.coordinates[1];
    case 1: p.coordinates[0] = 
	(lhs.coordinates[0] $2 rhs.coordinates[0])
	    ? lhs.coordinates[0] : rhs.coordinates[0];
    case 0: break;
    default:
	    {
		for (unsigned i = 0; i < p.dim(); i++) 
		    p.coordinates[i]
			= (lhs.coordinates[i] $2 rhs.coordinates[i])
			    ?  lhs.coordinates[i] : rhs.coordinates[i];
	    }
    }
#endif    
    return p; 
}')

define(`FRIEND_SELECT_UNARY',`
TYPE $1 (const POINT_TYPE& point)
{

    if (point.dim() == 0) {  
	ia_throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
	return 0;
    }

    TYPE result = point.coordinates[0];

#ifdef NO_LOOP_UNROLLING
    for (unsigned i = 1; i < point.dim(); i++) 
	result =  (point.coordinates[i] $2 result)
			? point.coordinates[i] : result;
#else
    switch (point.dim()) {
    case 5: result = (point.coordinates[4] $2 result)
			? point.coordinates[4] : result;
    case 4: result = (point.coordinates[3] $2 result)
			? point.coordinates[3] : result;
    case 3: result = (point.coordinates[2] $2 result)
			? point.coordinates[2] : result;
    case 2: result = (point.coordinates[1] $2 result)
			? point.coordinates[1] : result;
    case 1: break;
    default:
	    {
		for (unsigned i = 1; i < point.dim(); i++) 
		    result =  (point.coordinates[i] $2 result)
				? point.coordinates[i] : result;
	    }
    }
#endif
    return result; 
}')


define(`ROUNDING_DOUBLE_TO_DOUBLE',`
POINT_TYPE $1 (POINT_TYPE p) 
{ 
#ifdef NO_LOOP_UNROLLING
    for (unsigned i = 0; i < p.dim(); i++) 
	p.coordinates[i] = $1(p.coordinates[i]); 
#else
    switch (p.dim()) {
    case 5: p.coordinates[4] = $1(p.coordinates[4]);
    case 4: p.coordinates[3] = $1(p.coordinates[3]);
    case 3: p.coordinates[2] = $1(p.coordinates[2]);
    case 2: p.coordinates[1] = $1(p.coordinates[1]);
    case 1: p.coordinates[0] = $1(p.coordinates[0]);
    case 0: break;
    default:
	    {
		for (unsigned i = 0; i < p.dim(); i++) 
		    p.coordinates[i] = $1(p.coordinates[i]);
	    }
    }
#endif
    return p; 
}')

define(`ROUNDING_DOUBLE_TO_INT',`
IPOINT $1 (const POINT_TYPE& p) 
{ 
    int	*iptr;
    iptr = new int[p.dim()];	    

#ifdef NO_LOOP_UNROLLING
    for (unsigned i = 0; i < p.dim(); i++) 
	iptr[i] = $1(p.coordinates[i]);    
#else
    switch (p.dim()) {
    case 5: iptr[4] = $1(p.coordinates[4]);
    case 4: iptr[3] = $1(p.coordinates[3]);
    case 3: iptr[2] = $1(p.coordinates[2]);
    case 2: iptr[1] = $1(p.coordinates[1]);
    case 1: iptr[0] = $1(p.coordinates[0]);
    case 0: break;
    default:
	    {
		for (unsigned i = 0; i < p.dim(); i++) 
		    iptr[i] = $1 (p.coordinates[i]);
	    }
    }
#endif    
    return IPOINT (iptr, p.dim(), 1);

}')
@


2.15
log
@FloatPoint is now either Point<double> or DoublePoint.
@
text
@d4 4
@


2.15.1.1
log
@All throws are now of class objects.
@
text
@a4 4

#
# $Log$

d63 1
a63 1
	ia_throw(Point_DimensionMismatch_Exception(__FILE__, __LINE__));  
d67 1
a67 1
	ia_throw(Point_Uninitialized_Exception(__FILE__, __LINE__));;  
d95 1
a95 1
	ia_throw(Point_Uninitialized_Exception(__FILE__, __LINE__));;  
a168 1
// this is suspicious -XXX-
d170 1
a170 1
	ia_throw(Point_Uninitialized_Exception(__FILE__, __LINE__));;  
d203 1
a203 1
	ia_throw(Point_Uninitialized_Exception(__FILE__, __LINE__));;  
d233 1
a233 1
	ia_throw(Point_Uninitialized_Exception(__FILE__, __LINE__));;  
d264 1
a264 1
	ia_throw(Point_Uninitialized_Exception(__FILE__, __LINE__));;  
d294 1
a294 1
	ia_throw(Point_Uninitialized_Exception(__FILE__, __LINE__));;  
d331 1
a331 1
	ia_throw(Point_DimensionMismatch_Exception(__FILE__, __LINE__));  
d335 1
a335 1
	ia_throw(Point_Uninitialized_Exception(__FILE__, __LINE__));;  
d363 1
a363 1
	ia_throw(Point_Uninitialized_Exception(__FILE__, __LINE__));;  
d432 1
a432 1
	ia_throw(Point_DimensionMismatch_Exception(__FILE__, __LINE__));  
d478 1
a478 1
	ia_throw(Point_Uninitialized_Exception(__FILE__, __LINE__));;  
@


2.14
log
@Point is now a template with specializations only.
@
text
@d45 1
a45 1
ifdef(`FLOATPOINT', `
d145 1
a145 1
define(`ARITH_INTPOINT_FLOAT', `
d152 1
a152 1
define(`ARITH_FLOAT_INTPOINT', `
d260 1
a260 1
define(`LATTICE_INTPOINT_FLOAT', ` 
d290 1
a290 1
define(`LATTICE_FLOAT_INTPOINT', `
d511 1
a511 1
define(`ROUNDING_FLOAT_TO_FLOAT',`
d535 1
a535 1
define(`ROUNDING_FLOAT_TO_INT',`
@


2.13
log
@Added copyright notice
@
text
@d39 5
a43 2
ifdef(`INTPOINT', `define(`POINT_TYPE', `IA_IntPoint')')
ifdef(`INTPOINT', `define(`TYPE', `int')')
d45 4
a48 2
ifdef(`FLOATPOINT', `define(`POINT_TYPE', `IA_FloatPoint')')
ifdef(`FLOATPOINT', `define(`TYPE', `double')')
d50 3
d146 1
a146 1
POINT_TYPE operator $1 (const IA_IntPoint& lhs, TYPE rhs)
d153 1
a153 1
POINT_TYPE operator $1 (TYPE lhs, const IA_IntPoint& rhs)
d329 1
a329 1
IA_IntPoint& IA_IntPoint::operator $1= (const IA_IntPoint& rhs) {  
d361 1
a361 1
IA_IntPoint& IA_IntPoint::operator $1= (int rhs) {
d389 1
a389 1
POINT_TYPE POINT_TYPE::operator $1 (const IA_IntPoint& rhs) const  
d405 1
a405 1
POINT_TYPE operator $1 (int lhs, const IA_IntPoint& rhs) {
d512 1
a512 1
IA_FloatPoint $1 (IA_FloatPoint p) 
d536 1
a536 1
IA_IntPoint $1 (const IA_FloatPoint& p) 
d559 1
a559 1
    return IA_IntPoint(iptr, p.dim(), 1);
@


2.12
log
@Added missing  const  for  POINT op NUMBER.  Only effected Arith ops
	since the others were done correctly.
@
text
@d2 2
@


2.11
log
@Changes "const TYPE" to "TYPE"
Changed bitwise unsigned parameters to int
@
text
@d117 1
a117 1
POINT_TYPE POINT_TYPE::operator $1 (TYPE rhs)  
@


2.10
log
@Changes to support mutation to newpoint interface.
  Reference Point.h.m4 revision 2.10 and
  Point.C.m4 revision 1.8 for more details.
@
text
@d83 1
a83 1
POINT_TYPE& POINT_TYPE::operator $1= (const TYPE rhs) { 
d117 1
a117 1
POINT_TYPE POINT_TYPE::operator $1 (const TYPE rhs)  
d124 1
a124 1
POINT_TYPE operator $1 (const TYPE lhs, const POINT_TYPE& rhs)  
d136 1
a136 1
POINT_TYPE operator $1 (const IA_IntPoint& lhs, const TYPE rhs)
d143 1
a143 1
POINT_TYPE operator $1 (const TYPE lhs, const IA_IntPoint& rhs)
d190 1
a190 1
int  POINT_TYPE::operator $1 (const TYPE rhs) const
d220 1
a220 1
int operator $1 (const TYPE lhs, const POINT_TYPE& rhs)  
d251 1
a251 1
int POINT_TYPE::operator $1  (const double rhs) const
d281 1
a281 1
int operator $1 (const double lhs, const POINT_TYPE& rhs)  
d351 1
a351 1
IA_IntPoint& IA_IntPoint::operator $1= (const unsigned rhs) {
a384 3
//???????????????????????????????
// unsigned or int
//???????????????????????????????
d387 1
a387 1
POINT_TYPE POINT_TYPE::operator $1 (const unsigned rhs) const
d395 1
a395 1
POINT_TYPE operator $1 (const int lhs, const IA_IntPoint& rhs) {
@


2.9
log
@Added support to ensure float op IntPoint and IntPoint op float yield FloatPoint.
@
text
@d14 2
a15 1
# `define'	`defn'		`divert'	`divnum'	`dnl'		`dumpdef'
d20 2
a21 1
# `sysval'	`traceoff'	`traceon'	`translit'	`undefine'	`undivert'
d37 1
a37 1
ifdef(`INTPOINT', `define(`POINT_TYPE', `IntPoint')')
d40 1
a40 1
ifdef(`FLOATPOINT', `define(`POINT_TYPE', `FloatPoint')')
d43 7
a49 1

d51 2
a52 2
const POINT_TYPE& POINT_TYPE::operator $1= (const POINT_TYPE& rhs) {  
    if (this->size != rhs.size) {  
d56 1
a56 1
    if (this->size == 0) {  
d61 1
a61 1
    for (unsigned i = 0; i < this->size; i++)  
d64 1
a64 1
    switch (this->size) {
d73 1
a73 1
		for (unsigned i = 0; i < this->size; i++)  
a80 30
define(`COMPOUND_BITWISE_ASSIGN_POINT', `  
const IntPoint& IntPoint::operator $1= (const IntPoint& rhs) {  
    if (this->size != rhs.size) {  
	ia_throw(IA::POINT_INDEX_MISMATCH, __FILE__, __LINE__);  
	return *this;  
    }  
    if (this->size == 0) {  
	ia_throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
	return *this;  
    }  
#ifdef NO_LOOP_UNROLLING
    for (unsigned i = 0; i < this->size; i++)  
	this->coordinates[i] $1= rhs.coordinates[i];  
#else
    switch (this->size) {
    case 5: this->coordinates[4] $1= rhs.coordinates[4];  
    case 4: this->coordinates[3] $1= rhs.coordinates[3];  
    case 3: this->coordinates[2] $1= rhs.coordinates[2];  
    case 2: this->coordinates[1] $1= rhs.coordinates[1];  
    case 1: this->coordinates[0] $1= rhs.coordinates[0];  
    case 0: break;
    default:
	    {
		for (unsigned i = 0; i < this->size; i++)  
		    this->coordinates[i] $1= rhs.coordinates[i];  
	    }
    }
#endif
    return *this;  
}')
a81 1

d83 2
a84 2
const POINT_TYPE& POINT_TYPE::operator $1= (TYPE rhs) { 
    if (this->size == 0) {  
d89 1
a89 1
    for (unsigned i = 0; i < this->size; i++)  
d92 1
a92 1
    switch (this->size) {
d101 1
a101 1
		for (unsigned i = 0; i < this->size; i++)  
a108 27
define(`COMPOUND_BITWISE_ASSIGN_NUMBER', `  
const IntPoint& IntPoint::operator $1= (unsigned rhs) { 
    if (this->size == 0) {  
	ia_throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
	return *this;  
    }  
#ifdef NO_LOOP_UNROLLING
    for (unsigned i = 0; i < this->size; i++)  
	this->coordinates[i] $1= rhs;
#else
    switch (this->size) {
    case 5: this->coordinates[4] $1= rhs;
    case 4: this->coordinates[3] $1= rhs;
    case 3: this->coordinates[2] $1= rhs;
    case 2: this->coordinates[1] $1= rhs;
    case 1: this->coordinates[0] $1= rhs;
    case 0: break;
    default:
	    {
		for (unsigned i = 0; i < this->size; i++)  
		    this->coordinates[i] $1= rhs;
	    }
    }
#endif
    return *this;  
}')

d117 1
a117 1
POINT_TYPE operator $1 (const POINT_TYPE& lhs, TYPE rhs)  
d119 1
a119 1
    POINT_TYPE result_point = lhs;
d124 1
a124 1
POINT_TYPE operator $1 (TYPE lhs, const POINT_TYPE& rhs)  
d126 1
a126 1
  POINT_TYPE result_point = extend_to_point (lhs, rhs.size); 
d130 7
a136 2
define(`ARITH_INTPOINT_NUMBER', `
POINT_TYPE operator $1 (const IntPoint& lhs, const TYPE rhs)
d142 2
a143 2
define(`ARITH_NUMBER_INTPOINT', `
POINT_TYPE operator $1 (const TYPE lhs, const IntPoint& rhs)
d149 8
a156 23

define(`BITWISE_POINT_POINT', `
POINT_TYPE POINT_TYPE::operator $1 (const IntPoint& rhs) const  
{ 
   POINT_TYPE result_point = *this;    
   return result_point $1= rhs;  
}')

define(`BITWISE_POINT_NUMBER', `
POINT_TYPE operator $1 (const IntPoint& lhs, unsigned rhs)  
{ 
   POINT_TYPE result_point = lhs;    
   return result_point $1= rhs;  
}')

define(`BITWISE_NUMBER_POINT', `
POINT_TYPE operator $1 (int lhs, const IntPoint& rhs)  
{ 
    POINT_TYPE result_point = extend_to_point (lhs, rhs.size);  
    return result_point $1= rhs;  
}')

define(`POINT_POINT_RELATION', ` 
d159 1
a159 1
    if (this->size == 0 || rhs.size == 0) {  
d163 1
a163 1
    if (this->size != rhs.size)  
d167 2
a168 2
    for (unsigned i = 0; i < this->size ; i++)   
	if (! (this->coordinates[i] $1 rhs.coordinates[i])) return char(0);  
d170 6
a175 6
    switch (this->size) {
    case 5: if (! (this->coordinates[4] $1 rhs.coordinates[4])) return char(0);  
    case 4: if (! (this->coordinates[3] $1 rhs.coordinates[3])) return char(0);  
    case 3: if (! (this->coordinates[2] $1 rhs.coordinates[2])) return char(0);  
    case 2: if (! (this->coordinates[1] $1 rhs.coordinates[1])) return char(0);  
    case 1: if (! (this->coordinates[0] $1 rhs.coordinates[0])) return char(0);  
d179 3
a181 2
		for (unsigned i = 0; i < this->size ; i++)   
		    if (! (this->coordinates[i] $1 rhs.coordinates[i])) return char(0);  
d185 1
a185 1
    return char(1);  
d188 3
a190 2
define(`POINT_INT_RELATION', ` 
int operator $1 (const POINT_TYPE& lhs, int rhs)  
d192 1
a192 1
    if (lhs.size == 0) {  
d198 2
a199 2
    for (unsigned int i = 0; i < lhs.size; i++)  
	if (! (lhs.coordinates[i] $1 rhs)) return  0;  
d201 6
a206 6
    switch (lhs.size) {
    case 5: if (! (lhs.coordinates[4] $1 rhs)) return  0;  
    case 4: if (! (lhs.coordinates[3] $1 rhs)) return  0;  
    case 3: if (! (lhs.coordinates[2] $1 rhs)) return  0;  
    case 2: if (! (lhs.coordinates[1] $1 rhs)) return  0;  
    case 1: if (! (lhs.coordinates[0] $1 rhs)) return  0;
d210 2
a211 2
		for (unsigned int i = 0; i < lhs.size; i++)  
		    if (! (lhs.coordinates[i] $1 rhs)) return  0;  
d218 3
a220 2
define(`INT_POINT_RELATION', ` 
int operator $1 (int lhs, const POINT_TYPE& rhs)  
d222 1
a222 1
    if (rhs.size == 0) {  
d228 1
a228 1
    for (unsigned int i = 0; i < rhs.size; i++)  
d231 1
a231 1
    switch (rhs.size) {
d240 1
a240 1
		for (unsigned int i = 0; i < rhs.size; i++)  
d249 3
a251 2
define(`POINT_FLOAT_RELATION', ` 
int operator $1 (const POINT_TYPE& lhs, double rhs)  
d253 1
a253 1
    if (lhs.size == 0) {  
d259 2
a260 2
    for (unsigned int i = 0; i < lhs.size; i++)  
	if (! (lhs.coordinates[i] $1 rhs)) return  0;  
d262 6
a267 6
    switch (lhs.size) {
    case 5: if (! (lhs.coordinates[4] $1 rhs)) return  0;  
    case 4: if (! (lhs.coordinates[3] $1 rhs)) return  0;  
    case 3: if (! (lhs.coordinates[2] $1 rhs)) return  0;  
    case 2: if (! (lhs.coordinates[1] $1 rhs)) return  0;  
    case 1: if (! (lhs.coordinates[0] $1 rhs)) return  0;
d271 2
a272 2
		for (unsigned int i = 0; i < lhs.size; i++)  
		    if (! (lhs.coordinates[i] $1 rhs)) return  0;  
d279 3
a281 2
define(`FLOAT_POINT_RELATION', ` 
int operator $1 (double lhs, const POINT_TYPE& rhs)  
d283 1
a283 1
    if (rhs.size == 0) {  
d289 1
a289 1
    for (unsigned int i = 0; i < rhs.size; i++)  
d292 1
d294 1
a294 1
    switch (rhs.size) {
d303 1
a303 1
		for (unsigned int i = 0; i < rhs.size; i++)  
d311 37
d349 54
d404 5
d410 1
d414 1
a414 1
# The "FRIEND_SELECT_MONARY" is similar, but extracts the element in the point
d424 1
a424 1
    if (lhs.size != rhs.size) {  
d432 1
a432 1
    for (unsigned i = 0; i < p.size; i++) 
d437 1
a437 1
    switch (p.size) {
d456 1
a456 1
		for (unsigned i = 0; i < p.size; i++) 
d470 1
a470 1
    if (point.size == 0) {  
d478 1
a478 1
    for (unsigned i = 1; i < point.size; i++) 
d482 1
a482 1
    switch (point.size) {
d494 1
a494 1
		for (unsigned i = 1; i < point.size; i++) 
d505 1
a505 1
FloatPoint $1 (FloatPoint p) 
d508 1
a508 1
    for (unsigned i = 0; i < p.size; i++) 
d511 1
a511 1
    switch (p.size) {
d520 1
a520 1
		for (unsigned i = 0; i < p.size; i++) 
d529 1
a529 1
IntPoint $1 (const FloatPoint& p) 
d532 1
a532 1
    iptr = new int[p.size];	    
d535 1
a535 1
    for (unsigned i = 0; i < p.size; i++) 
d538 1
a538 1
    switch (p.size) {
d547 1
a547 1
		for (unsigned i = 0; i < p.size; i++) 
d552 1
a552 1
    return IntPoint(iptr, p.size, 1);
a554 3



@


2.8
log
@Changed TYPE for FLOATPOINT to double.
Changed code in $1= operations to use $1= at coordinates[i] level.
Formatted some long lines (>80) to be multiple line, mostly
	this involved the ?: operator.
Changed file references from .cc to .C .
@
text
@d180 14
@


2.7
log
@Cfrontified
hack-around for switch statements that CFront's flow analysis
can't fully understand.
@
text
@d3 2
a4 2
# This is a set of m4 macros and defines for turning Point.cc.m4 and Point.h.m4
# into the files IntPoint.{cc,h} and FloatPoint.{cc,h}.
d6 1
a6 1
# usage: "/local/gnu/m4 -DFLOATPOINT defines.m4 Point.cc.m4 > FloatPoint.cc"
d39 1
a39 1
ifdef(`FLOATPOINT', `define(`TYPE', `float')')
d54 1
a54 1
	this->coordinates[i] = this->coordinates[i] $1 rhs.coordinates[i];  
d57 5
a61 5
    case 5: this->coordinates[4] = this->coordinates[4] $1 rhs.coordinates[4];  
    case 4: this->coordinates[3] = this->coordinates[3] $1 rhs.coordinates[3];  
    case 3: this->coordinates[2] = this->coordinates[2] $1 rhs.coordinates[2];  
    case 2: this->coordinates[1] = this->coordinates[1] $1 rhs.coordinates[1];  
    case 1: this->coordinates[0] = this->coordinates[0] $1 rhs.coordinates[0];  
d66 1
a66 1
		    coordinates[i] = coordinates[i] $1 rhs.coordinates[i];  
d85 1
a85 1
	this->coordinates[i] = this->coordinates[i] $1 rhs.coordinates[i];  
d88 5
a92 5
    case 5: this->coordinates[4] = this->coordinates[4] $1 rhs.coordinates[4];  
    case 4: this->coordinates[3] = this->coordinates[3] $1 rhs.coordinates[3];  
    case 3: this->coordinates[2] = this->coordinates[2] $1 rhs.coordinates[2];  
    case 2: this->coordinates[1] = this->coordinates[1] $1 rhs.coordinates[1];  
    case 1: this->coordinates[0] = this->coordinates[0] $1 rhs.coordinates[0];  
d97 1
a97 1
		    this->coordinates[i] = this->coordinates[i] $1 rhs.coordinates[i];  
d113 1
a113 1
	this->coordinates[i] = this->coordinates[i] $1 rhs;  
d116 5
a120 5
    case 5: this->coordinates[4] = this->coordinates[4] $1 rhs;  
    case 4: this->coordinates[3] = this->coordinates[3] $1 rhs;  
    case 3: this->coordinates[2] = this->coordinates[2] $1 rhs;  
    case 2: this->coordinates[1] = this->coordinates[1] $1 rhs;  
    case 1: this->coordinates[0] = this->coordinates[0] $1 rhs;  
d125 1
a125 1
		    this->coordinates[i] = this->coordinates[i] $1 rhs;  
d140 1
a140 1
	this->coordinates[i] = this->coordinates[i] $1 rhs;
d143 5
a147 5
    case 5: this->coordinates[4] = this->coordinates[4] $1 rhs;
    case 4: this->coordinates[3] = this->coordinates[3] $1 rhs;
    case 3: this->coordinates[2] = this->coordinates[2] $1 rhs;
    case 2: this->coordinates[1] = this->coordinates[1] $1 rhs;
    case 1: this->coordinates[0] = this->coordinates[0] $1 rhs;
d152 1
a152 1
		    this->coordinates[i] = this->coordinates[i] $1 rhs;
d293 1
a293 1
int operator $1 (const POINT_TYPE& lhs, float rhs)  
d322 1
a322 1
int operator $1 (float lhs, const POINT_TYPE& rhs)  
d377 2
a378 1
	    = (lhs.coordinates[i] $2 rhs.coordinates[i]) ?  lhs.coordinates[i] : rhs.coordinates[i];
d382 2
a383 1
	(lhs.coordinates[4] $2 rhs.coordinates[4]) ? lhs.coordinates[4] : rhs.coordinates[4];
d385 2
a386 1
	(lhs.coordinates[3] $2 rhs.coordinates[3]) ? lhs.coordinates[3] : rhs.coordinates[3];
d388 2
a389 1
	(lhs.coordinates[2] $2 rhs.coordinates[2]) ? lhs.coordinates[2] : rhs.coordinates[2];
d391 2
a392 1
	(lhs.coordinates[1] $2 rhs.coordinates[1]) ? lhs.coordinates[1] : rhs.coordinates[1];
d394 2
a395 1
	(lhs.coordinates[0] $2 rhs.coordinates[0]) ? lhs.coordinates[0] : rhs.coordinates[0];
d401 2
a402 1
			= (lhs.coordinates[i] $2 rhs.coordinates[i]) ?  lhs.coordinates[i] : rhs.coordinates[i];
d422 2
a423 1
	result =  (point.coordinates[i] $2 result) ? point.coordinates[i] : result;
d426 8
a433 4
    case 5: result = (point.coordinates[4] $2 result) ? point.coordinates[4] : result;
    case 4: result = (point.coordinates[3] $2 result) ? point.coordinates[3] : result;
    case 3: result = (point.coordinates[2] $2 result) ? point.coordinates[2] : result;
    case 2: result = (point.coordinates[1] $2 result) ? point.coordinates[1] : result;
d438 2
a439 1
		    result =  (point.coordinates[i] $2 result) ? point.coordinates[i] : result;
@


2.6
log
@Changed all calls to throw(,,) to be calls to ia_throw(,,)
@
text
@d64 4
a67 2
	for (unsigned i = 0; i < this->size; i++)  
	    this->coordinates[i] = this->coordinates[i] $1 rhs.coordinates[i];  
d95 4
a98 2
	for (unsigned i = 0; i < this->size; i++)  
	    this->coordinates[i] = this->coordinates[i] $1 rhs.coordinates[i];  
d123 4
a126 2
	for (unsigned i = 0; i < this->size; i++)  
	    this->coordinates[i] = this->coordinates[i] $1 rhs;  
d150 4
a153 2
	for (unsigned i = 0; i < this->size; i++)  
	    this->coordinates[i] = this->coordinates[i] $1 rhs;
d224 4
a227 2
        for (unsigned i = 0; i < this->size ; i++)   
	if (! (this->coordinates[i] $1 rhs.coordinates[i])) return char(0);  
d253 4
a256 2
	for (unsigned int i = 0; i < lhs.size; i++)  
	    if (! (lhs.coordinates[i] $1 rhs)) return  0;  
d282 4
a285 2
	for (unsigned int i = 0; i < rhs.size; i++)  
	    if (! (lhs $1 rhs.coordinates[i])) return  0;  
d312 4
a315 2
	for (unsigned int i = 0; i < lhs.size; i++)  
	    if (! (lhs.coordinates[i] $1 rhs)) return  0;  
d342 4
a345 2
	for (unsigned int i = 0; i < rhs.size; i++)  
	    if (! (lhs $1 rhs.coordinates[i])) return  0;  
d392 5
a396 3
        for (unsigned i = 0; i < p.size; i++) 
	    p.coordinates[i]
		= (lhs.coordinates[i] $2 rhs.coordinates[i]) ?  lhs.coordinates[i] : rhs.coordinates[i];
d424 4
a427 2
	for (unsigned i = 1; i < point.size; i++) 
	    result =  (point.coordinates[i] $2 result) ? point.coordinates[i] : result;
d449 4
a452 2
	for (unsigned i = 0; i < p.size; i++) 
	    p.coordinates[i] = $1(p.coordinates[i]);
d476 4
a479 2
	for (unsigned i = 0; i < p.size; i++) 
	    iptr[i] = $1 (p.coordinates[i]);
@


2.5
log
@Changed relational operators to return int, Pointcmp as well.
@
text
@d45 1
a45 1
	throw(IA::POINT_INDEX_MISMATCH, __FILE__, __LINE__);  
d49 1
a49 1
	throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
d74 1
a74 1
	throw(IA::POINT_INDEX_MISMATCH, __FILE__, __LINE__);  
d78 1
a78 1
	throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
d104 1
a104 1
	throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
d129 1
a129 1
	throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
d198 1
a198 1
	throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
d227 1
a227 1
	throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
d254 1
a254 1
	throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
d282 1
a282 1
	throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
d309 1
a309 1
	throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
d350 1
a350 1
	throw(IA::POINT_INDEX_MISMATCH, __FILE__, __LINE__);  
d387 1
a387 1
	throw(IA::POINT_UNINITIALIZED, __FILE__, __LINE__);  
@


2.4
log
@Did more loop unrolling, this time to arithmetic and
bitwise operations.
@
text
@d195 1
a195 1
char POINT_TYPE::operator $1 (const POINT_TYPE& rhs) const  
d199 1
a199 1
	return (char) 0;  
d202 1
a202 1
	return (char) 0;  
d224 1
a224 1
char operator $1 (const POINT_TYPE& lhs, int rhs)  
d228 1
a228 1
	return (char) 0;  
d233 1
a233 1
	if (! (lhs.coordinates[i] $1 rhs)) return (char) 0;  
d236 5
a240 5
    case 5: if (! (lhs.coordinates[4] $1 rhs)) return (char) 0;  
    case 4: if (! (lhs.coordinates[3] $1 rhs)) return (char) 0;  
    case 3: if (! (lhs.coordinates[2] $1 rhs)) return (char) 0;  
    case 2: if (! (lhs.coordinates[1] $1 rhs)) return (char) 0;  
    case 1: if (! (lhs.coordinates[0] $1 rhs)) return (char) 0;
d244 1
a244 1
	    if (! (lhs.coordinates[i] $1 rhs)) return (char) 0;  
d247 1
a247 1
    return (char) 1;  
d251 1
a251 1
char operator $1 (int lhs, const POINT_TYPE& rhs)  
d255 1
a255 1
	return (char) 0;  
d260 1
a260 1
	if (! (lhs $1 rhs.coordinates[i])) return (char) 0;  
d263 5
a267 5
    case 5: if (! (lhs $1 rhs.coordinates[4])) return (char) 0;  
    case 4: if (! (lhs $1 rhs.coordinates[3])) return (char) 0;  
    case 3: if (! (lhs $1 rhs.coordinates[2])) return (char) 0;  
    case 2: if (! (lhs $1 rhs.coordinates[1])) return (char) 0;  
    case 1: if (! (lhs $1 rhs.coordinates[0])) return (char) 0;
d271 1
a271 1
	    if (! (lhs $1 rhs.coordinates[i])) return (char) 0;  
d275 1
a275 1
    return (char) 1;  
d279 1
a279 1
char operator $1 (const POINT_TYPE& lhs, float rhs)  
d283 1
a283 1
	return (char) 0;  
d288 1
a288 1
	if (! (lhs.coordinates[i] $1 rhs)) return (char) 0;  
d291 5
a295 5
    case 5: if (! (lhs.coordinates[4] $1 rhs)) return (char) 0;  
    case 4: if (! (lhs.coordinates[3] $1 rhs)) return (char) 0;  
    case 3: if (! (lhs.coordinates[2] $1 rhs)) return (char) 0;  
    case 2: if (! (lhs.coordinates[1] $1 rhs)) return (char) 0;  
    case 1: if (! (lhs.coordinates[0] $1 rhs)) return (char) 0;
d299 1
a299 1
	    if (! (lhs.coordinates[i] $1 rhs)) return (char) 0;  
d302 1
a302 1
    return (char) 1;  
d306 1
a306 1
char operator $1 (float lhs, const POINT_TYPE& rhs)  
d310 1
a310 1
	return (char) 0;  
d316 1
a316 1
	    return (char) 0;  
d319 5
a323 5
    case 5: if (! (lhs $1 rhs.coordinates[4])) return (char) 0;  
    case 4: if (! (lhs $1 rhs.coordinates[3])) return (char) 0;  
    case 3: if (! (lhs $1 rhs.coordinates[2])) return (char) 0;  
    case 2: if (! (lhs $1 rhs.coordinates[1])) return (char) 0;  
    case 1: if (! (lhs $1 rhs.coordinates[0])) return (char) 0;
d327 1
a327 1
	    if (! (lhs $1 rhs.coordinates[i])) return (char) 0;  
d330 1
a330 1
    return (char) 1;  
@


2.3
log
@removed max_dimensions static constant from Point classes.
removed many checks for zero-length points, now that we 
know "new foo[0]" gives us a pointer to one "foo" that can
be safely deleted.  Did some more loop unrolling in functions
like min.  A min-based test program showed 6% speedup 
with g++ -O flag.
@
text
@d52 1
d54 14
a67 2
	this->coordinates[i]  
	    = this->coordinates[i] $1 rhs.coordinates[i];  
d81 1
d83 14
a96 2
	this->coordinates[i]  
	    = this->coordinates[i] $1 rhs.coordinates[i];  
d107 1
d109 14
a122 2
	this->coordinates[i]  
	    = this->coordinates[i] $1 rhs;  
d132 1
d134 14
a147 2
	this->coordinates[i]  
	    = this->coordinates[i] $1 rhs;  
d203 2
a204 1
      
d206 14
a219 3
	if (! (this->coordinates[i] $1 rhs.coordinates[i]))  
	    return char(0);  
      
d230 2
d233 14
a246 3
	if (! (lhs.coordinates[i] $1 rhs))  
	    return (char) 0;  
  
d257 2
d260 15
a274 3
	if (! (lhs $1 rhs.coordinates[i]))  
	    return (char) 0;  
  
d285 2
d288 14
a301 3
	if (! (lhs.coordinates[i] $1 rhs))  
	    return (char) 0;  
  
d312 2
d317 13
a329 1
  
@


2.2
log
@fixed problem with nint/rint/trunc pointer.
optimized constructors via loop unrolling.
added min/max as binary (point,point) and
unary (point) functions.
@
text
@d10 23
d225 1
d227 2
d238 1
d240 21
a260 2
	if (lhs.coordinates[i] $2 rhs.coordinates[i])
	    p.coordinates[i] = lhs.coordinates[i];
d266 7
a272 1
{ 
d275 1
d277 13
a289 2
	if (point.coordinates[i] $2 result)
	    result = point.coordinates[i];
d297 1
d300 13
d319 21
a339 8
    int	*iptr; 
    if (p.size != 0) {  
	iptr = new int[p.size];	     
	for (unsigned i = 0; i < p.size; i++)  
	    *iptr++ = $1(p.coordinates[i]); 
	return IntPoint(iptr-p.size, p.size, 1); 	 
    } else 
	return IntPoint(); 
@


2.1
log
@Fixed reversal of arg names in ARITH_POINT_NUMBER
@
text
@d193 37
d233 1
a233 1
    for (unsigned i = 0; i < p.dimensions(); i++) 
d246 1
a246 1
	return IntPoint(iptr, p.size, 1); 	 
@


2.0
log
@Part of m4 preprocessor defines, see also Point.cc.m4 and Point.h.m4
@
text
@d84 1
a84 1
POINT_TYPE operator $1 (const POINT_TYPE& rhs, TYPE lhs)  
@
