head	1.52;
access;
symbols
	bobbase:1.48
	bob:1.48.1
	r2_1:1.43
	r2_0:1.43
	r1_1_beta:1.42
	r1_1_alpha:1.41
	r1_0:1.41
	r0_11:1.40
	r0_10:1.38
	r0_9:1.37
	Eglin_alpha_1:1.33;
locks; strict;
comment	@// @;


1.52
date	94.12.15.21.49.24;	author ljr;	state Exp;
branches;
next	1.51;

1.51
date	94.12.07.20.21.37;	author ljr;	state Exp;
branches;
next	1.50;

1.50
date	94.12.01.22.05.59;	author fjsoria;	state Exp;
branches;
next	1.49;

1.49
date	94.11.23.19.42.44;	author jnw;	state Exp;
branches;
next	1.48;

1.48
date	94.11.10.18.50.09;	author fjsoria;	state Exp;
branches
	1.48.1.1;
next	1.47;

1.47
date	94.10.05.17.07.47;	author ljr;	state Exp;
branches;
next	1.46;

1.46
date	94.10.04.18.16.35;	author thoth;	state Exp;
branches;
next	1.45;

1.45
date	94.09.27.20.47.09;	author fjsoria;	state Exp;
branches;
next	1.44;

1.44
date	94.09.19.16.49.11;	author ljr;	state Exp;
branches;
next	1.43;

1.43
date	94.08.18.23.38.01;	author thoth;	state Exp;
branches;
next	1.42;

1.42
date	94.07.25.16.58.52;	author thoth;	state Exp;
branches;
next	1.41;

1.41
date	94.05.08.19.35.40;	author thoth;	state Exp;
branches;
next	1.40;

1.40
date	94.04.26.18.16.19;	author thoth;	state Exp;
branches;
next	1.39;

1.39
date	94.03.30.13.44.31;	author thoth;	state Exp;
branches;
next	1.38;

1.38
date	94.01.31.16.38.04;	author thoth;	state Exp;
branches;
next	1.37;

1.37
date	93.11.17.18.04.38;	author thoth;	state Exp;
branches;
next	1.36;

1.36
date	93.10.20.15.50.54;	author thoth;	state Exp;
branches;
next	1.35;

1.35
date	93.09.15.12.36.33;	author thoth;	state Exp;
branches;
next	1.34;

1.34
date	93.08.08.13.18.35;	author thoth;	state Exp;
branches;
next	1.33;

1.33
date	93.05.26.16.51.29;	author thoth;	state Exp;
branches;
next	1.32;

1.32
date	93.05.19.14.47.57;	author thoth;	state Exp;
branches;
next	1.31;

1.31
date	93.04.19.23.27.43;	author thoth;	state Exp;
branches;
next	1.30;

1.30
date	93.04.17.14.52.42;	author thoth;	state Exp;
branches;
next	1.29;

1.29
date	93.02.20.15.21.47;	author thoth;	state Exp;
branches;
next	1.28;

1.28
date	93.02.12.16.24.37;	author thoth;	state Exp;
branches;
next	1.27;

1.27
date	93.01.20.11.36.37;	author thoth;	state Exp;
branches;
next	1.26;

1.26
date	92.12.16.14.48.11;	author thoth;	state Exp;
branches;
next	1.25;

1.25
date	92.12.15.21.16.30;	author thoth;	state Exp;
branches;
next	1.24;

1.24
date	92.12.07.12.05.09;	author thoth;	state Exp;
branches;
next	1.23;

1.23
date	92.11.11.12.11.56;	author thoth;	state Exp;
branches;
next	1.22;

1.22
date	92.11.04.11.59.06;	author thoth;	state Exp;
branches;
next	1.21;

1.21
date	92.10.25.20.53.47;	author thoth;	state Exp;
branches;
next	1.20;

1.20
date	92.10.22.15.11.51;	author thoth;	state Exp;
branches;
next	1.19;

1.19
date	92.10.07.23.16.03;	author thoth;	state Exp;
branches;
next	1.18;

1.18
date	92.09.30.10.33.07;	author thoth;	state Exp;
branches;
next	1.17;

1.17
date	92.09.20.17.40.34;	author thoth;	state Exp;
branches;
next	1.16;

1.16
date	92.09.20.17.39.03;	author thoth;	state Exp;
branches;
next	1.15;

1.15
date	92.09.20.14.05.49;	author thoth;	state Exp;
branches;
next	1.14;

1.14
date	92.09.14.21.55.46;	author thoth;	state Exp;
branches;
next	1.13;

1.13
date	92.09.07.13.23.23;	author thoth;	state Exp;
branches;
next	1.12;

1.12
date	92.09.03.13.35.49;	author thoth;	state Exp;
branches;
next	1.11;

1.11
date	92.08.26.13.45.51;	author thoth;	state Exp;
branches;
next	1.10;

1.10
date	92.08.25.15.31.04;	author thoth;	state Exp;
branches;
next	1.9;

1.9
date	92.08.23.13.30.15;	author thoth;	state Exp;
branches;
next	1.8;

1.8
date	92.08.20.11.11.33;	author thoth;	state Exp;
branches;
next	1.7;

1.7
date	92.08.14.15.45.01;	author thoth;	state Exp;
branches;
next	1.6;

1.6
date	92.08.05.14.32.07;	author jnw;	state Exp;
branches;
next	1.5;

1.5
date	92.07.30.16.39.11;	author jnw;	state Exp;
branches;
next	1.4;

1.4
date	92.07.26.16.46.03;	author thoth;	state Exp;
branches;
next	1.3;

1.3
date	92.07.26.16.30.35;	author thoth;	state Exp;
branches;
next	1.2;

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

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

1.48.1.1
date	94.11.21.19.40.14;	author thoth;	state Exp;
branches;
next	;


desc
@The IntPointSet container class.
@


1.52
log
@added typedef to force IA_ClosurePS<IA_Point<int> > to be a public
reference for BC++ template instantiation scheme.
@
text
@// Emacs: -*- C++ -*-

//
//	Copyright 1993, Center for Computer Vision and Visualization,
//	University of Florida.  All rights reserved.
//


