Functions
groebnerComplex.cc File Reference
#include <misc/options.h>
#include <bbfan.h>
#include <groebnerCone.h>
#include <startingCone.h>
#include <groebnerFan.h>
#include <tropicalTraversal.h>
#include <ppinitialReduction.h>

Go to the source code of this file.

Functions

gfan::ZFan * groebnerComplex (const tropicalStrategy currentStrategy)
 
BOOLEAN groebnerComplex (leftv res, leftv args)
 

Function Documentation

◆ groebnerComplex() [1/2]

gfan::ZFan* groebnerComplex ( const tropicalStrategy  currentStrategy)

Definition at line 11 of file groebnerComplex.cc.

12 {
13  groebnerCone startingCone = groebnerStartingCone(currentStrategy);
15  return toFanStar(tropicalVariety);
16 }
gfan::ZFan * toFanStar(std::set< gfan::ZCone > setOfCones)
groebnerCones groebnerTraversal(const groebnerCone startingCone)
std::set< groebnerCone, groebnerCone_compare > groebnerCones
Definition: groebnerCone.h:24
BOOLEAN tropicalVariety(leftv res, leftv args)
groebnerCone groebnerStartingCone(const tropicalStrategy &currentStrategy)
Definition: startingCone.cc:21

◆ groebnerComplex() [2/2]

BOOLEAN groebnerComplex ( leftv  res,
leftv  args 
)

Definition at line 19 of file groebnerComplex.cc.

20 {
21  leftv u = args;
22  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
23  {
24  ideal I = (ideal) u->Data();
25  leftv v = u->next;
26  if ((v!=NULL) && (v->Typ()==NUMBER_CMD))
27  {
28  leftv w = v->next;
29  if (w==NULL)
30  {
31  number p = (number) v->Data();
32  tropicalStrategy currentStrategy(I,p,currRing);
33  if ((I->m[0]!=NULL) && (idElem(I)==1))
34  {
35  try
36  {
37  ideal startingIdeal = currentStrategy.getStartingIdeal();
38  ring startingRing = currentStrategy.getStartingRing();
39  currentStrategy.pReduce(startingIdeal,startingRing);
40  poly g = startingIdeal->m[0];
41  pReduceInhomogeneous(g, currentStrategy.getUniformizingParameter(), startingRing);
42  gfan::ZFan* zf = groebnerFanOfPolynomial(g,startingRing,true);
43  res->rtyp = fanID;
44  res->data = (char*) zf;
45  return FALSE;
46  }
47  catch (const std::exception& ex)
48  {
49  WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
50  return TRUE;
51  }
52  }
53  else
54  {
55  try
56  {
57  gfan::ZFan* zf = groebnerComplex(currentStrategy);
58  res->rtyp = fanID;
59  res->data = (char*) zf;
60  return FALSE;
61  }
62  catch (const std::exception& ex)
63  {
64  WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
65  return TRUE;
66  }
67  }
68  }
69  }
70  }
71  if ((u!=NULL) && (u->Typ()==POLY_CMD))
72  {
73  poly g = (poly) u->Data();
74  leftv v = u->next;
75  if ((v!=NULL) && (v->Typ()==NUMBER_CMD))
76  {
77  leftv w = v->next;
78  if (w==NULL)
79  {
80  try
81  {
82  number p = (number) v->Data();
83  ideal I = idInit(1);
84  I->m[0] = p_Copy(g,currRing);
85  tropicalStrategy currentStrategy(I,p,currRing);
86  ideal startingIdeal = currentStrategy.getStartingIdeal();
87  ring startingRing = currentStrategy.getStartingRing();
88  poly gg = startingIdeal->m[0];
89  pReduceInhomogeneous(gg, currentStrategy.getUniformizingParameter(), startingRing);
90  gfan::ZFan* zf = groebnerFanOfPolynomial(gg,startingRing,true);
91  id_Delete(&I,currRing);
92  res->rtyp = fanID;
93  res->data = (char*) zf;
94  return FALSE;
95  }
96  catch (const std::exception& ex)
97  {
98  WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
99  return TRUE;
100  }
101  }
102  }
103  }
104  WerrorS("groebnerComplex: unexpected parameters");
105  return TRUE;
106 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
gfan::ZFan * groebnerComplex(const tropicalStrategy currentStrategy)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:98
g
Definition: cfModGcd.cc:4031
void WerrorS(const char *s)
Definition: feFopen.cc:24
int fanID
Definition: bbfan.cc:20
int Typ()
Definition: subexpr.cc:995
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:804
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
leftv next
Definition: subexpr.h:87
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1137
int idElem(const ideal F)
count non-zero elements
gfan::ZFan * groebnerFanOfPolynomial(poly g, ring r, bool onlyLowerHalfSpace=false)
Definition: groebnerFan.cc:36
polyrec * poly
Definition: hilb.h:10
void pReduceInhomogeneous(poly &g, const number p, const ring r)