Loading...
Searching...
No Matches
groebnerCone.h
Go to the documentation of this file.
#ifndef CALLGFANLIB_GROEBNERCONE_H
#define CALLGFANLIB_GROEBNERCONE_H
#include "kernel/polys.h"
#include "Singular/ipid.h"
#include "polys/monomials/ring.h"
#include "polys/simpleideals.h"
#include "kernel/ideals.h"
#include "gfanlib/gfanlib.h"
#include "tropicalStrategy.h"
/** \file
* implementation of the class groebnerCone
*
* groebnerCone is a class that encapsulates relevant (possibly redundant) information about a groebnerCone.
* Moreover, it contains implrementation of several highly non-trivial algorithms, such as computing its neighbours
* in the Groebner fan or computing its neighbours in the tropical variety.
*/
class groebnerCone;
struct groebnerCone_compare;
typedef std::set<groebnerCone,groebnerCone_compare> groebnerCones;
class groebnerCone
{
private:
/**
* ideal to which this Groebner cone belongs to
*/
ideal polynomialIdeal;
/**
* ring in which the ideal exists
*/
ring polynomialRing;
gfan::ZCone polyhedralCone;
gfan::ZVector interiorPoint;
const tropicalStrategy* currentStrategy;
public:
groebnerCone();
groebnerCone(const ideal I, const ring r, const tropicalStrategy& currentCase);
groebnerCone(const ideal I, const ring r, const gfan::ZVector& w, const tropicalStrategy& currentCase);
groebnerCone(const ideal I, const ring r, const gfan::ZVector& u, const gfan::ZVector& w, const tropicalStrategy& currentCase);
groebnerCone(const ideal I, const ideal inI, const ring r, const tropicalStrategy& currentCase);
groebnerCone(const groebnerCone& sigma);
~groebnerCone();
groebnerCone& operator=(const groebnerCone& sigma);
void deletePolynomialData()
{
assume ((!polynomialIdeal) || (polynomialIdeal && polynomialRing));
if (polynomialIdeal) id_Delete(&polynomialIdeal,polynomialRing);
if (polynomialRing) rDelete(polynomialRing);
polynomialIdeal = NULL;
polynomialRing = NULL;
}
ideal getPolynomialIdeal() const { return polynomialIdeal; };
ring getPolynomialRing() const { return polynomialRing; };
gfan::ZCone getPolyhedralCone() const { return polyhedralCone; };
gfan::ZVector getInteriorPoint() const { return interiorPoint; };
const tropicalStrategy* getTropicalStrategy() const { return currentStrategy; };
friend struct groebnerCone_compare;
bool isTrivial() const
{
bool b = (polynomialRing==NULL);
return b;
}
/**
* Returns true if Groebner cone contains w, false otherwise
*/
bool contains(const gfan::ZVector &w) const;
/**
* Returns a point in the tropical variety, if the groebnerCone contains one.
* Returns an empty vector otherwise.
*/
gfan::ZVector tropicalPoint() const;
/**
* Given an interior point on the facet and the outer normal factor on the facet,
* returns the adjacent groebnerCone sharing that facet
*/
groebnerCone flipCone(const gfan::ZVector &interiorPoint, const gfan::ZVector &facetNormal) const;
/**
* Returns a complete list of neighboring Groebner cones.
*/
groebnerCones groebnerNeighbours() const;
/**
* Returns a complete list of neighboring Groebner cones in the tropical variety.
*/
groebnerCones tropicalNeighbours() const;
/**
* Return 1 if w points is in the dual of the polyhedral cone, 0 otherwise
*/
bool pointsOutwards(const gfan::ZVector w) const;
/**
* Debug tools.
*/
#ifndef NDEBUG
bool checkFlipConeInput(const gfan::ZVector interiorPoint, const gfan::ZVector facetNormal) const;
#endif
};
struct groebnerCone_compare
{
bool operator()(const groebnerCone &sigma, const groebnerCone &theta) const
{
const gfan::ZVector p1 = sigma.getInteriorPoint();
const gfan::ZVector p2 = theta.getInteriorPoint();
assume (p1.size() == p2.size());
return p1 < p2;
}
};
gfan::ZFan* toFanStar(groebnerCones setOfCones);
#endif
b
CanonicalForm b
Definition cfModGcd.cc:4111
groebnerCone
Definition groebnerCone.h:28
groebnerCone::currentStrategy
const tropicalStrategy * currentStrategy
Definition groebnerCone.h:41
groebnerCone::groebnerCone_compare
friend struct groebnerCone_compare
Definition groebnerCone.h:67
groebnerCone::groebnerCone
groebnerCone()
Definition groebnerCone.cc:69
groebnerCone::getTropicalStrategy
const tropicalStrategy * getTropicalStrategy() const
Definition groebnerCone.h:66
groebnerCone::tropicalPoint
gfan::ZVector tropicalPoint() const
Returns a point in the tropical variety, if the groebnerCone contains one.
Definition groebnerCone.cc:354
groebnerCone::tropicalNeighbours
groebnerCones tropicalNeighbours() const
Returns a complete list of neighboring Groebner cones in the tropical variety.
Definition groebnerCone.cc:438
groebnerCone::groebnerNeighbours
groebnerCones groebnerNeighbours() const
Returns a complete list of neighboring Groebner cones.
Definition groebnerCone.cc:404
groebnerCone::operator=
groebnerCone & operator=(const groebnerCone &sigma)
Definition groebnerCone.cc:328
groebnerCone::contains
bool contains(const gfan::ZVector &w) const
Returns true if Groebner cone contains w, false otherwise.
Definition groebnerCone.cc:344
groebnerCone::interiorPoint
gfan::ZVector interiorPoint
Definition groebnerCone.h:40
groebnerCone::getPolyhedralCone
gfan::ZCone getPolyhedralCone() const
Definition groebnerCone.h:64
groebnerCone::checkFlipConeInput
bool checkFlipConeInput(const gfan::ZVector interiorPoint, const gfan::ZVector facetNormal) const
Debug tools.
Definition groebnerCone.cc:23
groebnerCone::isTrivial
bool isTrivial() const
Definition groebnerCone.h:69
groebnerCone::polynomialIdeal
ideal polynomialIdeal
ideal to which this Groebner cone belongs to
Definition groebnerCone.h:34
groebnerCone::pointsOutwards
bool pointsOutwards(const gfan::ZVector w) const
Return 1 if w points is in the dual of the polyhedral cone, 0 otherwise.
Definition groebnerCone.cc:428
groebnerCone::getPolynomialIdeal
ideal getPolynomialIdeal() const
Definition groebnerCone.h:62
groebnerCone::polyhedralCone
gfan::ZCone polyhedralCone
Definition groebnerCone.h:39
groebnerCone::getPolynomialRing
ring getPolynomialRing() const
Definition groebnerCone.h:63
groebnerCone::~groebnerCone
~groebnerCone()
Definition groebnerCone.cc:319
groebnerCone::getInteriorPoint
gfan::ZVector getInteriorPoint() const
Definition groebnerCone.h:65
groebnerCone::flipCone
groebnerCone flipCone(const gfan::ZVector &interiorPoint, const gfan::ZVector &facetNormal) const
Given an interior point on the facet and the outer normal factor on the facet, returns the adjacent g...
Definition groebnerCone.cc:383
groebnerCone::deletePolynomialData
void deletePolynomialData()
Definition groebnerCone.h:53
groebnerCone::polynomialRing
ring polynomialRing
ring in which the ideal exists
Definition groebnerCone.h:38
tropicalStrategy
Definition tropicalStrategy.h:37
w
const CanonicalForm & w
Definition facAbsFact.cc:51
toFanStar
gfan::ZFan * toFanStar(groebnerCones setOfCones)
Definition groebnerCone.cc:461
groebnerCones
std::set< groebnerCone, groebnerCone_compare > groebnerCones
Definition groebnerCone.h:24
ideals.h
ipid.h
assume
#define assume(x)
Definition mod2.h:389
NULL
#define NULL
Definition omList.c:12
polys.h
Compatibility layer for legacy polynomial operations (over currRing).
rDelete
void rDelete(ring r)
unconditionally deletes fields in r
Definition ring.cc:454
ring.h
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition simpleideals.cc:123
simpleideals.h
groebnerCone_compare
Definition groebnerCone.h:116
groebnerCone_compare::operator()
bool operator()(const groebnerCone &sigma, const groebnerCone &theta) const
Definition groebnerCone.h:117
tropicalStrategy.h
implementation of the class tropicalStrategy