// 
// $Log: IntPS.h,v $
// Revision 1.51  1994/12/07  20:21:37  ljr
// added pragma and typedef to force IA_PSIter<IA_Point<int> > to
// be a public reference for BC++ template instantiation scheme.
//
// Revision 1.50  1994/12/01  22:05:59  fjsoria
// changed __NO_INLINE_DESTRUCTORS to
// __NO_OUTLINE_DESTRUCTORS
//
// Revision 1.49  1994/11/23  19:42:44  jnw
// gaurds around inlined friends operator != == and also
// added concat an operator- (from broken lock of ver. 1.48.1)
//
// Revision 1.48  1994/11/10  18:50:09  fjsoria
// *** empty log message ***
//
// Revision 1.47  1994/10/05  17:07:47  ljr
// Changed to not declare >= and > operators for IA_Set<IA_Point<int> >.
// This fixes a problem BC++ has compiling the bodies of these functions.
//
// Revision 1.46  1994/10/04  18:16:35  thoth
// comparisons don't need to be friends, but they do need to be declared.
//
// Revision 1.45  1994/09/27  20:47:09  fjsoria
// g++ v2.6 does no like n0n-inlined destructors
// added __NO_INLINE_DESTRUCTORS
//
// Revision 1.44  1994/09/19  16:49:11  ljr
// Changed to not declare <, <=, >=, > operators for IA_Set<IA_Point<int> >
// as friends.  This fixes a problem BC++ 4.02 has compiling the >= and >
// operator functions.
//
// Revision 1.43  1994/08/18  23:38:01  thoth
// DOS-inspired filename rework
//
// Revision 1.42  1994/07/25  16:58:52  thoth
// \Name sanitization
//
// Revision 1.41  1994/05/08  19:35:40  thoth
// New pointset concatenation capability.
// New intpointset decomposition capability.
//
// Revision 1.40  1994/04/26  18:16:19  thoth
// New array constructor that doesn't require dimension.
// White and Black Hole have been renamed to universal and empty _pset
//
// Revision 1.39  1994/03/30  13:44:31  thoth
// BasePSIter<IA_IntPoint> needs access to the hash table.
//
// Revision 1.38  1994/01/31  16:38:04  thoth
// Added static member functions to construct white and black holes.
// We can now transpose boxy 2D pointsets.
//
// Revision 1.37  1993/11/17  18:04:38  thoth
// extensivep() is now extensive()
// IPSIter is now PSIter<IntPoint> but bug in cfront 3.0.2 prevents typedef
//
// Revision 1.36  1993/10/20  15:50:54  thoth
// New naming scheme.  Closures are named Closure.
//
// Revision 1.35  1993/09/15  12:36:33  thoth
// Pointset behavior controls have moved to IA::
//
// Revision 1.34  93/08/08  13:18:35  thoth
// Parametrization of the pointsets on the point type using
// template specialization.
// 
// Revision 1.33  93/05/26  16:51:29  thoth
// Copyright Notices
// 
// Revision 1.32  93/05/19  14:47:57  thoth
// LatticeRelation is now in IA::
// 
// Revision 1.31  93/04/19  23:27:43  thoth
// Convert BaseIPS to IA_BasePS<IA_IntPoint>
// 
// Revision 1.30  93/04/17  14:52:42  thoth
// Use IA_IntPoint instead of IntPoint
// 
// Revision 1.29  93/02/20  15:21:47  thoth
// Added some comments on the op_with_structure operations.
// 
// Revision 1.28  93/02/12  16:24:37  thoth
// more IA_ prefixes.
// more comments.
// 
// Revision 1.27  93/01/20  11:36:37  thoth
// new PredicatePS class to allow for families of comprehensive pointsets.
// 
// Revision 1.26  92/12/16  14:48:11  thoth
// conversion to IA_ mostly complete
// 
// Revision 1.25  92/12/15  21:16:30  thoth
// added boxy predicate method.
// 
// Revision 1.24  92/12/07  12:05:09  thoth
// new IntPoint index(unsigned) operation for use with "other" iterators.
// 
// Revision 1.23  92/11/11  12:11:56  thoth
// added another restriction utility.
// 
// Revision 1.22  92/11/04  11:59:06  thoth
// New union_with_structure function for image extension.
// 
// Revision 1.21  92/10/25  20:53:47  thoth
// changed argument passing on set restriction routines.
// 
// Revision 1.20  92/10/22  15:11:51  thoth
// pointset restriction utilities.
// 
// Revision 1.19  92/10/07  23:16:03  thoth
// trim gratuitous includes from public headers.
// 
// Revision 1.18  92/09/30  10:33:07  thoth
// reference counts are protected from IntPointSet, unfortunately.
// infimum & supremum virtuals now inf & sup.
// contains now accepts const Point<>&.
// WhiteHole is now a family of pointsets.
// White and Black holes are now semi-public classes, unfortunately.
// 
// Revision 1.17  92/09/20  17:40:34  thoth
// fixed spelling error.
// Minkowski addition of point sets now supported.
// 
// Revision 1.15  92/09/20  14:05:49  thoth
// new infimum and supremum methods for point sets.
// 
// Revision 1.14  92/09/14  21:55:46  thoth
// dimension is now a parameter to the IntPoint array constructor.
// constructor for predicate IPS
// 
// Revision 1.13  92/09/07  13:23:23  thoth
// |&^/ operators are now friends.
// 
// Revision 1.12  92/09/03  13:35:49  thoth
// some lazies need to know the guts of IntPointSets
// 
// Revision 1.11  92/08/26  13:45:51  thoth
// eliminated dummy parameter to constructor (was workaround for g++).
// 
// Revision 1.10  92/08/25  15:31:04  thoth
// new converter from IntPoint to IntPointSet.
// set difference is operator/, not -
// op= for binary set operations now available.
// operator+ is set translation, using the offsetted() function of BaseIPS
// lattice operations on sets defined in terms of compare() friend
// 
// Revision 1.9  92/08/23  13:30:15  thoth
// CFrontified version
// 
// 

#ifndef IntPointSet_h_
#define IntPointSet_h_

#ifdef IA_PRII
#pragma interface
#endif

#define SUPPRESS_INCLUDE
#include "Set.h"
#undef SUPPRESS_INCLUDE

//#include "HashTable.h"
#include "IntPoint.h"
#include "BasePS.h"
// #include "SetStructure.h"

class IA_YoderIPS;
class IA_BoxyIPS;
class IA_HashTable;
class IA_SetStructure;
template <class P> struct IA_ClosurePS;
template <class P> class IA_PSIter;

#ifdef IA_BCPP_TMPLINST_PUBLIC_REFERENCES
#pragma option -Jgd
typedef IA_PSIter<IA_Point<int> > IA_psi_ip_bcpp_tmplinst;
typedef IA_ClosurePS<IA_Point<int> > IA_cps_ip_bcpp_tmplinst;
#pragma option -Jgx
#endif

class IA_IPS_HT_initter {
    static int count;
public:
    IA_IPS_HT_initter();
    ~IA_IPS_HT_initter();
};

static IA_IPS_HT_initter	IA_ihi;

class IA_Set<IA_Point<int> > {

    friend class IA_BasePSIter<IA_Point<int> >; // needs access to hash_table
    /* remove the following line of code to make CFront 3.0.3 puke:
/local/bin/CC-3.0.3 -D__CFRONT__=3 -g -I. -I../../include -I../ia      -c  IntPS.c
CC  IntPS.c:
"./MondoPS.h", line 115: error: ambiguous call: 
"./MondoPS.h", line 115:         error detected during the instantiation of IA_BlackHole_ <class  IA_Point <int >>
"IntPS.c", line 211:     is the site of the instantiation
operator << ( class ostream, char )
"./MondoPS.h", line 115: choice of operator <<()s:
"./MondoPS.h", line 115:         ostream&operator <<(ostream&, const class  IA_Point <int >&);
"./MondoPS.h", line 115:         ostream&operator <<(ostream&, const class  IA_Point <double >&);
 */
    friend void hash_managed_delete(IA_BasePS<IA_Point<int> >*); // ditto

    friend class IA_PointSetDecomposition;
  private:
    friend class IA_IPS_HT_initter;
    static IA_HashTable /* <IA_BasePS<IA_Point<int> >*,256> */	*hash_table;
    
    IA_BasePS<IA_Point<int> >	*ps;
    void lookup_and_set(IA_BasePS<IA_Point<int> > *);
    void disassociate_ps();
    IA_Set(IA_BasePS<IA_Point<int> > *ips) { this->lookup_and_set(ips); }
    IA_Set(IA::Type t, unsigned dim);
  public:
    IA_Set();
    IA_Set(const IA_Point<int>& p);
    IA_Set(const IA_Point<int>& p0, const IA_Point<int>& p1);
    IA_Set(unsigned dimen, int(*f)(IA_Point<int>));
    IA_Set(unsigned dimen, int(*f)(const IA_Point<int>&));
    IA_Set(const IA_ClosurePS<IA_Point<int> >&);
    IA_Set(const IA_BoxyIPS&);
    IA_Set(const IA_YoderIPS&);
    IA_Set(unsigned dimen, const IA_Point<int> *aip, unsigned len);
    IA_Set(const IA_Point<int> *aip, unsigned len);
    IA_Set(const IA_Set<IA_Point<int> >& ips) { ps = ips.ps; ps->enref(); }
// dont now why g++ 2.6 doesn't like non-inlined destructors
#ifdef __NO_OUTLINE_DESTRUCTORS
    ~IA_Set() {
      if (ps==0) {
	cerr << "Internal Error: pointset destructed twice!\n";
	return;
      }
      this->disassociate_ps();
      ps = 0;
    }
#else
    ~IA_Set();
#endif
  
