// // $Source: /cvsroot/gambit/gambit/sources/tools/enumpoly/rectangl.h,v $ // $Date: 2006/08/17 03:05:01 $ // $Revision: 1.6 $ // // DESCRIPTION: // Declaration of rectangle class // // This file is part of Gambit // Copyright (c) 2002, The Gambit Project // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // #ifndef RECTANGL_H #define RECTANGL_H #include "interval.h" #include "libgambit/vector.h" /* This file provides the template class gRectangle which models the concept of a nonempty compact interval. Since boundary points can be identified, open and half open (bounded) intervals can be effected, but less directly. */ template class gRectangle { private: Gambit::List > sides; public: // constructors gRectangle(const gRectangle&); gRectangle(const Gambit::List >&); gRectangle(const Gambit::Vector, const Gambit::Vector); ~gRectangle(); // operators gRectangle& operator = (const gRectangle& y); bool operator == (const gRectangle& y) const; bool operator != (const gRectangle& y) const; // information const int Dmnsn() const; Gambit::Vector LowerBound() const; Gambit::Vector UpperBound() const; const T LowerBoundOfCoord(const int&) const; const T UpperBoundOfCoord(const int&) const; const T HeightInCoord(const int&) const; const gInterval CartesianFactor(const int&) const; const gRectangle SameCenterDoubleSideLengths() const; const gRectangle CubeContainingCrcmscrbngSphere() const; const gRectangle Orthant(const Gambit::Array&) const; const Gambit::Vector SideLengths() const; const T MaximalSideLength() const; bool Contains(const Gambit::Vector &) const; bool Contains(const gRectangle &) const; const T Volume() const; const Gambit::Vector Center() const; const gRectangle BoundingRectangle() const; const Gambit::List > VertexList() const; const int NumberOfCellsInSubdivision() const; const gRectangle SubdivisionCell(const int&) const; const T DiameterSquared() const; }; //------------- // Conversion: //------------- template gRectangle TogDouble(const gRectangle&); #endif // RECTANGL_H