Functions | Variables
bbcone.cc File Reference
#include <kernel/mod2.h>
#include <misc/intvec.h>
#include <misc/sirandom.h>
#include <coeffs/bigintmat.h>
#include <coeffs/longrat.h>
#include <Singular/ipid.h>
#include <Singular/ipshell.h>
#include <Singular/blackbox.h>
#include <Singular/links/ssiLink.h>
#include <callgfanlib_conversion.h>
#include <sstream>
#include <gfanlib/gfanlib.h>
#include <gfanlib/gfanlib_q.h>
#include <bbfan.h>
#include <bbpolytope.h>

Go to the source code of this file.

Functions

std::string toString (const gfan::ZCone *const c)
 
void * bbcone_Init (blackbox *)
 
BOOLEAN bbcone_Assign (leftv l, leftv r)
 
char * bbcone_String (blackbox *, void *d)
 
void bbcone_destroy (blackbox *, void *d)
 
void * bbcone_Copy (blackbox *, void *d)
 
static BOOLEAN bbcone_Op2 (int op, leftv res, leftv i1, leftv i2)
 
static BOOLEAN jjCONENORMALS1 (leftv res, leftv v)
 
static BOOLEAN jjCONENORMALS2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjCONENORMALS3 (leftv res, leftv u, leftv v, leftv w)
 
BOOLEAN coneViaNormals (leftv res, leftv args)
 
static BOOLEAN jjCONERAYS1 (leftv res, leftv v)
 
static BOOLEAN jjCONERAYS2 (leftv res, leftv u, leftv v)
 
static BOOLEAN jjCONERAYS3 (leftv res, leftv u, leftv v, leftv w)
 
BOOLEAN coneViaRays (leftv res, leftv args)
 
BOOLEAN inequalities (leftv res, leftv args)
 
BOOLEAN equations (leftv res, leftv args)
 
BOOLEAN facets (leftv res, leftv args)
 
BOOLEAN impliedEquations (leftv res, leftv args)
 
BOOLEAN generatorsOfSpan (leftv res, leftv args)
 
BOOLEAN generatorsOfLinealitySpace (leftv res, leftv args)
 
BOOLEAN rays (leftv res, leftv args)
 
BOOLEAN quotientLatticeBasis (leftv res, leftv args)
 
BOOLEAN getLinearForms (leftv res, leftv args)
 
BOOLEAN ambientDimension (leftv res, leftv args)
 
BOOLEAN dimension (leftv res, leftv args)
 
BOOLEAN codimension (leftv res, leftv args)
 
BOOLEAN linealityDimension (leftv res, leftv args)
 
BOOLEAN getMultiplicity (leftv res, leftv args)
 
BOOLEAN isOrigin (leftv res, leftv args)
 
BOOLEAN isFullSpace (leftv res, leftv args)
 
BOOLEAN isSimplicial (leftv res, leftv args)
 
BOOLEAN containsPositiveVector (leftv res, leftv args)
 
BOOLEAN linealitySpace (leftv res, leftv args)
 
BOOLEAN dualCone (leftv res, leftv args)
 
BOOLEAN negatedCone (leftv res, leftv args)
 
BOOLEAN semigroupGenerator (leftv res, leftv args)
 
BOOLEAN relativeInteriorPoint (leftv res, leftv args)
 
BOOLEAN uniquePoint (leftv res, leftv args)
 
gfan::ZVector randomPoint (const gfan::ZCone *zc)
 
BOOLEAN randomPoint (leftv res, leftv args)
 
BOOLEAN setMultiplicity (leftv res, leftv args)
 
BOOLEAN setLinearForms (leftv res, leftv args)
 
gfan::ZMatrix liftUp (const gfan::ZMatrix &zm)
 
gfan::ZCone liftUp (const gfan::ZCone &zc)
 
BOOLEAN coneToPolytope (leftv res, leftv args)
 
BOOLEAN intersectCones (leftv res, leftv args)
 
BOOLEAN convexHull (leftv res, leftv args)
 
BOOLEAN coneLink (leftv res, leftv args)
 
BOOLEAN containsInSupport (leftv res, leftv args)
 
BOOLEAN containsRelatively (leftv res, leftv args)
 
BOOLEAN hasFace (leftv res, leftv args)
 
BOOLEAN canonicalizeCone (leftv res, leftv args)
 
BOOLEAN containsCone (leftv res, leftv args)
 
lists listOfFacets (const gfan::ZCone &zc)
 
BOOLEAN listOfFacets (leftv res, leftv args)
 
gfan::ZVector * facetContaining (gfan::ZCone *zc, gfan::ZVector *zv)
 
BOOLEAN facetContaining (leftv res, leftv args)
 
gfan::ZMatrix interiorPointsOfFacets (const gfan::ZCone &zc, const std::set< gfan::ZVector > &exceptThese)
 
std::pair< gfan::ZMatrix, gfan::ZMatrix > interiorPointsAndNormalsOfFacets (const gfan::ZCone zc, const std::set< gfan::ZVector > &exceptThesePoints, const bool onlyLowerHalfSpace)
 
static void gfanIntegerWriteFd (gfan::Integer n, ssiInfo *dd)
 
static void gfanZMatrixWriteFd (gfan::ZMatrix M, ssiInfo *dd)
 
BOOLEAN bbcone_serialize (blackbox *b, void *d, si_link f)
 
static gfan::Integer gfanIntegerReadFd (ssiInfo *dd)
 
static gfan::ZMatrix gfanZMatrixReadFd (ssiInfo *dd)
 
BOOLEAN bbcone_deserialize (blackbox **b, void **d, si_link f)
 
void bbcone_setup (SModulFunctions *p)
 

Variables

int coneID
 

Function Documentation

BOOLEAN ambientDimension ( leftv  res,
leftv  args 
)

Definition at line 673 of file bbcone.cc.