    IA_Set<IA_Point<int> > & operator=(const IA_Set<IA_Point<int> >&);

// g++ has problems with these operators unless its an inlined friend
#ifndef __GNUC__ 
    int operator==(const IA_Set<IA_Point<int> >&ips) const
    { return this->ps == ips.ps; }
    int operator!=(const IA_Set<IA_Point<int> >&ips) const
    { return this->ps != ips.ps; }
#else
    inline friend int operator==(const IA_Set<IA_Point<int> >&s1,const IA_Set<IA_Point<int> >&s2 ) 
    { return s1.ps == s2.ps; }
    inline friend int operator!=(const IA_Set<IA_Point<int> >&s1,const IA_Set<IA_Point<int> >&s2 )
    { return s1.ps != s2.ps; }
#endif

    friend IA_Set<IA_Point<int> > operator|
    (const IA_Set<IA_Point<int> >&,const IA_Set<IA_Point<int> >&);
    friend IA_Set<IA_Point<int> > operator&
    (const IA_Set<IA_Point<int> >&,const IA_Set<IA_Point<int> >&);
    friend IA_Set<IA_Point<int> > operator^
    (const IA_Set<IA_Point<int> >&,const IA_Set<IA_Point<int> >&);
    friend IA_Set<IA_Point<int> > operator/
    (const IA_Set<IA_Point<int> >&,const IA_Set<IA_Point<int> >&);
    IA_Set<IA_Point<int> > operator~() const;
    IA_Set<IA_Point<int> >& operator|=(const IA_Set<IA_Point<int> >&rhs)
    { return (*this = *this | rhs); }
    IA_Set<IA_Point<int> >& operator&=(const IA_Set<IA_Point<int> >&rhs)
    { return (*this = *this & rhs); }
    IA_Set<IA_Point<int> >& operator^=(const IA_Set<IA_Point<int> >&rhs)
    { return (*this = *this ^ rhs); }
    IA_Set<IA_Point<int> >& operator/=(const IA_Set<IA_Point<int> >&rhs)
    { return (*this = *this / rhs); }
    
    friend IA_Set<IA_Point<int> > operator+(const IA_Set<IA_Point<int> >&, const IA_Point<int>&);
    friend IA_Set<IA_Point<int> > operator+(const IA_Point<int>& ip, const IA_Set<IA_Point<int> >&ips) {
	return ips+ip;	// commutative
    }
    IA_Set<IA_Point<int> >& operator+=(const IA_Point<int> &rhs)
    { return (*this = *this + rhs); }
    // Minkowski addition
    friend IA_Set<IA_Point<int> > operator+(const IA_Set<IA_Point<int> >&, const IA_Set<IA_Point<int> >&);
    IA_Set<IA_Point<int> >& operator+=(const IA_Set<IA_Point<int> > &rhs)
    { return (*this = *this + rhs); }

    IA_Set<IA_Point<int> > operator-() const;

    friend IA::LatticeRelation compare(const IA_Set<IA_Point<int> >&, const IA_Set<IA_Point<int> >&);
    
    IA::Type type() const { return ps->type(); }
    unsigned dim() const { return ps->dim(); }
    
    int contains(const IA_Point<int> &ip) const { return ps->contains(ip); }
    unsigned index(const IA_Point<int> &ip) const { return ps->index(ip); }
    IA_Point<int> index(unsigned idx) const { return ps->index(idx); }
    
    IA_Point<int> min() const { return ps->min(); }
    IA_Point<int> max() const { return ps->max(); }
    IA_Point<int> inf() const { return ps->inf(); }
    IA_Point<int> sup() const { return ps->sup(); }
    IA_Point<int> choice() const { return ps->choice(); }
    
    unsigned card() const { return ps->card(); }
    int empty() const { return ps->empty(); }
    int boxy() const;
    int extensive() const { return ps->extensive(); }
    
    void output(ostream &o, unsigned indent=0) const { ps->output(o,indent); }
    static void print_hashtable(ostream &o);
    
    int hash_self(int modulus) const { return ps->hash_self(modulus); }
        
    // Return the intersection of two IntPointSets, but also
    // return the structure of the lhs relative to the result.
    friend IA_Set<IA_Point<int> > intersect_with_structure
    (const IA_Set<IA_Point<int> > &lhs, const IA_Set<IA_Point<int> > &rhs,
     IA_SetStructure *s_struct);
    // Return the intersection of two IntPointSets, but also
    // return the structure of the both arguments relative to the result.
    friend IA_Set<IA_Point<int> > intersect_with_dualstruct
    (const IA_Set<IA_Point<int> > &lhs, const IA_Set<IA_Point<int> > &rhs, IA_SetStructure *s_struct);
    // Return the union of two IntPointSets, but also
    // return the structure of the both arguments relative to the result.
    friend IA_Set<IA_Point<int> > union_with_structure
    (const IA_Set<IA_Point<int> > &lhs, const IA_Set<IA_Point<int> > &rhs, IA_SetStructure *s_struct);
    
    // he has to know how to get at the underlying IA_BasePS<IA_Point<int> >*
    friend class IA_PSIter<IA_Point<int> >;
    
    
    friend IA_Set<IA_Point<int> > IA_boxy_pset(IA_Point<int>, IA_Point<int>);

    friend IA_Set<IA_Point<int> > concat(int, const IA_Set<IA_Point<int> >&);
    friend IA_Set<IA_Point<int> > concat(IA_Set<IA_Point<int> >,
					 IA_Set<IA_Point<int> >);

    static IA_Set<IA_Point<int> > empty_pset(unsigned dim);
    static IA_Set<IA_Point<int> > universal_pset(unsigned dim);

    static IA_Set<IA_Point<int> > WhiteHole(unsigned dim) {
	return universal_pset(dim);
    }
    static IA_Set<IA_Point<int> > BlackHole(unsigned dim) {
	return empty_pset(dim);
    }
};



inline IA_Set<IA_Point<int> > IA_empty_ipset(unsigned dim) {
    return IA_Set<IA_Point<int> >::empty_pset(dim);
}
inline IA_Set<IA_Point<int> > IA_universal_ipset(unsigned dim) {
    return IA_Set<IA_Point<int> >::universal_pset(dim);
}

inline IA_Set<IA_Point<int> > IA_WhiteHole(unsigned dim) {
    return IA_universal_ipset(dim);
}
inline IA_Set<IA_Point<int> > IA_BlackHole(unsigned dim) {
    return IA_empty_ipset(dim);
}

void SortIntPointArray(IA_Point<int> *aip, unsigned len);

IA_Set<IA_Point<int> > transpose(const IA_Set<IA_Point<int> > &);

// in some cases, these operations can not tell definitively.
// In such cases, they return false (0).
// The following functions do not need to be declared friends.
int operator<(const IA_Set<IA_Point<int> > &, const IA_Set<IA_Point<int> >&);
int operator<=(const IA_Set<IA_Point<int> > &, const IA_Set<IA_Point<int> >&);

// The following declarations cause BC++ grief.  No one should need them,
// according to thoth.  If someone does, put a guard around them to keep
// BC++ from having problems compiling the bodies of these functions in
// IntPS.c.
#if 0
int operator>=(const IA_Set<IA_Point<int> > &, const IA_Set<IA_Point<int> >&);
int operator>(const IA_Set<IA_Point<int> > &, const IA_Set<IA_Point<int> >&);
#endif
  

#endif

@


