Changeset 69b2c1 in git


Ignore:
Timestamp:
Oct 25, 2013, 6:22:49 PM (9 years ago)
Author:
Yue Ren <ren@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
62de8de7d677c1aa9a6da3c0e58b04a58a9a884b
Parents:
19addd1fe8e5af5d3cb924815b54b7300d961766
git-author:
Yue Ren <ren@mathematik.uni-kl.de>2013-10-25 18:22:49+02:00
git-committer:
Yue Ren <ren@mathematik.uni-kl.de>2013-10-25 18:25:28+02:00
Message:
chg: updated callgfanlib to newest version
Location:
dyn_modules/callgfanlib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • dyn_modules/callgfanlib/bbcone.cc

    r19addd1 r69b2c1  
    170170}
    171171
    172 void* bbcone_Init(blackbox *b)
     172void* bbcone_Init(blackbox* /*b*/)
    173173{
    174174  return (void*)(new gfan::ZCone());
     
    229229}
    230230
    231 char * bbcone_String(blackbox *b, void *d)
     231char* bbcone_String(blackbox* /*b*/, void *d)
    232232{
    233233  if (d==NULL) return omStrDup("invalid object");
     
    239239}
    240240
    241 void bbcone_destroy(blackbox *b, void *d)
     241void bbcone_destroy(blackbox* /*b*/, void *d)
    242242{
    243243  if (d!=NULL)
     
    248248}
    249249
    250 void* bbcone_Copy(blackbox*b, void *d)
     250void* bbcone_Copy(blackbox* /*b*/, void *d)
    251251{
    252252  gfan::ZCone* zc = (gfan::ZCone*)d;
     
    622622{
    623623  leftv u = args;
    624   if ((u != NULL) && (u->Typ() == coneID))
     624  if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID))
    625625  {
    626626    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
     
    638638{
    639639  leftv u = args;
    640   if ((u != NULL) && (u->Typ() == coneID))
     640  if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID))
    641641  {
    642642    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
     
    653653{
    654654  leftv u = args;
    655   if ((u != NULL) && (u->Typ() == coneID))
     655  if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID))
    656656  {
    657657    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
     
    661661    return FALSE;
    662662  }
    663   if ((u != NULL) && (u->Typ() == polytopeID))
    664     {
    665       gfan::ZCone* zc = (gfan::ZCone*)u->Data();
    666       res->rtyp = BIGINTMAT_CMD;
    667       res->data = (void*) getFacetNormals(zc);
    668       return FALSE;
    669     }
    670663  WerrorS("facets: unexpected parameters");
    671664  return TRUE;
     
    675668{
    676669  leftv u = args;
    677   if ((u != NULL) && (u->Typ() == coneID))
     670  if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID))
    678671  {
    679672    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
     
    690683{
    691684  leftv u = args;
    692   if ((u != NULL) && (u->Typ() == coneID))
     685  if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID))
    693686  {
    694687    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
     
    705698{
    706699  leftv u = args;
    707   if ((u != NULL) && (u->Typ() == coneID))
     700  if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID))
    708701  {
    709702    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
     
    16461639
    16471640
     1641lists listOfFacets(const gfan::ZCone &zc)
     1642{
     1643  gfan::ZMatrix inequalities = zc.getFacets();
     1644  gfan::ZMatrix equations = zc.getImpliedEquations();
     1645  lists L = (lists)omAllocBin(slists_bin);
     1646  int r = inequalities.getHeight();
     1647  int c = inequalities.getWidth();
     1648  L->Init(r);
     1649
     1650  /* next we iterate over each of the r facets, build the respective cone and add it to the list */
     1651  /* this is the i=0 case */
     1652  gfan::ZMatrix newInequalities = inequalities.submatrix(1,0,r,c);
     1653  gfan::ZMatrix newEquations = equations;
     1654  newEquations.appendRow(inequalities[0]);
     1655  L->m[0].rtyp = coneID; L->m[0].data=(void*) new gfan::ZCone(newInequalities,newEquations);
     1656
     1657  /* these are the cases i=1,...,r-2 */
     1658  for (int i=1; i<r-1; i++)
     1659  {
     1660    newInequalities = inequalities.submatrix(0,0,i-1,c);
     1661    newInequalities.append(inequalities.submatrix(i+1,0,r,c));
     1662    newEquations = equations;
     1663    newEquations.appendRow(inequalities[i]);
     1664    L->m[i].rtyp = coneID; L->m[i].data=(void*) new gfan::ZCone(newInequalities,newEquations);
     1665  }
     1666
     1667  /* this is the i=r-1 case */
     1668  newInequalities = inequalities.submatrix(0,0,r-1,c);
     1669  newEquations = equations;
     1670  newEquations.appendRow(inequalities[r]);
     1671  L->m[r-1].rtyp = coneID; L->m[r-1].data=(void*) new gfan::ZCone(newInequalities,newEquations);
     1672
     1673  return L;
     1674}
     1675
     1676
     1677BOOLEAN listOfFacets(leftv res, leftv args)
     1678{
     1679  leftv u=args;
     1680  if ((u != NULL) && (u->Typ() == coneID))
     1681  {
     1682    gfan::ZCone* zc = (gfan::ZCone*) u->Data();
     1683    lists L = listOfFacets(*zc);
     1684    res->rtyp = LIST_CMD;
     1685    res->data = (void*) L;
     1686    return FALSE;
     1687  }
     1688  WerrorS("listOfFacets: unexpected parameters");
     1689  return TRUE;
     1690}
     1691
     1692
    16481693poly initial(poly p)
    16491694{
     
    16841729      ideal I = (ideal) u->Data();
    16851730      ideal inI = idInit(IDELEMS(I));
    1686       poly g; poly h; long d;
     1731      poly g;
    16871732      for (int i=0; i<IDELEMS(I); i++)
    16881733      {
     
    19081953  p->iiAddCproc("","uniquePoint",FALSE,uniquePoint);
    19091954  p->iiAddCproc("","listContainsCone",FALSE,containsCone);
     1955  p->iiAddCproc("","listOfFacets",FALSE,listOfFacets);
    19101956  p->iiAddCproc("","maximalGroebnerCone",FALSE,maximalGroebnerCone);
    19111957  p->iiAddCproc("","groebnerCone",FALSE,groebnerCone);
  • dyn_modules/callgfanlib/bbfan.cc

    r19addd1 r69b2c1  
    2525int fanID;
    2626
    27 void* bbfan_Init(blackbox *b)
     27void* bbfan_Init(blackbox* /*b*/)
    2828{
    2929  return (void*) new gfan::ZFan(0);
    3030}
    3131
    32 void bbfan_destroy(blackbox *b, void *d)
     32void bbfan_destroy(blackbox* /*b*/, void *d)
    3333{
    3434  if (d!=NULL)
     
    3939}
    4040
    41 char* bbfan_String(blackbox *b, void *d)
     41char* bbfan_String(blackbox* /*b*/, void *d)
    4242{
    4343  if (d==NULL) return omStrDup("invalid object");
     
    5050}
    5151
    52 void* bbfan_Copy(blackbox*b, void *d)
     52void* bbfan_Copy(blackbox* /*b*/, void *d)
    5353{
    5454  gfan::ZFan* zf = (gfan::ZFan*)d;
     
    502502      leftv w=v->next; int n = 1;
    503503      if ((w != NULL) && (w->Typ() == INT_CMD))
    504         int n = (int)(long) w;
     504        n = (int)(long) w;
    505505
    506506      if (n != 0)
     
    864864}
    865865
    866 lists listOfFacets(const gfan::ZCone &zc)
    867 {
    868   gfan::ZMatrix inequalities = zc.getFacets();
    869   gfan::ZMatrix equations = zc.getImpliedEquations();
    870   lists L = (lists)omAllocBin(slists_bin);
    871   int r = inequalities.getHeight();
    872   int c = inequalities.getWidth();
    873   L->Init(r);
    874 
    875   /* next we iterate over each of the r facets, build the respective cone and add it to the list */
    876   /* this is the i=0 case */
    877   gfan::ZMatrix newInequalities = inequalities.submatrix(1,0,r,c);
    878   gfan::ZMatrix newEquations = equations;
    879   newEquations.appendRow(inequalities[0]);
    880   L->m[0].rtyp = coneID; L->m[0].data=(void*) new gfan::ZCone(newInequalities,newEquations);
    881 
    882   /* these are the cases i=1,...,r-2 */
    883   for (int i=1; i<r-1; i++)
    884   {
    885     newInequalities = inequalities.submatrix(0,0,i-1,c);
    886     newInequalities.append(inequalities.submatrix(i+1,0,r,c));
    887     newEquations = equations;
    888     newEquations.appendRow(inequalities[i]);
    889     L->m[i].rtyp = coneID; L->m[i].data=(void*) new gfan::ZCone(newInequalities,newEquations);
    890   }
    891 
    892   /* this is the i=r-1 case */
    893   newInequalities = inequalities.submatrix(0,0,r-1,c);
    894   newEquations = equations;
    895   newEquations.appendRow(inequalities[r]);
    896   L->m[r-1].rtyp = coneID; L->m[r-1].data=(void*) new gfan::ZCone(newInequalities,newEquations);
    897 
    898   return L;
    899 }
    900 
    901 BOOLEAN listOfFacets(leftv res, leftv args)
    902 {
    903   leftv u=args;
    904   if ((u != NULL) && (u->Typ() == coneID))
    905   {
    906     gfan::ZCone* zc = (gfan::ZCone*) u->Data();
    907     lists L = listOfFacets(*zc);
    908     res->rtyp = LIST_CMD;
    909     res->data = (void*) L;
    910     return FALSE;
    911   }
    912   WerrorS("listOfFacets: unexpected parameters");
    913   return TRUE;
    914 }
    915866
    916867BOOLEAN tropicalVariety(leftv res, leftv args)
  • dyn_modules/callgfanlib/bbpolytope.cc

    r19addd1 r69b2c1  
    3838}
    3939
    40 void *bbpolytope_Init(blackbox *b)
     40void *bbpolytope_Init(blackbox* /*b*/)
    4141{
    4242  return (void*)(new gfan::ZCone());
     
    9797}
    9898
    99 char* bbpolytope_String(blackbox *b, void *d)
     99char* bbpolytope_String(blackbox* /*b*/, void *d)
    100100{ if (d==NULL) return omStrDup("invalid object");
    101101   else
     
    107107}
    108108
    109 void bbpolytope_destroy(blackbox *b, void *d)
     109void bbpolytope_destroy(blackbox* /*b*/, void *d)
    110110{
    111111  if (d!=NULL)
     
    116116}
    117117
    118 void* bbpolytope_Copy(blackbox*b, void *d)
     118void* bbpolytope_Copy(blackbox* /*b*/, void *d)
    119119{
    120120  gfan::ZCone* zc = (gfan::ZCone*)d;
     
    358358  WerrorS("vertices: unexpected parameters");
    359359  return TRUE;
    360 }
    361 
    362 bigintmat* getFacetNormals(gfan::ZCone* zc)
    363 {
    364   gfan::ZMatrix zmat = zc->getFacets();
    365   return zMatrixToBigintmat(zmat);
    366360}
    367361
     
    482476  // iiAddCproc("","getCodimension",FALSE,getAmbientDimension);
    483477  // iiAddCproc("","getDimension",FALSE,getDimension);
    484   // iiAddCproc("","getFacetNormals",FALSE,getFacetNormals);
    485478  /********************************************************/
    486479  /* the following functions are identical to those in bbcone.cc */
     480  // iiAddCproc("","facets",FALSE,facets);
    487481  // iiAddCproc("","setLinearForms",FALSE,setLinearForms);
    488482  // iiAddCproc("","getLinearForms",FALSE,getLinearForms);
  • dyn_modules/callgfanlib/gfan.h

    r19addd1 r69b2c1  
    261261};
    262262lists lprepareResult(gcone *gc, const int n);
    263 static int64 int64gcd(const int64 &a, const int64 &b);
    264 static int intgcd(const int &a, const int &b);
    265 static int dotProduct(const int64vec &iva, const int64vec &ivb);
    266 static bool isParallel(const int64vec &a, const int64vec &b);
    267 static int64vec *ivNeg(/*const*/ int64vec *iv);
    268 static void idDebugPrint(const ideal &I);
    269 static volatile void showSLA(facet &f);
    270 static bool isMonomial(const ideal &I);
    271 static bool ivAreEqual(const int64vec &a, const int64vec &b);
    272 static bool areEqual2(facet *f, facet *g);
    273 static bool areEqual( facet *f, facet *g);
     263/* static int64 int64gcd(const int64 &a, const int64 &b); */
     264/* static int intgcd(const int &a, const int &b); */
     265/* static int dotProduct(const int64vec &iva, const int64vec &ivb); */
     266/* static bool isParallel(const int64vec &a, const int64vec &b); */
     267/* static int64vec *ivNeg(/\*const*\/ int64vec *iv); */
     268/* static void idDebugPrint(const ideal &I); */
     269/* static volatile void showSLA(facet &f); */
     270/* static bool isMonomial(const ideal &I); */
     271/* static bool ivAreEqual(const int64vec &a, const int64vec &b); */
     272/* static bool areEqual2(facet *f, facet *g); */
     273/* static bool areEqual( facet *f, facet *g); */
    274274// bool iv64isStrictlyPositive(int64vec *);
    275275#endif
  • dyn_modules/callgfanlib/gitfan.cc

    r19addd1 r69b2c1  
    4040    gfan::ZVector v = f.interiorPoint;
    4141    gfan::ZVector w = f.facetNormal;
    42     assume(c.ambientDimension() == v.size());
    43     assume(c.ambientDimension() == w.size());
     42    assume(c.ambientDimension() == (int)v.size());
     43    assume(c.ambientDimension() == (int)w.size());
    4444    assume(c.contains(v));
    4545    assume(!c.contains(w));
     
    5353  {
    5454#ifndef NDEBUG
    55     assume(c.ambientDimension() == v.size());
    56     assume(c.ambientDimension() == w.size());
     55    assume(c.ambientDimension() == (int)v.size());
     56    assume(c.ambientDimension() == (int)w.size());
    5757    assume(c.contains(v));
    5858    assume(!c.contains(w));
     
    6666    gfan::ZVector v = this->interiorPoint;
    6767    gfan::ZVector w = this->facetNormal;
    68     assume(c.ambientDimension() == v.size());
    69     assume(c.ambientDimension() == w.size());
     68    assume(c.ambientDimension() == (int)v.size());
     69    assume(c.ambientDimension() == (int)w.size());
    7070    assume(c.contains(v));
    7171    assume(!c.contains(w));
     
    114114    return F;
    115115
    116   int index = 0;
     116  // int index = 0;
    117117  /* next we iterate over each of the r facets, build the respective cone and add it to the list */
    118118  /* this is the i=0 case */
Note: See TracChangeset for help on using the changeset viewer.