Ignore:
Timestamp:
Aug 5, 2016, 12:24:51 PM (8 years ago)
Author:
Yue <ren@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
f73b0dba8fd582e1ebf4d2a1ed2067a19cab5a36
Parents:
5cea7ad489a20fb756363be9d41e8e6955b5835f
git-author:
Yue <ren@mathematik.uni-kl.de>2016-08-05 12:24:51+02:00
git-committer:
Yue <ren@mathematik.uni-kl.de>2016-08-05 18:10:20+02:00
Message:
fix: mixedVolume small mistakes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/dyn_modules/gfanlib/bbpolytope.cc

    r5cea7a rfbaeb5  
    385385{
    386386  int N = rVar(r);
    387   gfan::ZMatrix zm(1,N+1);
     387  gfan::ZMatrix zm(0,N+1);
    388388  int *leadexpv = (int*)omAlloc((N+1)*sizeof(int));
    389389  while (p!=NULL)
     
    395395  }
    396396  omFreeSize(leadexpv,(N+1)*sizeof(int));
    397   return gfan::ZCone();
     397  gfan::ZCone Delta = gfan::ZCone::givenByRays(zm,gfan::ZMatrix(0, zm.getWidth()));
     398  return Delta;
    398399}
    399400
     
    466467    for (int i=0; i<k; i++)
    467468    {
    468       if (l->m[i].Typ() != polytopeID)
     469      if (l->m[i].Typ() == polytopeID)
    469470      {
    470471        gfan::ZCone* p = (gfan::ZCone*) l->m[i].Data();
     
    472473        int r = pv.getHeight();
    473474        int c = pv.getWidth();
    474         gfan::IntMatrix pw(c,r);
    475         for (int n=0; n<c; n++)
    476           for (int m=0; m<r; m++)
    477           {
    478             pw[n][m] = pv[m][n].toInt();
    479           }
    480         P[i]=pw;
    481       } else if (l->m[i].Typ() != POLY_CMD)
     475        gfan::IntMatrix pw(r,c-1);
     476        for (int n=0; n<r; n++)
     477          for (int m=1; m<c; m++)
     478            pw[n][m-1] = pv[n][m].toInt();
     479        P[i]=pw.transposed();
     480      } else if (l->m[i].Typ() == POLY_CMD)
    482481      {
    483482        poly p = (poly) l->m[i].Data();
    484483        int N = rVar(currRing);
    485         gfan::IntMatrix pw(0,N+1);
     484        gfan::IntMatrix pw(0,N);
    486485        int *leadexpv = (int*)omAlloc((N+1)*sizeof(int));
    487486        while (p!=NULL)
     
    494493          pIter(p);
    495494        }
    496         P[i]=pw;
     495        P[i]=pw.transposed();
    497496        omFreeSize(leadexpv,(N+1)*sizeof(int));
    498497      }
     
    533532  p->iiAddCproc("","scalePolytope",FALSE,scalePolytope);
    534533  p->iiAddCproc("","dualPolytope",FALSE,dualPolytope);
     534  p->iiAddCproc("","mixedVolume",FALSE,mixedVolume);
    535535  /********************************************************/
    536536  /* the following functions are implemented in bbcone.cc */
Note: See TracChangeset for help on using the changeset viewer.