1.51
log
@added pragma and typedef to force IA_PSIter<IA_Point<int> > to
be a public reference for BC++ template instantiation scheme.
@
text
@d11 4
d188 1
@


1.50
log
@changed __NO_INLINE_DESTRUCTORS to
__NO_OUTLINE_DESTRUCTORS
@
text
@d11 4
d180 6
@


1.49
log
@gaurds around inlined friends operator != == and also
added concat an operator- (from broken lock of ver. 1.48.1)
@
text
@d11 4
d225 1
a225 1
#ifdef __NO_INLINE_DESTRUCTORS
@


1.48
log
@*** empty log message ***
@
text
@d11 3
d173 8
d185 13
d200 2
a201 1
    static IA_HashTable /* <IA_BasePS<IA_Point<int> >*,256> */	hash_table;
d235 8
d247 2
d277 3
a279 1
    
d301 1
d304 1
a304 2
    
    
d326 2
d339 1
@


1.48.1.1
log
@Added hash_managed_delete to handle BasePS deletion
Added operator-() to reflect through origin
Added pointset concatenation.
@
text
@a10 3
// Revision 1.48  1994/11/10  18:50:09  fjsoria
// *** empty log message ***
//
a173 13
    /* remove the following line of code to make CFront 3.0.3 puke:
/local/bin/CC-3.0.3 -D__CFRONT__=3 -g -I. -I../../include -I../ia      -c  IntPS.c
CC  IntPS.c:
"./MondoPS.h", line 115: error: ambiguous call: 
"./MondoPS.h", line 115:         error detected during the instantiation of IA_BlackHole_ <class  IA_Point <int >>
"IntPS.c", line 211:     is the site of the instantiation
operator << ( class ostream, char )
"./MondoPS.h", line 115: choice of operator <<()s:
"./MondoPS.h", line 115:         ostream&operator <<(ostream&, const class  IA_Point <int >&);
"./MondoPS.h", line 115:         ostream&operator <<(ostream&, const class  IA_Point <double >&);
 */
    friend void hash_managed_delete(IA_BasePS<IA_Point<int> >*); // ditto

a209 2


a213 2


d242 1
a242 3

    IA_Set<IA_Point<int> > operator-() const;

a263 1
    static void print_hashtable(ostream &o);
a288 2
    friend IA_Set<IA_Point<int> > concat(IA_Set<IA_Point<int> >,
					 IA_Set<IA_Point<int> >);
@


1.47
log
@Changed to not declare >= and > operators for IA_Set<IA_Point<int> >.
This fixes a problem BC++ has compiling the bodies of these functions.
@
text
@d11 4
d158 1
d210 4
a213 4
    int operator==(const IA_Set<IA_Point<int> >&ips) const
    { return this->ps == ips.ps; }
    int operator!=(const IA_Set<IA_Point<int> >&ips) const
    { return this->ps != ips.ps; }
d301 1
d334 1
a334 1
    
@


1.46
log
@comparisons don't need to be friends, but they do need to be declared.
@
text
@d11 3
d319 6
d327 1
a327 1

d331 1
@


1.45
log
@g++ v2.6 does no like n0n-inlined destructors
added __NO_INLINE_DESTRUCTORS
@
text
@d11 4
a236 10
    // in some cases, these operations can not tell definitively.
    // In such cases, they return false (0).
    // The following functions do not need to be declared friends.
#if 0
	 friend int operator<(const IA_Set<IA_Point<int> > &, const IA_Set<IA_Point<int> >&);
	 friend int operator<=(const IA_Set<IA_Point<int> > &, const IA_Set<IA_Point<int> >&);
	 friend int operator>=(const IA_Set<IA_Point<int> > &, const IA_Set<IA_Point<int> >&);
	 friend int operator>(const IA_Set<IA_Point<int> > &, const IA_Set<IA_Point<int> >&);
#endif
    
d310 10
@


1.44
log
@Changed to not declare <, <=, >=, > operators for IA_Set<IA_Point<int> >
as friends.  This fixes a problem BC++ 4.02 has compiling the >= and >
operator functions.
@
text
@d11 5
d183 11
d195 2
a197 1
    
@


1.43
log
@DOS-inspired filename rework
@
text
@d11 3
d218 7
a224 5
    friend int operator<(const IA_Set<IA_Point<int> > &, const IA_Set<IA_Point<int> >&);
    friend int operator<=(const IA_Set<IA_Point<int> > &, const IA_Set<IA_Point<int> >&);
    friend int operator>=(const IA_Set<IA_Point<int> > &, const IA_Set<IA_Point<int> >&);
    friend int operator>(const IA_Set<IA_Point<int> > &, const IA_Set<IA_Point<int> >&);
    
@


1.42
log
@\Name sanitization
@
text
@d10 4
a13 1
// $Log: IntPointSet.h,v $
a261 2
    friend IA_Set<IA_Point<int> > IA_empty_ipset(unsigned dim);
    friend IA_Set<IA_Point<int> > IA_universal_ipset(unsigned dim);
d266 3
d270 1
a270 1
	return IA_universal_ipset(dim);
d273 1
a273 1
	return IA_empty_ipset(dim);
d277 6
@


