[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323
Bernhard R. Link
brlink at debian.org
Tue Apr 24 15:54:24 UTC 2012
The following commit has been merged in the cleanedupstream branch:
commit b3feee6698f1557c17d855d7e092ba26714a686b
Author: Yue Ren <ren at mathematik.uni-kl.de>
Date: Mon Mar 26 15:55:50 2012 +0200
new: documentation for callpolymake
diff --git a/callgfanlib/bbcone.cc b/callgfanlib/bbcone.cc
index 30ac9cc..bb2427e 100644
--- a/callgfanlib/bbcone.cc
+++ b/callgfanlib/bbcone.cc
@@ -57,20 +57,20 @@ intvec* zMatrix2Intvec(const gfan::ZMatrix zm)
return iv;
}
-gfan::ZMatrix intmat2ZMatrix(const intvec* iMat)
+gfan::ZMatrix* intmat2ZMatrix(const intvec* iMat)
{
int d=iMat->rows();
int n=iMat->cols();
- gfan::ZMatrix ret(d,n);
+ gfan::ZMatrix* ret = new gfan::ZMatrix(d,n);
for(int i=0;i<d;i++)
for(int j=0;j<n;j++)
- ret[i][j]=IMATELEM(*iMat, i+1, j+1);
+ (*ret)[i][j]=IMATELEM(*iMat, i+1, j+1);
return ret;
}
-gfan::ZVector intStar2ZVector(const int d, const int* i)
+gfan::ZVector* intStar2ZVector(const int d, const int* i)
{
- gfan::ZVector zv(d);
+ gfan::ZVector* zv=new gfan::ZVector(d);
for(int j=0; j<d; j++)
{
zv[j]=i[j];
@@ -79,12 +79,12 @@ gfan::ZVector intStar2ZVector(const int d, const int* i)
}
/* expects iMat to have just one row */
-gfan::ZVector intvec2ZVector(const intvec* iVec)
+gfan::ZVector* intvec2ZVector(const intvec* iVec)
{
int n =iVec->rows();
- gfan::ZVector ret(n);
+ gfan::ZVector* ret = new gfan::ZVector(n);
for(int j=0;j<n;j++)
- ret[j]=IMATELEM(*iVec, j+1, 1);
+ (*ret)[j]=IMATELEM(*iVec, j+1, 1);
return ret;
}
@@ -119,6 +119,18 @@ std::string toString(gfan::ZCone const &c)
s<<toString(i);
s<<"EQUATIONS"<<std::endl;
s<<toString(e);
+ if(c.areExtremeRaysKnown())
+ {
+ gfan::ZMatrix r=c.extremeRays();
+ s<<"EXTREME_RAYS"<<std::endl;
+ s<<toString(r);
+ }
+ if(c.areGeneratorsOfLinealitySpaceKnown())
+ {
+ gfan::ZMatrix r=c.generatorsOfLinealitySpace();
+ s<<"LINEALITY_SPACE"<<std::endl;
+ s<<toString(r);
+ }
return s.str();
}
@@ -277,70 +289,64 @@ static BOOLEAN bbcone_Op2(int op, leftv res, leftv i1, leftv i2)
return blackboxDefaultOp2(op,res,i1,i2);
}
-static BOOLEAN jjCONERAYS1(leftv res, leftv v)
+
+/* singular wrapper for gfanlib functions */
+
+
+static BOOLEAN jjCONENORMALS1(leftv res, leftv v)
{
- /* method for generating a cone object from half-lines
- (cone = convex hull of the half-lines; note: there may be
- entire lines in the cone);
+ /* method for generating a cone object from inequalities;
valid parametrizations: (intmat) */
- intvec* rays = (intvec *)v->CopyD(INTVEC_CMD);
- gfan::ZMatrix zm = intmat2ZMatrix(rays);
- gfan::ZCone* zc = new gfan::ZCone();
- *zc = gfan::ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
+ intvec* inequs = (intvec *)v->CopyD(INTVEC_CMD);
+ gfan::ZMatrix* zm = intmat2ZMatrix(inequs);
+ gfan::ZCone* zc = new gfan::ZCone(*zm, gfan::ZMatrix(0, zm->getWidth()));
+ delete zm;
zc->canonicalize();
res->rtyp = coneID;
res->data = (char *)zc;
return FALSE;
}
-static BOOLEAN jjCONERAYS2(leftv res, leftv u, leftv v)
+static BOOLEAN jjCONENORMALS2(leftv res, leftv u, leftv v)
{
- /* method for generating a cone object from half-lines,
- and lines (any point in the cone being the sum of a point
- in the convex hull of the half-lines and a point in the span
- of the lines; the second argument may contain or entirely consist
- of zero rows);
+ /* method for generating a cone object from iequalities,
+ and equations (...)
valid parametrizations: (intmat, intmat)
Errors will be invoked in the following cases:
- u and v have different numbers of columns */
- intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
- intvec* linSpace = (intvec *)v->CopyD(INTVEC_CMD);
- if (rays->cols() != linSpace->cols())
+ intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
+ intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
+ if (inequs->cols() != equs->cols())
{
Werror("expected same number of columns but got %d vs. %d",
- rays->cols(), linSpace->cols());
+ inequs->cols(), equs->cols());
return TRUE;
}
- gfan::ZMatrix zm1 = intmat2ZMatrix(rays);
- gfan::ZMatrix zm2 = intmat2ZMatrix(linSpace);
- gfan::ZCone* zc = new gfan::ZCone();
- *zc = gfan::ZCone::givenByRays(zm1, zm2);
+ gfan::ZMatrix* zm1 = intmat2ZMatrix(inequs);
+ gfan::ZMatrix* zm2 = intmat2ZMatrix(equs);
+ gfan::ZCone* zc = new gfan::ZCone(*zm1, *zm2);
+ delete zm1, zm2;
zc->canonicalize();
res->rtyp = coneID;
res->data = (char *)zc;
return FALSE;
}
-static BOOLEAN jjCONERAYS3(leftv res, leftv u, leftv v, leftv w)
+static BOOLEAN jjCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
{
- /* method for generating a cone object from half-lines,
- and lines (any point in the cone being the sum of a point
- in the convex hull of the half-lines and a point in the span
- of the lines), and an integer k;
+ /* method for generating a cone object from inequalities, equations,
+ and an integer k;
valid parametrizations: (intmat, intmat, int);
Errors will be invoked in the following cases:
- u and v have different numbers of columns,
- k not in [0..3];
- if the 2^0-bit of k is set, then the lineality space is known
- to be the span of the provided lines;
- if the 2^1-bit of k is set, then the extreme rays are known:
- each half-line spans a (different) extreme ray */
- intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
- intvec* linSpace = (intvec *)v->CopyD(INTVEC_CMD);
- if (rays->cols() != linSpace->cols())
+ if the 2^0-bit of k is set, then ... */
+ intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
+ intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
+ if (inequs->cols() != equs->cols())
{
Werror("expected same number of columns but got %d vs. %d",
- rays->cols(), linSpace->cols());
+ inequs->cols(), equs->cols());
return TRUE;
}
int k = (int)(long)w->Data();
@@ -349,100 +355,89 @@ static BOOLEAN jjCONERAYS3(leftv res, leftv u, leftv v, leftv w)
WerrorS("expected int argument in [0..3]");
return TRUE;
}
- gfan::ZMatrix zm1 = intmat2ZMatrix(rays);
- gfan::ZMatrix zm2 = intmat2ZMatrix(linSpace);
- gfan::ZCone* zc = new gfan::ZCone();
- *zc = gfan::ZCone::givenByRays(zm1, zm2);
- //k should be passed on to zc; not available yet
+ gfan::ZMatrix* zm1 = intmat2ZMatrix(inequs);
+ gfan::ZMatrix* zm2 = intmat2ZMatrix(equs);
+ gfan::ZCone* zc = new gfan::ZCone(*zm1, *zm2, k);
+ delete zm1, zm2;
zc->canonicalize();
res->rtyp = coneID;
res->data = (char *)zc;
return FALSE;
}
-BOOLEAN coneViaRays(leftv res, leftv args)
+BOOLEAN coneViaNormals(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == INTMAT_CMD))
{
- if (u->next == NULL) return jjCONERAYS1(res, u);
- leftv v = u->next;
- if ((v != NULL) && (v->Typ() == INTMAT_CMD))
- {
- if (v->next == NULL) return jjCONERAYS2(res, u, v);
- leftv w = v->next;
- if ((w != NULL) && (w->Typ() == INT_CMD))
- {
- if (w->next == NULL) return jjCONERAYS3(res, u, v, w);
- }
- }
+ if (u->next == NULL) return jjCONENORMALS1(res, u);
}
- WerrorS("coneViaRays: unexpected parameters");
+ leftv v = u->next;
+ if ((v != NULL) && (v->Typ() == INTMAT_CMD))
+ {
+ if (v->next == NULL) return jjCONENORMALS2(res, u, v);
+ }
+ leftv w = v->next;
+ if ((w != NULL) && (w->Typ() == INT_CMD))
+ {
+ if (w->next == NULL) return jjCONENORMALS3(res, u, v, w);
+ }
+ WerrorS("coneViaNormals: unexpected parameters");
return TRUE;
}
-static BOOLEAN qqCONERAYS1(leftv res, leftv v)
+static BOOLEAN qqCONENORMALS1(leftv res, leftv v)
{
- /* method for generating a cone object from half-lines
- (cone = convex hull of the half-lines; note: there may be
- entire lines in the cone);
+ /* method for generating a cone object from inequalities;
valid parametrizations: (intmat) */
- intvec* rays = (intvec *)v->CopyD(INTVEC_CMD);
- gfan::ZMatrix zm = intmat2ZMatrix(rays);
- gfan::ZCone* zc = new gfan::ZCone();
- *zc = gfan::ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
+ intvec* inequs = (intvec *)v->CopyD(INTVEC_CMD);
+ gfan::ZMatrix* zm = intmat2ZMatrix(inequs);
+ gfan::ZCone* zc = new gfan::ZCone(*zm, gfan::ZMatrix(0, zm->getWidth()));
+ delete zm;
res->rtyp = coneID;
res->data = (char *)zc;
return FALSE;
}
-static BOOLEAN qqCONERAYS2(leftv res, leftv u, leftv v)
+static BOOLEAN qqCONENORMALS2(leftv res, leftv u, leftv v)
{
- /* method for generating a cone object from half-lines,
- and lines (any point in the cone being the sum of a point
- in the convex hull of the half-lines and a point in the span
- of the lines; the second argument may contain or entirely consist
- of zero rows);
+ /* method for generating a cone object from iequalities,
+ and equations (...)
valid parametrizations: (intmat, intmat)
Errors will be invoked in the following cases:
- u and v have different numbers of columns */
- intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
- intvec* linSpace = (intvec *)v->CopyD(INTVEC_CMD);
- if (rays->cols() != linSpace->cols())
+ intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
+ intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
+ if (inequs->cols() != equs->cols())
{
Werror("expected same number of columns but got %d vs. %d",
- rays->cols(), linSpace->cols());
+ inequs->cols(), equs->cols());
return TRUE;
}
- gfan::ZMatrix zm1 = intmat2ZMatrix(rays);
- gfan::ZMatrix zm2 = intmat2ZMatrix(linSpace);
- gfan::ZCone* zc = new gfan::ZCone();
- *zc = gfan::ZCone::givenByRays(zm1, zm2);
+ gfan::ZMatrix* zm1 = intmat2ZMatrix(inequs);
+ gfan::ZMatrix* zm2 = intmat2ZMatrix(equs);
+ gfan::ZCone* zc = new gfan::ZCone(*zm1, *zm2);
+ delete zm1, zm2;
res->rtyp = coneID;
res->data = (char *)zc;
return FALSE;
}
-static BOOLEAN qqCONERAYS3(leftv res, leftv u, leftv v, leftv w)
+static BOOLEAN qqCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
{
- /* method for generating a cone object from half-lines,
- and lines (any point in the cone being the sum of a point
- in the convex hull of the half-lines and a point in the span
- of the lines), and an integer k;
+ /* method for generating a cone object from inequalities, equations,
+ and an integer k;
valid parametrizations: (intmat, intmat, int);
Errors will be invoked in the following cases:
- u and v have different numbers of columns,
- k not in [0..3];
- if the 2^0-bit of k is set, then the lineality space is known
- to be the span of the provided lines;
- if the 2^1-bit of k is set, then the extreme rays are known:
- each half-line spans a (different) extreme ray */
- intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
- intvec* linSpace = (intvec *)v->CopyD(INTVEC_CMD);
- if (rays->cols() != linSpace->cols())
+ if the 2^0-bit of k is set, then ... */
+ intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
+ intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
+ if (inequs->cols() != equs->cols())
{
Werror("expected same number of columns but got %d vs. %d",
- rays->cols(), linSpace->cols());
+ inequs->cols(), equs->cols());
return TRUE;
}
int k = (int)(long)w->Data();
@@ -451,89 +446,103 @@ static BOOLEAN qqCONERAYS3(leftv res, leftv u, leftv v, leftv w)
WerrorS("expected int argument in [0..3]");
return TRUE;
}
- gfan::ZMatrix zm1 = intmat2ZMatrix(rays);
- gfan::ZMatrix zm2 = intmat2ZMatrix(linSpace);
- gfan::ZCone* zc = new gfan::ZCone();
- *zc = gfan::ZCone::givenByRays(zm1, zm2);
- //k should be passed on to zc; not available yet
+ gfan::ZMatrix* zm1 = intmat2ZMatrix(inequs);
+ gfan::ZMatrix* zm2 = intmat2ZMatrix(equs);
+ gfan::ZCone* zc = new gfan::ZCone(*zm1, *zm2, k);
+ delete zm1, zm2;
res->rtyp = coneID;
res->data = (char *)zc;
return FALSE;
}
-BOOLEAN quickConeViaRays(leftv res, leftv args)
+BOOLEAN quickConeViaNormals(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == INTMAT_CMD))
{
- if (u->next == NULL) return qqCONERAYS1(res, u);
- leftv v = u->next;
- if ((v != NULL) && (v->Typ() == INTMAT_CMD))
- {
- if (v->next == NULL) return qqCONERAYS2(res, u, v);
- leftv w = v->next;
- if ((w != NULL) && (w->Typ() == INT_CMD))
- {
- if (w->next == NULL) return qqCONERAYS3(res, u, v, w);
- }
- }
+ if (u->next == NULL) return qqCONENORMALS1(res, u);
}
- WerrorS("quickConeViaRays: unexpected parameters");
+ leftv v = u->next;
+ if ((v != NULL) && (v->Typ() == INTMAT_CMD))
+ {
+ if (v->next == NULL) return qqCONENORMALS2(res, u, v);
+ }
+ leftv w = v->next;
+ if ((w != NULL) && (w->Typ() == INT_CMD))
+ {
+ if (w->next == NULL) return qqCONENORMALS3(res, u, v, w);
+ }
+ WerrorS("quickConeViaNormals: unexpected parameters");
return TRUE;
}
-static BOOLEAN jjCONENORMALS1(leftv res, leftv v)
+
+static BOOLEAN jjCONERAYS1(leftv res, leftv v)
{
- /* method for generating a cone object from inequalities;
+ /* method for generating a cone object from half-lines
+ (cone = convex hull of the half-lines; note: there may be
+ entire lines in the cone);
valid parametrizations: (intmat) */
- intvec* inequs = (intvec *)v->CopyD(INTVEC_CMD);
- gfan::ZMatrix zm = intmat2ZMatrix(inequs);
- gfan::ZCone* zc = new gfan::ZCone(zm, gfan::ZMatrix(0, zm.getWidth()));
+ intvec* rays = (intvec *)v->CopyD(INTVEC_CMD);
+ gfan::ZMatrix* zm = intmat2ZMatrix(rays);
+ gfan::ZCone* zc = new gfan::ZCone();
+ *zc = gfan::ZCone::givenByRays(*zm, gfan::ZMatrix(0, zm->getWidth()));
+ delete zm;
zc->canonicalize();
res->rtyp = coneID;
res->data = (char *)zc;
return FALSE;
}
-static BOOLEAN jjCONENORMALS2(leftv res, leftv u, leftv v)
+static BOOLEAN jjCONERAYS2(leftv res, leftv u, leftv v)
{
- /* method for generating a cone object from iequalities,
- and equations (...)
+ /* method for generating a cone object from half-lines,
+ and lines (any point in the cone being the sum of a point
+ in the convex hull of the half-lines and a point in the span
+ of the lines; the second argument may contain or entirely consist
+ of zero rows);
valid parametrizations: (intmat, intmat)
Errors will be invoked in the following cases:
- u and v have different numbers of columns */
- intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
- intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
- if (inequs->cols() != equs->cols())
+ intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
+ intvec* linSpace = (intvec *)v->CopyD(INTVEC_CMD);
+ if (rays->cols() != linSpace->cols())
{
Werror("expected same number of columns but got %d vs. %d",
- inequs->cols(), equs->cols());
+ rays->cols(), linSpace->cols());
return TRUE;
}
- gfan::ZMatrix zm1 = intmat2ZMatrix(inequs);
- gfan::ZMatrix zm2 = intmat2ZMatrix(equs);
- gfan::ZCone* zc = new gfan::ZCone(zm1, zm2);
+ gfan::ZMatrix* zm1 = intmat2ZMatrix(rays);
+ gfan::ZMatrix* zm2 = intmat2ZMatrix(linSpace);
+ gfan::ZCone* zc = new gfan::ZCone();
+ *zc = gfan::ZCone::givenByRays(*zm1, *zm2);
+ delete zm1, zm2;
zc->canonicalize();
res->rtyp = coneID;
res->data = (char *)zc;
return FALSE;
}
-static BOOLEAN jjCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
+static BOOLEAN jjCONERAYS3(leftv res, leftv u, leftv v, leftv w)
{
- /* method for generating a cone object from inequalities, equations,
- and an integer k;
+ /* method for generating a cone object from half-lines,
+ and lines (any point in the cone being the sum of a point
+ in the convex hull of the half-lines and a point in the span
+ of the lines), and an integer k;
valid parametrizations: (intmat, intmat, int);
Errors will be invoked in the following cases:
- u and v have different numbers of columns,
- k not in [0..3];
- if the 2^0-bit of k is set, then ... */
- intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
- intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
- if (inequs->cols() != equs->cols())
+ if the 2^0-bit of k is set, then the lineality space is known
+ to be the span of the provided lines;
+ if the 2^1-bit of k is set, then the extreme rays are known:
+ each half-line spans a (different) extreme ray */
+ intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
+ intvec* linSpace = (intvec *)v->CopyD(INTVEC_CMD);
+ if (rays->cols() != linSpace->cols())
{
Werror("expected same number of columns but got %d vs. %d",
- inequs->cols(), equs->cols());
+ rays->cols(), linSpace->cols());
return TRUE;
}
int k = (int)(long)w->Data();
@@ -542,86 +551,103 @@ static BOOLEAN jjCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
WerrorS("expected int argument in [0..3]");
return TRUE;
}
- gfan::ZMatrix zm1 = intmat2ZMatrix(inequs);
- gfan::ZMatrix zm2 = intmat2ZMatrix(equs);
- gfan::ZCone* zc = new gfan::ZCone(zm1, zm2, k);
+ gfan::ZMatrix* zm1 = intmat2ZMatrix(rays);
+ gfan::ZMatrix* zm2 = intmat2ZMatrix(linSpace);
+ gfan::ZCone* zc = new gfan::ZCone();
+ *zc = gfan::ZCone::givenByRays(*zm1, *zm2);
+ //k should be passed on to zc; not available yet
+ delete zm1, zm2;
zc->canonicalize();
res->rtyp = coneID;
res->data = (char *)zc;
return FALSE;
}
-BOOLEAN coneViaNormals(leftv res, leftv args)
+BOOLEAN coneViaRays(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == INTMAT_CMD))
{
- if (u->next == NULL) return jjCONENORMALS1(res, u);
- }
- leftv v = u->next;
- if ((v != NULL) && (v->Typ() == INTMAT_CMD))
- {
- if (v->next == NULL) return jjCONENORMALS2(res, u, v);
- }
- leftv w = v->next;
- if ((w != NULL) && (w->Typ() == INT_CMD))
- {
- if (w->next == NULL) return jjCONENORMALS3(res, u, v, w);
+ if (u->next == NULL) return jjCONERAYS1(res, u);
+ leftv v = u->next;
+ if ((v != NULL) && (v->Typ() == INTMAT_CMD))
+ {
+ if (v->next == NULL) return jjCONERAYS2(res, u, v);
+ leftv w = v->next;
+ if ((w != NULL) && (w->Typ() == INT_CMD))
+ {
+ if (w->next == NULL) return jjCONERAYS3(res, u, v, w);
+ }
+ }
}
- WerrorS("coneViaNormals: unexpected parameters");
+ WerrorS("coneViaRays: unexpected parameters");
return TRUE;
}
-static BOOLEAN qqCONENORMALS1(leftv res, leftv v)
+static BOOLEAN qqCONERAYS1(leftv res, leftv v)
{
- /* method for generating a cone object from inequalities;
+ /* method for generating a cone object from half-lines
+ (cone = convex hull of the half-lines; note: there may be
+ entire lines in the cone);
valid parametrizations: (intmat) */
- intvec* inequs = (intvec *)v->CopyD(INTVEC_CMD);
- gfan::ZMatrix zm = intmat2ZMatrix(inequs);
- gfan::ZCone* zc = new gfan::ZCone(zm, gfan::ZMatrix(0, zm.getWidth()));
+ intvec* rays = (intvec *)v->CopyD(INTVEC_CMD);
+ gfan::ZMatrix* zm = intmat2ZMatrix(rays);
+ gfan::ZCone* zc = new gfan::ZCone();
+ *zc = gfan::ZCone::givenByRays(*zm, gfan::ZMatrix(0, zm->getWidth()));
+ delete zm;
res->rtyp = coneID;
res->data = (char *)zc;
return FALSE;
}
-static BOOLEAN qqCONENORMALS2(leftv res, leftv u, leftv v)
+static BOOLEAN qqCONERAYS2(leftv res, leftv u, leftv v)
{
- /* method for generating a cone object from iequalities,
- and equations (...)
+ /* method for generating a cone object from half-lines,
+ and lines (any point in the cone being the sum of a point
+ in the convex hull of the half-lines and a point in the span
+ of the lines; the second argument may contain or entirely consist
+ of zero rows);
valid parametrizations: (intmat, intmat)
Errors will be invoked in the following cases:
- u and v have different numbers of columns */
- intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
- intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
- if (inequs->cols() != equs->cols())
+ intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
+ intvec* linSpace = (intvec *)v->CopyD(INTVEC_CMD);
+ if (rays->cols() != linSpace->cols())
{
Werror("expected same number of columns but got %d vs. %d",
- inequs->cols(), equs->cols());
+ rays->cols(), linSpace->cols());
return TRUE;
}
- gfan::ZMatrix zm1 = intmat2ZMatrix(inequs);
- gfan::ZMatrix zm2 = intmat2ZMatrix(equs);
- gfan::ZCone* zc = new gfan::ZCone(zm1, zm2);
+ gfan::ZMatrix* zm1 = intmat2ZMatrix(rays);
+ gfan::ZMatrix* zm2 = intmat2ZMatrix(linSpace);
+ gfan::ZCone* zc = new gfan::ZCone();
+ *zc = gfan::ZCone::givenByRays(*zm1, *zm2);
+ delete zm1, zm2;
res->rtyp = coneID;
res->data = (char *)zc;
return FALSE;
}
-static BOOLEAN qqCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
+static BOOLEAN qqCONERAYS3(leftv res, leftv u, leftv v, leftv w)
{
- /* method for generating a cone object from inequalities, equations,
- and an integer k;
+ /* method for generating a cone object from half-lines,
+ and lines (any point in the cone being the sum of a point
+ in the convex hull of the half-lines and a point in the span
+ of the lines), and an integer k;
valid parametrizations: (intmat, intmat, int);
Errors will be invoked in the following cases:
- u and v have different numbers of columns,
- k not in [0..3];
- if the 2^0-bit of k is set, then ... */
- intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
- intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
- if (inequs->cols() != equs->cols())
+ if the 2^0-bit of k is set, then the lineality space is known
+ to be the span of the provided lines;
+ if the 2^1-bit of k is set, then the extreme rays are known:
+ each half-line spans a (different) extreme ray */
+ intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
+ intvec* linSpace = (intvec *)v->CopyD(INTVEC_CMD);
+ if (rays->cols() != linSpace->cols())
{
Werror("expected same number of columns but got %d vs. %d",
- inequs->cols(), equs->cols());
+ rays->cols(), linSpace->cols());
return TRUE;
}
int k = (int)(long)w->Data();
@@ -630,32 +656,35 @@ static BOOLEAN qqCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
WerrorS("expected int argument in [0..3]");
return TRUE;
}
- gfan::ZMatrix zm1 = intmat2ZMatrix(inequs);
- gfan::ZMatrix zm2 = intmat2ZMatrix(equs);
- gfan::ZCone* zc = new gfan::ZCone(zm1, zm2, k);
+ gfan::ZMatrix* zm1 = intmat2ZMatrix(rays);
+ gfan::ZMatrix* zm2 = intmat2ZMatrix(linSpace);
+ gfan::ZCone* zc = new gfan::ZCone();
+ *zc = gfan::ZCone::givenByRays(*zm1, *zm2);
+ //k should be passed on to zc; not available yet
+ delete zm1, zm2;
res->rtyp = coneID;
res->data = (char *)zc;
return FALSE;
}
-BOOLEAN quickConeViaNormals(leftv res, leftv args)
+BOOLEAN quickConeViaRays(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == INTMAT_CMD))
{
- if (u->next == NULL) return qqCONENORMALS1(res, u);
- }
- leftv v = u->next;
- if ((v != NULL) && (v->Typ() == INTMAT_CMD))
- {
- if (v->next == NULL) return qqCONENORMALS2(res, u, v);
- }
- leftv w = v->next;
- if ((w != NULL) && (w->Typ() == INT_CMD))
- {
- if (w->next == NULL) return qqCONENORMALS3(res, u, v, w);
+ if (u->next == NULL) return qqCONERAYS1(res, u);
+ leftv v = u->next;
+ if ((v != NULL) && (v->Typ() == INTMAT_CMD))
+ {
+ if (v->next == NULL) return qqCONERAYS2(res, u, v);
+ leftv w = v->next;
+ if ((w != NULL) && (w->Typ() == INT_CMD))
+ {
+ if (w->next == NULL) return qqCONERAYS3(res, u, v, w);
+ }
+ }
}
- WerrorS("quickConeViaNormals: unexpected parameters");
+ WerrorS("quickConeViaRays: unexpected parameters");
return TRUE;
}
@@ -663,68 +692,73 @@ BOOLEAN ZCone(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && ((u->Typ() == INTMAT_CMD) || (u->Typ() == INT_CMD)))
+ {
+ leftv v = u->next;
+ if ((u != NULL) && ((v->Typ() == INTMAT_CMD) || (v->Typ() == INT_CMD)))
{
- leftv v = u->next;
- if ((u != NULL) && ((v->Typ() == INTMAT_CMD) || (v->Typ() == INT_CMD)))
+ leftv w = v->next;
+ if ((u != NULL) && ((w->Typ() == INTMAT_CMD) || (w->Typ() == INT_CMD)))
+ {
+ leftv x = w->next;
+ if ((u != NULL) && ((x->Typ() == INTMAT_CMD) || (x->Typ() == INT_CMD)))
{
- leftv w = v->next;
- if ((u != NULL) && ((w->Typ() == INTMAT_CMD) || (w->Typ() == INT_CMD)))
+ leftv y = x->next;
+ if ((u != NULL) && ((y->Typ() == INTMAT_CMD) || (y->Typ() == INT_CMD)))
+ {
+ leftv z = y->next;
+ if ((u != NULL) && (z->Typ() == INT_CMD))
{
- leftv x = w->next;
- if ((u != NULL) && ((x->Typ() == INTMAT_CMD) || (x->Typ() == INT_CMD)))
- {
- leftv y = x->next;
- if ((u != NULL) && ((y->Typ() == INTMAT_CMD) || (y->Typ() == INT_CMD)))
- {
- leftv z = y->next;
- if ((u != NULL) && (z->Typ() == INT_CMD))
- {
- gfan::ZMatrix gfineq, gfeq, gfexRays, gflinSpace, gfspan;
- // if user has given int as input, an empty ZMatrix will be passed to gfan
- // which will be ignored by the constructor
- if (u->Typ() == INTMAT_CMD)
- {
- intvec* ineq = (intvec*) u->Data();
- gfineq = intmat2ZMatrix(ineq);
- }
- if (v->Typ() == INTMAT_CMD)
- {
- intvec* eq = (intvec*) v->Data();
- gfeq = intmat2ZMatrix(eq);
- }
- if (w->Typ() == INTMAT_CMD)
- {
- intvec* exRays = (intvec*) w->Data();
- gfexRays = intmat2ZMatrix(exRays);
- }
- if (x->Typ() == INTMAT_CMD)
- {
- intvec* linSpace = (intvec*) x->Data();
- gflinSpace = intmat2ZMatrix(linSpace);
- }
- if (y->Typ() == INTMAT_CMD)
- {
- intvec* span = (intvec*) y->Data();
- gfspan = intmat2ZMatrix(span);
- }
- int flag = (int)(long) z->Data();
-
- gfan::ZCone* zc = new gfan::ZCone(gfineq,gfeq,gfexRays,gflinSpace,gfspan,flag);
- res->rtyp = coneID;
- res->data = (char*) zc;
- return FALSE;
- }
- }
- }
+ gfan::ZMatrix* gfineq = new gfan::ZMatrix();
+ gfan::ZMatrix* gfeq = new gfan::ZMatrix();
+ gfan::ZMatrix* gfexRays = new gfan::ZMatrix();
+ gfan::ZMatrix* gflinSpace = new gfan::ZMatrix();
+ gfan::ZMatrix* gfspan = new gfan::ZMatrix();
+ // if user has given int as input, an empty ZMatrix will be passed to gfan
+ // which will be ignored by the constructor
+ if (u->Typ() == INTMAT_CMD)
+ {
+ intvec* ineq = (intvec*) u->Data();
+ gfineq = intmat2ZMatrix(ineq);
+ }
+ if (v->Typ() == INTMAT_CMD)
+ {
+ intvec* eq = (intvec*) v->Data();
+ gfeq = intmat2ZMatrix(eq);
+ }
+ if (w->Typ() == INTMAT_CMD)
+ {
+ intvec* exRays = (intvec*) w->Data();
+ gfexRays = intmat2ZMatrix(exRays);
+ }
+ if (x->Typ() == INTMAT_CMD)
+ {
+ intvec* linSpace = (intvec*) x->Data();
+ gflinSpace = intmat2ZMatrix(linSpace);
+ }
+ if (y->Typ() == INTMAT_CMD)
+ {
+ intvec* span = (intvec*) y->Data();
+ gfspan = intmat2ZMatrix(span);
+ }
+ int flag = (int)(long) z->Data();
+
+ gfan::ZCone* zc = new gfan::ZCone(*gfineq,*gfeq,*gfexRays,*gflinSpace,*gfspan,flag);
+ delete gfineq, gfeq, gfexRays, gflinSpace, gfspan;
+ res->rtyp = coneID;
+ res->data = (char*) zc;
+ return FALSE;
}
+ }
}
+ }
}
+ }
WerrorS("ZCone: unexpected parameters");
return TRUE;
}
-BOOLEAN getInequalities(leftv res, leftv args)
+BOOLEAN inequalities(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -736,11 +770,11 @@ BOOLEAN getInequalities(leftv res, leftv args)
res->data = (void*)zMatrix2Intvec(zmat);
return FALSE;
}
- WerrorS("getInequalities: unexpected parameters");
+ WerrorS("inequalities: unexpected parameters");
return TRUE;
}
-BOOLEAN getEquations(leftv res, leftv args)
+BOOLEAN equations(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -751,11 +785,11 @@ BOOLEAN getEquations(leftv res, leftv args)
res->data = (void*)zMatrix2Intvec(zmat);
return FALSE;
}
- WerrorS("getEquations: unexpected parameters");
+ WerrorS("equations: unexpected parameters");
return TRUE;
}
-BOOLEAN getFacetNormals(leftv res, leftv args)
+BOOLEAN facets(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -773,11 +807,11 @@ BOOLEAN getFacetNormals(leftv res, leftv args)
res->data = (void*)getFacetNormals(zc);
return FALSE;
}
- WerrorS("getFacetNormals: unexpected parameters");
+ WerrorS("facets: unexpected parameters");
return TRUE;
}
-BOOLEAN getImpliedEquations(leftv res, leftv args)
+BOOLEAN impliedEquations(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -788,11 +822,11 @@ BOOLEAN getImpliedEquations(leftv res, leftv args)
res->data = (void*)zMatrix2Intvec(zmat);
return FALSE;
}
- WerrorS("getImpliedEquations: unexpected parameters");
+ WerrorS("impliedEquations: unexpected parameters");
return TRUE;
}
-BOOLEAN getGeneratorsOfSpan(leftv res, leftv args)
+BOOLEAN generatorsOfSpan(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -803,11 +837,11 @@ BOOLEAN getGeneratorsOfSpan(leftv res, leftv args)
res->data = (void*)zMatrix2Intvec(zmat);
return FALSE;
}
- WerrorS("getGeneratorsOfSpan: unexpected parameters");
+ WerrorS("generatorsOfSpan: unexpected parameters");
return TRUE;
}
-BOOLEAN getGeneratorsOfLinealitySpace(leftv res, leftv args)
+BOOLEAN generatorsOfLinealitySpace(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -818,11 +852,11 @@ BOOLEAN getGeneratorsOfLinealitySpace(leftv res, leftv args)
res->data = (void*)zMatrix2Intvec(zmat);
return FALSE;
}
- WerrorS("getGeneratorsOfLinealitySpace: unexpected parameters");
+ WerrorS("generatorsOfLinealitySpace: unexpected parameters");
return TRUE;
}
-BOOLEAN getRays(leftv res, leftv args)
+BOOLEAN rays(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -833,11 +867,11 @@ BOOLEAN getRays(leftv res, leftv args)
res->data = (void*)zMatrix2Intvec(zmat);
return FALSE;
}
- WerrorS("getRays: unexpected parameters");
+ WerrorS("rays: unexpected parameters");
return TRUE;
}
-BOOLEAN getQuotientLatticeBasis(leftv res, leftv args)
+BOOLEAN quotientLatticeBasis(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -848,11 +882,11 @@ BOOLEAN getQuotientLatticeBasis(leftv res, leftv args)
res->data = (void*)zMatrix2Intvec(zmat);
return FALSE;
}
- WerrorS("getQuotientLatticeBasis: unexpected parameters");
+ WerrorS("quotientLatticeBasis: unexpected parameters");
return TRUE;
}
-BOOLEAN getLinearForms(leftv res, leftv args)
+BOOLEAN linearForms(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -863,11 +897,11 @@ BOOLEAN getLinearForms(leftv res, leftv args)
res->data = (void*)zMatrix2Intvec(zmat);
return FALSE;
}
- WerrorS("getLinearForms: unexpected parameters");
+ WerrorS("linearForms: unexpected parameters");
return TRUE;
}
-BOOLEAN getAmbientDimension(leftv res, leftv args)
+BOOLEAN ambientDimension(leftv res, leftv args)
{
leftv u=args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -891,11 +925,11 @@ BOOLEAN getAmbientDimension(leftv res, leftv args)
res->data = (char*) getAmbientDimension(zc);
return FALSE;
}
- WerrorS("getAmbientDimension: unexpected parameters");
+ WerrorS("ambientDimension: unexpected parameters");
return TRUE;
}
-BOOLEAN getDimension(leftv res, leftv args)
+BOOLEAN dimension(leftv res, leftv args)
{
leftv u=args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -919,11 +953,11 @@ BOOLEAN getDimension(leftv res, leftv args)
res->data = (char*) getDimension(zc);
return FALSE;
}
- WerrorS("getDimension: unexpected parameters");
+ WerrorS("dimension: unexpected parameters");
return TRUE;
}
-BOOLEAN getCodimension(leftv res, leftv args)
+BOOLEAN codimension(leftv res, leftv args)
{
leftv u=args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -951,7 +985,7 @@ BOOLEAN getCodimension(leftv res, leftv args)
return TRUE;
}
-BOOLEAN getLinealityDimension(leftv res, leftv args)
+BOOLEAN linealityDimension(leftv res, leftv args)
{
leftv u=args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -968,11 +1002,11 @@ BOOLEAN getLinealityDimension(leftv res, leftv args)
res->data = (char*) getLinealityDimension(zf);
return FALSE;
}
- WerrorS("getLinealityDimension: unexpected parameters");
+ WerrorS("linealityDimension: unexpected parameters");
return TRUE;
}
-BOOLEAN getMultiplicity(leftv res, leftv args)
+BOOLEAN multiplicity(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -986,7 +1020,7 @@ BOOLEAN getMultiplicity(leftv res, leftv args)
res->data = (void*) i;
return FALSE;
}
- WerrorS("getMultiplicity: unexpected parameters");
+ WerrorS("multiplicity: unexpected parameters");
return TRUE;
}
@@ -1041,7 +1075,7 @@ BOOLEAN containsPositiveVector(leftv res, leftv args)
return TRUE;
}
-BOOLEAN getLinealitySpace(leftv res, leftv args)
+BOOLEAN linealitySpace(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -1052,11 +1086,11 @@ BOOLEAN getLinealitySpace(leftv res, leftv args)
res->data = (void*) zd;
return FALSE;
}
- WerrorS("getLinealitySpace: unexpected parameters");
+ WerrorS("linealitySpace: unexpected parameters");
return TRUE;
}
-BOOLEAN getDualCone(leftv res, leftv args)
+BOOLEAN dualCone(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -1067,11 +1101,11 @@ BOOLEAN getDualCone(leftv res, leftv args)
res->data = (void*) zd;
return FALSE;
}
- WerrorS("getDualCone: unexpected parameters");
+ WerrorS("dualCone: unexpected parameters");
return TRUE;
}
-BOOLEAN getNegated(leftv res, leftv args)
+BOOLEAN negatedCone(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -1082,11 +1116,11 @@ BOOLEAN getNegated(leftv res, leftv args)
res->data = (void*) zd;
return FALSE;
}
- WerrorS("getNegated: unexpected parameters");
+ WerrorS("negatedCone: unexpected parameters");
return TRUE;
}
-BOOLEAN getSemigroupGenerator(leftv res, leftv args)
+BOOLEAN semigroupGenerator(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -1107,11 +1141,11 @@ BOOLEAN getSemigroupGenerator(leftv res, leftv args)
"but got dimensions %d and %d", d, dLS);
}
}
- WerrorS("getSemigroupGenerator: unexpected parameters");
+ WerrorS("semigroupGenerator: unexpected parameters");
return TRUE;
}
-BOOLEAN getRelativeInteriorPoint(leftv res, leftv args)
+BOOLEAN relativeInteriorPoint(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -1122,11 +1156,11 @@ BOOLEAN getRelativeInteriorPoint(leftv res, leftv args)
res->data = (void*) zVector2Intvec(zv);
return FALSE;
}
- WerrorS("getRelativeInteriorPoint: unexpected parameters");
+ WerrorS("relativeInteriorPoint: unexpected parameters");
return TRUE;
}
-BOOLEAN getUniquePoint(leftv res, leftv args)
+BOOLEAN uniquePoint(leftv res, leftv args)
{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
@@ -1137,7 +1171,7 @@ BOOLEAN getUniquePoint(leftv res, leftv args)
res->data = (void*) zVector2Intvec(zv);
return FALSE;
}
- WerrorS("getUniquePoint: unexpected parameters");
+ WerrorS("uniquePoint: unexpected parameters");
return TRUE;
}
@@ -1171,8 +1205,9 @@ BOOLEAN setLinearForms(leftv res, leftv args)
if ((v != NULL) && (v->Typ() == INTVEC_CMD))
{
intvec* mat = (intvec*)v->Data();
- gfan::ZMatrix zm = intmat2ZMatrix(mat);
- zc->setLinearForms(zm);
+ gfan::ZMatrix* zm = intmat2ZMatrix(mat);
+ zc->setLinearForms(*zm);
+ delete zm;
res->rtyp = NONE;
res->data = NULL;
return FALSE;
@@ -1208,44 +1243,44 @@ BOOLEAN intersectCones(leftv res, leftv args)
return TRUE;
}
-// BOOLEAN takeUnion(leftv res, leftv args)
-// {
-// leftv u = args;
-// std::cout << u->Typ() << (u != NULL) << std::endl;
-// if ((u != NULL) && (u->Typ() == coneID))
-// {
-// leftv v = u->next;
-// std::cout << v->Typ() << (v != NULL) << std::endl;
-// if ((v != NULL) && (v->Typ() == coneID))
-// {
-// gfan::ZCone* zc1 = (gfan::ZCone*)u->Data();
-// gfan::ZCone* zc2 = (gfan::ZCone*)v->Data();
-// int d1 = zc1->ambientDimension();
-// int d2 = zc2->ambientDimension();
-// if (d1 != d2)
-// Werror("expected ambient dims of both cones to coincide\n"
-// "but got %d and %d", d1, d2);
-// gfan::ZCone zc3 = gfan::intersection(*zc1, *zc2);
-// zc3.canonicalize();
-// if (zc1->hasFace(zc3) && zc2->hasFace(zc3))
-// {
-// gfan::ZMatrix zm1 = zc1->extremeRays();
-// gfan::ZMatrix zm2 = zc2->extremeRays();
-// gfan::ZMatrix zm11 = zc1->generatorsOfLinealitySpace();
-// gfan::ZMatrix zm22 = zc2->generatorsOfLinealitySpace();
-// gfan::ZMatrix zm = combineOnTop(combineOnTop(combineOnTop(zm1,zm2),zm11),zm22);
-// gfan::ZCone* zc = new gfan::ZCone();
-// *zc = gfan::ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
-// res->rtyp = coneID;
-// res->data = (char*) zc;
-// return FALSE;
-// }
-// WerrorS("takeUnion: cones do not share common edge");
-// }
-// }
-// WerrorS("takeUnion: unexpected parameters");
-// return TRUE;
-// }
+BOOLEAN takeUnion(leftv res, leftv args)
+{
+ leftv u = args;
+ std::cout << u->Typ() << (u != NULL) << std::endl;
+ if ((u != NULL) && (u->Typ() == coneID))
+ {
+ leftv v = u->next;
+ std::cout << v->Typ() << (v != NULL) << std::endl;
+ if ((v != NULL) && (v->Typ() == coneID))
+ {
+ gfan::ZCone* zc1 = (gfan::ZCone*)u->Data();
+ gfan::ZCone* zc2 = (gfan::ZCone*)v->Data();
+ int d1 = zc1->ambientDimension();
+ int d2 = zc2->ambientDimension();
+ if (d1 != d2)
+ Werror("expected ambient dims of both cones to coincide\n"
+ "but got %d and %d", d1, d2);
+ gfan::ZCone zc3 = gfan::intersection(*zc1, *zc2);
+ zc3.canonicalize();
+ if (zc1->hasFace(zc3) && zc2->hasFace(zc3))
+ {
+ gfan::ZMatrix zm1 = zc1->extremeRays();
+ gfan::ZMatrix zm2 = zc2->extremeRays();
+ gfan::ZMatrix zm11 = zc1->generatorsOfLinealitySpace();
+ gfan::ZMatrix zm22 = zc2->generatorsOfLinealitySpace();
+ gfan::ZMatrix zm = combineOnTop(combineOnTop(combineOnTop(zm1,zm2),zm11),zm22);
+ gfan::ZCone* zc = new gfan::ZCone();
+ *zc = gfan::ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
+ res->rtyp = coneID;
+ res->data = (char*) zc;
+ return FALSE;
+ }
+ WerrorS("takeUnion: cones do not share common face");
+ }
+ }
+ WerrorS("takeUnion: unexpected parameters");
+ return TRUE;
+}
BOOLEAN coneLink(leftv res, leftv args)
{
@@ -1257,18 +1292,20 @@ BOOLEAN coneLink(leftv res, leftv args)
{
gfan::ZCone* zc = (gfan::ZCone*)u->Data();
intvec* iv = (intvec*)v->Data();
- gfan::ZVector zv= intvec2ZVector(iv);
+ gfan::ZVector* zv= intvec2ZVector(iv);
int d1 = zc->ambientDimension();
- int d2 = zv.size();
+ int d2 = zv->size();
if (d1 != d2)
Werror("expected ambient dim of cone and size of vector\n"
"to be equal but got %d and %d", d1, d2);
- if(!zc->contains(zv))
+ if(!zc->contains(*zv))
{
WerrorS("the provided intvec does not lie in the cone");
}
+ gfan::ZCone* zd = new gfan::ZCone(zc->link(*zv));
+ delete zv;
res->rtyp = coneID;
- res->data = (void *)new gfan::ZCone(zc->link(zv));
+ res->data = (void *) zd;
return FALSE;
}
}
@@ -1288,11 +1325,15 @@ bool containsInSupport(gfan::ZCone* zc, gfan::ZCone* zd)
bool containsInSupport(gfan::ZCone* zc, intvec* vec)
{
- gfan::ZVector zv = intvec2ZVector(vec);
+ gfan::ZVector* zv = intvec2ZVector(vec);
int d1 = zc->ambientDimension();
- int d2 = zv.size();
+ int d2 = zv->size();
if (d1 == d2)
- return (zc->contains(zv) ? 1 : 0);
+ {
+ bool b = (zc->contains(*zv) ? 1 : 0);
+ delete zv;
+ return b;
+ }
Werror("expected ambient dim of cone and size of vector\n"
"to be equal but got %d and %d", d1, d2);
}
@@ -1307,13 +1348,15 @@ BOOLEAN containsRelatively(leftv res, leftv args)
{
gfan::ZCone* zc = (gfan::ZCone*)u->Data();
intvec* vec = (intvec*)v->Data();
- gfan::ZVector zv = intvec2ZVector(vec);
+ gfan::ZVector* zv = intvec2ZVector(vec);
int d1 = zc->ambientDimension();
- int d2 = zv.size();
+ int d2 = zv->size();
if (d1 == d2)
{
+ bool b = (zc->containsRelatively(*zv) ? 1 : 0);
+ delete zv;
res->rtyp = INT_CMD;
- res->data = (void *)(zc->containsRelatively(zv) ? 1 : 0);
+ res->data = (void *) b;
return FALSE;
}
Werror("expected ambient dim of cone and size of vector\n"
@@ -1357,6 +1400,8 @@ BOOLEAN canonicalizeCone(leftv res, leftv args)
res->data = (char*) zd;
return FALSE;
}
+ WerrorS("canonicalizeCone: unexpected parameters");
+ return TRUE;
}
BOOLEAN areExtremeRaysKnown(leftv res, leftv args)
@@ -1404,46 +1449,54 @@ void bbcone_setup()
b->blackbox_Copy=bbcone_Copy;
b->blackbox_Assign=bbcone_Assign;
b->blackbox_Op2=bbcone_Op2;
- iiAddCproc("","canonicalizeCone",FALSE,canonicalizeCone);
- iiAddCproc("","coneViaRays",FALSE,coneViaRays);
iiAddCproc("","coneViaNormals",FALSE,coneViaNormals);
- iiAddCproc("","quickConeViaRays",FALSE,quickConeViaRays);
iiAddCproc("","quickConeViaNormals",FALSE,quickConeViaNormals);
+ iiAddCproc("","coneViaRays",FALSE,coneViaRays);
+ iiAddCproc("","quickConeViaRays",FALSE,quickConeViaRays);
iiAddCproc("","ZCone",FALSE,ZCone);
- iiAddCproc("","intersectCones",FALSE,intersectCones);
- // iiAddCproc("","takeUnion",FALSE,takeUnion);
- iiAddCproc("","coneLink",FALSE,coneLink);
- // iiAddCproc("","contains",FALSE,contains);
- iiAddCproc("","containsRelatively",FALSE,containsRelatively);
- iiAddCproc("","getRays",FALSE,getRays);
- iiAddCproc("","getMultiplicity",FALSE,getMultiplicity);
+ iiAddCproc("","areExtremeRaysKnown",FALSE,areExtremeRaysKnown);
+ iiAddCproc("","areGeneratorsOfLinealitySpaceKnown",FALSE,areGeneratorsOfLinealitySpaceKnown);
+ iiAddCproc("","canonicalizeCone",FALSE,canonicalizeCone);
+
+ iiAddCproc("","inequalities",FALSE,inequalities);
+ iiAddCproc("","impliedInequalities",FALSE,facets);
+ iiAddCproc("","facets",FALSE,facets);
+ iiAddCproc("","equations",FALSE,equations);
+ iiAddCproc("","impliedEquations",FALSE,impliedEquations);
+ iiAddCproc("","rays",FALSE,rays);
+ iiAddCproc("","generatorsOfLinealitySpace",FALSE,generatorsOfLinealitySpace);
+ iiAddCproc("","linealitySpace",FALSE,linealitySpace);
+ iiAddCproc("","generatorsOfSpan",FALSE,generatorsOfSpan);
+
+ iiAddCproc("","dimension",FALSE,dimension);
+ iiAddCproc("","codimension",FALSE,codimension);
+ iiAddCproc("","ambientDimension",FALSE,ambientDimension);
+ iiAddCproc("","linealityDimension",FALSE,linealityDimension);
+
iiAddCproc("","setMultiplicity",FALSE,setMultiplicity);
- iiAddCproc("","getLinearForms",FALSE,getLinearForms);
+ iiAddCproc("","multiplicity",FALSE,multiplicity);
iiAddCproc("","setLinearForms",FALSE,setLinearForms);
- iiAddCproc("","getInequalities",FALSE,getInequalities);
- iiAddCproc("","getEquations",FALSE,getEquations);
- iiAddCproc("","getGeneratorsOfSpan",FALSE,getGeneratorsOfSpan);
- iiAddCproc("","getGeneratorsOfLinealitySpace",FALSE,getGeneratorsOfLinealitySpace);
- iiAddCproc("","getFacetNormals",FALSE,getFacetNormals);
- iiAddCproc("","getImpliedEquations",FALSE,getImpliedEquations);
- iiAddCproc("","getRelativeInteriorPoint",FALSE,getRelativeInteriorPoint);
- iiAddCproc("","getAmbientDimension",FALSE,getAmbientDimension);
- iiAddCproc("","getCodimension",FALSE,getCodimension);
- iiAddCproc("","getDimension",FALSE,getDimension);
- iiAddCproc("","getLinealityDimension",FALSE,getLinealityDimension);
+ iiAddCproc("","linearForms",FALSE,linearForms);
+
+ iiAddCproc("","dualCone",FALSE,dualCone);
+ iiAddCproc("","negatedCone",FALSE,negatedCone);
+ iiAddCproc("","coneLink",FALSE,coneLink);
+ iiAddCproc("","intersectCones",FALSE,intersectCones);
+ // iiAddCproc("","uniteCones",FALSE,takeUnion);
+
iiAddCproc("","isOrigin",FALSE,isOrigin);
iiAddCproc("","isFullSpace",FALSE,isFullSpace);
+
+ iiAddCproc("","containsAsFace",FALSE,hasFace);
+ iiAddCproc("","containsRelatively",FALSE,containsRelatively);
iiAddCproc("","containsPositiveVector",FALSE,containsPositiveVector);
- iiAddCproc("","getLinealitySpace",FALSE,getLinealitySpace);
- iiAddCproc("","getDualCone",FALSE,getDualCone);
- iiAddCproc("","getNegated",FALSE,getNegated);
- iiAddCproc("","getQuotientLatticeBasis",FALSE,getQuotientLatticeBasis);
- iiAddCproc("","getSemigroupGenerator",FALSE,getSemigroupGenerator);
- iiAddCproc("","getUniquePoint",FALSE,getUniquePoint);
+
+ // iiAddCproc("","contains",FALSE,contains);
+ iiAddCproc("","relativeInteriorPoint",FALSE,relativeInteriorPoint);
+ iiAddCproc("","quotientLatticeBasis",FALSE,quotientLatticeBasis);
+ iiAddCproc("","semigroupGenerator",FALSE,semigroupGenerator);
+ iiAddCproc("","uniquePoint",FALSE,uniquePoint);
// iiAddCproc("","faceContaining",FALSE,faceContaining);
- iiAddCproc("","hasFace",FALSE,hasFace);
- iiAddCproc("","areExtremeRaysKnown",FALSE,areExtremeRaysKnown);
- iiAddCproc("","areGeneratorsOfLinealitySpaceKnown",FALSE,areGeneratorsOfLinealitySpaceKnown);
coneID=setBlackboxStuff(b,"cone");
//Print("created type %d (cone)\n",coneID);
}
diff --git a/callgfanlib/bbcone.h b/callgfanlib/bbcone.h
index 026eb09..61b7b20 100755
--- a/callgfanlib/bbcone.h
+++ b/callgfanlib/bbcone.h
@@ -10,9 +10,9 @@ extern int coneID;
void bbcone_setup();
intvec* zVector2Intvec(const gfan::ZVector zv);
intvec* zMatrix2Intvec(const gfan::ZMatrix zm);
-gfan::ZMatrix intmat2ZMatrix(const intvec* iMat);
-gfan::ZVector intStar2ZVector(const int d, const int* i);
-gfan::ZVector intvec2ZVector(const intvec* iVec);
+gfan::ZMatrix* intmat2ZMatrix(const intvec* iMat);
+gfan::ZVector* intStar2ZVector(const int d, const int* i);
+gfan::ZVector* intvec2ZVector(const intvec* iVec);
std::string toString(gfan::ZMatrix const &m, char *tab=0);
int integerToInt(gfan::Integer const &V, bool &ok);
diff --git a/callgfanlib/bbpolytope.cc b/callgfanlib/bbpolytope.cc
index 3046a08..b56a0b3 100644
--- a/callgfanlib/bbpolytope.cc
+++ b/callgfanlib/bbpolytope.cc
@@ -22,9 +22,26 @@ int polytopeID;
std::string bbpolytopeToString(gfan::ZCone const &c)
{
std::stringstream s;
- gfan::ZMatrix r=c.extremeRays();
- s<<"VERTICES"<<std::endl;
- s<<toString(r);
+ gfan::ZMatrix i=c.getInequalities();
+ gfan::ZMatrix e=c.getEquations();
+ s<<"AMBIENT_DIM"<<std::endl;
+ s<<c.ambientDimension()<<std::endl;
+ s<<"INEQUALITIES"<<std::endl;
+ s<<toString(i);
+ s<<"EQUATIONS"<<std::endl;
+ s<<toString(e);
+ if(c.areExtremeRaysKnown())
+ {
+ gfan::ZMatrix r=c.extremeRays();
+ s<<"VERTICES"<<std::endl;
+ s<<toString(r);
+ }
+ if(c.areGeneratorsOfLinealitySpaceKnown())
+ {
+ gfan::ZMatrix r=c.generatorsOfLinealitySpace();
+ s<<"LINEALITY_SPACE"<<std::endl;
+ s<<toString(r);
+ }
return s.str();
}
@@ -516,7 +533,21 @@ BOOLEAN scalePolytope(leftv res, leftv args)
}
WerrorS("scalePolytope: unexpected parameters");
return TRUE;
+}
+BOOLEAN dualPolytope(leftv res, leftv args)
+{
+ leftv u = args;
+ if ((u != NULL) && (u->Typ() == polytopeID))
+ {
+ gfan::ZCone* zp = (gfan::ZCone*) u->Data();
+ gfan::ZCone* zq = new gfan::ZCone(zp->dualCone());
+ res->rtyp = polytopeID;
+ res->data = (char*) zq;
+ return FALSE;
+ }
+ WerrorS("dualPolytope: unexpected parameters");
+ return TRUE;
}
void bbpolytope_setup()
@@ -538,6 +569,7 @@ void bbpolytope_setup()
iiAddCproc("","getVertices",FALSE,getVertices);
iiAddCproc("","newtonPolytope",FALSE,newtonPolytope);
iiAddCproc("","scalePolytope",FALSE,scalePolytope);
+ iiAddCproc("","dualPolytope",FALSE,dualPolytope);
/********************************************************/
/* the following functions are implemented in bbcone.cc */
// iiAddCproc("","getAmbientDimension",FALSE,getAmbientDimension);
diff --git a/callpolymake/Makefile b/callpolymake/Makefile
index 9de94a5..2a2b5cc 100755
--- a/callpolymake/Makefile
+++ b/callpolymake/Makefile
@@ -10,8 +10,9 @@ all: polymake
polymake:
g++ -o polymake_conversion.o -I. ${PM_INC} ${PM_CFLAGS} ${CFLAGS} ${LDFLAGS} -I../ -c -g polymake_conversion.cc
+ g++ -o polymake_documentation.o -I. ${PM_INC} ${PM_CFLAGS} ${CFLAGS} ${LDFLAGS} -I../ -c -g polymake_documentation.cc
g++ -o polymake_wrapper.o -I. ${PM_INC} ${PM_CFLAGS} ${CFLAGS} ${LDFLAGS} -I../ -c -g polymake_wrapper.cc
- g++ -shared -o polymake.so ${PM_LDFLAGS} ${LDFLAGS} -g polymake_conversion.o polymake_wrapper.o ${PM_LIBS} -lgmpxx -lgmp
+ g++ -shared -o polymake.so ${PM_LDFLAGS} ${LDFLAGS} -g polymake_conversion.o -g polymake_documentation.o polymake_wrapper.o ${PM_LIBS} -lgmpxx -lgmp
cp polymake.so ../Singular/polymake.so
clean:
diff --git a/callpolymake/polymake_documentation.cc b/callpolymake/polymake_documentation.cc
index d214dae..9fb5e4c 100644
--- a/callpolymake/polymake_documentation.cc
+++ b/callpolymake/polymake_documentation.cc
@@ -1 +1,195 @@
-std::string isBounded_help="test";
+#include <polymake_conversion.h>
+
+#include <callgfanlib/bbcone.h>
+#include <callgfanlib/bbfan.h>
+#include <callgfanlib/bbpolytope.h>
+
+#include <Singular/blackbox.h>
+#include <Singular/ipshell.h>
+#include <Singular/subexpr.h>
+#include <Singular/ipid.h>
+
+void init_polymake_help()
+{
+
+ std::string isReflexive_help =
+ "USAGE: isReflexive(p); p polytope\nRETURN: int, 1 if p is reflexive and 0 otherwise\nKEYWORDS: polytopes; polymake; reflexive\nEXAMPLE: example isReflexive shows an example\nexample\n{ \"EXAMPLE:\";\nintmat M[4][4]=1,1,0,0, 1,0,1,0, 1,0,0,1, 1,-1,-1,-1;\npolytope p = polytopeViaVertices(M);\nPolymake::isReflexive(p);\nintmat N[4][4]=1,2,0,0, 1,0,2,0, 1,0,0,2, 1,-2,-2,-2;\nq = polytopeViaVertices(N);\nPolymake::isReflexive(q);\n}\n";
+
+ module_help_proc("polymake.so","isReflexive", omStrDup(isReflexive_help.c_str()));
+
+ std::string isBounded_help =
+ "USAGE: isBounded(polytope p)\nRETURN: int, 1 if p is bounded, 0 otherwise.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example isBounded shows an example\n";
+
+ module_help_proc("polymake.so","isBounded", omStrDup(isBounded_help.c_str()));
+
+ std::string isGorenstein_help =
+ "USAGE: isGorenstein(polytope p)\nRETURN: int, 1 if p is gorenstein (i.e. reflexive after dilatation and translation), 0 otherwise.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example isGorenstein shows an example\n";
+
+ module_help_proc("polymake.so","isGorenstein", omStrDup(isGorenstein_help.c_str()));
+
+ std::string gorensteinIndex_help =
+ "USAGE: gorensteinIndex(polytope p)\nRETURN: int, n if p is reflexive after dilatation by n and translation, 0 otherwise.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example gorensteinIndex shows an example\n";
+
+ module_help_proc("polymake.so","gorensteinIndex", omStrDup(gorensteinIndex_help.c_str()));
+
+ std::string gorensteinVector_help =
+ "USAGE: gorensteinVector(polytope p)\nRETURN: intvec, v if p is reflexive after dilatation and translation by v, 0 otherwise.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example gorensteinVector shows an example\n";
+
+ module_help_proc("polymake.so","gorensteinVector", omStrDup(gorensteinVector_help.c_str()));
+
+ std::string isCanonical_help =
+ "USAGE: isCanonical(polytope p)\nRETURN: intvec, 1 if p has exactly one interior lattice point, 0 otherwise.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example isCanonical shows an example\n";
+
+ module_help_proc("polymake.so","isCanonical", omStrDup(isCanonical_help.c_str()));
+
+ std::string isTerminal_help =
+ "USAGE: isLatticeEmpty(polytope p)\nRETURN: int, 1 if p contains no lattice points other than the vertices, 0 otherwise.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example isLatticeEmpty shows an example\n";
+
+ module_help_proc("polymake.so","isTerminal", omStrDup(isTerminal_help.c_str()));
+
+ std::string latticeVolume_help =
+ "USAGE: latticeVolume(polytope p)\nRETURN: int, the normalized lattice volume of p, that is, (dim(P))! times the volume of P.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example latticeVolume shows an example\n";
+
+ module_help_proc("polymake.so","latticeVolume", omStrDup(latticeVolume_help.c_str()));
+
+ std::string latticeDegree_help =
+ "USAGE: latticeDegree(polytope p)\nRETURN: int, the lattice degree of p, i.e. degree of the Ehrhart polynomial of P.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example latticeDegree shows an example\n";
+
+ module_help_proc("polymake.so","latticeDegree", omStrDup(latticeDegree_help.c_str()));
+
+ std::string latticeCodegree_help =
+ "USAGE: latticeCodegree(polytope p)\nRETURN: int, getDimension(p)+1-latticeDegree(p), which is the smallest number k such that k*p has an interior latt\\nice point.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example latticeCodegree shows an example\n";
+
+ module_help_proc("polymake.so","latticeCodegree", omStrDup(latticeCodegree_help.c_str()));
+
+ std::string ehrhartPolynomialCoeff_help =
+ "USAGE: ehrhartPolynomialCoeff(polytope p)\nRETURN: intvec, coefficients of the Ehrhart polynomial of p.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example ehrhartPolynomialCoeff shows an example\n";
+
+ module_help_proc("polymake.so","ehrhartPolynomialCoeff", omStrDup(ehrhartPolynomialCoeff_help.c_str()));
+
+ std::string hStarVector_help =
+ "USAGE: hStarVector(polytope p)\nRETURN: intvec, h*-vector of p.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example hStarVector shows an example\n";
+
+ module_help_proc("polymake.so","hStarVector", omStrDup(hStarVector_help.c_str()));
+
+ std::string hVector_help =
+ "USAGE: hVector(polytope p)\nRETURN: intvec, h-vector of p.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example hVector shows an example\n";
+
+ module_help_proc("polymake.so","hVector", omStrDup(hVector_help.c_str()));
+
+ std::string fVector_help =
+ "USAGE: fVector(polytope p)\nRETURN: intvec, the f-vector of p.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example fVector shows an example\n";
+
+ module_help_proc("polymake.so","fVector", omStrDup(fVector_help.c_str()));
+
+ std::string isNormal_help =
+ "USAGE: isNormal(polytope p)\nRETURN: int, 1 if p is normal, i.e. the projective toric variety defined by p is projectively normal, 0 otherwise.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example isNormal shows an example\n";
+
+ module_help_proc("polymake.so","isNormal", omStrDup(isNormal_help.c_str()));
+
+ std::string facetWidths_help =
+ "USAGE: facetWidths(polytope p)\nRETURN: intvec, vector with the integral widths of p with respect to all facet normals.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example facetWidths shows an example\n";
+
+ module_help_proc("polymake.so","facetWidths", omStrDup(facetWidths_help.c_str()));
+
+ std::string facetWidth_help =
+ "USAGE: facetWidth(polytope p)\nRETURN: int, maximum of the integral widths of p over all facet normals.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example facetWidth shows an example\n";
+
+ module_help_proc("polymake.so","facetWidth", omStrDup(facetWidth_help.c_str()));
+
+ std::string facetVertexLatticeDistances_help =
+ "USAGE: facetVertexLatticeDistances(polytope p)\nRETURN: intmat, matrix of lattice distances between vertices (columns) and facets (rows).\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example facetVertexLatticeDistances shows an example\n";
+
+ module_help_proc("polymake.so","facetVertexLatticeDistances", omStrDup(facetVertexLatticeDistances_help.c_str()));
+
+ std::string isCompressed_help =
+ "USAGE: isCompressed(polytope p)\nRETURN: int, 1 if facetWidth(p)=1, 0 otherwise.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example isCompressed shows an example\n";
+
+ module_help_proc("polymake.so","isCompressed", omStrDup(isCompressed_help.c_str()));
+
+ std::string isSmooth_help =
+ "USAGE: isSmooth(polytope p)\n isSmooth(cone c)\n isSmooth(fan F)\nRETURN: int, 1 if p, c, or F is smooth, 0 otherwise.\nKEYWORDS: polytopes; cones; fans; polymake;\nEXAMPLE: example isSmooth shows an example\n";
+
+ module_help_proc("polymake.so","isSmooth", omStrDup(isSmooth_help.c_str()));
+
+ std::string isVeryAmple_help =
+ "USAGE: isVeryAmple(polytope p)\nRETURN: int, 1 if p is very ample, 0 otherwise.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example isVeryAmple shows an example\n";
+
+ module_help_proc("polymake.so","isVeryAmple", omStrDup(isVeryAmple_help.c_str()));
+
+ std::string latticePoints_help =
+ "USAGE: latticePoints(polytope p)\nRETURN: intmat, matrix whose rows are the lattice points of p.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example latticePoints shows an example\n";
+
+ module_help_proc("polymake.so","latticePoints", omStrDup(latticePoints_help.c_str()));
+
+ std::string nLatticePoints_help =
+ "USAGE: nLatticePoints(polytope p)\nRETURN: int, number of lattice points of p.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example nLatticePoints shows an example\n";
+
+ module_help_proc("polymake.so","nLatticePoints", omStrDup(nLatticePoints_help.c_str()));
+
+ std::string interiorLatticePoints_help =
+ "USAGE: interiorLatticePoints(polytope p)\nRETURN: intmat, an matrix whose rows are the lattice points in the relative interior of p.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example interiorLatticePoints shows an example\n";
+
+ module_help_proc("polymake.so","interiorLatticePoints", omStrDup(interiorLatticePoints_help.c_str()));
+
+ std::string nInteriorLatticePoints_help =
+ "USAGE: nInteriorLatticePoints(polytope p)\nRETURN: int, number of lattice points in the relative interior of p.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example nInteriorLatticePoints shows an example\n";
+
+ module_help_proc("polymake.so","nInteriorLatticePoints", omStrDup(nInteriorLatticePoints_help.c_str()));
+
+ std::string boundaryLatticePoints_help =
+ "USAGE: boundaryLatticePoints(polytope p)\nRETURN: intmat, matrix whose rows are the lattice points in the relative boundary of p.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example boundaryLatticePoints shows an example\n";
+
+ module_help_proc("polymake.so","boundaryLatticePoints", omStrDup(boundaryLatticePoints_help.c_str()));
+
+ std::string nBoundaryLatticePoints_help =
+ "USAGE: nBoundaryLatticePoints(polytope p)\nRETURN: int, number of lattice points in the relative boundary of p.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example nBoundaryLatticePoints shows an example\n";
+
+ module_help_proc("polymake.so","nBoundaryLatticePoints", omStrDup(nBoundaryLatticePoints_help.c_str()));
+
+ std::string hilbertBasis_help =
+ "USAGE: hilbertBasis(cone c)\nRETURN: intmat, Hilbert basis of the semigroup of c.\nKEYWORDS: cones; polymake;\nEXAMPLE: example hilbertBasis shows an example\n";
+
+ module_help_proc("polymake.so","hilbertBasis", omStrDup(hilbertBasis_help.c_str()));
+
+ std::string nHilbertBasis_help =
+ "USAGE: nHilbertBasis(cone c)\nRETURN: int, size of the Hilbert basis of the semigroup of c.\nKEYWORDS: cones; polymake;\nEXAMPLE: example nHilbertBasis shows an example\n";
+
+ module_help_proc("polymake.so","nHilbertBasis", omStrDup(nHilbertBasis_help.c_str()));
+
+ std::string minkowskiSum_help =
+ "USAGE: minkowskiSum(polytope p, polytope q)\nRETURN: polytope, Minkowski sum of p and q.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example minkowskiSum shows an example\n";
+
+ module_help_proc("polymake.so","minkowskiSum", omStrDup(minkowskiSum_help.c_str()));
+
+ std::string minimalValue_help =
+ "USAGE: minimalValue(polytope p, intvec v)\nRETURN: int, the minimal value of the linear form v on p.\n The first coordinate of v corresponds to a shift of the\n minimal value since p is considered as a polytope\n in the plane (first coordinate) = 1.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example minimalValue shows an example\n";
+
+ module_help_proc("polymake.so","minimalValue", omStrDup(minimalValue_help.c_str()));
+
+ std::string maximalValue_help =
+ "USAGE: maximalValue(polytope p, intvec v)\nRETURN: int, maximal value of the linear form v on p.\n The first coordinate of v corresponds to a shift of the\n maximal value since p is considered as a polytope\n in the plane (first coordinate) = 1.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example maximalValue shows an example\n";
+
+ module_help_proc("polymake.so","maximalValue", omStrDup(maximalValue_help.c_str()));
+
+ std::string minimalFace_help =
+ "USAGE: minimalFace(polytope p, intvec v)\nRETURN: intmat, vertices of the face of p on which the linear form v\n is minimal.\n The first coordinate of v corresponds to a shift of the\n minimal value since p is considered as a polytope\n in the plane (first coordinate) = 1. Hence\n the minimal face is independent of the first coordinate of v.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example minimalFace shows an example\n";
+
+ module_help_proc("polymake.so","minimalFace", omStrDup(minimalFace_help.c_str()));
+
+ std::string maximalFace_help =
+ "USAGE: maximalFace(polytope p, intvec v)\nRETURN: intmat, vertices of the face of p on which the linear form v\n is maximal.\n The first coordinate of v corresponds to a shift of the\n maximal value since p is considered as a polytope\n in the plane (first coordinate) = 1. Hence\n the maximal face is independent of the first coordinate of v.\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example maximalFace shows an example\n";
+
+ module_help_proc("polymake.so","maximalFace", omStrDup(maximalFace_help.c_str()));
+
+ std::string visual_help =
+ "USAGE: visual(polytope p)\n visual(fan F)\nRETURN: none, draws the polytope p or fan F using jreality.\nKEYWORDS: polytopes; polymake; visualization;\nEXAMPLE: example visual shows an example\n";
+
+ module_help_proc("polymake.so","visual", omStrDup(visual_help.c_str()));
+
+ std::string normalFan_help =
+ "USAGE: normalFan(polytope p)\nRETURN: fan,\nKEYWORDS: polytopes; polymake; visualization;\nEXAMPLE: example visual shows an example\n";
+
+ module_help_proc("polymake.so","normalFan", omStrDup(normalFan_help.c_str()));
+
+}
diff --git a/callpolymake/polymake_documentation.h b/callpolymake/polymake_documentation.h
index 456a542..b2cf9fc 100644
--- a/callpolymake/polymake_documentation.h
+++ b/callpolymake/polymake_documentation.h
@@ -1 +1,14 @@
-extern std::string isBounded_help;
+#include <polymake_conversion.h>
+
+#include <callgfanlib/bbcone.h>
+#include <callgfanlib/bbfan.h>
+#include <callgfanlib/bbpolytope.h>
+
+#include <Singular/blackbox.h>
+#include <Singular/ipshell.h>
+#include <Singular/subexpr.h>
+#include <Singular/ipid.h>
+
+#include <string>
+
+void init_polymake_help();
diff --git a/callpolymake/polymake_wrapper.cc b/callpolymake/polymake_wrapper.cc
index c73bef6..712eb4f 100644
--- a/callpolymake/polymake_wrapper.cc
+++ b/callpolymake/polymake_wrapper.cc
@@ -1,4 +1,5 @@
#include <polymake_conversion.h>
+#include <polymake_documentation.h>
// #include <polymake/Main.h>
// #include <polymake/Matrix.h>
@@ -1798,9 +1799,18 @@ BOOLEAN PMpolytopeViaVertices(leftv res, leftv args)
}
-extern "C" int mod_init(void* polymakesingular)
+BOOLEAN loadPolymakeDocumentation(leftv res, leftv args)
{
+ init_polymake_help();
+
+ res->rtyp = NONE;
+ res->data = NULL;
+ return FALSE;
+}
+
+extern "C" int mod_init(void* polymakesingular)
+{
if (init_polymake==NULL)
{init_polymake = new polymake::Main();}
init_polymake->set_application("fan");
@@ -1854,8 +1864,10 @@ extern "C" int mod_init(void* polymakesingular)
// iiAddCproc("","testingvisuals",FALSE,testingvisuals);
// iiAddCproc("","testingstrings",FALSE,testingstrings);
// iiAddCproc("","testingmatrices",FALSE,testingmatrices);
+ iiAddCproc("","loadPolymakeDocumentation",FALSE,loadPolymakeDocumentation);
blackbox* b=getBlackboxStuff(polytopeID);
b->blackbox_Op2=bbpolytope_Op2;
+ // init_polymake_help();
}
diff --git a/doc/cones.doc b/doc/cones.doc
index 0a6b855..31d4727 100644
--- a/doc/cones.doc
+++ b/doc/cones.doc
@@ -207,26 +207,26 @@ d;
* containsInSupport::
* containsPositiveVector::
* containsRelatively::
-* getAmbientDimension::
-* getCodimension::
-* getDimension::
-* getDualCone::
-* getEquations::
-* getFacetNormals::
-* getGeneratorsOfLinealitySpace::
-* getGeneratorsOfSpan::
-* getImpliedEquations::
-* getInequalities::
-* getLinealityDimension::
-* getLinealitySpace::
-* getLinearForms::
-* getMultiplicity::
-* getNegated::
-* getQuotientLatticeBasis::
-* getRays::
-* getRelativeInteriorPoint::
-* getSemigroupGenerator::
-* getUniquePoint::
+* ambientDimension::
+* codimension::
+* dimension::
+* dualCone::
+* equations::
+* facets::
+* generatorsOfLinealitySpace::
+* generatorsOfSpan::
+* impliedEquations::
+* inequalities::
+* linealityDimension::
+* linealitySpace::
+* linearForms::
+* multiplicity::
+* negatedCone::
+* quotientLatticeBasis::
+* rays::
+* relativeInteriorPoint::
+* semigroupGenerator::
+* uniquePoint::
* hasFace::
* intersectCones::
* isFullSpace::
@@ -293,11 +293,11 @@ cone c=coneViaRays(M);
intvec v=1,0,0;
cone cc=coneLink(c,v);
cc;
-print(getRays(cc));
+print(rays(cc));
intvec w=1,1,1;
cone cd=coneLink(c,w);
cd;
-print(getRays(cd));
+print(rays(cd));
@c example
@end smallexample
@end table
@@ -368,7 +368,7 @@ containsPositiveVector(c2);
@end smallexample
@end table
@c --------------------------------------
- at node containsRelatively,getAmbientDimension,containsPositiveVector,cone related functions
+ at node containsRelatively,ambientDimension,containsPositiveVector,cone related functions
@subsubsection containsRelatively
@cindex containsRelatively
@@ -394,15 +394,15 @@ containsRelatively(c,p2);
@end smallexample
@end table
@c --------------------------------------
- at node getAmbientDimension,getCodimension,containsRelatively,cone related functions
- at subsubsection getAmbientDimension
- at cindex getAmbientDimension
+ at node ambientDimension,codimension,containsRelatively,cone related functions
+ at subsubsection ambientDimension
+ at cindex ambientDimension
@table @code
@item @strong{Syntax:}
- at code{getAmbientDimension(} cone c @code{)}
-@*@code{getAmbientDimension(} fan f @code{)}
-@*@code{getAmbientDimension(} polytope p @code{)}
+ at code{ambientDimension(} cone c @code{)}
+@*@code{ambientDimension(} fan f @code{)}
+@*@code{ambientDimension(} polytope p @code{)}
@item @strong{Type:}
int
@item @strong{Purpose:}
@@ -414,25 +414,25 @@ intmat M1[2][2]=
1,0,
0,1;
cone c1=coneViaRays(M1);
-getAmbientDimension(c1);
+ambientDimension(c1);
intmat M2[2][3]=
1,0,0,
0,1,0;
cone c2=coneViaRays(M2);
-getAmbientDimension(c2);
+ambientDimension(c2);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getCodimension,getDimension,getAmbientDimension,cone related functions
- at subsubsection getCodimension
- at cindex getCodimension
+ at node codimension,dimension,ambientDimension,cone related functions
+ at subsubsection codimension
+ at cindex codimension
@table @code
@item @strong{Syntax:}
- at code{getCodimension(} cone c @code{)}
- at code{getCodimension(} fan f @code{)}
- at code{getCodimension(} polytope c @code{)}
+ at code{codimension(} cone c @code{)}
+ at code{codimension(} fan f @code{)}
+ at code{codimension(} polytope c @code{)}
@item @strong{Type:}
int
@item @strong{Purpose:}
@@ -443,24 +443,24 @@ codimension of the cone;
intmat M1[1][2]=
1,0;
cone c1=coneViaRays(M1);
-getCodimension(c1);
+codimension(c1);
intmat M2[1][2]=
0,0;
cone c2=coneViaRays(M2);
-getCodimension(c2);
+codimension(c2);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getDimension,getDualCone,getCodimension,cone related functions
- at subsubsection getDimension
- at cindex getDimension
+ at node dimension,dualCone,codimension,cone related functions
+ at subsubsection dimension
+ at cindex dimension
@table @code
@item @strong{Syntax:}
- at code{getDimension(} cone c @code{)}
- at code{getDimension(} fan f @code{)}
- at code{getDimension(} polytope p @code{)}
+ at code{dimension(} cone c @code{)}
+ at code{dimension(} fan f @code{)}
+ at code{dimension(} polytope p @code{)}
@item @strong{Type:}
int
@item @strong{Purpose:}
@@ -471,22 +471,22 @@ dimension of the cone
intmat M1[1][2]=
1,0;
cone c1=coneViaRays(M1);
-getDimension(c1);
+dimension(c1);
intmat M2[1][2]=
0,0;
cone c2=coneViaRays(M2);
-getDimension(c2);
+dimension(c2);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getDualCone,getEquations,getDimension,cone related functions
- at subsubsection getDualCone
- at cindex getDualCone
+ at node dualCone,equations,dimension,cone related functions
+ at subsubsection dualCone
+ at cindex dualCone
@table @code
@item @strong{Syntax:}
- at code{getDualCone(} cone c @code{)}
+ at code{dualCone(} cone c @code{)}
@item @strong{Type:}
cone
@item @strong{Purpose:}
@@ -498,28 +498,28 @@ intmat M1[2][2]=
1,0,
0,1;
cone c1=coneViaRays(M1);
-cone d1=getDualCone(c1);
+cone d1=dualCone(c1);
d1;
-print(getRays(d1));
+print(rays(d1));
intmat M2[2][2]=
1,1,
0,1;
cone c2=coneViaRays(M2);
-cone d2=getDualCone(c2);
+cone d2=dualCone(c2);
d2;
-print(getRays(d2));
+print(rays(d2));
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getEquations,getFacetNormals,getDualCone,cone related functions
- at subsubsection getEquations
- at cindex getEquations
+ at node equations,facets,dualCone,cone related functions
+ at subsubsection equations
+ at cindex equations
@table @code
@item @strong{Syntax:}
- at code{getEquations(} cone c @code{)}
- at code{getEquations(} polytope p @code{)}
+ at code{equations(} cone c @code{)}
+ at code{equations(} polytope p @code{)}
@item @strong{Type:}
intmat
@item @strong{Purpose:}
@@ -531,25 +531,25 @@ intmat M1[2][2]=
1,0,
0,1;
cone c1=coneViaRays(M1);
-intmat E1=getEquations(c1);
+intmat E1=equations(c1);
print(E1);
intmat M2[1][2]=
1,0;
cone c2=coneViaRays(M2);
-intmat E2=getEquations(c2);
+intmat E2=equations(c2);
print(E2);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getFacetNormals,getGeneratorsOfLinealitySpace,getEquations,cone related functions
- at subsubsection getFacetNormals
+ at node facets,generatorsOfLinealitySpace,equations,cone related functions
+ at subsubsection facets
@cindex getFacets
@table @code
@item @strong{Syntax:}
- at code{getFacetNormals(} cone c @code{)}
-@*@code{getFacetNormals(} polytope p @code{)}
+ at code{facets(} cone c @code{)}
+@*@code{facets(} polytope p @code{)}
@item @strong{Type:}
intmat
@item @strong{Purpose:}
@@ -561,25 +561,25 @@ intmat M1[2][2]=
1,0,
0,1;
cone c1=coneViaRays(M1);
-intmat F1=getFacetNormals(c1);
+intmat F1=facets(c1);
print(F1);
intmat M2[2][2]=
1,1,
0,-1;
cone c2=coneViaRays(M2);
-intmat F2=getFacetNormals(c2);
+intmat F2=facets(c2);
print(F2);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getGeneratorsOfLinealitySpace,getGeneratorsOfSpan,getFacetNormals,cone related functions
- at subsubsection getGeneratorsOfLinealitySpace
- at cindex getGeneratorsOfLinealitySpace
+ at node generatorsOfLinealitySpace,generatorsOfSpan,facets,cone related functions
+ at subsubsection generatorsOfLinealitySpace
+ at cindex generatorsOfLinealitySpace
@table @code
@item @strong{Syntax:}
- at code{getGeneratorsOfLinealitySpace(} cone c @code{)}
+ at code{generatorsOfLinealitySpace(} cone c @code{)}
@item @strong{Type:}
intmat
@item @strong{Purpose:}
@@ -594,19 +594,19 @@ intmat M[5][3]=
-1,0,0,
0,-1,0;
cone c=coneViaRays(M);
-intmat L=getGeneratorsOfLinealitySpace(c);
+intmat L=generatorsOfLinealitySpace(c);
print(L);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getGeneratorsOfSpan,getImpliedEquations,getGeneratorsOfLinealitySpace,cone related functions
- at subsubsection getGeneratorsOfSpan
- at cindex getGeneratorsOfSpan
+ at node generatorsOfSpan,impliedEquations,generatorsOfLinealitySpace,cone related functions
+ at subsubsection generatorsOfSpan
+ at cindex generatorsOfSpan
@table @code
@item @strong{Syntax:}
- at code{getGeneratorsOfSpan(} cone c @code{)}
+ at code{generatorsOfSpan(} cone c @code{)}
@item @strong{Type:}
intmat
@item @strong{Purpose:}
@@ -619,19 +619,19 @@ intmat M[3][5]=
0,1,0,0,0,
0,0,1,0,0;
cone c=coneViaRays(M);
-intmat S=getGeneratorsOfSpan(c);
+intmat S=generatorsOfSpan(c);
print(S);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getImpliedEquations,getInequalities,getGeneratorsOfSpan,cone related functions
- at subsubsection getImpliedEquations
- at cindex getImpliedEquations
+ at node impliedEquations,inequalities,generatorsOfSpan,cone related functions
+ at subsubsection impliedEquations
+ at cindex impliedEquations
@table @code
@item @strong{Syntax:}
- at code{getImpliedEquations(} cone c @code{)}
+ at code{impliedEquations(} cone c @code{)}
@item @strong{Type:}
intmat
@item @strong{Purpose:}
@@ -644,19 +644,19 @@ intmat M[3][5]=
0,1,0,0,0,
0,0,1,0,0;
cone c=coneViaRays(M);
-intmat I=getImpliedEquations(c);
+intmat I=impliedEquations(c);
print(I);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getInequalities,getLinealityDimension,getImpliedEquations,cone related functions
- at subsubsection getInequalities
- at cindex getInequalities
+ at node inequalities,linealityDimension,impliedEquations,cone related functions
+ at subsubsection inequalities
+ at cindex inequalities
@table @code
@item @strong{Syntax:}
- at code{getInequalities(} cone c @code{)}
+ at code{inequalities(} cone c @code{)}
@item @strong{Type:}
intmat
@item @strong{Purpose:}
@@ -668,25 +668,25 @@ intmat M1[2][2]=
1,0,
0,1;
cone c1=coneViaRays(M1);
-intmat I1=getInequalities(c1);
+intmat I1=inequalities(c1);
print(I);
intmat M2[1][2]=
1,0;
cone c2=coneViaRays(M2);
-intmat I2=getInequalities(c2);
+intmat I2=inequalities(c2);
print(I2);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getLinealityDimension,getLinealitySpace,getInequalities,cone related functions
- at subsubsection getLinealityDimension
- at cindex getLinealityDimension
+ at node linealityDimension,linealitySpace,inequalities,cone related functions
+ at subsubsection linealityDimension
+ at cindex linealityDimension
@table @code
@item @strong{Syntax:}
- at code{getLinealityDimension(} cone c @code{)}
- at code{getLinealityDimension(} fan c @code{)}
+ at code{linealityDimension(} cone c @code{)}
+ at code{linealityDimension(} fan c @code{)}
@item @strong{Type:}
int
@item @strong{Purpose:}
@@ -699,25 +699,25 @@ intmat M1[3][3]=
0,1,0,
0,0,1;
cone c1=coneViaRays(M1);
-getLinealityDimension(c1);
+linealityDimension(c1);
intmat M2[4][3]=
1,0,0,
0,1,0,
0,0,1,
-1,0,0;
cone c2=coneViaRays(M2);
-getLinealityDimension(c2);
+linealityDimension(c2);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getLinealitySpace,getLinearForms,getLinealityDimension,cone related functions
- at subsubsection getLinealitySpace
- at cindex getLinealitySpace
+ at node linealitySpace,linearForms,linealityDimension,cone related functions
+ at subsubsection linealitySpace
+ at cindex linealitySpace
@table @code
@item @strong{Syntax:}
- at code{getLinealitySpace(} cone c @code{)}
+ at code{linealitySpace(} cone c @code{)}
@item @strong{Type:}
cone
@item @strong{Purpose:}
@@ -730,7 +730,7 @@ intmat M1[3][3]=
0,1,0,
0,0,1;
cone c1=coneViaRays(M1);
-cone l1=getLinealitySpace(c1);
+cone l1=linealitySpace(c1);
l1;
intmat M2[4][3]=
1,0,0,
@@ -738,20 +738,20 @@ intmat M2[4][3]=
0,0,1,
-1,0,0;
cone c2=coneViaRays(M2);
-cone l2=getLinealitySpace(c2);
+cone l2=linealitySpace(c2);
l2;
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getLinearForms,getMultiplicity,getLinealitySpace,cone related functions
- at subsubsection getLinearForms
- at cindex getLinearForms
+ at node linearForms,multiplicity,linealitySpace,cone related functions
+ at subsubsection linearForms
+ at cindex linearForms
@table @code
@item @strong{Syntax:}
- at code{getLinearForms(} cone c @code{)}
-@*@code{getLinearForms(} polytope p @code{)}
+ at code{linearForms(} cone c @code{)}
+@*@code{linearForms(} polytope p @code{)}
@item @strong{Type:}
intvec
@item @strong{Purpose:}
@@ -763,22 +763,22 @@ intmat M[2][3]=
-1,0,0,
0,-1,0;
cone c=coneViaRays(M);
-getLinearForms(c);
+linearForms(c);
intvec v=1,1,1;
setLinearForms(c,v);
-getLinearForms(c);
+linearForms(c);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getMultiplicity,getNegated,getLinearForms,cone related functions
- at subsubsection getMultiplicity
- at cindex getMultiplicity
+ at node multiplicity,negatedCone,linearForms,cone related functions
+ at subsubsection multiplicity
+ at cindex multiplicity
@table @code
@item @strong{Syntax:}
- at code{getMultiplicity(} cone c @code{)}
-@*@code{getMultiplicity(} polytope p @code{)}
+ at code{multiplicity(} cone c @code{)}
+@*@code{multiplicity(} polytope p @code{)}
@item @strong{Type:}
int
@item @strong{Purpose:}
@@ -790,20 +790,20 @@ intmat M[2][3]=
-1,0,0,
0,-1,0;
cone c=coneViaRays(M);
-getMultiplicity(c);
+multiplicity(c);
setMultiplicity(c,3);
-getMultiplicity(c);
+multiplicity(c);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getNegated,getQuotientLatticeBasis,getMultiplicity,cone related functions
- at subsubsection getNegated
- at cindex getNegated
+ at node negatedCone,quotientLatticeBasis,multiplicity,cone related functions
+ at subsubsection negatedCone
+ at cindex negatedCone
@table @code
@item @strong{Syntax:}
- at code{getNegated(} cone c @code{)}
+ at code{negatedCone(} cone c @code{)}
@item @strong{Type:}
cone
@item @strong{Purpose:}
@@ -815,20 +815,20 @@ intmat M[2][2]=
1,0,
0,1;
cone c=coneViaRays(M);
-cone cn=getNegated(c);
+cone cn=negatedCone(c);
cn;
-print(getRays(cn));
+print(rays(cn));
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getQuotientLatticeBasis,getRays,getNegated,cone related functions
- at subsubsection getQuotientLatticeBasis
- at cindex getQuotientLatticeBasis
+ at node quotientLatticeBasis,rays,negatedCone,cone related functions
+ at subsubsection quotientLatticeBasis
+ at cindex quotientLatticeBasis
@table @code
@item @strong{Syntax:}
- at code{getQuotientLatticeBasis(} cone c @code{)}
+ at code{quotientLatticeBasis(} cone c @code{)}
@item @strong{Type:}
int
@item @strong{Purpose:}
@@ -841,19 +841,19 @@ intmat M[3][2]=
0,1,
-1,0;
cone c=coneViaRays(M);
-intmat Q=getQuotientLatticeBasis(c);
+intmat Q=quotientLatticeBasis(c);
print(Q);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getRays,getRelativeInteriorPoint,getQuotientLatticeBasis,cone related functions
- at subsubsection getRays
- at cindex getRays
+ at node rays,relativeInteriorPoint,quotientLatticeBasis,cone related functions
+ at subsubsection rays
+ at cindex rays
@table @code
@item @strong{Syntax:}
- at code{getRays(} cone c @code{)}
+ at code{rays(} cone c @code{)}
@item @strong{Type:}
intmat
@item @strong{Purpose:}
@@ -865,26 +865,26 @@ intmat M1[2][2]=
1,0,
0,1;
cone c1=coneViaRays(M1);
-intmat R1=getRays(c1);
+intmat R1=rays(c1);
print(R1);
intmat M2[3][2]=
1,0,
0,1,
-1,0;
cone c2=coneViaRays(M2);
-intmat R2=getRays(c2);
+intmat R2=rays(c2);
print(R2);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getRelativeInteriorPoint,getSemigroupGenerator,getRays,cone related functions
- at subsubsection getRelativeInteriorPoint
- at cindex getRelativeInteriorPoint
+ at node relativeInteriorPoint,semigroupGenerator,rays,cone related functions
+ at subsubsection relativeInteriorPoint
+ at cindex relativeInteriorPoint
@table @code
@item @strong{Syntax:}
- at code{getRelativeInteriorPoint(} cone c @code{)}
+ at code{relativeInteriorPoint(} cone c @code{)}
@item @strong{Type:}
intvec
@item @strong{Purpose:}
@@ -896,27 +896,27 @@ intmat M1[2][2]=
1,0,
0,1;
cone c1=coneViaRays(M1);
-getRelativeInteriorPoint(c1);
+relativeInteriorPoint(c1);
intmat M2[2][2]=
1,0,
1,1;
cone c2=coneViaRays(M2);
-getRelativeInteriorPoint(c2);
+relativeInteriorPoint(c2);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getSemigroupGenerator,getUniquePoint,getRelativeInteriorPoint,cone related functions
- at subsubsection getSemigroupGenerator
- at cindex getSemigroupGenerator
+ at node semigroupGenerator,uniquePoint,relativeInteriorPoint,cone related functions
+ at subsubsection semigroupGenerator
+ at cindex semigroupGenerator
@table @code
@item @strong{Syntax:}
- at code{getSemigroupGenerator(} cone c @code{)}
+ at code{semigroupGenerator(} cone c @code{)}
@item @strong{Type:}
intvec
@item @strong{Purpose:}
-if getDimension(c)=getLinealityDimension(c)+1, then the quotient lattice of Z^n intersected with the span and Z^n intersected with the lineality space is Z^1 and the class of the cone is a semigroup. returns a generator of that semigroup. (like getQuotientLatticeBasis(cone c), but as intvec)
+if dimension(c)=linealityDimension(c)+1, then the quotient lattice of Z^n intersected with the span and Z^n intersected with the lineality space is Z^1 and the class of the cone is a semigroup. returns a generator of that semigroup. (like quotientLatticeBasis(cone c), but as intvec)
@item @strong{Example:}
@smallexample
@c example
@@ -925,18 +925,18 @@ intmat M[3][2]=
0,1,
-1,0;
cone c=coneViaRays(M);
-getSemigroupGenerator(c);
+semigroupGenerator(c);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node getUniquePoint,hasFace,getSemigroupGenerator,cone related functions
- at subsubsection getUniquePoint
- at cindex getUniquePoint
+ at node uniquePoint,hasFace,semigroupGenerator,cone related functions
+ at subsubsection uniquePoint
+ at cindex uniquePoint
@table @code
@item @strong{Syntax:}
- at code{getUniquePoint(} cone c @code{)}
+ at code{uniquePoint(} cone c @code{)}
@item @strong{Type:}
intvec
@item @strong{Purpose:}
@@ -948,17 +948,17 @@ intmat M1[2][2]=
1,0,
0,1;
cone c1=coneViaRays(M1);
-getUniquePoint(c1);
+uniquePoint(c1);
intmat M2[2][2]=
1,0,
1,1;
cone c2=coneViaRays(M2);
-getUniquePoint(c2);
+uniquePoint(c2);
@c example
@end smallexample
@end table
@c --------------------------------------
- at node hasFace,intersectCones,getUniquePoint,cone related functions
+ at node hasFace,intersectCones,uniquePoint,cone related functions
@subsubsection hasFace
@cindex hasFace
@@ -1016,13 +1016,13 @@ intmat M3[2][2]=
cone c3=coneViaRays(M3);
cone c12=intersectCones(c1,c2);
c12;
-print(getRays(c12));
+print(rays(c12));
cone c23=intersectCones(c2,c3);
c23;
-print(getRays(c23));
+print(rays(c23));
cone c13=intersectCones(c1,c3);
c13;
-print(getRays(c13));
+print(rays(c13));
@c example
@end smallexample
@end table
@@ -1159,10 +1159,10 @@ intmat M[2][3]=
-1,0,0,
0,-1,0;
cone c=coneViaRays(M);
-getLinearForms(c);
+linearForms(c);
intvec v=1,1,1;
setLinearForms(c,v);
-getLinearForms(c);
+linearForms(c);
@c example
@end smallexample
@end table
@@ -1185,9 +1185,9 @@ intmat M[2][3]=
-1,0,0,
0,-1,0;
cone c=coneViaRays(M);
-getMultiplicity(c);
+multiplicity(c);
setMultiplicity(c,3);
-getMultiplicity(c);
+multiplicity(c);
@c example
@end smallexample
@end table
@@ -1289,9 +1289,9 @@ Access to cones of the fan is provided in three different ways:
@subsection fan related functions
@cindex fan related functions
-See also @ref{getAmbientDimension},
- at ref{getCodimension},
- at ref{getLinealityDimension},
+See also @ref{ambientDimension},
+ at ref{codimension},
+ at ref{linealityDimension},
@ref{isSimplicial}.
@menu
@@ -1723,14 +1723,14 @@ p;
@subsection polytope related functions
@cindex polytope related functions
-See also @ref{getAmbientDimension},
- at ref{getCodimension},
- at ref{getDimension},
- at ref{getEquations},
- at ref{getFacetNormals},
- at ref{getInequalities},
- at ref{getLinearForms},
- at ref{getMultiplicity},
+See also @ref{ambientDimension},
+ at ref{codimension},
+ at ref{dimension},
+ at ref{equations},
+ at ref{facets},
+ at ref{inequalities},
+ at ref{linearForms},
+ at ref{multiplicity},
@ref{setLinearForms},
@ref{setMultiplicity}.
--
an open source computer algebra system
More information about the debian-science-commits
mailing list