Skip to content

Commit

Permalink
Remove unused polynomial-related code
Browse files Browse the repository at this point in the history
This removes some blocks of code which is no longer used.
Much of this pertains to support for Grobner bases - which have not been
used to attempt to solve polynomial systems for more than
20 years now.
  • Loading branch information
tturocy committed Dec 12, 2024
1 parent 3ad9327 commit 9cfe468
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 1,714 deletions.
6 changes: 0 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,6 @@ gambit_enumpoly_SOURCES = \
src/solvers/enumpoly/gpolylst.cc \
src/solvers/enumpoly/gpolylst.h \
src/solvers/enumpoly/gpolylst.imp \
src/solvers/enumpoly/gsolver.cc \
src/solvers/enumpoly/gsolver.h \
src/solvers/enumpoly/gsolver.imp \
src/solvers/enumpoly/ideal.cc \
src/solvers/enumpoly/ideal.h \
src/solvers/enumpoly/ideal.imp \
src/solvers/enumpoly/ineqsolv.cc \
src/solvers/enumpoly/ineqsolv.h \
src/solvers/enumpoly/ineqsolv.imp \
Expand Down
51 changes: 10 additions & 41 deletions src/solvers/enumpoly/gpolylst.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,14 @@
#include "gpoly.h"

template <class T> class gPolyList {
using index_pair = std::pair<int, int>;

private:
const gSpace *Space;
const term_order *Order;
Gambit::List<gPoly<T> *> List;

// SubProcedures of ToSortedReducedGrobner
void Sort(const term_order &);
void CriterionTwo(Gambit::List<index_pair> &, const Gambit::List<index_pair> &, 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 *sp, const term_order *to) : Space(sp), Order(to) {}

gPolyList(const gSpace *, const term_order *, const Gambit::List<gPoly<T> *> &);
gPolyList(const gSpace *, const term_order *, const Gambit::List<gPoly<T>> &);
gPolyList(const gPolyList<T> &);
Expand All @@ -56,49 +46,28 @@ template <class T> class gPolyList {
gPolyList<T> &operator=(const gPolyList<T> &);

bool operator==(const gPolyList<T> &) const;
bool operator!=(const gPolyList<T> &) const;
bool operator!=(const gPolyList<T> &x) const { return !(*this == x); }
void operator+=(const gPoly<T> &);
void operator+=(const gPolyList<T> &);

void operator+=(gPoly<T> *); // 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<T> operator[](const int) const;
// Takes ownership of pointer
void operator+=(gPoly<T> *poly) { List.push_back(poly); }

// Residue of repeated reduction by members of the list
gPoly<T> ReductionOf(const gPoly<T> &, const term_order &) const;
bool SelfReduction(const int &, const term_order &);

// Transform to canonical basis for associated ideal
gPolyList<T> &ToSortedReducedGrobner(const term_order &);
const gPoly<T> &operator[](const int index) const { return *(List[index]); }

// New Coordinate Systems
gPolyList<T> TranslateOfSystem(const Gambit::Vector<T> &) const;
gPolyList<T> SystemInNewCoordinates(const Gambit::SquareMatrix<T> &) const;

// Truncations
gPolyList<T> InteriorSegment(int, int) const;

// Information
const gSpace *AmbientSpace() const;
const term_order *TermOrder() const;
int Length() const;
int Dmnsn() const;
const gSpace *AmbientSpace() const { return Space; }
const term_order *TermOrder() const { return Order; }
int Length() const { return List.size(); }
int Dmnsn() const { return Space->Dmnsn(); }
bool IsMultiaffine() const;
Gambit::List<gPoly<T>> UnderlyingList() const;
Gambit::Vector<T> Evaluate(const Gambit::Vector<T> &) const;
bool IsRoot(const Gambit::Vector<T> &) const;
Gambit::RectArray<gPoly<T> *> DerivativeMatrix() const;
gPoly<T> DetOfDerivativeMatrix() const;
Gambit::Matrix<T> DerivativeMatrix(const Gambit::Vector<T> &) const;
Gambit::SquareMatrix<T> SquareDerivativeMatrix(const Gambit::Vector<T> &) const;

// inline int static Count() { return Counted<gPolyList<T> >::objCount(); }

// Conversion
Gambit::List<gPoly<double>> ListTogDouble() const;
Gambit::List<gPoly<double>> NormalizedList() const;
};

Expand Down
Loading

0 comments on commit 9cfe468

Please sign in to comment.