Skip to content

Commit

Permalink
fix: wrong dimension index in fans with non-tivial linealiy space
Browse files Browse the repository at this point in the history
  • Loading branch information
Yue Ren committed Sep 5, 2012
1 parent f889b14 commit 133976d
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions callgfanlib/bbfan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,20 @@ BOOLEAN numberOfConesOfDimension(leftv res, leftv args)
{
bool oo = (bool) o;
bool mm = (bool) m;
int n = zf->numberOfConesOfDimension(d,oo,mm);
res->rtyp = INT_CMD;
res->data = (char*) n;
return FALSE;
int ld = zf->dimensionOfLinealitySpace();
if (d-ld>=0)
{
int n = zf->numberOfConesOfDimension(d,oo,mm);
res->rtyp = INT_CMD;
res->data = (char*) n;
return FALSE;
}
else
{
res->rtyp = INT_CMD;
res->data = (char*) 0;
return FALSE;
}
}
}
}
Expand Down Expand Up @@ -552,10 +562,19 @@ BOOLEAN getCone(leftv res, leftv args)
if (0<i && i<=zf->numberOfConesOfDimension(d,oo,mm))
{
i=i-1;
gfan::ZCone zc = zf->getCone(d,i,oo,mm);
res->rtyp = coneID;
res->data = (char*)new gfan::ZCone(zc);
return FALSE;
int ld = zf->dimensionOfLinealitySpace();
if (d-ld>=0)
{
gfan::ZCone zc = zf->getCone(d-ld,i,oo,mm);
res->rtyp = coneID;
res->data = (char*)new gfan::ZCone(zc);
return FALSE;
}
else
{
WerrorS("getCone: invalid index; no cones in this dimension");
return TRUE;
}
}
else
{
Expand Down

0 comments on commit 133976d

Please sign in to comment.