#include <kernel/mod2.h>
#include <Singular/ipid.h>
#include <Singular/ipshell.h>
#include <Singular/blackbox.h>
#include <misc/intvec.h>
#include <coeffs/bigintmat.h>
#include <callgfanlib_conversion.h>
#include <sstream>
#include <gfanlib/gfanlib.h>
#include <gfanlib/gfanlib_q.h>
Go to the source code of this file.
|
std::string | bbpolytopeToString (gfan::ZCone const &c) |
|
void * | bbpolytope_Init (blackbox *) |
|
BOOLEAN | bbpolytope_Assign (leftv l, leftv r) |
|
char * | bbpolytope_String (blackbox *, void *d) |
|
void | bbpolytope_destroy (blackbox *, void *d) |
|
void * | bbpolytope_Copy (blackbox *, void *d) |
|
static BOOLEAN | ppCONERAYS1 (leftv res, leftv v) |
|
static BOOLEAN | ppCONERAYS3 (leftv res, leftv u, leftv v) |
|
BOOLEAN | polytopeViaVertices (leftv res, leftv args) |
|
static BOOLEAN | ppCONENORMALS1 (leftv res, leftv v) |
|
static BOOLEAN | ppCONENORMALS2 (leftv res, leftv u, leftv v) |
|
static BOOLEAN | ppCONENORMALS3 (leftv res, leftv u, leftv v, leftv w) |
|
BOOLEAN | polytopeViaNormals (leftv res, leftv args) |
|
BOOLEAN | vertices (leftv res, leftv args) |
|
int | getAmbientDimension (gfan::ZCone *zc) |
|
int | getCodimension (gfan::ZCone *zc) |
|
int | getDimension (gfan::ZCone *zc) |
|
gfan::ZVector | intStar2ZVectorWithLeadingOne (const int d, const int *i) |
|
BOOLEAN | newtonPolytope (leftv res, leftv args) |
|
BOOLEAN | scalePolytope (leftv res, leftv args) |
|
BOOLEAN | dualPolytope (leftv res, leftv args) |
|
void | bbpolytope_setup (SModulFunctions *p) |
|
Definition at line 38 of file bbpolytope.cc.
45 gfan::ZCone* zd = (gfan::ZCone*)l->
Data();
48 newZc =
new gfan::ZCone();
50 else if (r->
Typ()==l->
Typ())
54 gfan::ZCone* zd = (gfan::ZCone*)l->
Data();
57 gfan::ZCone* zc = (gfan::ZCone*)r->
Data();
58 newZc =
new gfan::ZCone(*zc);
77 Werror(
"assign Type(%d) = Type(%d) not implemented",l->
Typ(),r->
Typ());
87 l->
data=(
void *)newZc;
void Werror(const char *fmt,...)
void* bbpolytope_Copy |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
Definition at line 111 of file bbpolytope.cc.
113 gfan::ZCone* zc = (gfan::ZCone*)d;
114 gfan::ZCone* newZc =
new gfan::ZCone(*zc);
void bbpolytope_destroy |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
Definition at line 102 of file bbpolytope.cc.
106 gfan::ZCone* zc = (gfan::ZCone*) d;
void* bbpolytope_Init |
( |
blackbox * |
| ) |
|
Definition at line 33 of file bbpolytope.cc.
35 return (
void*)(
new gfan::ZCone());
Definition at line 448 of file bbpolytope.cc.
450 blackbox *
b=(blackbox*)
omAlloc0(
sizeof(blackbox));
BOOLEAN dualPolytope(leftv res, leftv args)
BOOLEAN bbpolytope_Assign(leftv l, leftv r)
BOOLEAN scalePolytope(leftv res, leftv args)
void * bbpolytope_Init(blackbox *)
void bbpolytope_destroy(blackbox *, void *d)
BOOLEAN vertices(leftv res, leftv args)
BOOLEAN polytopeViaNormals(leftv res, leftv args)
BOOLEAN polytopeViaVertices(leftv res, leftv args)
BOOLEAN newtonPolytope(leftv res, leftv args)
char * bbpolytope_String(blackbox *, void *d)
int(* iiAddCproc)(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
void * bbpolytope_Copy(blackbox *, void *d)
char* bbpolytope_String |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
Definition at line 92 of file bbpolytope.cc.
96 gfan::ZCone* zc = (gfan::ZCone*)d;
const CanonicalForm int s
std::string bbpolytopeToString(gfan::ZCone const &c)
Definition at line 19 of file bbpolytope.cc.
22 gfan::ZMatrix
i=c.getInequalities();
23 gfan::ZMatrix e=c.getEquations();
24 s<<
"AMBIENT_DIM"<<std::endl;
25 s<<c.ambientDimension()-1<<std::endl;
26 s<<
"INEQUALITIES"<<std::endl;
28 s<<
"EQUATIONS"<<std::endl;
const CanonicalForm int s
std::string toString(const gfan::ZCone *const c)
Definition at line 433 of file bbpolytope.cc.
438 gfan::ZCone* zp = (gfan::ZCone*) u->
Data();
439 gfan::ZCone* zq =
new gfan::ZCone(zp->dualCone());
441 res->
data = (
void*) zq;
444 WerrorS(
"dualPolytope: unexpected parameters");
Class used for (list of) interpreter objects.
void WerrorS(const char *s)
int getAmbientDimension |
( |
gfan::ZCone * |
zc | ) |
|
Definition at line 355 of file bbpolytope.cc.
357 return zc->ambientDimension()-1;
int getCodimension |
( |
gfan::ZCone * |
zc | ) |
|
int getDimension |
( |
gfan::ZCone * |
zc | ) |
|
gfan::ZVector intStar2ZVectorWithLeadingOne |
( |
const int |
d, |
|
|
const int * |
i |
|
) |
| |
Definition at line 370 of file bbpolytope.cc.
372 gfan::ZVector zv(d+1);
374 for(
int j=1;
j<=d;
j++)
Definition at line 381 of file bbpolytope.cc.
388 gfan::ZMatrix zm(1,N+1);
389 int *leadexpv = (
int*)
omAlloc((N+1)*
sizeof(int));
398 gfan::ZCone* zc =
new gfan::ZCone();
399 *zc = gfan::ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
401 res->
data = (
void*) zc;
404 WerrorS(
"newtonPolytope: unexpected parameters");
Class used for (list of) interpreter objects.
#define omFreeSize(addr, size)
static short rVar(const ring r)
#define rVar(r) (r->N)
void WerrorS(const char *s)
gfan::ZVector intStar2ZVectorWithLeadingOne(const int d, const int *i)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
const CanonicalForm CFMap CFMap & N
#define pGetExpV(p, e)
Gets a copy of (resp. set) the exponent vector, where e is assumed to point to (r->N +1)*sizeof(long)...
Definition at line 319 of file bbpolytope.cc.
336 WerrorS(
"polytopeViaInequalities: unexpected parameters");
Class used for (list of) interpreter objects.
static BOOLEAN ppCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
void WerrorS(const char *s)
static BOOLEAN ppCONENORMALS2(leftv res, leftv u, leftv v)
const Variable & v
< [in] a sqrfree bivariate poly
static BOOLEAN ppCONENORMALS1(leftv res, leftv v)
Definition at line 185 of file bbpolytope.cc.
197 WerrorS(
"polytopeViaPoints: unexpected parameters");
Class used for (list of) interpreter objects.
static BOOLEAN ppCONERAYS1(leftv res, leftv v)
void WerrorS(const char *s)
const Variable & v
< [in] a sqrfree bivariate poly
static BOOLEAN ppCONERAYS3(leftv res, leftv u, leftv v)
Definition at line 201 of file bbpolytope.cc.
214 gfan::ZCone* zc =
new gfan::ZCone(*zm, gfan::ZMatrix(0, zm->getWidth()));
219 res->
data = (
void*) zc;
bigintmat * iv2bim(intvec *b, const coeffs C)
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
Definition at line 223 of file bbpolytope.cc.
248 Werror(
"expected same number of columns but got %d vs. %d",
254 gfan::ZCone* zc =
new gfan::ZCone(*zm1, *zm2);
263 res->
data = (
void*) zc;
bigintmat * iv2bim(intvec *b, const coeffs C)
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
void Werror(const char *fmt,...)
Definition at line 267 of file bbpolytope.cc.
294 Werror(
"expected same number of columns but got %d vs. %d",
298 int k = (int)(
long)w->
Data();
299 if ((k < 0) || (k > 3))
301 WerrorS(
"expected int argument in [0..3]");
306 gfan::ZCone* zc =
new gfan::ZCone(*zm1, *zm2, k);
315 res->
data = (
void*) zc;
bigintmat * iv2bim(intvec *b, const coeffs C)
void WerrorS(const char *s)
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
void Werror(const char *fmt,...)
Definition at line 118 of file bbpolytope.cc.
134 gfan::ZCone* zc =
new gfan::ZCone();
135 *zc = gfan::ZCone::givenByRays(*zm, gfan::ZMatrix(0, zm->getWidth()));
137 res->
data = (
void*) zc;
bigintmat * iv2bim(intvec *b, const coeffs C)
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
BOOLEAN rays(leftv res, leftv args)
Definition at line 145 of file bbpolytope.cc.
164 int k = (int)(
long)v->
Data();
166 if ((k < 0) || (k > 1))
168 WerrorS(
"expected int argument in [0..1]");
173 gfan::ZCone* zc =
new gfan::ZCone();
174 *zc = gfan::ZCone::givenByRays(*zm,gfan::ZMatrix(0, zm->getWidth()));
177 res->
data = (
void*) zc;
bigintmat * iv2bim(intvec *b, const coeffs C)
void WerrorS(const char *s)
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
BOOLEAN rays(leftv res, leftv args)
Definition at line 408 of file bbpolytope.cc.
416 int s = (int)(
long) u->
Data();
417 gfan::ZCone* zp = (gfan::ZCone*) v->
Data();
418 gfan::ZMatrix zm = zp->extremeRays();
419 for (
int i=0;
i<zm.getHeight();
i++)
420 for (
int j=1;
j<zm.getWidth();
j++)
422 gfan::ZCone* zq =
new gfan::ZCone();
423 *zq = gfan::ZCone::givenByRays(zm,gfan::ZMatrix(0, zm.getWidth()));
425 res->
data = (
void*) zq;
429 WerrorS(
"scalePolytope: unexpected parameters");
const CanonicalForm int s
Class used for (list of) interpreter objects.
void WerrorS(const char *s)
const Variable & v
< [in] a sqrfree bivariate poly
Definition at line 340 of file bbpolytope.cc.
345 gfan::ZCone* zc = (gfan::ZCone*)u->
Data();
346 gfan::ZMatrix zmat = zc->extremeRays();
351 WerrorS(
"vertices: unexpected parameters");
Class used for (list of) interpreter objects.
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
void WerrorS(const char *s)