13#include "gfanlib/gfanlib.h"
14#include "gfanlib/gfanlib_q.h"
23 s<<
"AMBIENT_DIM"<<std::endl;
24 s<<c.ambientDimension()-1<<std::endl;
25 s<<
"INEQUALITIES"<<std::endl;
27 s<<
"EQUATIONS"<<std::endl;
49 else if (r->
Typ()==
l->Typ())
76 Werror(
"assign Type(%d) = Type(%d) not implemented",
l->Typ(),r->
Typ());
136 res->data = (
void*)
zc;
163 int k = (
int)(
long)
v->Data();
165 if ((
k < 0) || (
k > 1))
167 WerrorS(
"expected int argument in [0..1]");
176 res->data = (
void*)
zc;
208 WerrorS(
"polytopeViaPoints: unexpected parameters");
230 res->data = (
void*)
zc;
257 if (
ineq->cols() !=
eq->cols())
259 Werror(
"expected same number of columns but got %d vs. %d",
260 ineq->cols(),
eq->cols());
274 res->data = (
void*)
zc;
303 if (
ineq->cols() !=
eq->cols())
305 Werror(
"expected same number of columns but got %d vs. %d",
306 ineq->cols(),
eq->cols());
309 int k = (
int)(
long)
w->Data();
310 if ((
k < 0) || (
k > 3))
312 WerrorS(
"expected int argument in [0..3]");
326 res->data = (
void*)
zc;
365 WerrorS(
"polytopeViaInequalities: unexpected parameters");
382 WerrorS(
"vertices: unexpected parameters");
388 return zc->ambientDimension()-1;
393 return zc->codimension();
398 return zc->dimension()-1;
405 for(
int j=1;
j<=d;
j++)
435 poly
p = (poly)u->
Data();
441 WerrorS(
"newtonPolytope: unexpected parameters");
457 for (
int i=0;
i<
zm.getHeight();
i++)
458 for (
int j=1;
j<
zm.getWidth();
j++)
463 res->data = (
void*)
zq;
468 WerrorS(
"scalePolytope: unexpected parameters");
481 res->data = (
void*)
zq;
485 WerrorS(
"dualPolytope: unexpected parameters");
497 std::vector<gfan::IntMatrix> P(
k);
498 for (
int i=0;
i<
k;
i++)
504 int r =
pv.getHeight();
505 int c =
pv.getWidth();
507 for (
int n=0; n<r; n++)
508 for (
int m=1;
m<c;
m++)
510 P[
i]=
pw.transposed();
513 poly
p = (poly)
l->m[
i].Data();
521 for (
int i=0;
i<
N;
i++)
526 P[
i]=
pw.transposed();
531 WerrorS(
"mixedVolume: entries of unsupported type in list");
543 WerrorS(
"mixedVolume: unexpected parameters");
BOOLEAN rays(leftv res, leftv args)
std::string toString(const gfan::ZCone *const c)
static BOOLEAN ppCONERAYS1(leftv res, leftv v)
BOOLEAN polytopeViaVertices(leftv res, leftv args)
void bbpolytope_setup(SModulFunctions *p)
void bbpolytope_destroy(blackbox *, void *d)
std::string bbpolytopeToString(gfan::ZCone const &c)
static BOOLEAN ppCONENORMALS2(leftv res, leftv u, leftv v)
int getCodimension(gfan::ZCone *zc)
char * bbpolytope_String(blackbox *, void *d)
BOOLEAN polytopeViaNormals(leftv res, leftv args)
BOOLEAN dualPolytope(leftv res, leftv args)
gfan::ZVector intStar2ZVectorWithLeadingOne(const int d, const int *i)
BOOLEAN scalePolytope(leftv res, leftv args)
static BOOLEAN ppCONENORMALS1(leftv res, leftv v)
int getDimension(gfan::ZCone *zc)
void * bbpolytope_Init(blackbox *)
static BOOLEAN ppCONERAYS3(leftv res, leftv u, leftv v)
int getAmbientDimension(gfan::ZCone *zc)
BOOLEAN bbpolytope_Assign(leftv l, leftv r)
BOOLEAN mixedVolume(leftv res, leftv args)
static BOOLEAN ppCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
gfan::ZCone newtonPolytope(poly p, ring r)
BOOLEAN vertices(leftv res, leftv args)
void * bbpolytope_Copy(blackbox *, void *d)
bigintmat * iv2bim(intvec *b, const coeffs C)
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
number integerToNumber(const gfan::Integer &I)
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
const CanonicalForm CFMap CFMap & N
Class used for (list of) interpreter objects.
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
void WerrorS(const char *s)
#define omFreeSize(addr, size)
static void p_GetExpV(poly p, int *ev, const ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
void Werror(const char *fmt,...)
static short rVar(const ring r)
#define rVar(r) (r->N)