 |
My Project
debian-1:4.1.1-p2+ds-4build1
|
#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 "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) |
|
gfan::ZCone | newtonPolytope (poly p, ring r) |
|
BOOLEAN | newtonPolytope (leftv res, leftv args) |
|
BOOLEAN | scalePolytope (leftv res, leftv args) |
|
BOOLEAN | dualPolytope (leftv res, leftv args) |
|
BOOLEAN | mixedVolume (leftv res, leftv args) |
|
void | bbpolytope_setup (SModulFunctions *p) |
|
◆ bbpolytope_Assign()
Definition at line 37 of file bbpolytope.cc.
44 gfan::ZCone* zd = (gfan::ZCone*)
l->Data();
47 newZc =
new gfan::ZCone();
49 else if (r->
Typ()==
l->Typ())
53 gfan::ZCone* zd = (gfan::ZCone*)
l->Data();
56 gfan::ZCone* zc = (gfan::ZCone*)r->
Data();
57 newZc =
new gfan::ZCone(*zc);
76 Werror(
"assign Type(%d) = Type(%d) not implemented",
l->Typ(),r->
Typ());
86 l->data=(
void *)newZc;
◆ bbpolytope_Copy()
void* bbpolytope_Copy |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
Definition at line 110 of file bbpolytope.cc.
112 gfan::ZCone* zc = (gfan::ZCone*)d;
113 gfan::ZCone* newZc =
new gfan::ZCone(*zc);
◆ bbpolytope_destroy()
void bbpolytope_destroy |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
Definition at line 101 of file bbpolytope.cc.
105 gfan::ZCone* zc = (gfan::ZCone*) d;
◆ bbpolytope_Init()
void* bbpolytope_Init |
( |
blackbox * |
| ) |
|
Definition at line 32 of file bbpolytope.cc.
34 return (
void*)(
new gfan::ZCone());
◆ bbpolytope_setup()
◆ bbpolytope_String()
char* bbpolytope_String |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
Definition at line 91 of file bbpolytope.cc.
95 gfan::ZCone* zc = (gfan::ZCone*)d;
◆ bbpolytopeToString()
Definition at line 18 of file bbpolytope.cc.
21 gfan::ZMatrix
i=c.getInequalities();
22 gfan::ZMatrix e=c.getEquations();
23 s<<
"AMBIENT_DIM"<<std::endl;
24 s<<c.ambientDimension()-1<<std::endl;
25 s<<
"INEQUALITIES"<<std::endl;
27 s<<
"EQUATIONS"<<std::endl;
◆ dualPolytope()
Definition at line 472 of file bbpolytope.cc.
477 gfan::initializeCddlibIfRequired();
478 gfan::ZCone* zp = (gfan::ZCone*) u->
Data();
479 gfan::ZCone* zq =
new gfan::ZCone(zp->dualCone());
481 res->data = (
void*) zq;
482 gfan::deinitializeCddlibIfRequired();
485 WerrorS(
"dualPolytope: unexpected parameters");
◆ getAmbientDimension()
int getAmbientDimension |
( |
gfan::ZCone * |
zc | ) |
|
Definition at line 386 of file bbpolytope.cc.
388 return zc->ambientDimension()-1;
◆ getCodimension()
int getCodimension |
( |
gfan::ZCone * |
zc | ) |
|
◆ getDimension()
int getDimension |
( |
gfan::ZCone * |
zc | ) |
|
◆ intStar2ZVectorWithLeadingOne()
gfan::ZVector intStar2ZVectorWithLeadingOne |
( |
const int |
d, |
|
|
const int * |
i |
|
) |
| |
Definition at line 401 of file bbpolytope.cc.
403 gfan::ZVector zv(d+1);
405 for(
int j=1;
j<=d;
j++)
◆ mixedVolume()
Definition at line 489 of file bbpolytope.cc.
494 gfan::initializeCddlibIfRequired();
497 std::vector<gfan::IntMatrix> P(
k);
498 for (
int i=0;
i<
k;
i++)
502 gfan::ZCone*
p = (gfan::ZCone*)
l->m[
i].Data();
503 gfan::ZMatrix pv =
p->extremeRays();
504 int r = pv.getHeight();
505 int c = pv.getWidth();
506 gfan::IntMatrix pw(r,c-1);
507 for (
int n=0; n<r; n++)
508 for (
int m=1;
m<c;
m++)
509 pw[n][
m-1] = pv[n][
m].toInt();
510 P[
i]=pw.transposed();
513 poly
p = (poly)
l->m[
i].Data();
515 gfan::IntMatrix pw(0,
N);
516 int *leadexpv = (
int*)
omAlloc((
N+1)*
sizeof(int));
520 gfan::IntVector zv(
N);
521 for (
int i=0;
i<
N;
i++)
522 zv[
i] = leadexpv[
i+1];
526 P[
i]=pw.transposed();
531 WerrorS(
"mixedVolume: entries of unsupported type in list");
532 gfan::deinitializeCddlibIfRequired();
540 gfan::deinitializeCddlibIfRequired();
543 WerrorS(
"mixedVolume: unexpected parameters");
◆ newtonPolytope() [1/2]
Definition at line 429 of file bbpolytope.cc.
434 gfan::initializeCddlibIfRequired();
435 poly
p = (poly)u->
Data();
438 gfan::deinitializeCddlibIfRequired();
441 WerrorS(
"newtonPolytope: unexpected parameters");
◆ newtonPolytope() [2/2]
gfan::ZCone newtonPolytope |
( |
poly |
p, |
|
|
ring |
r |
|
) |
| |
Definition at line 412 of file bbpolytope.cc.
415 gfan::ZMatrix zm(0,
N+1);
416 int *leadexpv = (
int*)
omAlloc((
N+1)*
sizeof(int));
425 gfan::ZCone Delta = gfan::ZCone::givenByRays(zm,gfan::ZMatrix(0, zm.getWidth()));
◆ polytopeViaNormals()
Definition at line 330 of file bbpolytope.cc.
337 gfan::initializeCddlibIfRequired();
339 gfan::deinitializeCddlibIfRequired();
348 gfan::initializeCddlibIfRequired();
350 gfan::deinitializeCddlibIfRequired();
359 gfan::initializeCddlibIfRequired();
361 gfan::deinitializeCddlibIfRequired();
365 WerrorS(
"polytopeViaInequalities: unexpected parameters");
◆ polytopeViaVertices()
Definition at line 184 of file bbpolytope.cc.
191 gfan::initializeCddlibIfRequired();
193 gfan::deinitializeCddlibIfRequired();
201 gfan::initializeCddlibIfRequired();
203 gfan::deinitializeCddlibIfRequired();
208 WerrorS(
"polytopeViaPoints: unexpected parameters");
◆ ppCONENORMALS1()
Definition at line 212 of file bbpolytope.cc.
225 gfan::ZCone* zc =
new gfan::ZCone(*zm, gfan::ZMatrix(0, zm->getWidth()));
230 res->data = (
void*) zc;
◆ ppCONENORMALS2()
Definition at line 234 of file bbpolytope.cc.
259 Werror(
"expected same number of columns but got %d vs. %d",
265 gfan::ZCone* zc =
new gfan::ZCone(*zm1, *zm2);
274 res->data = (
void*) zc;
◆ ppCONENORMALS3()
Definition at line 278 of file bbpolytope.cc.
305 Werror(
"expected same number of columns but got %d vs. %d",
309 int k = (int)(
long)
w->Data();
310 if ((
k < 0) || (
k > 3))
312 WerrorS(
"expected int argument in [0..3]");
317 gfan::ZCone* zc =
new gfan::ZCone(*zm1, *zm2,
k);
326 res->data = (
void*) zc;
◆ ppCONERAYS1()
Definition at line 117 of file bbpolytope.cc.
133 gfan::ZCone* zc =
new gfan::ZCone();
134 *zc = gfan::ZCone::givenByRays(*zm, gfan::ZMatrix(0, zm->getWidth()));
136 res->data = (
void*) zc;
◆ ppCONERAYS3()
Definition at line 144 of file bbpolytope.cc.
163 int k = (int)(
long)
v->Data();
165 if ((
k < 0) || (
k > 1))
167 WerrorS(
"expected int argument in [0..1]");
172 gfan::ZCone* zc =
new gfan::ZCone();
173 *zc = gfan::ZCone::givenByRays(*zm,gfan::ZMatrix(0, zm->getWidth()));
176 res->data = (
void*) zc;
◆ scalePolytope()
Definition at line 445 of file bbpolytope.cc.
453 gfan::initializeCddlibIfRequired();
454 int s = (int)(
long) u->
Data();
455 gfan::ZCone* zp = (gfan::ZCone*)
v->Data();
456 gfan::ZMatrix zm = zp->extremeRays();
457 for (
int i=0;
i<zm.getHeight();
i++)
458 for (
int j=1;
j<zm.getWidth();
j++)
460 gfan::ZCone* zq =
new gfan::ZCone();
461 *zq = gfan::ZCone::givenByRays(zm,gfan::ZMatrix(0, zm.getWidth()));
463 res->data = (
void*) zq;
464 gfan::deinitializeCddlibIfRequired();
468 WerrorS(
"scalePolytope: unexpected parameters");
◆ vertices()
Definition at line 369 of file bbpolytope.cc.
374 gfan::initializeCddlibIfRequired();
375 gfan::ZCone* zc = (gfan::ZCone*)u->
Data();
376 gfan::ZMatrix zmat = zc->extremeRays();
379 gfan::deinitializeCddlibIfRequired();
382 WerrorS(
"vertices: unexpected parameters");
◆ polytopeID
std::string toString(const gfan::ZCone *const c)
BOOLEAN bbpolytope_Assign(leftv l, leftv r)
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
static BOOLEAN ppCONERAYS3(leftv res, leftv u, leftv v)
const CanonicalForm CFMap CFMap & N
void bbpolytope_destroy(blackbox *, void *d)
Class used for (list of) interpreter objects.
gfan::ZCone newtonPolytope(poly p, ring r)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static short rVar(const ring r)
#define rVar(r) (r->N)
BOOLEAN polytopeViaNormals(leftv res, leftv args)
#define omFreeSize(addr, size)
static BOOLEAN ppCONENORMALS1(leftv res, leftv v)
BOOLEAN vertices(leftv res, leftv args)
char * bbpolytope_String(blackbox *, void *d)
number integerToNumber(const gfan::Integer &I)
static BOOLEAN ppCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
void * bbpolytope_Copy(blackbox *, void *d)
BOOLEAN rays(leftv res, leftv args)
static void p_GetExpV(poly p, int *ev, const ring r)
std::string bbpolytopeToString(gfan::ZCone const &c)
BOOLEAN dualPolytope(leftv res, leftv args)
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
static BOOLEAN ppCONENORMALS2(leftv res, leftv u, leftv v)
BOOLEAN mixedVolume(leftv res, leftv args)
void Werror(const char *fmt,...)
void * bbpolytope_Init(blackbox *)
void WerrorS(const char *s)
gfan::ZVector intStar2ZVectorWithLeadingOne(const int d, const int *i)
BOOLEAN polytopeViaVertices(leftv res, leftv args)
const Variable & v
< [in] a sqrfree bivariate poly
const CanonicalForm int s
static BOOLEAN ppCONERAYS1(leftv res, leftv v)
bigintmat * iv2bim(intvec *b, const coeffs C)
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
BOOLEAN scalePolytope(leftv res, leftv args)