// // $Source: /cvsroot/gambit/gambit/sources/tools/enumpoly/gpolylst.h,v $ // $Date: 2006/08/17 03:05:00 $ // $Revision: 1.8 $ // // DESCRIPTION: // Declaration of polynomial list type // // 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 GPOLYLST_H #define GPOLYLST_H #include "odometer.h" #include #include "gpoly.h" //! //! Simple class for compact reference to pairs of indices //! class index_pair { private: const int m_first, m_second; public: index_pair(int p_first, int p_second) : m_first(p_first), m_second(p_second) { } bool operator==(const index_pair &p_other) const { return (m_first == p_other.m_first && m_second == p_other.m_second); } bool operator!=(const index_pair &p_other) const { return (m_first != p_other.m_first || m_second != p_other.m_second); } int operator[](int p_index) const { return (p_index == 1) ? m_first : m_second; } }; // *********************** // class gPolyList // *********************** template class gPolyList // : private Counted > { private: const gSpace* Space; const term_order* Order; Gambit::List< gPoly *> List; // SubProcedures of ToSortedReducedGrobner void Sort(const term_order &); void CriterionTwo( Gambit::List&, const Gambit::List&, const int&, const term_order&) const; // See Adams and Loustaunau, p. 130 void Grobnerize(const term_order &); void GrobnerToMinimalGrobner(const term_order &); void MinimalGrobnerToReducedGrobner(const term_order &); public: gPolyList(const gSpace *, const term_order*); gPolyList(const gSpace *, const term_order*, const Gambit::List< gPoly *> &); gPolyList(const gSpace *, const term_order*, const Gambit::List< gPoly > &); gPolyList(const gPolyList &); ~gPolyList(); // Deletes all pointees // Operators gPolyList& operator= (const gPolyList &); bool operator==(const gPolyList &) const; bool operator!=(const gPolyList &) const; void operator+=(const gPoly &); void operator+=(const gPolyList &); void operator+=( gPoly *); // NB - Doesn't copy pointee // This can save a copy when one must create a // polynomial, then do something in order to // decide whether it should be added to the List gPoly operator[](const int) const; // Residue of repeated reduction by members of the list gPoly ReductionOf(const gPoly &, const term_order &) const; bool SelfReduction(const int &, const term_order &); // Transform to canonical basis for associated ideal gPolyList& ToSortedReducedGrobner(const term_order &); // New Coordinate Systems gPolyList TranslateOfSystem(const Gambit::Vector&) const; gPolyList SystemInNewCoordinates(const Gambit::SquareMatrix&) const; // Truncations gPolyList InteriorSegment(int, int) const; // Information const gSpace* AmbientSpace() const; const term_order* TermOrder() const; const int Length() const; const int Dmnsn() const; const bool IsMultiaffine() const; Gambit::List > UnderlyingList() const; const Gambit::Vector Evaluate(const Gambit::Vector&) const; const bool IsRoot(const Gambit::Vector&) const; const Gambit::RectArray*> DerivativeMatrix() const; const gPoly DetOfDerivativeMatrix() const; const Gambit::Matrix DerivativeMatrix(const Gambit::Vector&) const; const Gambit::SquareMatrix SquareDerivativeMatrix(const Gambit::Vector&) const; // inline int static Count() { return Counted >::objCount(); } // Conversion Gambit::List > ListTogDouble() const; Gambit::List > NormalizedList() const; }; #endif // GPOLYLST_H