674 {
675  leftv u=args;
676  if ((u != NULL) && (u->Typ() == coneID))
677  {
678  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
679  res->rtyp = INT_CMD;
680  res->data = (void*) (long) zc->ambientDimension();
681  return FALSE;
682  }
683  if ((u != NULL) && (u->Typ() == fanID))
684  {
685  gfan::ZFan* zf = (gfan::ZFan*)u->Data();
686  res->rtyp = INT_CMD;
687  res->data = (void*) (long) getAmbientDimension(zf);
688  return FALSE;
689  }
690  if ((u != NULL) && (u->Typ() == polytopeID))
691  {
692  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
693  res->rtyp = INT_CMD;
694  res->data = (void*) (long) getAmbientDimension(zc);
695  return FALSE;
696  }
697  WerrorS("ambientDimension: unexpected parameters");
698  return TRUE;
699 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int fanID
Definition: bbfan.cc:20
int Typ()
Definition: subexpr.cc:976
int getAmbientDimension(gfan::ZFan *zf)
Definition: bbfan.cc:244
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN bbcone_Assign ( leftv  l,
leftv  r 
)

Definition at line 86 of file bbcone.cc.

87 {
88  gfan::ZCone* newZc;
89  if (r==NULL)
90  {
91  if (l->Data()!=NULL)
92  {
93  gfan::ZCone* zd = (gfan::ZCone*)l->Data();
94  delete zd;
95  }
96  newZc = new gfan::ZCone();
97  }
98  else if (r->Typ()==l->Typ())
99  {
100  if (l->Data()!=NULL)
101  {
102  gfan::ZCone* zd = (gfan::ZCone*)l->Data();
103  delete zd;
104  }
105  newZc = (gfan::ZCone*)r->CopyD();
106  }
107  else if (r->Typ()==INT_CMD)
108  {
109  int ambientDim = (int)(long)r->Data();
110  if (ambientDim < 0)
111  {
112  Werror("expected an int >= 0, but got %d", ambientDim);
113  return TRUE;
114  }
115  if (l->Data()!=NULL)
116  {
117  gfan::ZCone* zd = (gfan::ZCone*)l->Data();
118  delete zd;
119  }
120  newZc = new gfan::ZCone(ambientDim);
121  }
122  else
123  {
124  Werror("assign Type(%d) = Type(%d) not implemented",l->Typ(),r->Typ());
125  return TRUE;
126  }
127 
128  if (l->rtyp==IDHDL)
129  {
130  IDDATA((idhdl)l->data)=(char*) newZc;
131  }
132  else
133  {
134  l->data=(void *)newZc;
135  }
136  return FALSE;
137 }
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
int Typ()
Definition: subexpr.cc:976
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:35
void * data
Definition: subexpr.h:89
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
#define IDDATA(a)
Definition: ipid.h:125
void Werror(const char *fmt,...)
Definition: reporter.cc:199
void * CopyD(int t)
Definition: subexpr.cc:676
void* bbcone_Copy ( blackbox *  ,
void *  d 
)

Definition at line 158 of file bbcone.cc.

159 {
160  gfan::ZCone* zc = (gfan::ZCone*)d;
161  gfan::ZCone* newZc = new gfan::ZCone(*zc);
162  return newZc;
163 }
BOOLEAN bbcone_deserialize ( blackbox **  b,
void **  d,
si_link  f 
)

Definition at line 1816 of file bbcone.cc.

1817 {
1818  ssiInfo *dd = (ssiInfo *)f->data;
1819  int preassumptions = s_readint(dd->f_read);
1820 
1821  gfan::ZMatrix i = gfanZMatrixReadFd(dd);
1822  gfan::ZMatrix e = gfanZMatrixReadFd(dd);
1823 
1824  // if (e.getHeight()==0) // why is e sometimes 0x0 and sometimex 0xn???
1825  // e = gfan::ZMatrix(0,i.getWidth());
1826 
1827  gfan::ZCone* Z = new gfan::ZCone(i,e,preassumptions);
1828 
1829  *d=Z;
1830  return FALSE;
1831 }
#define FALSE
Definition: auxiliary.h:140
static gfan::ZMatrix gfanZMatrixReadFd(ssiInfo *dd)
Definition: bbcone.cc:1800
int s_readint(s_buff F)
Definition: s_buff.cc:120
FILE * f
Definition: checklibs.c:7
int i
Definition: cfEzgcd.cc:123
void bbcone_destroy ( blackbox *  ,
void *  d 
)

Definition at line 149 of file bbcone.cc.

150 {
151  if (d!=NULL)
152  {
153  gfan::ZCone* zc = (gfan::ZCone*) d;
154  delete zc;
155  }
156 }
#define NULL
Definition: omList.c:10
void* bbcone_Init ( blackbox *  )

Definition at line 81 of file bbcone.cc.

82 {
83  return (void*)(new gfan::ZCone());
84 }
static BOOLEAN bbcone_Op2 ( int  op,
leftv  res,
leftv  i1,
leftv  i2 
)
static

Definition at line 165 of file bbcone.cc.

166 {
167  gfan::ZCone* zp = (gfan::ZCone*) i1->Data();
168  switch(op)
169  {
170  case '&':
171  {
172  if (i2->Typ()==coneID)
173  {
174  gfan::ZCone* zq = (gfan::ZCone*) i2->Data();
175  int d1 = zp->ambientDimension();
176  int d2 = zq->ambientDimension();
177  if (d1 != d2)
178  {
179  WerrorS("mismatching ambient dimensions");
180  return TRUE;
181  }
182  gfan::ZCone* zs = new gfan::ZCone();
183  *zs = gfan::intersection(*zp, *zq);
184  zs->canonicalize();
185  res->rtyp = coneID;
186  res->data = (void*) zs;
187  return FALSE;
188  }
189  return blackboxDefaultOp2(op,res,i1,i2);
190  }
191  case '|':
192  {
193  if(i2->Typ()==coneID)
194  {
195  gfan::ZCone* zq = (gfan::ZCone*) i2->Data();
196  int d1 = zp->ambientDimension();
197  int d2 = zq->ambientDimension();
198  if (d1 != d2)
199  {
200  WerrorS("mismatching ambient dimensions");
201  return TRUE;
202  }
203  gfan::ZMatrix rays = zp->extremeRays();
204  rays.append(zq->extremeRays());
205  gfan::ZMatrix lineality = zp->generatorsOfLinealitySpace();
206  lineality.append(zq->generatorsOfLinealitySpace());
207  gfan::ZCone* zs = new gfan::ZCone();
208  *zs = gfan::ZCone::givenByRays(rays,lineality);
209  zs->canonicalize();
210  res->rtyp = coneID;
211  res->data = (void*) zs;
212  return FALSE;
213  }
214  return blackboxDefaultOp2(op,res,i1,i2);
215  }
216  case EQUAL_EQUAL:
217  {
218  if(i2->Typ()==coneID)
219  {
220  gfan::ZCone* zq = (gfan::ZCone*) i2->Data();
221  zp->canonicalize();
222  zq->canonicalize();
223  bool b = !((*zp)!=(*zq));
224  res->rtyp = INT_CMD;
225  res->data = (void*) b;
226  return FALSE;
227  }
228  return blackboxDefaultOp2(op,res,i1,i2);
229  }
230  default:
231  return blackboxDefaultOp2(op,res,i1,i2);
232  }
233  return blackboxDefaultOp2(op,res,i1,i2);
234 }
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
BOOLEAN blackboxDefaultOp2(int op, leftv, leftv r1, leftv)
default procedure blackboxDefaultOp2, to be called as "default:" branch
Definition: blackbox.cc:85
int coneID
Definition: bbcone.cc:26
BOOLEAN rays(leftv res, leftv args)
Definition: bbcone.cc:620
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
const poly b
Definition: syzextra.cc:213
BOOLEAN bbcone_serialize ( blackbox *  b,
void *  d,
si_link  f 
)

Definition at line 1767 of file bbcone.cc.

1768 {
1769  ssiInfo *dd = (ssiInfo *)f->data;
1770 
1771  sleftv l;
1772  memset(&l,0,sizeof(l));
1773  l.rtyp=STRING_CMD;
1774  l.data=(void*)"cone";
1775  f->m->Write(f, &l);
1776 
1777  gfan::ZCone *Z = (gfan::ZCone*) d;
1778  fprintf(dd->f_write,"%d ",Z->areImpliedEquationsKnown()+Z->areFacetsKnown()*2);
1779 
1780  gfan::ZMatrix i=Z->getInequalities();
1781  gfanZMatrixWriteFd(i,dd);
1782 
1783  gfan::ZMatrix e=Z->getEquations();
1784  gfanZMatrixWriteFd(e,dd);
1785 
1786  // assert(i.getWidth() == e.getWidth());
1787  return FALSE;
1788 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
FILE * f
Definition: checklibs.c:7
int i
Definition: cfEzgcd.cc:123
static void gfanZMatrixWriteFd(gfan::ZMatrix M, ssiInfo *dd)
Definition: bbcone.cc:1754
int l
Definition: cfEzgcd.cc:94
void bbcone_setup ( SModulFunctions p)

Definition at line 1833 of file bbcone.cc.

1834 {
1835  blackbox *b=(blackbox*)omAlloc0(sizeof(blackbox));
1836  // all undefined entries will be set to default in setBlackboxStuff
1837  // the default Print is quite usefull,
1838  // all other are simply error messages
1839  b->blackbox_destroy=bbcone_destroy;
1840  b->blackbox_String=bbcone_String;
1841  // b->blackbox_Print=blackbox_default_Print;
1842  b->blackbox_Init=bbcone_Init;
1843  b->blackbox_Copy=bbcone_Copy;
1844  b->blackbox_Assign=bbcone_Assign;
1845  b->blackbox_Op2=bbcone_Op2;
1846  b->blackbox_serialize=bbcone_serialize;
1847  b->blackbox_deserialize=bbcone_deserialize;
1848  p->iiAddCproc("","coneViaInequalities",FALSE,coneViaNormals);
1849  p->iiAddCproc("","coneViaPoints",FALSE,coneViaRays);
1850 
1851  // iiAddCproc("","makePolytope",FALSE,coneToPolytope);
1852  p->iiAddCproc("","ambientDimension",FALSE,ambientDimension);
1853  p->iiAddCproc("","canonicalizeCone",FALSE,canonicalizeCone);
1854  p->iiAddCproc("","codimension",FALSE,codimension);
1855  p->iiAddCproc("","coneLink",FALSE,coneLink);
1856  p->iiAddCproc("","containsAsFace",FALSE,hasFace);
1857  p->iiAddCproc("","containsInSupport",FALSE,containsInSupport);
1858  p->iiAddCproc("","containsPositiveVector",FALSE,containsPositiveVector);
1859  p->iiAddCproc("","containsRelatively",FALSE,containsRelatively);
1860  p->iiAddCproc("","convexHull",FALSE,convexHull);
1861  p->iiAddCproc("","convexIntersection",FALSE,intersectCones);
1862  p->iiAddCproc("","dimension",FALSE,dimension);
1863  p->iiAddCproc("","dualCone",FALSE,dualCone);
1864  p->iiAddCproc("","equations",FALSE,equations);
1865  p->iiAddCproc("","facets",FALSE,facets);
1866  p->iiAddCproc("","generatorsOfLinealitySpace",FALSE,generatorsOfLinealitySpace);
1867  p->iiAddCproc("","generatorsOfSpan",FALSE,generatorsOfSpan);
1868  p->iiAddCproc("","getLinearForms",FALSE,getLinearForms);
1869  p->iiAddCproc("","getMultiplicity",FALSE,getMultiplicity);
1870  p->iiAddCproc("","inequalities",FALSE,inequalities);
1871  p->iiAddCproc("","isFullSpace",FALSE,isFullSpace);
1872  p->iiAddCproc("","isOrigin",FALSE,isOrigin);
1873  p->iiAddCproc("","isSimplicial",FALSE,isSimplicial);
1874  p->iiAddCproc("","linealityDimension",FALSE,linealityDimension);
1875  p->iiAddCproc("","linealitySpace",FALSE,linealitySpace);
1876  p->iiAddCproc("","negatedCone",FALSE,negatedCone);
1877  p->iiAddCproc("","quotientLatticeBasis",FALSE,quotientLatticeBasis);
1878  p->iiAddCproc("","randomPoint",FALSE,randomPoint);
1879  p->iiAddCproc("","rays",FALSE,rays);
1880  p->iiAddCproc("","relativeInteriorPoint",FALSE,relativeInteriorPoint);
1881  p->iiAddCproc("","semigroupGenerator",FALSE,semigroupGenerator);
1882  p->iiAddCproc("","setLinearForms",FALSE,setLinearForms);
1883  p->iiAddCproc("","setMultiplicity",FALSE,setMultiplicity);
1884  p->iiAddCproc("","span",FALSE,impliedEquations);
1885  p->iiAddCproc("","uniquePoint",FALSE,uniquePoint);
1886  p->iiAddCproc("","listContainsCone",FALSE,containsCone);
1887  p->iiAddCproc("","listOfFacets",FALSE,listOfFacets);
1888  p->iiAddCproc("","facetContaining",FALSE,facetContaining);
1889  coneID=setBlackboxStuff(b,"cone");
1890 }
BOOLEAN isFullSpace(leftv res, leftv args)
Definition: bbcone.cc:808
BOOLEAN coneViaNormals(leftv res, leftv args)
Definition: bbcone.cc:353
BOOLEAN getMultiplicity(leftv res, leftv args)
Definition: bbcone.cc:778
BOOLEAN dualCone(leftv res, leftv args)
Definition: bbcone.cc:876
BOOLEAN containsPositiveVector(leftv res, leftv args)
Definition: bbcone.cc:846
BOOLEAN containsRelatively(leftv res, leftv args)
Definition: bbcone.cc:1381
BOOLEAN canonicalizeCone(leftv res, leftv args)
Definition: bbcone.cc:1455
BOOLEAN bbcone_deserialize(blackbox **b, void **d, si_link f)
Definition: bbcone.cc:1816
#define FALSE
Definition: auxiliary.h:140
BOOLEAN quotientLatticeBasis(leftv res, leftv args)
Definition: bbcone.cc:643
BOOLEAN generatorsOfSpan(leftv res, leftv args)
Definition: bbcone.cc:590
gfan::ZVector * facetContaining(gfan::ZCone *zc, gfan::ZVector *zv)
Definition: bbcone.cc:1569
BOOLEAN coneViaRays(leftv res, leftv args)
Definition: bbcone.cc:508
BOOLEAN containsInSupport(leftv res, leftv args)
Definition: bbcone.cc:1323
static BOOLEAN bbcone_Op2(int op, leftv res, leftv i1, leftv i2)
Definition: bbcone.cc:165
gfan::ZVector randomPoint(const gfan::ZCone *zc)
Definition: bbcone.cc:958
BOOLEAN bbcone_serialize(blackbox *b, void *d, si_link f)
Definition: bbcone.cc:1767
BOOLEAN inequalities(leftv res, leftv args)
Definition: bbcone.cc:529
BOOLEAN linealitySpace(leftv res, leftv args)
Definition: bbcone.cc:861
BOOLEAN relativeInteriorPoint(leftv res, leftv args)
Definition: bbcone.cc:928
BOOLEAN semigroupGenerator(leftv res, leftv args)
Definition: bbcone.cc:906
BOOLEAN isSimplicial(leftv res, leftv args)
Definition: bbcone.cc:823
BOOLEAN codimension(leftv res, leftv args)
Definition: bbcone.cc:729
BOOLEAN coneLink(leftv res, leftv args)
Definition: bbcone.cc:1278
BOOLEAN negatedCone(leftv res, leftv args)
Definition: bbcone.cc:891
BOOLEAN getLinearForms(leftv res, leftv args)
Definition: bbcone.cc:658
int coneID
Definition: bbcone.cc:26
lists listOfFacets(const gfan::ZCone &zc)
Definition: bbcone.cc:1508
BOOLEAN rays(leftv res, leftv args)
Definition: bbcone.cc:620
void bbcone_destroy(blackbox *, void *d)
Definition: bbcone.cc:149
BOOLEAN dimension(leftv res, leftv args)
Definition: bbcone.cc:701
void * bbcone_Init(blackbox *)
Definition: bbcone.cc:81
BOOLEAN containsCone(leftv res, leftv args)
Definition: bbcone.cc:1471
BOOLEAN uniquePoint(leftv res, leftv args)
Definition: bbcone.cc:943
BOOLEAN equations(leftv res, leftv args)
Definition: bbcone.cc:545
BOOLEAN facets(leftv res, leftv args)
Definition: bbcone.cc:560
BOOLEAN setLinearForms(leftv res, leftv args)
Definition: bbcone.cc:1014
BOOLEAN ambientDimension(leftv res, leftv args)
Definition: bbcone.cc:673
char * bbcone_String(blackbox *, void *d)
Definition: bbcone.cc:139
BOOLEAN isOrigin(leftv res, leftv args)
Definition: bbcone.cc:793
BOOLEAN bbcone_Assign(leftv l, leftv r)
Definition: bbcone.cc:86
BOOLEAN linealityDimension(leftv res, leftv args)
Definition: bbcone.cc:757
int(* iiAddCproc)(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: ipid.h:73
BOOLEAN generatorsOfLinealitySpace(leftv res, leftv args)
Definition: bbcone.cc:605
BOOLEAN impliedEquations(leftv res, leftv args)
Definition: bbcone.cc:575
BOOLEAN hasFace(leftv res, leftv args)
Definition: bbcone.cc:1422
BOOLEAN intersectCones(leftv res, leftv args)
Definition: bbcone.cc:1083
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
Definition: blackbox.cc:128
const poly b
Definition: syzextra.cc:213
void * bbcone_Copy(blackbox *, void *d)
Definition: bbcone.cc:158
#define omAlloc0(size)
Definition: omAllocDecl.h:211
BOOLEAN setMultiplicity(leftv res, leftv args)
Definition: bbcone.cc:994
char* bbcone_String ( blackbox *  ,
void *  d 
)

Definition at line 139 of file bbcone.cc.

140 {
141  if (d==NULL) return omStrDup("invalid object");
142  else
143  {
144  std::string s=toString((gfan::ZCone*) d);
145  return omStrDup(s.c_str());
146  }
147 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define string
Definition: libparse.cc:1250
#define NULL
Definition: omList.c:10
std::string toString(const gfan::ZCone *const c)
Definition: bbcone.cc:28
#define omStrDup(s)
Definition: omAllocDecl.h:263
BOOLEAN canonicalizeCone ( leftv  res,
leftv  args 
)

Definition at line 1455 of file bbcone.cc.

1456 {
1457  leftv u=args;
1458  if ((u != NULL) && (u->Typ() == coneID))
1459  {
1460  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
1461  gfan::ZCone* zd = new gfan::ZCone(*zc);
1462  zd->canonicalize();
1463  res->rtyp = coneID;
1464  res->data = (void*) zd;
1465  return FALSE;
1466  }
1467  WerrorS("canonicalizeCone: unexpected parameters");
1468  return TRUE;
1469 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN codimension ( leftv  res,
leftv  args 
)

Definition at line 729 of file bbcone.cc.

730 {
731  leftv u=args;
732  if ((u != NULL) && (u->Typ() == coneID))
733  {
734  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
735  res->rtyp = INT_CMD;
736  res->data = (void*) (long) zc->codimension();
737  return FALSE;
738  }
739  if ((u != NULL) && (u->Typ() == fanID))
740  {
741  gfan::ZFan* zf = (gfan::ZFan*)u->Data();
742  res->rtyp = INT_CMD;
743  res->data = (void*) (long) getCodimension(zf);
744  return FALSE;
745  }
746  if ((u != NULL) && (u->Typ() == polytopeID))
747  {
748  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
749  res->rtyp = INT_CMD;
750  res->data = (void*) (long) getCodimension(zc);
751  return FALSE;
752  }
753  WerrorS("getCodimension: unexpected parameters");
754  return TRUE;
755 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int fanID
Definition: bbfan.cc:20
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
int getCodimension(gfan::ZFan *zf)
Definition: bbfan.cc:249
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN coneLink ( leftv  res,
leftv  args 
)

Definition at line 1278 of file bbcone.cc.

1279 {
1280  leftv u = args;
1281  if ((u != NULL) && (u->Typ() == coneID))
1282  {
1283  leftv v = u->next;
1284  if ((v != NULL) && ((v->Typ() == BIGINTMAT_CMD) || (v->Typ() == INTVEC_CMD)))
1285  {
1286  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
1287  bigintmat* iv = NULL;
1288  if (v->Typ() == INTVEC_CMD)
1289  {
1290  intvec* iv0 = (intvec*) v->Data();
1291  iv = iv2bim(iv0,coeffs_BIGINT)->transpose();
1292  }
1293  else
1294  iv = (bigintmat*)v->Data();
1295  gfan::ZVector* zv = bigintmatToZVector(iv);
1296  int d1 = zc->ambientDimension();
1297  int d2 = zv->size();
1298  if (d1 != d2)
1299  {
1300  Werror("expected ambient dim of cone and size of vector\n"
1301  " to be equal but got %d and %d", d1, d2);
1302  return TRUE;
1303  }
1304  if(!zc->contains(*zv))
1305  {
1306  WerrorS("the provided intvec does not lie in the cone");
1307  return TRUE;
1308  }
1309  gfan::ZCone* zd = new gfan::ZCone(zc->link(*zv));
1310  res->rtyp = coneID;
1311  res->data = (void *) zd;
1312 
1313  delete zv;
1314  if (v->Typ() == INTMAT_CMD)
1315  delete iv;
1316  return FALSE;
1317  }
1318  }
1319  WerrorS("coneLink: unexpected parameters");
1320  return TRUE;
1321 }
bigintmat * transpose()
Definition: bigintmat.cc:38
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:352
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
int coneID
Definition: bbcone.cc:26
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
void Werror(const char *fmt,...)
Definition: reporter.cc:199
gfan::ZVector * bigintmatToZVector(const bigintmat &bim)
BOOLEAN coneToPolytope ( leftv  res,
leftv  args 
)

Definition at line 1066 of file bbcone.cc.

1067 {
1068  leftv u = args;
1069  if ((u != NULL) && (u->Typ() == coneID))
1070  {
1071  gfan::ZCone* zc = (gfan::ZCone*) u->Data();
1072  gfan::ZMatrix ineq=zc->getInequalities();
1073  gfan::ZMatrix eq=zc->getEquations();
1074  gfan::ZCone* zd = new gfan::ZCone(liftUp(ineq),liftUp(eq));
1075  res->rtyp = polytopeID;
1076  res->data = (void*) zd;
1077  return FALSE;
1078  }
1079  WerrorS("makePolytope: unexpected parameters");
1080  return TRUE;
1081 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
gfan::ZMatrix liftUp(const gfan::ZMatrix &zm)
Definition: bbcone.cc:1046
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN coneViaNormals ( leftv  res,
leftv  args 
)

Definition at line 353 of file bbcone.cc.

354 {
355  leftv u = args;
356  if ((u != NULL) && ((u->Typ() == BIGINTMAT_CMD) || (u->Typ() == INTMAT_CMD)))
357  {
358  if (u->next == NULL) return jjCONENORMALS1(res, u);
359  }
360  leftv v = u->next;
361  if ((v != NULL) && ((v->Typ() == BIGINTMAT_CMD) || (v->Typ() == INTMAT_CMD)))
362  {
363  if (v->next == NULL) return jjCONENORMALS2(res, u, v);
364  }
365  leftv w = v->next;
366  if ((w != NULL) && (w->Typ() == INT_CMD))
367  {
368  if (w->next == NULL) return jjCONENORMALS3(res, u, v, w);
369  }
370  WerrorS("coneViaInequalities: unexpected parameters");
371  return TRUE;
372 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
leftv next
Definition: subexpr.h:87
static BOOLEAN jjCONENORMALS2(leftv res, leftv u, leftv v)
Definition: bbcone.cc:260
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
static BOOLEAN jjCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
Definition: bbcone.cc:303
const CanonicalForm & w
Definition: facAbsFact.cc:55
static BOOLEAN jjCONENORMALS1(leftv res, leftv v)
Definition: bbcone.cc:238
BOOLEAN coneViaRays ( leftv  res,
leftv  args 
)

Definition at line 508 of file bbcone.cc.

509 {
510  leftv u = args;
511  if ((u != NULL) && ((u->Typ() == BIGINTMAT_CMD) || (u->Typ() == INTMAT_CMD)))
512  {
513  if (u->next == NULL) return jjCONERAYS1(res, u);
514  leftv v = u->next;
515  if ((v != NULL) && ((v->Typ() == BIGINTMAT_CMD) || (v->Typ() == INTMAT_CMD)))
516  {
517  if (v->next == NULL) return jjCONERAYS2(res, u, v);
518  leftv w = v->next;
519  if ((w != NULL) && (w->Typ() == INT_CMD))
520  {
521  if (w->next == NULL) return jjCONERAYS3(res, u, v, w);
522  }
523  }
524  }
525  WerrorS("coneViaPoints: unexpected parameters");
526  return TRUE;
527 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
static BOOLEAN jjCONERAYS1(leftv res, leftv v)
Definition: bbcone.cc:374
static BOOLEAN jjCONERAYS2(leftv res, leftv u, leftv v)
Definition: bbcone.cc:401
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
static BOOLEAN jjCONERAYS3(leftv res, leftv u, leftv v, leftv w)
Definition: bbcone.cc:449
const CanonicalForm & w
Definition: facAbsFact.cc:55
BOOLEAN containsCone ( leftv  res,
leftv  args 
)

Definition at line 1471 of file bbcone.cc.

1472 {
1473  leftv u=args;
1474  if ((u != NULL) && (u->Typ() == LIST_CMD))
1475  {
1476  leftv v=u->next;
1477  if ((v != NULL) && (v->Typ() == coneID))
1478  {
1479  lists l = (lists) u->Data();
1480  gfan::ZCone* zc = (gfan::ZCone*) v->Data();
1481  zc->canonicalize();
1482  int b = 0;
1483  for (int i=0; i<=lSize(l); i++)
1484  {
1485  if (l->m[i].Typ() != coneID)
1486  {
1487  WerrorS("containsCone: entries of wrong type in list");
1488  return TRUE;
1489  }
1490  gfan::ZCone* ll = (gfan::ZCone*) l->m[i].Data();
1491  ll->canonicalize();
1492  if (!((*ll) != (*zc)))
1493  {
1494  b = 1;
1495  break;
1496  }
1497  }
1498  res->rtyp = INT_CMD;
1499  res->data = (char*) (long) b;
1500  return FALSE;
1501  }
1502  }
1503  WerrorS("containsCone: unexpected parameters");
1504  return TRUE;
1505 }
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
int i
Definition: cfEzgcd.cc:123
int lSize(lists L)
Definition: lists.cc:25
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
Definition: tok.h:120
const poly b
Definition: syzextra.cc:213
int l
Definition: cfEzgcd.cc:94
BOOLEAN containsInSupport ( leftv  res,
leftv  args 
)

Definition at line 1323 of file bbcone.cc.

1324 {
1325  leftv u=args;
1326  if ((u != NULL) && (u->Typ() == coneID))
1327  {
1328  leftv v=u->next;
1329  if ((v != NULL) && (v->Typ() == coneID))
1330  {
1331  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
1332  gfan::ZCone* zd = (gfan::ZCone*)v->Data();
1333  int d1 = zc->ambientDimension();
1334  int d2 = zd->ambientDimension();
1335  if (d1 != d2)
1336  {
1337  Werror("expected cones with same ambient dimensions\n but got"
1338  " dimensions %d and %d", d1, d2);
1339  return TRUE;
1340  }
1341  bool b = (zc->contains(*zd) ? 1 : 0);
1342  res->rtyp = INT_CMD;
1343  res->data = (void*) (long) b;
1344  return FALSE;
1345  }
1346  if ((v != NULL) && ((v->Typ() == BIGINTMAT_CMD) || (v->Typ() == INTVEC_CMD)))
1347  {
1348  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
1349  bigintmat* iv = NULL;
1350  if (v->Typ() == INTVEC_CMD)
1351  {
1352  intvec* iv0 = (intvec*) v->Data();
1353  iv = iv2bim(iv0,coeffs_BIGINT)->transpose();
1354  }
1355  else
1356  iv = (bigintmat*)v->Data();
1357 
1358  gfan::ZVector* zv = bigintmatToZVector(iv);
1359  int d1 = zc->ambientDimension();
1360  int d2 = zv->size();
1361  if (d1 != d2)
1362  {
1363  Werror("expected cones with same ambient dimensions\n but got"
1364  " dimensions %d and %d", d1, d2);
1365  return TRUE;
1366  }
1367  int b = zc->contains(*zv);
1368  res->rtyp = INT_CMD;
1369  res->data = (void*) (long) b;
1370 
1371  delete zv;
1372  if (v->Typ() == INTMAT_CMD)
1373  delete iv;
1374  return FALSE;
1375  }
1376  }
1377  WerrorS("containsInSupport: unexpected parameters");
1378  return TRUE;
1379 }
bigintmat * transpose()
Definition: bigintmat.cc:38
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:352
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
int coneID
Definition: bbcone.cc:26
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
const poly b
Definition: syzextra.cc:213
void Werror(const char *fmt,...)
Definition: reporter.cc:199
gfan::ZVector * bigintmatToZVector(const bigintmat &bim)
BOOLEAN containsPositiveVector ( leftv  res,
leftv  args 
)

Definition at line 846 of file bbcone.cc.

847 {
848  leftv u = args;
849  if ((u != NULL) && (u->Typ() == coneID))
850  {
851  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
852  int i = zc->containsPositiveVector();
853  res->rtyp = INT_CMD;
854  res->data = (void*) (long) i;
855  return FALSE;
856  }
857  WerrorS("containsPositiveVector: unexpected parameters");
858  return TRUE;
859 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN containsRelatively ( leftv  res,
leftv  args 
)

Definition at line 1381 of file bbcone.cc.

1382 {
1383  leftv u = args;
1384  if ((u != NULL) && (u->Typ() == coneID))
1385  {
1386  leftv v = u->next;
1387  if ((v != NULL) && ((v->Typ() == BIGINTMAT_CMD) || (v->Typ() == INTVEC_CMD)))
1388  {
1389  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
1390  bigintmat* iv = NULL;
1391  if (v->Typ() == INTVEC_CMD)
1392  {
1393  intvec* iv0 = (intvec*) v->Data();
1394  iv = iv2bim(iv0,coeffs_BIGINT)->transpose();
1395  }
1396  else
1397  iv = (bigintmat*)v->Data();
1398  gfan::ZVector* zv = bigintmatToZVector(iv);
1399  int d1 = zc->ambientDimension();
1400  int d2 = zv->size();
1401  if (d1 == d2)
1402  {
1403  bool b = (zc->containsRelatively(*zv) ? 1 : 0);
1404  res->rtyp = INT_CMD;
1405  res->data = (void *) b;
1406  delete zv;
1407  if (v->Typ() == INTMAT_CMD)
1408  delete iv;
1409  return FALSE;
1410  }
1411  delete zv;
1412  if (v->Typ() == INTMAT_CMD)
1413  delete iv;
1414  Werror("expected ambient dim of cone and size of vector\n"
1415  "to be equal but got %d and %d", d1, d2);
1416  }
1417  }
1418  WerrorS("containsRelatively: unexpected parameters");
1419  return TRUE;
1420 }
bigintmat * transpose()
Definition: bigintmat.cc:38
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:352
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
int coneID
Definition: bbcone.cc:26
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
const poly b
Definition: syzextra.cc:213
void Werror(const char *fmt,...)
Definition: reporter.cc:199
gfan::ZVector * bigintmatToZVector(const bigintmat &bim)
BOOLEAN convexHull ( leftv  res,
leftv  args 
)

Definition at line 1172 of file bbcone.cc.

1173 {
1174  leftv u = args;
1175  if ((u != NULL) && (u->Typ() == coneID))
1176  {
1177  leftv v = u->next;
1178  if ((v != NULL) && (v->Typ() == coneID))
1179  {
1180  gfan::ZCone* zc1 = (gfan::ZCone*)u->Data();
1181  gfan::ZCone* zc2 = (gfan::ZCone*)v->Data();
1182  int d1 = zc1->ambientDimension();
1183  int d2 = zc2->ambientDimension();
1184  if (d1 != d2)
1185  {
1186  Werror("expected ambient dims of both cones to coincide\n"
1187  "but got %d and %d", d1, d2);
1188  return TRUE;
1189  }
1190  gfan::ZMatrix zm1 = zc1->extremeRays();
1191  gfan::ZMatrix zm2 = zc2->extremeRays();
1192  gfan::ZMatrix zn1 = zc1->generatorsOfLinealitySpace();
1193  gfan::ZMatrix zn2 = zc2->generatorsOfLinealitySpace();
1194  gfan::ZMatrix zm = combineOnTop(zm1,zm2);
1195  gfan::ZMatrix zn = combineOnTop(zn1,zn2);
1196  gfan::ZCone* zc = new gfan::ZCone();
1197  *zc = gfan::ZCone::givenByRays(zm, zn);
1198  res->rtyp = coneID;
1199  res->data = (void*) zc;
1200  return FALSE;
1201  }
1202  if ((v != NULL) && (v->Typ() == polytopeID))
1203  {
1204  gfan::ZCone* zc11 = (gfan::ZCone*)u->Data();
1205  gfan::ZCone zc1 = liftUp(*zc11);
1206  gfan::ZCone* zc2 = (gfan::ZCone*)v->Data();
1207  int d1 = zc1.ambientDimension()-1;
1208  int d2 = zc2->ambientDimension()-1;
1209  if (d1 != d2)
1210  {
1211  Werror("expected ambient dims of both cones to coincide\n"
1212  "but got %d and %d", d1, d2);
1213  return TRUE;
1214  }
1215  gfan::ZMatrix zm1 = zc1.extremeRays();
1216  gfan::ZMatrix zm2 = zc2->extremeRays();
1217  gfan::ZMatrix zn = zc1.generatorsOfLinealitySpace();
1218  gfan::ZMatrix zm = combineOnTop(zm1,zm2);
1219  gfan::ZCone* zc = new gfan::ZCone();
1220  *zc = gfan::ZCone::givenByRays(zm, zn);
1221  res->rtyp = polytopeID;
1222  res->data = (void*) zc;
1223  return FALSE;
1224  }
1225  }
1226  if ((u != NULL) && (u->Typ() == polytopeID))
1227  {
1228  leftv v = u->next;
1229  if ((v != NULL) && (v->Typ() == coneID))
1230  {
1231  gfan::ZCone* zc1 = (gfan::ZCone*)u->Data();
1232  gfan::ZCone* zc22 = (gfan::ZCone*)v->Data();
1233  gfan::ZCone zc2 = liftUp(*zc22);
1234  int d1 = zc1->ambientDimension()-1;
1235  int d2 = zc2.ambientDimension()-1;
1236  if (d1 != d2)
1237  {
1238  Werror("expected ambient dims of both cones to coincide\n"
1239  "but got %d and %d", d1, d2);
1240  return TRUE;
1241  }
1242  gfan::ZMatrix zm1 = zc1->extremeRays();
1243  gfan::ZMatrix zm2 = zc2.extremeRays();
1244  gfan::ZMatrix zn = zc2.generatorsOfLinealitySpace();
1245  gfan::ZMatrix zm = combineOnTop(zm1,zm2);
1246  gfan::ZCone* zc = new gfan::ZCone();
1247  *zc = gfan::ZCone::givenByRays(zm,gfan::ZMatrix(0, zm.getWidth()));
1248  res->rtyp = polytopeID;
1249  res->data = (void*) zc;
1250  return FALSE;
1251  }
1252  if ((v != NULL) && (v->Typ() == polytopeID))
1253  {
1254  gfan::ZCone* zc1 = (gfan::ZCone*)u->Data();
1255  gfan::ZCone* zc2 = (gfan::ZCone*)v->Data();
1256  int d1 = zc1->ambientDimension()-1;
1257  int d2 = zc2->ambientDimension()-1;
1258  if (d1 != d2)
1259  {
1260  Werror("expected ambient dims of both cones to coincide\n"
1261  "but got %d and %d", d1, d2);
1262  return TRUE;
1263  }
1264  gfan::ZMatrix zm1 = zc1->extremeRays();
1265  gfan::ZMatrix zm2 = zc2->extremeRays();
1266  gfan::ZMatrix zm = combineOnTop(zm1,zm2);
1267  gfan::ZCone* zc = new gfan::ZCone();
1268  *zc = gfan::ZCone::givenByRays(zm,gfan::ZMatrix(0, zm.getWidth()));
1269  res->rtyp = polytopeID;
1270  res->data = (void*) zc;
1271  return FALSE;
1272  }
1273  }
1274  WerrorS("convexHull: unexpected parameters");
1275  return TRUE;
1276 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
gfan::ZMatrix liftUp(const gfan::ZMatrix &zm)
Definition: bbcone.cc:1046
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
void Werror(const char *fmt,...)
Definition: reporter.cc:199
BOOLEAN dimension ( leftv  res,
leftv  args 
)

Definition at line 701 of file bbcone.cc.

702 {
703  leftv u=args;
704  if ((u != NULL) && (u->Typ() == coneID))
705  {
706  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
707  res->rtyp = INT_CMD;
708  res->data = (void*) (long) zc->dimension();
709  return FALSE;
710  }
711  if ((u != NULL) && (u->Typ() == fanID))
712  {
713  gfan::ZFan* zf = (gfan::ZFan*)u->Data();
714  res->rtyp = INT_CMD;
715  res->data = (void*) (long) getDimension(zf);
716  return FALSE;
717  }
718  if ((u != NULL) && (u->Typ() == polytopeID))
719  {
720  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
721  res->rtyp = INT_CMD;
722  res->data = (void*) (long) getDimension(zc);
723  return FALSE;
724  }
725  WerrorS("dimension: unexpected parameters");
726  return TRUE;
727 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int fanID
Definition: bbfan.cc:20
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
int getDimension(gfan::ZFan *zf)
Definition: bbfan.cc:254
BOOLEAN dualCone ( leftv  res,
leftv  args 
)

Definition at line 876 of file bbcone.cc.

877 {
878  leftv u = args;
879  if ((u != NULL) && (u->Typ() == coneID))
880  {
881  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
882  gfan::ZCone* zd = new gfan::ZCone(zc->dualCone());
883  res->rtyp = coneID;
884  res->data = (void*) zd;
885  return FALSE;
886  }
887  WerrorS("dual: unexpected parameters");
888  return TRUE;
889 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN equations ( leftv  res,
leftv  args 
)

Definition at line 545 of file bbcone.cc.

546 {
547  leftv u = args;
548  if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID))
549  {
550  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
551  gfan::ZMatrix zmat = zc->getEquations();
552  res->rtyp = BIGINTMAT_CMD;
553  res->data = (void*) zMatrixToBigintmat(zmat);
554  return FALSE;
555  }
556  WerrorS("equations: unexpected parameters");
557  return TRUE;
558 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
gfan::ZVector* facetContaining ( gfan::ZCone *  zc,
gfan::ZVector *  zv 
)

Definition at line 1569 of file bbcone.cc.

1570 {
1571  gfan::ZMatrix facets = zc->getFacets();
1572  for (int i=0; i<facets.getHeight(); i++)
1573  {
1574  gfan::ZVector facet = facets[i];
1575  if (dot(facet,*zv) == (long) 0)
1576  return new gfan::ZVector(facet);
1577  }
1578  return new gfan::ZVector(zc->ambientDimension());
1579 }
Definition: gfan.h:44
int i
Definition: cfEzgcd.cc:123
BOOLEAN facets(leftv res, leftv args)
Definition: bbcone.cc:560
BOOLEAN facetContaining ( leftv  res,
leftv  args 
)

Definition at line 1582 of file bbcone.cc.

1583 {
1584  leftv u = args;
1585  if ((u != NULL) && (u->Typ() == coneID))
1586  {
1587  leftv v = u->next;
1588  if ((v != NULL) && ((v->Typ() == BIGINTMAT_CMD) || (v->Typ() == INTVEC_CMD)))
1589  {
1590  gfan::ZCone* zc = (gfan::ZCone*) u->Data();
1591 
1592  bigintmat* point1;
1593  if (v->Typ() == INTVEC_CMD)
1594  {
1595  intvec* point0 = (intvec*) v->Data();
1596  point1 = iv2bim(point0,coeffs_BIGINT)->transpose();
1597  }
1598  else
1599  point1 = (bigintmat*) v->Data();
1600 
1601  gfan::ZVector* point = bigintmatToZVector(*point1);
1602  gfan::ZVector* facet = facetContaining(zc, point);
1603 
1604  res->rtyp = BIGINTMAT_CMD;
1605  res->data = (void*) zVectorToBigintmat(*facet);
1606 
1607  delete facet;
1608  delete point;
1609  if (v->Typ() == INTVEC_CMD)
1610  delete point1;
1611  return FALSE;
1612  }
1613  }
1614  WerrorS("facetContaining: unexpected parameters");
1615  return TRUE;
1616 }
bigintmat * transpose()
Definition: bigintmat.cc:38
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:352
Definition: gfan.h:44
gfan::ZVector * facetContaining(gfan::ZCone *zc, gfan::ZVector *zv)
Definition: bbcone.cc:1569
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
int coneID
Definition: bbcone.cc:26
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
gfan::ZVector * bigintmatToZVector(const bigintmat &bim)
BOOLEAN facets ( leftv  res,
leftv  args 
)

Definition at line 560 of file bbcone.cc.

561 {
562  leftv u = args;
563  if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID))
564  {
565  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
566  gfan::ZMatrix zm = zc->getFacets();
567  res->rtyp = BIGINTMAT_CMD;
568  res->data = (void*) zMatrixToBigintmat(zm);
569  return FALSE;
570  }
571  WerrorS("facets: unexpected parameters");
572  return TRUE;
573 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN generatorsOfLinealitySpace ( leftv  res,
leftv  args 
)

Definition at line 605 of file bbcone.cc.

606 {
607  leftv u = args;
608  if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID))
609  {
610  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
611  gfan::ZMatrix zmat = zc->generatorsOfLinealitySpace();
612  res->rtyp = BIGINTMAT_CMD;
613  res->data = (void*) zMatrixToBigintmat(zmat);
614  return FALSE;
615  }
616  WerrorS("generatorsOfLinealitySpace: unexpected parameters");
617  return TRUE;
618 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN generatorsOfSpan ( leftv  res,
leftv  args 
)

Definition at line 590 of file bbcone.cc.

591 {
592  leftv u = args;
593  if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID))
594  {
595  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
596  gfan::ZMatrix zmat = zc->generatorsOfSpan();
597  res->rtyp = BIGINTMAT_CMD;
598  res->data = (void*) zMatrixToBigintmat(zmat);
599  return FALSE;
600  }
601  WerrorS("generatorsOfSpan: unexpected parameters");
602  return TRUE;
603 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN getLinearForms ( leftv  res,
leftv  args 
)

Definition at line 658 of file bbcone.cc.

659 {
660  leftv u = args;
661  if ((u != NULL) && (u->Typ() == coneID))
662  {
663  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
664  gfan::ZMatrix zmat = zc->getLinearForms();
665  res->rtyp = BIGINTMAT_CMD;
666  res->data = (void*) zMatrixToBigintmat(zmat);
667  return FALSE;
668  }
669  WerrorS("getLinearForms: unexpected parameters");
670  return TRUE;
671 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN getMultiplicity ( leftv  res,
leftv  args 
)

Definition at line 778 of file bbcone.cc.

779 {
780  leftv u = args;
781  if ((u != NULL) && (u->Typ() == coneID))
782  {
783  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
784  number i = integerToNumber(zc->getMultiplicity());
785  res->rtyp = BIGINT_CMD;
786  res->data = (void*) i;
787  return FALSE;
788  }
789  WerrorS("getMultiplicity: unexpected parameters");
790  return TRUE;
791 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
Definition: tok.h:42
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
number integerToNumber(const gfan::Integer &I)
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
static gfan::Integer gfanIntegerReadFd ( ssiInfo dd)
static

Definition at line 1790 of file bbcone.cc.

1791 {
1792  mpz_t tmp;
1793  mpz_init(tmp);
1794  s_readmpz_base(dd->f_read,tmp,SSI_BASE);
1795  gfan::Integer n(tmp);
1796  mpz_clear(tmp);
1797  return n;
1798 }
void s_readmpz_base(s_buff F, mpz_ptr a, int base)
Definition: s_buff.cc:217
#define SSI_BASE
Definition: auxiliary.h:177
static void gfanIntegerWriteFd ( gfan::Integer  n,
ssiInfo dd 
)
static

Definition at line 1744 of file bbcone.cc.

1745 {
1746  mpz_t tmp;
1747  mpz_init(tmp);
1748  n.setGmp(tmp);
1749  mpz_out_str (dd->f_write,SSI_BASE, tmp);
1750  mpz_clear(tmp);
1751  fputc(' ',dd->f_write);
1752 }
#define SSI_BASE
Definition: auxiliary.h:177
static gfan::ZMatrix gfanZMatrixReadFd ( ssiInfo dd)
static

Definition at line 1800 of file bbcone.cc.

1801 {
1802  int r=s_readint(dd->f_read);
1803  int c=s_readint(dd->f_read);
1804 
1805  gfan::ZMatrix M(r,c);
1806  for (int i=0; i<r; i++)
1807  {
1808  for (int j=0; j<c; j++)
1809  {
1810  M[i][j] = gfanIntegerReadFd(dd);
1811  }
1812  }
1813  return M;
1814 }
#define M
Definition: sirandom.c:24
const ring r
Definition: syzextra.cc:208
int s_readint(s_buff F)
Definition: s_buff.cc:120
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
static gfan::Integer gfanIntegerReadFd(ssiInfo *dd)
Definition: bbcone.cc:1790
static void gfanZMatrixWriteFd ( gfan::ZMatrix  M,
ssiInfo dd 
)
static

Definition at line 1754 of file bbcone.cc.

1755 {
1756  fprintf(dd->f_write,"%d %d ",M.getHeight(),M.getWidth());
1757 
1758  for (int i=0; i<M.getHeight(); i++)
1759  {
1760  for (int j=0; j<M.getWidth(); j++)
1761  {
1762  gfanIntegerWriteFd(M[i][j],dd);
1763  }
1764  }
1765 }
#define M
Definition: sirandom.c:24
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
static void gfanIntegerWriteFd(gfan::Integer n, ssiInfo *dd)
Definition: bbcone.cc:1744
BOOLEAN hasFace ( leftv  res,
leftv  args 
)

Definition at line 1422 of file bbcone.cc.

1423 {
1424  leftv u=args;
1425  if ((u != NULL) && (u->Typ() == coneID))
1426  {
1427  leftv v=u->next;
1428  if ((v != NULL) && (v->Typ() == coneID))
1429  {
1430  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
1431  gfan::ZCone* zd = (gfan::ZCone*)v->Data();
1432  bool b = zc->hasFace(*zd);
1433  res->rtyp = INT_CMD;
1434  res->data = (void*) (long) b;
1435  return FALSE;
1436  }
1437  }
1438  if ((u != NULL) && (u->Typ() == polytopeID))
1439  {
1440  leftv v=u->next;
1441  if ((v != NULL) && (v->Typ() == polytopeID))
1442  {
1443  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
1444  gfan::ZCone* zd = (gfan::ZCone*)v->Data();
1445  bool b = zc->hasFace(*zd);
1446  res->rtyp = INT_CMD;
1447  res->data = (void*) (long) b;
1448  return FALSE;
1449  }
1450  }
1451  WerrorS("containsAsFace: unexpected parameters");
1452  return TRUE;
1453 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
const poly b
Definition: syzextra.cc:213
BOOLEAN impliedEquations ( leftv  res,
leftv  args 
)

Definition at line 575 of file bbcone.cc.

576 {
577  leftv u = args;
578  if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID))
579  {
580  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
581  gfan::ZMatrix zmat = zc->getImpliedEquations();
582  res->rtyp = BIGINTMAT_CMD;
583  res->data = (void*) zMatrixToBigintmat(zmat);
584  return FALSE;
585  }
586  WerrorS("span: unexpected parameters");
587  return TRUE;
588 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN inequalities ( leftv  res,
leftv  args 
)

Definition at line 529 of file bbcone.cc.

530 {
531  leftv u = args;
532  if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID))
533  {
534  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
535 
536  gfan::ZMatrix zmat = zc->getInequalities();
537  res->rtyp = BIGINTMAT_CMD;
538  res->data = (void*) zMatrixToBigintmat(zmat);
539  return FALSE;
540  }
541  WerrorS("inequalities: unexpected parameters");
542  return TRUE;
543 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
std::pair<gfan::ZMatrix,gfan::ZMatrix> interiorPointsAndNormalsOfFacets ( const gfan::ZCone  zc,
const std::set< gfan::ZVector > &  exceptThesePoints,
const bool  onlyLowerHalfSpace 
)

Definition at line 1676 of file bbcone.cc.

1677 {
1678  gfan::ZMatrix inequalities = zc.getFacets();
1679  gfan::ZMatrix equations = zc.getImpliedEquations();
1680  int r = inequalities.getHeight();
1681  int c = inequalities.getWidth();
1682 
1683  /* our cone has r facets, if r==0 return empty matrices */
1684  gfan::ZMatrix relativeInteriorPoints = gfan::ZMatrix(0,c);
1685  gfan::ZMatrix outerFacetNormals = gfan::ZMatrix(0,c);
1686  if (r==0)
1687  return std::make_pair(relativeInteriorPoints,outerFacetNormals);
1688 
1689  /* next we iterate over each of the r facets,
1690  * build the respective cone and add it to the list
1691  * this is the i=0 case */
1692  gfan::ZMatrix newInequalities = inequalities.submatrix(1,0,r,c);
1693  gfan::ZMatrix newEquations = equations;
1694  newEquations.appendRow(inequalities[0]);
1695  gfan::ZCone facet = gfan::ZCone(newInequalities,newEquations);
1696  gfan::ZVector interiorPoint = facet.getRelativeInteriorPoint();
1697  if (onlyLowerHalfSpace==false || interiorPoint[0].sign()<0)
1698  {
1699  if (exceptThesePoints.count(interiorPoint)==0)
1700  {
1701  relativeInteriorPoints.appendRow(interiorPoint);
1702  outerFacetNormals.appendRow(-inequalities[0]);
1703  }
1704  }
1705 
1706  /* these are the cases i=1,...,r-2 */
1707  for (int i=1; i<r-1; i++)
1708  {
1709  newInequalities = inequalities.submatrix(0,0,i,c);
1710  newInequalities.append(inequalities.submatrix(i+1,0,r,c));
1711  newEquations = equations;
1712  newEquations.appendRow(inequalities[i]);
1713  facet = gfan::ZCone(newInequalities,newEquations);
1714  interiorPoint = facet.getRelativeInteriorPoint();
1715  if (onlyLowerHalfSpace==false || interiorPoint[0].sign()<0)
1716  {
1717  if (exceptThesePoints.count(interiorPoint)==0)
1718  {
1719  relativeInteriorPoints.appendRow(interiorPoint);
1720  outerFacetNormals.appendRow(-inequalities[i]);
1721  }
1722  }
1723  }
1724 
1725  /* this is the i=r-1 case */
1726  newInequalities = inequalities.submatrix(0,0,r-1,c);
1727  newEquations = equations;
1728  newEquations.appendRow(inequalities[r-1]);
1729  facet = gfan::ZCone(newInequalities,newEquations);
1730  interiorPoint = facet.getRelativeInteriorPoint();
1731  if (onlyLowerHalfSpace==false || interiorPoint[0].sign()<0)
1732  {
1733  if (exceptThesePoints.count(interiorPoint)==0)
1734  {
1735  relativeInteriorPoints.appendRow(interiorPoint);
1736  outerFacetNormals.appendRow(-inequalities[r-1]);
1737  }
1738  }
1739 
1740  return std::make_pair(relativeInteriorPoints,outerFacetNormals);
1741 }
Definition: gfan.h:44
BOOLEAN inequalities(leftv res, leftv args)
Definition: bbcone.cc:529
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
BOOLEAN equations(leftv res, leftv args)
Definition: bbcone.cc:545
int sign(const CanonicalForm &a)
gfan::ZMatrix interiorPointsOfFacets ( const gfan::ZCone &  zc,
const std::set< gfan::ZVector > &  exceptThese 
)

Definition at line 1622 of file bbcone.cc.

1623 {
1624  gfan::ZMatrix inequalities = zc.getFacets();
1625  gfan::ZMatrix equations = zc.getImpliedEquations();
1626  int r = inequalities.getHeight();
1627  int c = inequalities.getWidth();
1628 
1629  /* our cone has r facets, if r==0 return empty matrices */
1630  gfan::ZMatrix relativeInteriorPoints = gfan::ZMatrix(0,c);
1631  if (r==0) return relativeInteriorPoints;
1632 
1633  /* next we iterate over each of the r facets,
1634  * build the respective cone and add it to the list
1635  * this is the i=0 case */
1636  gfan::ZMatrix newInequalities = inequalities.submatrix(1,0,r,c);
1637  gfan::ZMatrix newEquations = equations;
1638  newEquations.appendRow(inequalities[0]);
1639  gfan::ZCone facet = gfan::ZCone(newInequalities,newEquations);
1640  facet.canonicalize();
1641  gfan::ZVector interiorPoint = facet.getRelativeInteriorPoint();
1642  if (exceptThese.count(interiorPoint)==0)
1643  relativeInteriorPoints.appendRow(interiorPoint);
1644 
1645  /* these are the cases i=1,...,r-2 */
1646  for (int i=1; i<r-1; i++)
1647  {
1648  newInequalities = inequalities.submatrix(0,0,i,c);
1649  newInequalities.append(inequalities.submatrix(i+1,0,r,c));
1650  newEquations = equations;
1651  newEquations.appendRow(inequalities[i]);
1652  facet = gfan::ZCone(newInequalities,newEquations);
1653  facet.canonicalize();
1654  interiorPoint = facet.getRelativeInteriorPoint();
1655  if (exceptThese.count(interiorPoint)==0)
1656  relativeInteriorPoints.appendRow(interiorPoint);
1657  }
1658 
1659  /* this is the i=r-1 case */
1660  newInequalities = inequalities.submatrix(0,0,r-1,c);
1661  newEquations = equations;
1662  newEquations.appendRow(inequalities[r-1]);
1663  facet = gfan::ZCone(newInequalities,newEquations);
1664  facet.canonicalize();
1665  interiorPoint = facet.getRelativeInteriorPoint();
1666  if (exceptThese.count(interiorPoint)==0)
1667  relativeInteriorPoints.appendRow(interiorPoint);
1668 
1669  return relativeInteriorPoints;
1670 }
Definition: gfan.h:44
BOOLEAN inequalities(leftv res, leftv args)
Definition: bbcone.cc:529
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
BOOLEAN equations(leftv res, leftv args)
Definition: bbcone.cc:545
BOOLEAN intersectCones ( leftv  res,
leftv  args 
)

Definition at line 1083 of file bbcone.cc.

1084 {
1085  leftv u = args;
1086  if ((u != NULL) && (u->Typ() == coneID))
1087  {
1088  leftv v = u->next;
1089  if ((v != NULL) && (v->Typ() == coneID))
1090  {
1091  gfan::ZCone* zc1 = (gfan::ZCone*)u->Data();
1092  gfan::ZCone* zc2 = (gfan::ZCone*)v->Data();
1093  int d1 = zc1->ambientDimension();
1094  int d2 = zc2->ambientDimension();
1095  if (d1 != d2)
1096  {
1097  Werror("expected ambient dims of both cones to coincide\n"
1098  "but got %d and %d", d1, d2);
1099  return TRUE;
1100  }
1101  gfan::ZCone zc3 = gfan::intersection(*zc1, *zc2);
1102  zc3.canonicalize();
1103  res->rtyp = coneID;
1104  res->data = (void *)new gfan::ZCone(zc3);
1105  return FALSE;
1106  }
1107  if ((v != NULL) && (v->Typ() == polytopeID))
1108  {
1109  gfan::ZCone* zc11 = (gfan::ZCone*)u->Data();
1110  gfan::ZCone zc1 = liftUp(*zc11);
1111  gfan::ZCone* zc2 = (gfan::ZCone*)v->Data();
1112  int d1 = zc1.ambientDimension();
1113  int d2 = zc2->ambientDimension();
1114  if (d1 != d2)
1115  {
1116  Werror("expected ambient dims of both cones to coincide\n"
1117  "but got %d and %d", d1, d2);
1118  return TRUE;
1119  }
1120  gfan::ZCone zc3 = gfan::intersection(zc1, *zc2);
1121  zc3.canonicalize();
1122  res->rtyp = polytopeID;
1123  res->data = (void *)new gfan::ZCone(zc3);
1124  return FALSE;
1125  }
1126  }
1127  if ((u != NULL) && (u->Typ() == polytopeID))
1128  {
1129  leftv v = u->next;
1130  if ((v != NULL) && (v->Typ() == coneID))
1131  {
1132  gfan::ZCone* zc1 = (gfan::ZCone*)u->Data();
1133  gfan::ZCone* zc22 = (gfan::ZCone*)v->Data();
1134  gfan::ZCone zc2 = liftUp(*zc22);
1135  int d1 = zc1->ambientDimension();
1136  int d2 = zc2.ambientDimension();
1137  if (d1 != d2)
1138  {
1139  Werror("expected ambient dims of both cones to coincide\n"
1140  "but got %d and %d", d1, d2);
1141  return TRUE;
1142  }
1143  gfan::ZCone zc3 = gfan::intersection(*zc1, zc2);
1144  zc3.canonicalize();
1145  res->rtyp = polytopeID;
1146  res->data = (void *)new gfan::ZCone(zc3);
1147  return FALSE;
1148  }
1149  if ((v != NULL) && (v->Typ() == polytopeID))
1150  {
1151  gfan::ZCone* zc1 = (gfan::ZCone*)u->Data();
1152  gfan::ZCone* zc2 = (gfan::ZCone*)v->Data();
1153  int d1 = zc1->ambientDimension();
1154  int d2 = zc2->ambientDimension();
1155  if (d1 != d2)
1156  {
1157  Werror("expected ambient dims of both cones to coincide\n"
1158  "but got %d and %d", d1, d2);
1159  return TRUE;
1160  }
1161  gfan::ZCone zc3 = gfan::intersection(*zc1, *zc2);
1162  zc3.canonicalize();
1163  res->rtyp = polytopeID;
1164  res->data = (void *)new gfan::ZCone(zc3);
1165  return FALSE;
1166  }
1167  }
1168  WerrorS("convexIntersection: unexpected parameters");
1169  return TRUE;
1170 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
gfan::ZMatrix liftUp(const gfan::ZMatrix &zm)
Definition: bbcone.cc:1046
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int polytopeID
Definition: bbpolytope.cc:17
int coneID
Definition: bbcone.cc:26
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
void Werror(const char *fmt,...)
Definition: reporter.cc:199
BOOLEAN isFullSpace ( leftv  res,
leftv  args 
)

Definition at line 808 of file bbcone.cc.

809 {
810  leftv u = args;
811  if ((u != NULL) && (u->Typ() == coneID))
812  {
813  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
814  int i = zc->isFullSpace();
815  res->rtyp = INT_CMD;
816  res->data = (void*) (long) i;
817  return FALSE;
818  }
819  WerrorS("isFullSpace: unexpected parameters");
820  return TRUE;
821 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN isOrigin ( leftv  res,
leftv  args 
)

Definition at line 793 of file bbcone.cc.

794 {
795  leftv u = args;
796  if ((u != NULL) && (u->Typ() == coneID))
797  {
798  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
799  int i = zc->isOrigin();
800  res->rtyp = INT_CMD;
801  res->data = (void*) (long) i;
802  return FALSE;
803  }
804  WerrorS("isOrigin: unexpected parameters");
805  return TRUE;
806 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN isSimplicial ( leftv  res,
leftv  args 
)

Definition at line 823 of file bbcone.cc.

824 {
825  leftv u=args;
826  if ((u != NULL) && (u->Typ() == coneID))
827  {
828  gfan::ZCone* zc = (gfan::ZCone*) u->Data();
829  int b = zc->isSimplicial();
830  res->rtyp = INT_CMD;
831  res->data = (void*) (long) b;
832  return FALSE;
833  }
834  if ((u != NULL) && (u->Typ() == fanID))
835  {
836  gfan::ZFan* zf = (gfan::ZFan*) u->Data();
837  bool b = isSimplicial(zf);
838  res->rtyp = INT_CMD;
839  res->data = (void*) (long) b;
840  return FALSE;
841  }
842  WerrorS("isSimplicial: unexpected parameters");
843  return TRUE;
844 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int fanID
Definition: bbfan.cc:20
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
BOOLEAN isSimplicial(leftv res, leftv args)
Definition: bbcone.cc:823
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
const poly b
Definition: syzextra.cc:213
static BOOLEAN jjCONENORMALS1 ( leftv  res,
leftv  v 
)
static

Definition at line 238 of file bbcone.cc.

239 {
240  /* method for generating a cone object from inequalities;
241  valid parametrizations: (intmat) */
242  bigintmat* ineq = NULL;
243  if (v->Typ() == INTMAT_CMD)
244  {
245  intvec* ineq0 = (intvec*) v->Data();
246  ineq = iv2bim(ineq0,coeffs_BIGINT);
247  }
248  else
249  ineq = (bigintmat*) v->Data();
250  gfan::ZMatrix* zm = bigintmatToZMatrix(ineq);
251  gfan::ZCone* zc = new gfan::ZCone(*zm, gfan::ZMatrix(0, zm->getWidth()));
252  delete zm;
253  if (v->Typ() == INTMAT_CMD)
254  delete ineq;
255  res->rtyp = coneID;
256  res->data = (void*) zc;
257  return FALSE;
258 }
#define FALSE
Definition: auxiliary.h:140
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:352
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
static BOOLEAN jjCONENORMALS2 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 260 of file bbcone.cc.

261 {
262  /* method for generating a cone object from iequalities,
263  and equations (...)
264  valid parametrizations: (intmat, intmat)
265  Errors will be invoked in the following cases:
266  - u and v have different numbers of columns */
267  bigintmat* ineq = NULL; bigintmat* eq = NULL;
268  if (u->Typ() == INTMAT_CMD)
269  {
270  intvec* ineq0 = (intvec*) u->Data();
271  ineq = iv2bim(ineq0,coeffs_BIGINT);
272  }
273  else
274  ineq = (bigintmat*) u->Data();
275  if (v->Typ() == INTMAT_CMD)
276  {
277  intvec* eq0 = (intvec*) v->Data();
278  eq = iv2bim(eq0,coeffs_BIGINT);
279  }
280  else
281  eq = (bigintmat*) v->Data();
282 
283  if (ineq->cols() != eq->cols())
284  {
285  Werror("expected same number of columns but got %d vs. %d",
286  ineq->cols(), eq->cols());
287  return TRUE;
288  }
289  gfan::ZMatrix* zm1 = bigintmatToZMatrix(ineq);
290  gfan::ZMatrix* zm2 = bigintmatToZMatrix(eq);
291  gfan::ZCone* zc = new gfan::ZCone(*zm1, *zm2);
292  delete zm1;
293  delete zm2;
294  if (u->Typ() == INTMAT_CMD)
295  delete ineq;
296  if (v->Typ() == INTMAT_CMD)
297  delete eq;
298  res->rtyp = coneID;
299  res->data = (void*) zc;
300  return FALSE;
301 }
#define FALSE
Definition: auxiliary.h:140
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:352
#define TRUE
Definition: auxiliary.h:144
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
int coneID
Definition: bbcone.cc:26
int cols() const
Definition: bigintmat.h:145
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
void Werror(const char *fmt,...)
Definition: reporter.cc:199
static BOOLEAN jjCONENORMALS3 ( leftv  res,
leftv  u,
leftv  v,
leftv  w 
)
static

Definition at line 303 of file bbcone.cc.

304 {
305  /* method for generating a cone object from inequalities, equations,
306  and an integer k;
307  valid parametrizations: (intmat, intmat, int);
308  Errors will be invoked in the following cases:
309  - u and v have different numbers of columns,
310  - k not in [0..3];
311  if the 2^0-bit of k is set, then ... */
312  bigintmat* ineq = NULL; bigintmat* eq = NULL;
313  if (u->Typ() == INTMAT_CMD)
314  {
315  intvec* ineq0 = (intvec*) u->Data();
316  ineq = iv2bim(ineq0,coeffs_BIGINT);
317  }
318  else
319  ineq = (bigintmat*) u->Data();
320  if (v->Typ() == INTMAT_CMD)
321  {
322  intvec* eq0 = (intvec*) v->Data();
323  eq = iv2bim(eq0,coeffs_BIGINT);
324  }
325  else
326  eq = (bigintmat*) v->Data();
327  if (ineq->cols() != eq->cols())
328  {
329  Werror("expected same number of columns but got %d vs. %d",
330  ineq->cols(), eq->cols());
331  return TRUE;
332  }
333  int k = (int)(long)w->Data();
334  if ((k < 0) || (k > 3))
335  {
336  WerrorS("expected int argument in [0..3]");
337  return TRUE;
338  }
339  gfan::ZMatrix* zm1 = bigintmatToZMatrix(ineq);
340  gfan::ZMatrix* zm2 = bigintmatToZMatrix(eq);
341  gfan::ZCone* zc = new gfan::ZCone(*zm1, *zm2, k);
342  delete zm1;
343  delete zm2;
344  if (u->Typ() == INTMAT_CMD)
345  delete ineq;
346  if (v->Typ() == INTMAT_CMD)
347  delete eq;
348  res->rtyp = coneID;
349  res->data = (void*) zc;
350  return FALSE;
351 }
#define FALSE
Definition: auxiliary.h:140
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:352
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int k
Definition: cfEzgcd.cc:93
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
int coneID
Definition: bbcone.cc:26
int cols() const
Definition: bigintmat.h:145
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
void Werror(const char *fmt,...)
Definition: reporter.cc:199
static BOOLEAN jjCONERAYS1 ( leftv  res,
leftv  v 
)
static

Definition at line 374 of file bbcone.cc.

375 {
376  /* method for generating a cone object from half-lines
377  (cone = convex hull of the half-lines; note: there may be
378  entire lines in the cone);
379  valid parametrizations: (intmat) */
380  bigintmat* rays = NULL;
381  if (v->Typ() == INTMAT_CMD)
382  {
383  intvec* rays0 = (intvec*) v->Data();
384  rays = iv2bim(rays0,coeffs_BIGINT);
385  }
386  else
387  rays = (bigintmat*) v->Data();
388 
389  gfan::ZMatrix* zm = bigintmatToZMatrix(rays);
390  gfan::ZCone* zc = new gfan::ZCone();
391  *zc = gfan::ZCone::givenByRays(*zm, gfan::ZMatrix(0, zm->getWidth()));
392  res->rtyp = coneID;
393  res->data = (void*) zc;
394 
395  delete zm;
396  if (v->Typ() == INTMAT_CMD)
397  delete rays;
398  return FALSE;
399 }
#define FALSE
Definition: auxiliary.h:140
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:352
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
int coneID
Definition: bbcone.cc:26
BOOLEAN rays(leftv res, leftv args)
Definition: bbcone.cc:620
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
static BOOLEAN jjCONERAYS2 ( leftv  res,
leftv  u,
leftv  v 
)
static

Definition at line 401 of file bbcone.cc.

402 {
403  /* method for generating a cone object from half-lines,
404  and lines (any point in the cone being the sum of a point
405  in the convex hull of the half-lines and a point in the span
406  of the lines; the second argument may contain or entirely consist
407  of zero rows);
408  valid parametrizations: (intmat, intmat)
409  Errors will be invoked in the following cases:
410  - u and v have different numbers of columns */
411  bigintmat* rays = NULL; bigintmat* linSpace = NULL;
412  if (u->Typ() == INTMAT_CMD)
413  {
414  intvec* rays0 = (intvec*) u->Data();
415  rays = iv2bim(rays0,coeffs_BIGINT);
416  }
417  else
418  rays = (bigintmat*) u->Data();
419  if (v->Typ() == INTMAT_CMD)
420  {
421  intvec* linSpace0 = (intvec*) v->Data();
422  linSpace = iv2bim(linSpace0,coeffs_BIGINT);
423  }
424  else
425  linSpace = (bigintmat*) v->Data();
426 
427  if (rays->cols() != linSpace->cols())
428  {
429  Werror("expected same number of columns but got %d vs. %d",
430  rays->cols(), linSpace->cols());
431  return TRUE;
432  }
433  gfan::ZMatrix* zm1 = bigintmatToZMatrix(rays);
434  gfan::ZMatrix* zm2 = bigintmatToZMatrix(linSpace);
435  gfan::ZCone* zc = new gfan::ZCone();
436  *zc = gfan::ZCone::givenByRays(*zm1, *zm2);
437  res->rtyp = coneID;
438  res->data = (void*) zc;
439 
440  delete zm1;
441  delete zm2;
442  if (u->Typ() == INTMAT_CMD)
443  delete rays;
444  if (v->Typ() == INTMAT_CMD)
445  delete linSpace;
446  return FALSE;
447 }
#define FALSE
Definition: auxiliary.h:140
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:352
#define TRUE
Definition: auxiliary.h:144
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
int coneID
Definition: bbcone.cc:26
int cols() const
Definition: bigintmat.h:145
BOOLEAN rays(leftv res, leftv args)
Definition: bbcone.cc:620
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
void Werror(const char *fmt,...)
Definition: reporter.cc:199
static BOOLEAN jjCONERAYS3 ( leftv  res,
leftv  u,
leftv  v,
leftv  w 
)
static

Definition at line 449 of file bbcone.cc.

450 {
451  /* method for generating a cone object from half-lines,
452  and lines (any point in the cone being the sum of a point
453  in the convex hull of the half-lines and a point in the span
454  of the lines), and an integer k;
455  valid parametrizations: (intmat, intmat, int);
456  Errors will be invoked in the following cases:
457  - u and v have different numbers of columns,
458  - k not in [0..3];
459  if the 2^0-bit of k is set, then the lineality space is known
460  to be the span of the provided lines;
461  if the 2^1-bit of k is set, then the extreme rays are known:
462  each half-line spans a (different) extreme ray */
463  bigintmat* rays = NULL; bigintmat* linSpace = NULL;
464  if (u->Typ() == INTMAT_CMD)
465  {
466  intvec* rays0 = (intvec*) u->Data();
467  rays = iv2bim(rays0,coeffs_BIGINT);
468  }
469  else
470  rays = (bigintmat*) u->Data();
471  if (v->Typ() == INTMAT_CMD)
472  {
473  intvec* linSpace0 = (intvec*) v->Data();
474  linSpace = iv2bim(linSpace0,coeffs_BIGINT);
475  }
476  else
477  linSpace = (bigintmat*) v->Data();
478 
479  if (rays->cols() != linSpace->cols())
480  {
481  Werror("expected same number of columns but got %d vs. %d",
482  rays->cols(), linSpace->cols());
483  return TRUE;
484  }
485  int k = (int)(long)w->Data();
486  if ((k < 0) || (k > 3))
487  {
488  WerrorS("expected int argument in [0..3]");
489  return TRUE;
490  }
491  gfan::ZMatrix* zm1 = bigintmatToZMatrix(rays);
492  gfan::ZMatrix* zm2 = bigintmatToZMatrix(linSpace);
493  gfan::ZCone* zc = new gfan::ZCone();
494  *zc = gfan::ZCone::givenByRays(*zm1, *zm2);
495  //k should be passed on to zc; not available yet
496  res->rtyp = coneID;
497  res->data = (void*) zc;
498 
499  delete zm1;
500  delete zm2;
501  if (u->Typ() == INTMAT_CMD)
502  delete rays;
503  if (v->Typ() == INTMAT_CMD)
504  delete linSpace;
505  return FALSE;
506 }
#define FALSE
Definition: auxiliary.h:140
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:352
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int k
Definition: cfEzgcd.cc:93
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
int coneID
Definition: bbcone.cc:26
int cols() const
Definition: bigintmat.h:145
BOOLEAN rays(leftv res, leftv args)
Definition: bbcone.cc:620
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
void Werror(const char *fmt,...)
Definition: reporter.cc:199
gfan::ZMatrix liftUp ( const gfan::ZMatrix &  zm)

Definition at line 1046 of file bbcone.cc.

1047 {
1048  int r=zm.getHeight();
1049  int c=zm.getWidth();
1050  gfan::ZMatrix zn(r+1,c+1);
1051  zn[1][1]=1;
1052  for (int i=0; i<r; i++)
1053  for (int j=0; j<c; j++)
1054  zn[i+1][j+1]=zm[i][j];
1055  return zn;
1056 }
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
gfan::ZCone liftUp ( const gfan::ZCone &  zc)

Definition at line 1058 of file bbcone.cc.

1059 {
1060  gfan::ZMatrix ineq=zc.getInequalities();
1061  gfan::ZMatrix eq=zc.getEquations();
1062  gfan::ZCone zd(liftUp(ineq),liftUp(eq));
1063  return zd;
1064 }
gfan::ZMatrix liftUp(const gfan::ZMatrix &zm)
Definition: bbcone.cc:1046
BOOLEAN linealityDimension ( leftv  res,
leftv  args 
)

Definition at line 757 of file bbcone.cc.

758 {
759  leftv u=args;
760  if ((u != NULL) && (u->Typ() == coneID))
761  {
762  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
763  res->rtyp = INT_CMD;
764  res->data = (void*) (long) zc->dimensionOfLinealitySpace();
765  return FALSE;
766  }
767  if ((u != NULL) && (u->Typ() == fanID))
768  {
769  gfan::ZFan* zf = (gfan::ZFan*)u->Data();
770  res->rtyp = INT_CMD;
771  res->data = (void*) (long) getLinealityDimension(zf);
772  return FALSE;
773  }
774  WerrorS("linealityDimension: unexpected parameters");
775  return TRUE;
776 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int fanID
Definition: bbfan.cc:20
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
int getLinealityDimension(gfan::ZFan *zf)
Definition: bbfan.cc:259
BOOLEAN linealitySpace ( leftv  res,
leftv  args 
)

Definition at line 861 of file bbcone.cc.

862 {
863  leftv u = args;
864  if ((u != NULL) && (u->Typ() == coneID))
865  {
866  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
867  gfan::ZCone* zd = new gfan::ZCone(zc->linealitySpace());
868  res->rtyp = coneID;
869  res->data = (void*) zd;
870  return FALSE;
871  }
872  WerrorS("linealitySpace: unexpected parameters");
873  return TRUE;
874 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
lists listOfFacets ( const gfan::ZCone &  zc)

Definition at line 1508 of file bbcone.cc.

1509 {
1510  gfan::ZMatrix inequalities = zc.getFacets();
1511  gfan::ZMatrix equations = zc.getImpliedEquations();
1513  int r = inequalities.getHeight();
1514  int c = inequalities.getWidth();
1515  L->Init(r);
1516 
1517  /* next we iterate over each of the r facets, build the respective cone and add it to the list */
1518  /* this is the i=0 case */
1519  gfan::ZMatrix newInequalities = inequalities.submatrix(1,0,r,c);
1520  gfan::ZMatrix newEquations = equations;
1521  newEquations.appendRow(inequalities[0]);
1522  L->m[0].rtyp = coneID; L->m[0].data=(void*) new gfan::ZCone(newInequalities,newEquations);
1523 
1524  /* these are the cases i=1,...,r-2 */
1525  for (int i=1; i<r-1; i++)
1526  {
1527  newInequalities = inequalities.submatrix(0,0,i-1,c);
1528  newInequalities.append(inequalities.submatrix(i+1,0,r,c));
1529  newEquations = equations;
1530  newEquations.appendRow(inequalities[i]);
1531  L->m[i].rtyp = coneID; L->m[i].data=(void*) new gfan::ZCone(newInequalities,newEquations);
1532  }
1533 
1534  /* this is the i=r-1 case */
1535  newInequalities = inequalities.submatrix(0,0,r-1,c);
1536  newEquations = equations;
1537  newEquations.appendRow(inequalities[r]);
1538  L->m[r-1].rtyp = coneID; L->m[r-1].data=(void*) new gfan::ZCone(newInequalities,newEquations);
1539 
1540  return L;
1541 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
void * data
Definition: subexpr.h:89
BOOLEAN inequalities(leftv res, leftv args)
Definition: bbcone.cc:529
const ring r
Definition: syzextra.cc:208
int coneID
Definition: bbcone.cc:26
int i
Definition: cfEzgcd.cc:123
INLINE_THIS void Init(int l=0)
Definition: lists.h:66
slists * lists
Definition: mpr_numeric.h:146
BOOLEAN equations(leftv res, leftv args)
Definition: bbcone.cc:545
int rtyp
Definition: subexpr.h:92
omBin slists_bin
Definition: lists.cc:23
BOOLEAN listOfFacets ( leftv  res,
leftv  args 
)

Definition at line 1544 of file bbcone.cc.

1545 {
1546  leftv u=args;
1547  if ((u != NULL) && (u->Typ() == coneID))
1548  {
1549  gfan::ZCone* zc = (gfan::ZCone*) u->Data();
1550  lists L = listOfFacets(*zc);
1551  res->rtyp = LIST_CMD;
1552  res->data = (void*) L;
1553  return FALSE;
1554  }
1555  WerrorS("listOfFacets: unexpected parameters");
1556  return TRUE;
1557 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
lists listOfFacets(const gfan::ZCone &zc)
Definition: bbcone.cc:1508
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
Definition: tok.h:120
BOOLEAN negatedCone ( leftv  res,
leftv  args 
)

Definition at line 891 of file bbcone.cc.

892 {
893  leftv u = args;
894  if ((u != NULL) && (u->Typ() == coneID))
895  {
896  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
897  gfan::ZCone* zd = new gfan::ZCone(zc->negated());
898  res->rtyp = coneID;
899  res->data = (void*) zd;
900  return FALSE;
901  }
902  WerrorS("negatedCone: unexpected parameters");
903  return TRUE;
904 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN quotientLatticeBasis ( leftv  res,
leftv  args 
)

Definition at line 643 of file bbcone.cc.

644 {
645  leftv u = args;
646  if ((u != NULL) && (u->Typ() == coneID))
647  {
648  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
649  gfan::ZMatrix zmat = zc->quotientLatticeBasis();
650  res->rtyp = BIGINTMAT_CMD;
651  res->data = (void*) zMatrixToBigintmat(zmat);
652  return FALSE;
653  }
654  WerrorS("quotientLatticeBasis: unexpected parameters");
655  return TRUE;
656 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
gfan::ZVector randomPoint ( const gfan::ZCone *  zc)

Definition at line 958 of file bbcone.cc.

959 {
960  gfan::ZVector rp = gfan::ZVector(zc->ambientDimension());
961 
962  gfan::ZMatrix rays = zc->extremeRays();
963  for (int i=0; i<rays.getHeight(); i++)
964  {
965  int n = siRand();
966  rp = rp + n * rays[i];
967  }
968 
969  gfan::ZMatrix lins = zc->generatorsOfLinealitySpace();
970  for (int i=0; i<lins.getHeight(); i++)
971  {
972  int n = siRand();
973  rp = rp + n * lins[i];
974  }
975 
976  return rp;
977 }
int i
Definition: cfEzgcd.cc:123
BOOLEAN rays(leftv res, leftv args)
Definition: bbcone.cc:620
int siRand()
Definition: sirandom.c:41
BOOLEAN randomPoint ( leftv  res,
leftv  args 
)

Definition at line 979 of file bbcone.cc.

980 {
981  leftv u = args;
982  if ((u != NULL) && (u->Typ() == coneID))
983  {
984  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
985  gfan::ZVector zv = randomPoint(zc);
986  res->rtyp = BIGINTMAT_CMD;
987  res->data = (void*) zVectorToBigintmat(zv);
988  return FALSE;
989  }
990  WerrorS("randomPoint: unexpected parameters");
991  return TRUE;
992 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
int Typ()
Definition: subexpr.cc:976
gfan::ZVector randomPoint(const gfan::ZCone *zc)
Definition: bbcone.cc:958
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN rays ( leftv  res,
leftv  args 
)

Definition at line 620 of file bbcone.cc.

621 {
622  leftv u = args;
623  if ((u != NULL) && (u->Typ() == coneID))
624  {
625  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
626  gfan::ZMatrix zm = zc->extremeRays();
627  res->rtyp = BIGINTMAT_CMD;
628  res->data = (void*)zMatrixToBigintmat(zm);
629  return FALSE;
630  }
631  if ((u != NULL) && (u->Typ() == fanID))
632  {
633  gfan::ZFan* zf = (gfan::ZFan*)u->Data();
634  gfan::ZMatrix zmat = rays(zf);
635  res->rtyp = BIGINTMAT_CMD;
636  res->data = (void*) zMatrixToBigintmat(zmat);
637  return FALSE;
638  }
639  WerrorS("rays: unexpected parameters");
640  return TRUE;
641 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int fanID
Definition: bbfan.cc:20
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
BOOLEAN rays(leftv res, leftv args)
Definition: bbcone.cc:620
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN relativeInteriorPoint ( leftv  res,
leftv  args 
)

Definition at line 928 of file bbcone.cc.

929 {
930  leftv u = args;
931  if ((u != NULL) && (u->Typ() == coneID))
932  {
933  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
934  gfan::ZVector zv = zc->getRelativeInteriorPoint();
935  res->rtyp = BIGINTMAT_CMD;
936  res->data = (void*) zVectorToBigintmat(zv);
937  return FALSE;
938  }
939  WerrorS("relativeInteriorPoint: unexpected parameters");
940  return TRUE;
941 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
BOOLEAN semigroupGenerator ( leftv  res,
leftv  args 
)

Definition at line 906 of file bbcone.cc.

907 {
908  leftv u = args;
909  if ((u != NULL) && (u->Typ() == coneID))
910  {
911  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
912  int d = zc->dimension();
913  int dLS = zc->dimensionOfLinealitySpace();
914  if (d == dLS + 1)
915  {
916  gfan::ZVector zv = zc->semiGroupGeneratorOfRay();
917  res->rtyp = BIGINTMAT_CMD;
918  res->data = (void*) zVectorToBigintmat(zv);
919  return FALSE;
920  }
921  Werror("expected dim of cone one larger than dim of lin space\n"
922  "but got dimensions %d and %d", d, dLS);
923  }
924  WerrorS("semigroupGenerator: unexpected parameters");
925  return TRUE;
926 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
void Werror(const char *fmt,...)
Definition: reporter.cc:199
BOOLEAN setLinearForms ( leftv  res,
leftv  args 
)

Definition at line 1014 of file bbcone.cc.

1015 {
1016  leftv u = args;
1017  if ((u != NULL) && (u->Typ() == coneID))
1018  {
1019  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
1020  leftv v = u->next;
1021  if ((v != NULL) && ((v->Typ() == BIGINTMAT_CMD) || (v->Typ() == INTVEC_CMD)))
1022  {
1023  bigintmat* mat=NULL;
1024  if (v->Typ() == INTVEC_CMD)
1025  {
1026  intvec* mat0 = (intvec*) v->Data();
1027  mat = iv2bim(mat0,coeffs_BIGINT)->transpose();
1028  }
1029  else
1030  mat = (bigintmat*) v->Data();
1031  gfan::ZMatrix* zm = bigintmatToZMatrix(mat);
1032  zc->setLinearForms(*zm);
1033  res->rtyp = NONE;
1034  res->data = NULL;
1035 
1036  delete zm;
1037  if (v->Typ() == INTVEC_CMD)
1038  delete mat;
1039  return FALSE;
1040  }
1041  }
1042  WerrorS("setLinearForms: unexpected parameters");
1043  return TRUE;
1044 }
bigintmat * transpose()
Definition: bigintmat.cc:38
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
Matrices of numbers.
Definition: bigintmat.h:51
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:352
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
int coneID
Definition: bbcone.cc:26
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
#define NONE
Definition: tok.h:220
BOOLEAN setMultiplicity ( leftv  res,
leftv  args 
)

Definition at line 994 of file bbcone.cc.

995 {
996  leftv u = args;
997  if ((u != NULL) && (u->Typ() == coneID))
998  {
999  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
1000  leftv v = u->next;
1001  if ((v != NULL) && (v->Typ() == INT_CMD))
1002  {
1003  int val = (int)(long)v->Data();
1004  zc->setMultiplicity(gfan::Integer(val));
1005  res->rtyp = NONE;
1006  res->data = NULL;
1007  return FALSE;
1008  }
1009  }
1010  WerrorS("setMultiplicity: unexpected parameters");
1011  return TRUE;
1012 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
#define NONE
Definition: tok.h:220
std::string toString ( const gfan::ZCone *const  c)

Definition at line 28 of file bbcone.cc.

29 {
30  std::stringstream s;
31  s<<"AMBIENT_DIM"<<std::endl;
32  s<<c->ambientDimension()<<std::endl;
33 
34  gfan::ZMatrix i=c->getInequalities();
35  char* ineqs = toString(i);
36  if (c->areFacetsKnown())
37  s<<"FACETS"<<std::endl;
38  else
39  s<<"INEQUALITIES"<<std::endl;
40  if (ineqs!=NULL)
41  {
42  s<<ineqs<<std::endl;
43  omFree(ineqs);
44  }
45 
46  gfan::ZMatrix e=c->getEquations();
47  char* eqs = toString(e);
48  if (c->areImpliedEquationsKnown())
49  s<<"LINEAR_SPAN"<<std::endl;
50  else
51  s<<"EQUATIONS"<<std::endl;
52  if (eqs!=NULL)
53  {
54  s<<eqs<<std::endl;
55  omFree(eqs);
56  }
57 
58  if (c->areExtremeRaysKnown())
59  {
60  gfan::ZMatrix r=c->extremeRays();
61  char* rs = toString(r);
62  s<<"RAYS"<<std::endl;
63  if (rs!=NULL)
64  {
65  s<<rs<<std::endl;
66  omFree(rs);
67  }
68  gfan::ZMatrix l=c->generatorsOfLinealitySpace();
69  char* ls = toString(l);
70  s<<"LINEALITY_SPACE"<<std::endl;
71  if (ls!=NULL)
72  {
73  s<<ls<<std::endl;
74  omFree(ls);
75  }
76  }
77 
78  return s.str();
79 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
const ring r
Definition: syzextra.cc:208
#define omFree(addr)
Definition: omAllocDecl.h:261
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
std::string toString(const gfan::ZCone *const c)
Definition: bbcone.cc:28
int l
Definition: cfEzgcd.cc:94
BOOLEAN uniquePoint ( leftv  res,
leftv  args 
)

Definition at line 943 of file bbcone.cc.

944 {
945  leftv u = args;
946  if ((u != NULL) && (u->Typ() == coneID))
947  {
948  gfan::ZCone* zc = (gfan::ZCone*)u->Data();
949  gfan::ZVector zv = zc->getUniquePoint();
950  res->rtyp = BIGINTMAT_CMD;
951  res->data = (void*) zVectorToBigintmat(zv);
952  return FALSE;
953  }
954  WerrorS("uniquePoint: unexpected parameters");
955  return TRUE;
956 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
int coneID
Definition: bbcone.cc:26
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118

Variable Documentation

int coneID

Definition at line 26 of file bbcone.cc.