#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.
38{
41 {
43 {
46 }
48 }
49 else if (r->
Typ()==
l->Typ())
50 {
52 {
55 }
58 }
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74 else
75 {
76 Werror(
"assign Type(%d) = Type(%d) not implemented",
l->Typ(),r->
Typ());
78 }
79
81 {
83 }
84 else
85 {
87 }
89}
void Werror(const char *fmt,...)
◆ bbpolytope_Copy()
◆ bbpolytope_destroy()
◆ bbpolytope_Init()
◆ bbpolytope_setup()
Definition at line 549 of file bbpolytope.cc.
550{
552
553
554
557
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
585
586}
BOOLEAN polytopeViaVertices(leftv res, leftv args)
void bbpolytope_destroy(blackbox *, void *d)
char * bbpolytope_String(blackbox *, void *d)
BOOLEAN polytopeViaNormals(leftv res, leftv args)
BOOLEAN dualPolytope(leftv res, leftv args)
BOOLEAN scalePolytope(leftv res, leftv args)
void * bbpolytope_Init(blackbox *)
BOOLEAN bbpolytope_Assign(leftv l, leftv r)
BOOLEAN mixedVolume(leftv res, leftv args)
gfan::ZCone newtonPolytope(poly p, ring r)
BOOLEAN vertices(leftv res, leftv args)
void * bbpolytope_Copy(blackbox *, void *d)
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
◆ bbpolytope_String()
Definition at line 91 of file bbpolytope.cc.
93 else
94 {
98 }
99}
std::string bbpolytopeToString(gfan::ZCone const &c)
const CanonicalForm int s
◆ bbpolytopeToString()
Definition at line 18 of file bbpolytope.cc.
19{
23 s<<
"AMBIENT_DIM"<<std::endl;
24 s<<c.ambientDimension()-1<<std::endl;
25 s<<
"INEQUALITIES"<<std::endl;
27 s<<
"EQUATIONS"<<std::endl;
30}
std::string toString(const gfan::ZCone *const c)
◆ dualPolytope()
Definition at line 472 of file bbpolytope.cc.
473{
476 {
481 res->data = (
void*)
zq;
484 }
485 WerrorS(
"dualPolytope: unexpected parameters");
487}
Class used for (list of) interpreter objects.
void WerrorS(const char *s)
◆ getAmbientDimension()
Definition at line 386 of file bbpolytope.cc.
387{
388 return zc->ambientDimension()-1;
389}
◆ getCodimension()
◆ getDimension()
◆ intStar2ZVectorWithLeadingOne()
Definition at line 401 of file bbpolytope.cc.
402{
405 for(
int j=1;
j<=d;
j++)
406 {
408 }
410}
◆ mixedVolume()
Definition at line 489 of file bbpolytope.cc.
490{
493 {
497 std::vector<gfan::IntMatrix> P(
k);
498 for (
int i=0;
i<
k;
i++)
499 {
501 {
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();
512 {
513 poly
p = (poly)
l->m[
i].Data();
518 {
521 for (
int i=0;
i<
N;
i++)
525 }
526 P[
i]=
pw.transposed();
528 }
529 else
530 {
531 WerrorS(
"mixedVolume: entries of unsupported type in list");
534 }
535 }
537
542 }
543 WerrorS(
"mixedVolume: unexpected parameters");
545}
number integerToNumber(const gfan::Integer &I)
const CanonicalForm CFMap CFMap & N
#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 ...
static short rVar(const ring r)
#define rVar(r) (r->N)
◆ newtonPolytope() [1/2]
Definition at line 429 of file bbpolytope.cc.
430{
433 {
435 poly
p = (poly)u->
Data();
440 }
441 WerrorS(
"newtonPolytope: unexpected parameters");
443}
◆ newtonPolytope() [2/2]
Definition at line 412 of file bbpolytope.cc.
413{
418 {
423 }
427}
gfan::ZVector intStar2ZVectorWithLeadingOne(const int d, const int *i)
◆ polytopeViaNormals()
Definition at line 330 of file bbpolytope.cc.
331{
334 {
336 {
341 }
342 }
345 {
347 {
352 }
353 }
356 {
358 {
363 }
364 }
365 WerrorS(
"polytopeViaInequalities: unexpected parameters");
367}
static BOOLEAN ppCONENORMALS2(leftv res, leftv u, leftv v)
static BOOLEAN ppCONENORMALS1(leftv res, leftv v)
static BOOLEAN ppCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
const Variable & v
< [in] a sqrfree bivariate poly
◆ polytopeViaVertices()
Definition at line 184 of file bbpolytope.cc.
185{
188 {
190 {
195 }
198 {
200 {
205 }
206 }
207 }
208 WerrorS(
"polytopeViaPoints: unexpected parameters");
210}
static BOOLEAN ppCONERAYS1(leftv res, leftv v)
static BOOLEAN ppCONERAYS3(leftv res, leftv u, leftv v)
◆ ppCONENORMALS1()
Definition at line 212 of file bbpolytope.cc.
213{
214
215
218 {
221 }
222 else
230 res->data = (
void*)
zc;
232}
bigintmat * iv2bim(intvec *b, const coeffs C)
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
◆ ppCONENORMALS2()
Definition at line 234 of file bbpolytope.cc.
235{
236
237
238
239
240
243 {
246 }
247 else
250 {
253 }
254 else
256
257 if (
ineq->cols() !=
eq->cols())
258 {
259 Werror(
"expected same number of columns but got %d vs. %d",
260 ineq->cols(),
eq->cols());
262 }
272
274 res->data = (
void*)
zc;
276}
◆ ppCONENORMALS3()
Definition at line 278 of file bbpolytope.cc.
279{
280
281
282
283
284
285
286
289 {
292 }
293 else
296 {
299 }
300 else
302
303 if (
ineq->cols() !=
eq->cols())
304 {
305 Werror(
"expected same number of columns but got %d vs. %d",
306 ineq->cols(),
eq->cols());
308 }
309 int k = (
int)(
long)
w->Data();
310 if ((
k < 0) || (
k > 3))
311 {
312 WerrorS(
"expected int argument in [0..3]");
314 }
324
326 res->data = (
void*)
zc;
328}
◆ ppCONERAYS1()
Definition at line 117 of file bbpolytope.cc.
118{
119
120
121
122
125 {
128 }
129 else
131
136 res->data = (
void*)
zc;
137
142}
BOOLEAN rays(leftv res, leftv args)
◆ ppCONERAYS3()
Definition at line 144 of file bbpolytope.cc.
145{
146
147
148
149
150
151
152
153
154
157 {
160 }
161 else
163 int k = (
int)(
long)
v->Data();
164
165 if ((
k < 0) || (
k > 1))
166 {
167 WerrorS(
"expected int argument in [0..1]");
169 }
174
176 res->data = (
void*)
zc;
177
182}
◆ scalePolytope()
Definition at line 445 of file bbpolytope.cc.
446{
449 {
452 {
457 for (
int i=0;
i<
zm.getHeight();
i++)
458 for (
int j=1;
j<
zm.getWidth();
j++)
463 res->data = (
void*)
zq;
466 }
467 }
468 WerrorS(
"scalePolytope: unexpected parameters");
470}
◆ vertices()
Definition at line 369 of file bbpolytope.cc.
370{
373 {
381 }
382 WerrorS(
"vertices: unexpected parameters");
384}
bigintmat * zMatrixToBigintmat(const gfan::ZMatrix &zm)
◆ polytopeID