1.41
log
@New pointset concatenation capability.
New intpointset decomposition capability.
@
text
@d11 4
a146 1
//typedef IA_PSIter<IA_IntPoint> IA_IPSIter;
d148 1
a148 1
class IA_Set<IA_IntPoint> {
d150 1
a150 1
    friend class IA_BasePSIter<IA_IntPoint>; // needs access to hash_table
d153 1
a153 1
    static IA_HashTable /* <IA_BasePS<IA_IntPoint>*,256> */	hash_table;
d155 2
a156 2
    IA_BasePS<IA_IntPoint>	*ps;
    void lookup_and_set(IA_BasePS<IA_IntPoint> *);
d158 2
a159 2
    IA_Set(IA_BasePS<IA_IntPoint> *ips) { this->lookup_and_set(ips); }
    IA_Set(IA_PointSetType t, unsigned dim);
d162 5
a166 5
    IA_Set(const IA_IntPoint& p);
    IA_Set(const IA_IntPoint& p0, const IA_IntPoint& p1);
    IA_Set(unsigned dimen, int(*f)(IA_IntPoint));
    IA_Set(unsigned dimen, int(*f)(const IA_IntPoint&));
    IA_Set(const IA_ClosurePS<IA_IntPoint>&);
d169 3
a171 3
    IA_Set(unsigned dimen, const IA_IntPoint *aip, unsigned len);
    IA_Set(const IA_IntPoint *aip, unsigned len);
    IA_Set(const IA_Set<IA_IntPoint>& ips) { ps = ips.ps; ps->enref(); }
d173 1
a173 1
    IA_Set<IA_IntPoint> & operator=(const IA_Set<IA_IntPoint>&);
d175 1
a175 1
    int operator==(const IA_Set<IA_IntPoint>&ips) const
d177 1
a177 1
    int operator!=(const IA_Set<IA_IntPoint>&ips) const
d179 10
a188 10
    friend IA_Set<IA_IntPoint> operator|
    (const IA_Set<IA_IntPoint>&,const IA_Set<IA_IntPoint>&);
    friend IA_Set<IA_IntPoint> operator&
    (const IA_Set<IA_IntPoint>&,const IA_Set<IA_IntPoint>&);
    friend IA_Set<IA_IntPoint> operator^
    (const IA_Set<IA_IntPoint>&,const IA_Set<IA_IntPoint>&);
    friend IA_Set<IA_IntPoint> operator/
    (const IA_Set<IA_IntPoint>&,const IA_Set<IA_IntPoint>&);
    IA_Set<IA_IntPoint> operator~() const;
    IA_Set<IA_IntPoint>& operator|=(const IA_Set<IA_IntPoint>&rhs)
d190 1
a190 1
    IA_Set<IA_IntPoint>& operator&=(const IA_Set<IA_IntPoint>&rhs)
d192 1
a192 1
    IA_Set<IA_IntPoint>& operator^=(const IA_Set<IA_IntPoint>&rhs)
d194 1
a194 1
    IA_Set<IA_IntPoint>& operator/=(const IA_Set<IA_IntPoint>&rhs)
d197 2
a198 2
    friend IA_Set<IA_IntPoint> operator+(const IA_Set<IA_IntPoint>&, const IA_IntPoint&);
    friend IA_Set<IA_IntPoint> operator+(const IA_IntPoint& ip, const IA_Set<IA_IntPoint>&ips) {
d201 1
a201 1
    IA_Set<IA_IntPoint>& operator+=(const IA_IntPoint &rhs)
d204 2
a205 2
    friend IA_Set<IA_IntPoint> operator+(const IA_Set<IA_IntPoint>&, const IA_Set<IA_IntPoint>&);
    IA_Set<IA_IntPoint>& operator+=(const IA_Set<IA_IntPoint> &rhs)
d208 1
a208 1
    friend IA::LatticeRelation compare(const IA_Set<IA_IntPoint>&, const IA_Set<IA_IntPoint>&);
d212 4
a215 4
    friend int operator<(const IA_Set<IA_IntPoint> &, const IA_Set<IA_IntPoint>&);
    friend int operator<=(const IA_Set<IA_IntPoint> &, const IA_Set<IA_IntPoint>&);
    friend int operator>=(const IA_Set<IA_IntPoint> &, const IA_Set<IA_IntPoint>&);
    friend int operator>(const IA_Set<IA_IntPoint> &, const IA_Set<IA_IntPoint>&);
d218 1
a218 1
    IA_PointSetType type() const { return ps->type(); }
d221 9
a229 9
    int contains(const IA_IntPoint &ip) const { return ps->contains(ip); }
    unsigned index(const IA_IntPoint &ip) const { return ps->index(ip); }
    IA_IntPoint index(unsigned idx) const { return ps->index(idx); }
    
    IA_IntPoint min() const { return ps->min(); }
    IA_IntPoint max() const { return ps->max(); }
    IA_IntPoint inf() const { return ps->inf(); }
    IA_IntPoint sup() const { return ps->sup(); }
    IA_IntPoint choice() const { return ps->choice(); }
d243 2
a244 2
    friend IA_Set<IA_IntPoint> intersect_with_structure
    (const IA_Set<IA_IntPoint> &lhs, const IA_Set<IA_IntPoint> &rhs,
d248 2
a249 2
    friend IA_Set<IA_IntPoint> intersect_with_dualstruct
    (const IA_Set<IA_IntPoint> &lhs, const IA_Set<IA_IntPoint> &rhs, IA_SetStructure *s_struct);
d252 2
a253 2
    friend IA_Set<IA_IntPoint> union_with_structure
    (const IA_Set<IA_IntPoint> &lhs, const IA_Set<IA_IntPoint> &rhs, IA_SetStructure *s_struct);
d255 2
a256 2
    // he has to know how to get at the underlying IA_BasePS<IA_IntPoint>*
    friend class IA_PSIter<IA_IntPoint>;
d259 3
a261 3
    friend IA_Set<IA_IntPoint> IA_empty_ipset(unsigned dim);
    friend IA_Set<IA_IntPoint> IA_universal_ipset(unsigned dim);
    friend IA_Set<IA_IntPoint> IA_boxy_pset(IA_Point<int>, IA_Point<int>);
d265 1
a265 1
    static IA_Set<IA_IntPoint> WhiteHole(unsigned dim) {
d268 1
a268 1
    static IA_Set<IA_IntPoint> BlackHole(unsigned dim) {
a272 1
typedef IA_Set<IA_IntPoint> IA_IntPointSet;
d274 1
a274 1
inline IA_Set<IA_IntPoint> IA_WhiteHole(unsigned dim) {
d277 1
a277 1
inline IA_Set<IA_IntPoint> IA_BlackHole(unsigned dim) {
d281 1
a281 1
void SortIntPointArray(IA_IntPoint *aip, unsigned len);
d283 1
a283 1
IA_Set<IA_IntPoint> transpose(const IA_Set<IA_IntPoint> &);
@


1.40
log
@New array constructor that doesn't require dimension.
White and Black Hole have been renamed to universal and empty _pset
@
text
@d11 4
d134 1
a134 1
#include "SetStructure.h"
d139 1
d148 1
d259 2
@


1.39
log
@BasePSIter<IA_IntPoint> needs access to the hash table.
@
text
@d11 3
d161 1
d250 3
a252 2
    friend IA_Set<IA_IntPoint> IA_BlackHole(unsigned dim);
    friend IA_Set<IA_IntPoint> IA_WhiteHole(unsigned dim);
d255 1
a255 1
	return IA_WhiteHole(dim);
d258 1
a258 1
	return IA_BlackHole(dim);
d263 7
@


1.38
log
@Added static member functions to construct white and black holes.
We can now transpose boxy 2D pointsets.
@
text
@d11 4
d138 2
@


1.37
log
@extensivep() is now extensive()
IPSIter is now PSIter<IntPoint> but bug in cfront 3.0.2 prevents typedef
@
text
@d11 4
d242 7
d254 2
@


1.36
log
@New naming scheme.  Closures are named Closure.
@
text
@d11 3
d127 2
d211 1
a211 1
    int extensivep() const { return ps->extensivep(); }
@


1.35
log
@Pointset behavior controls have moved to IA::
@
text
@d10 4
a13 1
// $Log:	IntPointSet.h,v $
d121 1
a121 1
template <class P> struct IA_PSPred;
d139 1
a139 1
    IA_Set(const IA_PSPred<IA_IntPoint>&);
@


1.34
log
@Parametrization of the pointsets on the point type using
template specialization.
@
text
@d11 4
d213 2
a214 1
    (const IA_Set<IA_IntPoint> &lhs, const IA_Set<IA_IntPoint> &rhs, IA_SetStructure *s_struct);
a226 7
    // If this variable is non-zero, then an index() operation on an
    // uncontained point will throw.  It is non-zero by default.
    static char throw_on_index_uncontained;
    // If the argument to an index() operation is not contained in
    // in the point set, the return value (if any) will be this:
    static const unsigned index_of_uncontained;
    // CFront is totally braindead about static const member variables.
@


1.33
log
@Copyright Notices
@
text
@d11 3
d103 4
d115 1
d117 1
a117 1
class IA_IntPointSet {
d124 2
a125 2
    IA_IntPointSet(IA_BasePS<IA_IntPoint> *ips) { this->lookup_and_set(ips); }
    IA_IntPointSet(IA_PointSetType t, unsigned dim);
d127 12
a138 12
    IA_IntPointSet();
    IA_IntPointSet(const IA_IntPoint& p);
    IA_IntPointSet(const IA_IntPoint& p0, const IA_IntPoint& p1);
    IA_IntPointSet(unsigned dimen, int(*f)(IA_IntPoint));
    IA_IntPointSet(unsigned dimen, int(*f)(const IA_IntPoint&));
    IA_IntPointSet(const IA_PSPred<IA_IntPoint>&);
    IA_IntPointSet(const IA_BoxyIPS&);
    IA_IntPointSet(const IA_YoderIPS&);
    IA_IntPointSet(unsigned dimen, const IA_IntPoint *aip, unsigned len);
    IA_IntPointSet(const IA_IntPointSet& ips) { ps = ips.ps; ps->enref(); }
    ~IA_IntPointSet();
    IA_IntPointSet & operator=(const IA_IntPointSet&);
d140 1
a140 1
    int operator==(const IA_IntPointSet&ips) const
d142 1
a142 1
    int operator!=(const IA_IntPointSet&ips) const
d144 10
a153 10
    friend IA_IntPointSet operator|
    (const IA_IntPointSet&,const IA_IntPointSet&);
    friend IA_IntPointSet operator&
    (const IA_IntPointSet&,const IA_IntPointSet&);
    friend IA_IntPointSet operator^
    (const IA_IntPointSet&,const IA_IntPointSet&);
    friend IA_IntPointSet operator/
    (const IA_IntPointSet&,const IA_IntPointSet&);
    IA_IntPointSet operator~() const;
    IA_IntPointSet& operator|=(const IA_IntPointSet&rhs)
d155 1
a155 1
    IA_IntPointSet& operator&=(const IA_IntPointSet&rhs)
d157 1
a157 1
    IA_IntPointSet& operator^=(const IA_IntPointSet&rhs)
d159 1
a159 1
    IA_IntPointSet& operator/=(const IA_IntPointSet&rhs)
d162 2
a163 2
    friend IA_IntPointSet operator+(const IA_IntPointSet&, const IA_IntPoint&);
    friend IA_IntPointSet operator+(const IA_IntPoint& ip, const IA_IntPointSet&ips) {
d166 1
a166 1
    IA_IntPointSet& operator+=(const IA_IntPoint &rhs)
d169 2
a170 2
    friend IA_IntPointSet operator+(const IA_IntPointSet&, const IA_IntPointSet&);
    IA_IntPointSet& operator+=(const IA_IntPointSet &rhs)
d173 1
a173 1
    friend IA::LatticeRelation compare(const IA_IntPointSet&, const IA_IntPointSet&);
d177 4
a180 4
    friend int operator<(const IA_IntPointSet &, const IA_IntPointSet&);
    friend int operator<=(const IA_IntPointSet &, const IA_IntPointSet&);
    friend int operator>=(const IA_IntPointSet &, const IA_IntPointSet&);
    friend int operator>(const IA_IntPointSet &, const IA_IntPointSet&);
d208 2
a209 2
    friend IA_IntPointSet intersect_with_structure
    (const IA_IntPointSet &lhs, const IA_IntPointSet &rhs, IA_SetStructure *s_struct);
d212 2
a213 2
    friend IA_IntPointSet intersect_with_dualstruct
    (const IA_IntPointSet &lhs, const IA_IntPointSet &rhs, IA_SetStructure *s_struct);
d216 2
a217 2
    friend IA_IntPointSet union_with_structure
    (const IA_IntPointSet &lhs, const IA_IntPointSet &rhs, IA_SetStructure *s_struct);
d220 1
a220 1
    friend class IA_IPSIter;
d230 2
a231 2
    friend IA_IntPointSet IA_BlackHole(unsigned dim);
    friend IA_IntPointSet IA_WhiteHole(unsigned dim);
d234 1
@


1.32
log
@LatticeRelation is now in IA::
@
text
@d3 6
d11 3
@


1.31
log
@Convert BaseIPS to IA_BasePS<IA_IntPoint>
@
text
@d5 3
d156 1
a156 4
    enum LatticeRelation {
	P_SUBSET, MP_SUBSET, EQUAL, MP_SUPERSET, P_SUPERSET, NO_REL, UNKNOWN,
	};
    friend LatticeRelation compare(const IA_IntPointSet&, const IA_IntPointSet&);
@


1.30
log
@Use IA_IntPoint instead of IntPoint
@
text
@d5 3
d89 1
a89 1
#include "BaseIPS.h"
d99 1
a99 1
    static IA_HashTable /* <BaseIPS*,256> */	hash_table;
d101 2
a102 2
    BaseIPS	*ps;
    void lookup_and_set(BaseIPS *);
d104 1
a104 1
    IA_IntPointSet(BaseIPS *ips) { this->lookup_and_set(ips); }
d202 1
a202 1
    // he has to know how to get at the underlying BaseIPS*
@


1.29
log
@Added some comments on the op_with_structure operations.
@
text
@d5 3
d105 5
a109 5
    IA_IntPointSet(const IntPoint& p);
    IA_IntPointSet(const IntPoint& p0, const IntPoint& p1);
    IA_IntPointSet(unsigned dimen, int(*f)(IntPoint));
    IA_IntPointSet(unsigned dimen, int(*f)(const IntPoint&));
    IA_IntPointSet(const IA_PSPred<IntPoint>&);
d112 1
a112 1
    IA_IntPointSet(unsigned dimen, const IntPoint *aip, unsigned len);
d139 2
a140 2
    friend IA_IntPointSet operator+(const IA_IntPointSet&, const IntPoint&);
    friend IA_IntPointSet operator+(const IntPoint& ip, const IA_IntPointSet&ips) {
d143 1
a143 1
    IA_IntPointSet& operator+=(const IntPoint &rhs)
d166 3
a168 3
    int contains(const IntPoint &ip) const { return ps->contains(ip); }
    unsigned index(const IntPoint &ip) const { return ps->index(ip); }
    IntPoint index(unsigned idx) const { return ps->index(idx); }
d170 5
a174 5
    IntPoint min() const { return ps->min(); }
    IntPoint max() const { return ps->max(); }
    IntPoint inf() const { return ps->inf(); }
    IntPoint sup() const { return ps->sup(); }
    IntPoint choice() const { return ps->choice(); }
d215 1
a215 1
void SortIntPointArray(IntPoint *aip, unsigned len);
@


1.28
log
@more IA_ prefixes.
more comments.
@
text
@d5 4
d183 2
d187 2
d191 2
@


1.27
log
@new PredicatePS class to allow for families of comprehensive pointsets.
@
text
@d5 3
d88 111
a198 108
private:
  static IA_HashTable /* <BaseIPS*,256> */	hash_table;
  
  BaseIPS	*ps;
  void lookup_and_set(BaseIPS *);
  void disassociate_ps();
  IA_IntPointSet(BaseIPS *ips) { this->lookup_and_set(ips); }
public:
  IA_IntPointSet();
  IA_IntPointSet(PointSetType t, unsigned dim);
  IA_IntPointSet(const IntPoint& p);
  IA_IntPointSet(const IntPoint& p0, const IntPoint& p1);
  IA_IntPointSet(unsigned dimen, int(*f)(IntPoint));
  IA_IntPointSet(unsigned dimen, int(*f)(const IntPoint&));
  IA_IntPointSet(const IA_PSPred<IntPoint>&);
  IA_IntPointSet(const IA_BoxyIPS&);
  IA_IntPointSet(const IA_YoderIPS&);
  IA_IntPointSet(unsigned dimen, const IntPoint *aip, unsigned len);
  IA_IntPointSet(const IA_IntPointSet& ips) { ps = ips.ps; ps->enref(); }
  ~IA_IntPointSet();
  IA_IntPointSet & operator=(const IA_IntPointSet&);
  
  int operator==(const IA_IntPointSet&ips) const
  { return this->ps == ips.ps; }
  int operator!=(const IA_IntPointSet&ips) const
  { return this->ps != ips.ps; }
  friend IA_IntPointSet operator|
  (const IA_IntPointSet&,const IA_IntPointSet&);
  friend IA_IntPointSet operator&
  (const IA_IntPointSet&,const IA_IntPointSet&);
  friend IA_IntPointSet operator^
  (const IA_IntPointSet&,const IA_IntPointSet&);
  friend IA_IntPointSet operator/
  (const IA_IntPointSet&,const IA_IntPointSet&);
  IA_IntPointSet operator~() const;
  IA_IntPointSet& operator|=(const IA_IntPointSet&rhs)
  { return (*this = *this | rhs); }
  IA_IntPointSet& operator&=(const IA_IntPointSet&rhs)
  { return (*this = *this & rhs); }
  IA_IntPointSet& operator^=(const IA_IntPointSet&rhs)
  { return (*this = *this ^ rhs); }
  IA_IntPointSet& operator/=(const IA_IntPointSet&rhs)
  { return (*this = *this / rhs); }
  
  friend IA_IntPointSet operator+(const IA_IntPointSet&, const IntPoint&);
  friend IA_IntPointSet operator+(const IntPoint& ip, const IA_IntPointSet&ips) {
      return ips+ip;	// commutative
  }
  IA_IntPointSet& operator+=(const IntPoint &rhs)
  { return (*this = *this + rhs); }
  // Minkowski addition
  friend IA_IntPointSet operator+(const IA_IntPointSet&, const IA_IntPointSet&);
  IA_IntPointSet& operator+=(const IA_IntPointSet &rhs)
  { return (*this = *this + rhs); }
  
  enum LatticeRelation {
      P_SUBSET, MP_SUBSET, EQUAL, MP_SUPERSET, P_SUPERSET, NO_REL, UNKNOWN,
      };
  friend LatticeRelation compare(const IA_IntPointSet&, const IA_IntPointSet&);
  
  // in some cases, these operations can not tell definitively.
  // In such cases, they return false (0).
  friend int operator<(const IA_IntPointSet &, const IA_IntPointSet&);
  friend int operator<=(const IA_IntPointSet &, const IA_IntPointSet&);
  friend int operator>=(const IA_IntPointSet &, const IA_IntPointSet&);
  friend int operator>(const IA_IntPointSet &, const IA_IntPointSet&);
  
  
  PointSetType type() const { return ps->type(); }
  unsigned dim() const { return ps->dim(); }
  
  int contains(const IntPoint &ip) const { return ps->contains(ip); }
  unsigned index(const IntPoint &ip) const { return ps->index(ip); }
  IntPoint index(unsigned idx) const { return ps->index(idx); }
  
  IntPoint min() const { return ps->min(); }
  IntPoint max() const { return ps->max(); }
  IntPoint inf() const { return ps->inf(); }
  IntPoint sup() const { return ps->sup(); }
  IntPoint choice() const { return ps->choice(); }
  
  unsigned card() const { return ps->card(); }
  int empty() const { return ps->empty(); }
  int boxy() const;
  int extensivep() const { return ps->extensivep(); }
  
  void output(ostream &o, unsigned indent=0) const { ps->output(o,indent); }
  
  int hash_self(int modulus) const { return ps->hash_self(modulus); }
  
  
  friend IA_IntPointSet intersect_with_structure
  (const IA_IntPointSet &lhs, const IA_IntPointSet &rhs, IA_SetStructure *s_struct);
  friend IA_IntPointSet intersect_with_dualstruct
  (const IA_IntPointSet &lhs, const IA_IntPointSet &rhs, IA_SetStructure *s_struct);
  friend IA_IntPointSet union_with_structure
  (const IA_IntPointSet &lhs, const IA_IntPointSet &rhs, IA_SetStructure *s_struct);
  
  // he has to know how to get at the underlying BaseIPS*
  friend class IA_IPSIter;
  
  // If this variable is non-zero, then an index() operation on an
  // uncontained point will throw.  It is non-zero by default.
  static char throw_on_index_uncontained;
  // If the argument to an index() operation is not contained in
  // in the point set, the return value (if any) will be this:
  static const unsigned index_of_uncontained;
  // CFront is totally braindead about static const member variables.
a200 2
IA_IntPointSet BlackHole(unsigned dim);
IA_IntPointSet WhiteHole(unsigned dim);
@


1.26
log
@conversion to IA_ mostly complete
@
text
@d5 3
d82 1
d99 1
@


1.25
log
@added boxy predicate method.
@
text
@d5 3
d76 3
a78 3
class YoderIPS;
class BoxyIPS;
class HashTable;
d80 1
a80 1
class IntPointSet {
d82 6
a87 6
    static HashTable /* <BaseIPS*,256> */	hash_table;
    
    BaseIPS	*ps;
    void lookup_and_set(BaseIPS *);
    void disassociate_ps();
    IntPointSet(BaseIPS *ips) { this->lookup_and_set(ips); }
d89 99
a187 93
    IntPointSet();
    IntPointSet(PointSetType t, unsigned dim);
    IntPointSet(const IntPoint& p);
    IntPointSet(const IntPoint& p0, const IntPoint& p1);
    IntPointSet(unsigned dimen, int(*f)(IntPoint));
    IntPointSet(unsigned dimen, int(*f)(const IntPoint&));
    IntPointSet(const BoxyIPS&);
    IntPointSet(const YoderIPS&);
    IntPointSet(unsigned dimen, const IntPoint *aip, unsigned len);
    IntPointSet(const IntPointSet& ips) { ps = ips.ps; ps->enref(); }
    ~IntPointSet();
    IntPointSet & operator=(const IntPointSet&);

    int operator==(const IntPointSet&ips) const { return this->ps == ips.ps; }
    int operator!=(const IntPointSet&ips) const { return this->ps != ips.ps; }
    friend IntPointSet operator|(const IntPointSet&,const IntPointSet&);
    friend IntPointSet operator&(const IntPointSet&,const IntPointSet&);
    friend IntPointSet operator^(const IntPointSet&,const IntPointSet&);
    friend IntPointSet operator/(const IntPointSet&,const IntPointSet&);
    IntPointSet operator~() const;
    IntPointSet& operator|=(const IntPointSet&rhs)
	{ return (*this = *this | rhs); }
    IntPointSet& operator&=(const IntPointSet&rhs)
	{ return (*this = *this & rhs); }
    IntPointSet& operator^=(const IntPointSet&rhs)
	{ return (*this = *this ^ rhs); }
    IntPointSet& operator/=(const IntPointSet&rhs)
	{ return (*this = *this / rhs); }

    friend IntPointSet operator+(const IntPointSet&, const IntPoint&);
    friend IntPointSet operator+(const IntPoint& ip, const IntPointSet&ips) {
	return ips+ip;	// commutative
    }
    IntPointSet& operator+=(const IntPoint &rhs)
	{ return (*this = *this + rhs); }
    // Minkowski addition
    friend IntPointSet operator+(const IntPointSet&, const IntPointSet&);
    IntPointSet& operator+=(const IntPointSet &rhs)
	{ return (*this = *this + rhs); }

    enum LatticeRelation {
	P_SUBSET, MP_SUBSET, EQUAL, MP_SUPERSET, P_SUPERSET, NO_REL, UNKNOWN,
    };
    friend LatticeRelation compare(const IntPointSet&, const IntPointSet&);

    // in some cases, these operations can not tell definitively.
    // In such cases, they return false (0).
    friend int operator<(const IntPointSet &, const IntPointSet&);
    friend int operator<=(const IntPointSet &, const IntPointSet&);
    friend int operator>=(const IntPointSet &, const IntPointSet&);
    friend int operator>(const IntPointSet &, const IntPointSet&);


    PointSetType type() const { return ps->type(); }
    unsigned dim() const { return ps->dim(); }

    int contains(const IntPoint &ip) const { return ps->contains(ip); }
    unsigned index(const IntPoint &ip) const { return ps->index(ip); }
    IntPoint index(unsigned idx) const { return ps->index(idx); }

    IntPoint min() const { return ps->min(); }
    IntPoint max() const { return ps->max(); }
    IntPoint inf() const { return ps->inf(); }
    IntPoint sup() const { return ps->sup(); }
    IntPoint choice() const { return ps->choice(); }

    unsigned card() const { return ps->card(); }
    int empty() const { return ps->empty(); }
    int boxy() const;
    int extensivep() const { return ps->extensivep(); }

    void output(ostream &o, unsigned indent=0) const { ps->output(o,indent); }

    int hash_self(int modulus) const { return ps->hash_self(modulus); }


    friend IntPointSet intersect_with_structure
     (const IntPointSet &lhs, const IntPointSet &rhs, SetStructure *s_struct);
    friend IntPointSet intersect_with_dualstruct
     (const IntPointSet &lhs, const IntPointSet &rhs, SetStructure *s_struct);
    friend IntPointSet union_with_structure
     (const IntPointSet &lhs, const IntPointSet &rhs, SetStructure *s_struct);

    // he has to know how to get at the underlying BaseIPS*
    friend class IPSIter;

    // If this variable is non-zero, then an index() operation on an
    // uncontained point will throw.  It is non-zero by default.
    static char throw_on_index_uncontained;
    // If the argument to an index() operation is not contained in
    // in the point set, the return value (if any) will be this:
    static const unsigned index_of_uncontained;
    // CFront is totally braindead about static const member variables.
d190 2
a191 2
IntPointSet BlackHole(unsigned dim);
IntPointSet WhiteHole(unsigned dim);
@


1.24
log
@new IntPoint index(unsigned) operation for use with "other" iterators.
@
text
@d5 3
d154 1
a154 1

@


1.23
log
@added another restriction utility.
@
text
@d5 3
d141 1
@


1.22
log
@New union_with_structure function for image extension.
@
text
@d5 3
d156 2
@


1.21
log
@changed argument passing on set restriction routines.
@
text
@d5 3
d153 2
@


1.20
log
@pointset restriction utilities.
@
text
@d5 3
d149 2
a150 2
    friend SetStructure intersect_with_structure
     (const IntPointSet &lhs, const IntPointSet &rhs, IntPointSet *result);
@


1.19
log
@trim gratuitous includes from public headers.
@
text
@d5 3
d56 1
a57 1

d144 4
@


1.18
log
@reference counts are protected from IntPointSet, unfortunately.
infimum & supremum virtuals now inf & sup.
contains now accepts const Point<>&.
WhiteHole is now a family of pointsets.
White and Black holes are now semi-public classes, unfortunately.
@
text
@d5 7
a51 1
#include "HashTable.h"
a52 1
// #include "BoxyIPS.h"
d57 1
@


1.17
log
@fixed spelling error.
Minkowski addition of point sets now supported.
@
text
@d5 4
d47 1
a47 1
#include "BoxyIPS.h"
d51 1
d67 1
d71 1
a71 1
    IntPointSet(const IntPointSet& ips) { ps = ips.ps; ps->refcount++; }
d118 1
a118 1
    int contains(const IntPoint& ip) const { return ps->contains(ip); }
d123 2
a124 2
    IntPoint infimum() const { return ps->infimum(); }
    IntPoint supremum() const { return ps->supremum(); }
d148 2
a149 3
extern IntPointSet WhiteHole;

inline IntPointSet BlackHole(int dim) { return IntPointSet(BLACK, dim); }
@


1.16
log
@fixed spelling error.
Minkowski addition of point sets now supported.
@
text
@@


1.15
log
@new infemum and supremum methods for point sets.
@
text
@d5 3
d91 4
d117 1
a117 1
    IntPoint infemum() const { return ps->infemum(); }
@


1.14
log
@dimension is now a parameter to the IntPoint array constructor.
constructor for predicate IPS
@
text
@d5 4
d110 2
@


1.13
log
@|&^/ operators are now friends.
@
text
@d5 3
d54 1
d57 1
a57 1
    IntPointSet(const IntPoint *aip, unsigned len);
d115 1
a115 1
    int hash_self(int modulus) { return ps->hash_self(modulus); }
a118 2
    friend class LazyBinaryIPS;
    friend class LazyUnaryIPS;
@


1.12
log
@some lazies need to know the guts of IntPointSets
@
text
@d5 3
d60 4
a63 4
    IntPointSet operator|(const IntPointSet&) const;
    IntPointSet operator&(const IntPointSet&) const;
    IntPointSet operator^(const IntPointSet&) const;
    IntPointSet operator/(const IntPointSet&) const;
d75 3
@


1.11
log
@eliminated dummy parameter to constructor (was workaround for g++).
@
text
@d5 3
d109 2
@


1.10
log
@new converter from IntPoint to IntPointSet.
set difference is operator/, not -
op= for binary set operations now available.
operator+ is set translation, using the offsetted() function of BaseIPS
lattice operations on sets defined in terms of compare() friend
@
text
@d5 7
d42 1
a42 1
    IntPointSet(PointSetType t, int dummy, unsigned dim);
d118 1
a118 1
inline IntPointSet BlackHole(int dim) { return IntPointSet(BLACK, 'b', dim); }
@


1.9
log
@CFrontified version
@
text
@d5 2
d8 1
d36 1
d50 1
a50 1
    IntPointSet operator-(const IntPointSet&) const;
d52 25
a76 1
    IntPointSet& operator|=(const IntPointSet&rhs) { return (*this = *this | rhs); }
@


1.8
log
@Reference counting is now the responsibility of IntPointSet
New constructor to make IntPointSets from arrays of Points
More boolean operations between IntPointSets, intersection,
symmetric+asymmetric difference.
@
text
@a4 2
// Revision 1.7  92/08/14  15:45:01  thoth
// Added an index(IntPoint) function to the IntPointSet
a5 22
// Revision 1.6  92/08/05  14:32:07  jnw
// Made extensivep const.
// 
// Revision 1.5  92/07/30  16:39:11  jnw
// Added intersection member function and constructor from YoderIPS
// 
// Revision 1.4  92/07/26  16:46:03  thoth
// forgot to return a value from op |=
// 
// Revision 1.3  92/07/26  16:30:35  thoth
// switched the union operation to overload the bitwise operator.
// added the corresponding op=
// 
// Revision 1.2  92/07/21  11:28:08  thoth
// Support for Yoders, BlackHoles, WhiteHoles.
// using the hash table now.
// Union operation.
// 
// Revision 1.1  92/07/16  11:54:45  thoth
// Initial revision
// 
// 
d10 1
d12 1
d77 2
a78 1
    static const unsigned index_of_uncontained = ~0;
d83 1
a83 1
IntPointSet BlackHole(int dim) { return IntPointSet(BLACK, 'b', dim); }
@


1.7
log
@Added an index(IntPoint) function to the IntPointSet
@
text
@d5 3
d50 1
d58 2
a59 1
    IntPointSet(const IntPointSet& ips) { hash_table.reference(ips.ps, &ps); }
d67 3
d87 2
d105 2
@


1.6
log
@Made extensivep const.
@
text
@d5 3
d68 1
d83 7
@


1.5
log
@Added intersection member function and constructor from YoderIPS
@
text
@d5 3
d73 1
a73 1
    int extensivep() { return ps->extensivep(); }
@


1.4
log
@forgot to return a value from op |=
@
text
@d5 3
d32 3
d47 1
d55 1
@


1.3
log
@switched the union operation to overload the bitwise operator.
added the corresponding op=
@
text
@d5 4
d48 1
a48 1
    IntPointSet operator|=(const IntPointSet&rhs) { *this = *this | rhs; }
@


1.2
log
@Support for Yoders, BlackHoles, WhiteHoles.
using the hash table now.
Union operation.
@
text
@d5 5
d43 2
a44 1
    IntPointSet operator||(const IntPointSet&) const;
@


1.1
log
@Initial revision
@
text
@d4 3
a6 1
// $Log$
d8 1
d18 1
d25 2
d28 2
a29 2
    enum SpecialTypes { BLACK, WHITE}; // used for special IntPointSets
    IntPointSet(SpecialTypes t, unsigned dim=0);
d31 1
d34 1
d36 4
d54 2
d60 3
a62 1
extern IntPointSet WhiteHole, BlackHole;
@
