CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
/***************************************************************************
2
**
3
** polymake_main.cpp Sebastian Gutsche A file to provide Polymake
4
** to GAP.
5
**
6
*/
7
8
#include "loadgap.h"
9
10
# define MORE_TESTS 1
11
12
13
// This is the include of the polymake headers,
14
// make shure that you have installed polymake properly
15
16
#include <polymake/Main.h>
17
#include <polymake/Matrix.h>
18
#include <polymake/Rational.h>
19
20
#include <iostream>
21
#include <map>
22
#include <utility>
23
24
#include "polymake_fktn.h"
25
#include "polymake_polytopes.h"
26
#include "polymake_cone.h"
27
#include "polymake_fan.h"
28
#include "polymake_tropical.h"
29
30
using std::cerr;
31
using std::endl;
32
using std::string;
33
using std::map;
34
using std::pair;
35
36
37
static Polymake_Data akt_data;
38
39
Obj TheTypeExternalPolymakeCone;
40
Obj TheTypeExternalPolymakeFan;
41
Obj TheTypeExternalPolymakePolytope;
42
Obj TheTypeExternalPolymakeTropicalHypersurface;
43
Obj TheTypeExternalPolymakeTropicalPolytope;
44
45
Obj FuncPOLYMAKE_CREATE_CONE_BY_RAYS( Obj self, Obj rays ) {
46
47
polymake_start( &akt_data );
48
return REAL_CREATE_CONE_BY_RAYS( &akt_data,rays);
49
50
}
51
52
Obj FuncPOLYMAKE_CREATE_CONE_BY_RAYS_UNSAVE( Obj self, Obj rays ) {
53
54
polymake_start( &akt_data );
55
return REAL_CREATE_CONE_BY_RAYS_UNSAVE( &akt_data,rays);
56
57
}
58
59
60
Obj FuncPOLYMAKE_CREATE_CONE_BY_INEQUALITIES( Obj self, Obj rays ) {
61
62
polymake_start( &akt_data );
63
return REAL_CREATE_CONE_BY_INEQUALITIES( &akt_data,rays);
64
65
}
66
67
68
69
Obj FuncPOLYMAKE_CREATE_DUAL_CONE_OF_CONE( Obj self, Obj cone ) {
70
71
return REAL_CREATE_DUAL_CONE_OF_CONE( &akt_data, cone );
72
73
}
74
75
76
Obj FuncPOLYMAKE_IS_NONEMPTY_POLYTOPE( Obj self, Obj cone ){
77
78
//return REAL_IS_SIMPLICIAL_OBJECT( &akt_data, cone );
79
return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "FEASIBLE" );
80
81
}
82
83
84
Obj FuncPOLYMAKE_IS_SIMPLICIAL_OBJECT( Obj self, Obj cone ){
85
86
//return REAL_IS_SIMPLICIAL_OBJECT( &akt_data, cone );
87
return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "SIMPLICIAL" );
88
89
}
90
91
92
Obj FuncPOLYMAKE_IS_SIMPLE_OBJECT( Obj self, Obj cone ){
93
94
//return REAL_IS_SIMPLICIAL_OBJECT( &akt_data, cone );
95
return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "SIMPLE" );
96
97
}
98
99
100
Obj FuncPOLYMAKE_IS_SIMPLICIAL_CONE( Obj self, Obj cone ){
101
102
//return REAL_IS_SIMPLICIAL_OBJECT( &akt_data, cone );
103
return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "SIMPLICIAL_CONE" );
104
105
}
106
107
108
109
Obj FuncPOLYMAKE_IS_LATTICE_OBJECT( Obj self, Obj cone ) {
110
111
//return REAL_IS_LATTICE_OBJECT( &akt_data, cone );
112
return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "LATTICE" );
113
114
}
115
116
117
Obj FuncPOLYMAKE_IS_NORMAL_OBJECT( Obj self, Obj cone ) {
118
119
//return REAL_IS_NORMAL_OBJECT( &akt_data, cone );
120
return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "NORMAL" );
121
122
}
123
124
125
Obj FuncPOLYMAKE_IS_VERYAMPLE_OBJECT( Obj self, Obj cone ) {
126
127
//return REAL_IS_VERYAMPLE_OBJECT( &akt_data, cone );
128
return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "VERY_AMPLE" );
129
130
}
131
132
133
Obj FuncPOLYMAKE_IS_SMOOTH_OBJECT( Obj self, Obj cone ) {
134
135
//return REAL_IS_SMOOTH_OBJECT( &akt_data, cone );
136
return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "SMOOTH" );
137
138
}
139
140
141
142
Obj FuncPOLYMAKE_IS_STRICTLY_CONVEX_CONE( Obj self, Obj cone){
143
144
//return REAL_IS_STRICTLY_CONVEX_CONE( &akt_data, cone );
145
return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "POINTED" );
146
147
}
148
149
150
Obj FuncPOLYMAKE_IS_SMOOTH_CONE( Obj self, Obj cone){
151
152
return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "SMOOTH_CONE" );
153
154
}
155
156
Obj FuncPOLYMAKE_GENERATING_RAYS_OF_CONE( Obj self, Obj cone){
157
158
return REAL_GENERATING_RAYS_OF_CONE( &akt_data, cone );
159
160
}
161
162
Obj FuncPOLYMAKE_CREATE_POLYTOPE_BY_POINTS( Obj self, Obj polytope ){
163
164
polymake_start( &akt_data );
165
return REAL_CREATE_POLYTOPE_BY_POINTS( &akt_data, polytope );
166
167
}
168
169
Obj FuncPOLYMAKE_VERTICES_OF_POLYTOPE( Obj self, Obj polytope){
170
171
return REAL_VERTICES_OF_POLYTOPE( &akt_data, polytope);
172
173
}
174
175
Obj FuncPOLYMAKE_CREATE_POLYTOPE_BY_INEQUALITIES( Obj self, Obj polytope ){
176
177
polymake_start( &akt_data );
178
return REAL_CREATE_POLYTOPE_BY_INEQUALITIES( &akt_data, polytope );
179
180
}
181
182
Obj FuncPOLYMAKE_AMBIENT_DIM_OF_CONE( Obj self, Obj cone ){
183
184
return REAL_OBJECT_HAS_INT_PROPERTY( &akt_data, cone, "CONE_AMBIENT_DIM" );
185
186
}
187
188
Obj FuncPOLYMAKE_DIM_OF_CONE( Obj self, Obj cone ){
189
190
return REAL_OBJECT_HAS_INT_PROPERTY( &akt_data, cone, "CONE_DIM" );
191
192
}
193
194
Obj FuncPOLYMAKE_AMBIENT_DIM_OF_FAN( Obj self, Obj fan ){
195
196
return REAL_OBJECT_HAS_INT_PROPERTY( &akt_data, fan, "FAN_AMBIENT_DIM" );
197
198
}
199
200
Obj FuncPOLYMAKE_DIM_OF_FAN( Obj self, Obj fan ){
201
202
return REAL_OBJECT_HAS_INT_PROPERTY( &akt_data, fan, "FAN_DIM" );
203
204
}
205
206
Obj FuncPOLYMAKE_HILBERT_BASIS_OF_CONE( Obj self, Obj cone ){
207
208
return REAL_HILBERT_BASIS_OF_CONE( &akt_data, cone );
209
210
}
211
212
Obj FuncPOLYMAKE_RAYS_IN_FACETS( Obj self, Obj cone ){
213
214
return REAL_RAYS_IN_FACETS( &akt_data, cone );
215
216
}
217
218
Obj FuncPOLYMAKE_LATTICE_POINTS_OF_POLYTOPE( Obj self, Obj polytope ){
219
220
return REAL_LATTICE_POINTS_OF_POLYTOPE( &akt_data, polytope );
221
222
}
223
224
Obj FuncPOLYMAKE_FAN_BY_CONES( Obj self, Obj cones ){
225
226
polymake_start( &akt_data );
227
return REAL_FAN_BY_CONES( &akt_data, cones );
228
229
}
230
231
Obj FuncPOLYMAKE_FAN_BY_RAYS_AND_CONES( Obj self, Obj rays, Obj cones ){
232
233
polymake_start( &akt_data );
234
return REAL_FAN_BY_RAYS_AND_CONES( &akt_data, rays, cones );
235
236
}
237
238
Obj FuncPOLYMAKE_FAN_BY_RAYS_AND_CONES_UNSAVE( Obj self, Obj rays, Obj cones ){
239
240
polymake_start( &akt_data );
241
return REAL_FAN_BY_RAYS_AND_CONES_UNSAVE( &akt_data, rays, cones );
242
243
}
244
245
Obj FuncPOLYMAKE_RAYS_IN_MAXCONES_OF_FAN( Obj self, Obj fan){
246
247
return REAL_RAYS_IN_MAXCONES_OF_FAN( &akt_data, fan );
248
249
}
250
251
Obj FuncPOLYMAKE_RAYS_OF_FAN( Obj self, Obj fan){
252
253
return REAL_RAYS_OF_FAN( &akt_data, fan );
254
255
}
256
257
Obj FuncPOLYMAKE_IS_POINTED_FAN( Obj self, Obj fan){
258
259
return REAL_OBJECT_HAS_PROPERTY( &akt_data, fan, "POINTED" );
260
261
}
262
263
Obj FuncPOLYMAKE_IS_SMOOTH_FAN( Obj self, Obj fan ){
264
265
return REAL_OBJECT_HAS_PROPERTY( &akt_data, fan, "SMOOTH_FAN" );
266
267
}
268
269
Obj FuncPOLYMAKE_IS_COMPLETE_FAN( Obj self, Obj fan ){
270
271
return REAL_OBJECT_HAS_PROPERTY( &akt_data, fan, "COMPLETE" );
272
273
}
274
275
Obj FuncPOLYMAKE_OBJECT_HAS_PROPERTY( Obj self, Obj conv, Obj prop){
276
277
if( ! IS_STRING( prop ) )
278
ErrorMayQuit(" given property is not a string", 0 ,0 );
279
280
return REAL_OBJECT_HAS_PROPERTY( &akt_data, conv, CSTR_STRING( prop ) );
281
282
}
283
284
Obj FuncPOLYMAKE_OBJECT_HAS_INT_PROPERTY( Obj self, Obj conv, Obj prop){
285
286
if( ! IS_STRING( prop ) )
287
ErrorMayQuit(" given property is not a string", 0 ,0 );
288
289
return REAL_OBJECT_HAS_INT_PROPERTY( &akt_data, conv, CSTR_STRING( prop ) );
290
291
}
292
293
Obj FuncPOLYMAKE_IS_REGULAR_OBJECT( Obj self, Obj fan ){
294
295
return REAL_OBJECT_HAS_PROPERTY( &akt_data, fan, "REGULAR" );
296
297
}
298
299
Obj FuncPOLYMAKE_NORMALFAN_OF_POLYTOPE( Obj self, Obj polytope ){
300
301
polymake_start( &akt_data );
302
return REAL_NORMALFAN_OF_POLYTOPE( &akt_data, polytope );
303
304
}
305
306
Obj FuncPOLYMAKE_IS_FULL_DIMENSIONAL_OBJECT( Obj self, Obj cone ){
307
308
return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "FULL_DIM" );
309
310
}
311
312
Obj FuncPOLYMAKE_IS_BOUNDED_POLYTOPE( Obj self, Obj polytope ){
313
314
return REAL_OBJECT_HAS_PROPERTY( &akt_data, polytope, "BOUNDED" );
315
316
}
317
318
Obj FuncPOLYMAKE_DRAW( Obj self, Obj cone ){
319
320
polymake_start( &akt_data );
321
return REAL_POLYMAKE_DRAW( &akt_data, cone );
322
323
}
324
325
Obj FuncPOLYMAKE_SKETCH( Obj self, Obj cone ){
326
327
polymake_start( &akt_data );
328
return REAL_POLYMAKE_SKETCH( &akt_data, cone );
329
330
}
331
332
Obj FuncPOLYMAKE_SKETCH_WITH_OPTIONS_KERNEL( Obj self, Obj cone, Obj filename, Obj options ){
333
334
polymake_start( &akt_data );
335
return REAL_POLYMAKE_SKETCH_WITH_OPTIONS( &akt_data, cone, filename, options );
336
337
}
338
339
Obj FuncPOLYMAKE_DEFINING_INEQUALITIES_OF_CONE( Obj self, Obj cone ){
340
341
return REAL_DEFINING_INEQUALITIES_OF_CONE( &akt_data, cone );
342
343
}
344
345
Obj FuncPOLYMAKE_FACET_INEQUALITIES_OF_POLYTOPE( Obj self, Obj poly ){
346
347
return REAL_FACET_INEQUALITIES_OF_POLYTOPE( &akt_data, poly );
348
349
}
350
351
Obj FuncPOLYMAKE_EQUALITIES_OF_POLYTOPE( Obj self, Obj poly ){
352
353
return REAL_EQUALITIES_OF_POLYTOPE( &akt_data, poly );
354
355
}
356
357
Obj FuncPOLYMAKE_INTERIOR_LATTICE_POINTS( Obj self, Obj poly ){
358
359
return REAL_INTERIOR_LATTICE_POINTS( &akt_data, poly );
360
361
}
362
363
Obj FuncPOLYMAKE_CREATE_POLYTOPE_BY_HOMOGENEOUS_POINTS( Obj self, Obj points ){
364
365
polymake_start( &akt_data );
366
return REAL_CREATE_POLYTOPE_BY_HOMOGENEOUS_POINTS( &akt_data, points );
367
368
}
369
370
Obj FuncPOLYMAKE_HOMOGENEOUS_POINTS_OF_POLYTOPE( Obj self, Obj polytope ){
371
372
return REAL_HOMOGENEOUS_POINTS_OF_POLYTOPE( &akt_data, polytope );
373
374
}
375
376
Obj FuncPOLYMAKE_TAIL_CONE_OF_POLYTOPE( Obj self, Obj polytope ){
377
378
polymake_start( &akt_data );
379
return REAL_TAIL_CONE_OF_POLYTOPE( &akt_data, polytope );
380
381
}
382
383
Obj FuncPOLYMAKE_LINEALITY_SPACE_OF_CONE( Obj self, Obj cone ){
384
385
return REAL_LINEALITY_SPACE_OF_CONE( &akt_data, cone );
386
387
}
388
389
Obj FuncPOLYMAKE_MINKOWSKI_SUM( Obj self, Obj polytope1, Obj polytope2 ){
390
391
return REAL_MINKOWSKI_SUM( &akt_data, polytope1, polytope2 );
392
393
}
394
395
Obj FuncPOLYMAKE_INTERSECTION_OF_CONES( Obj self, Obj cone1, Obj cone2 ){
396
397
return REAL_INTERSECTION_OF_CONES( &akt_data, cone1, cone2 );
398
399
}
400
401
Obj FuncPOLYMAKE_INTERSECTION_OF_POLYTOPES( Obj self, Obj cone1, Obj cone2 ){
402
403
return REAL_INTERSECTION_OF_POLYTOPES( &akt_data, cone1, cone2 );
404
405
}
406
407
Obj FuncPOLYMAKE_CREATE_CONE_BY_EQUALITIES_AND_INEQUALITIES( Obj self, Obj equalities, Obj inequalities ){
408
409
polymake_start( &akt_data );
410
return REAL_CREATE_CONE_BY_EQUALITIES_AND_INEQUALITIES( &akt_data, equalities, inequalities );
411
412
}
413
414
Obj FuncPOLYMAKE_EQUALITIES_OF_CONE( Obj self, Obj cone ){
415
416
return REAL_EQUALITIES_OF_CONE( &akt_data, cone );
417
418
}
419
420
Obj FuncPOLYMAKE_STELLAR_SUBDIVISION( Obj self, Obj ray, Obj fan){
421
422
return REAL_STELLAR_SUBDIVISION( &akt_data, ray, fan );
423
424
}
425
426
Obj FuncPOLYMAKE_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS( Obj self, Obj mon, Obj coeff){
427
428
polymake_start( &akt_data );
429
return REAL_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS( &akt_data, mon, coeff );
430
431
}
432
433
Obj FuncPOLYMAKE_MONOMIALS_OF_HYPERSURFACE( Obj self, Obj surf ){
434
435
polymake_start( &akt_data );
436
return REAL_MONOMIALS_OF_HYPERSURFACE( &akt_data, surf );
437
438
}
439
440
Obj FuncPOLYMAKE_LATTICE_POINTS_GENERATORS( Obj self, Obj polytope ){
441
442
polymake_start( &akt_data );
443
return REAL_LATTICE_POINTS_GENERATORS( &akt_data, polytope );
444
445
}
446
447
Obj FuncPOLYMAKE_TROPICAL_POLYTOPE_BY_POINTS( Obj self, Obj points ){
448
449
polymake_start( &akt_data );
450
return REAL_TROPICAL_POLYTOPE_BY_POINTS( &akt_data, points );
451
452
}
453
454
Obj FuncPOLYMAKE_SET_PROPERTY_TRUE( Obj self, Obj conv, Obj prop){
455
456
if( ! IS_STRING( prop ) )
457
ErrorMayQuit(" given property is not a string", 0 ,0 );
458
459
REAL_SET_PROPERTY_TRUE( &akt_data, conv, CSTR_STRING( prop ) );
460
return INTOBJ_INT( 0 );
461
462
}
463
464
Obj FuncPOLYMAKE_RESET_WORKSPACE( Obj self ){
465
466
delete akt_data.main_polymake_session;
467
akt_data.main_polymake_session = new polymake::Main;
468
akt_data.main_polymake_scope = new polymake::perl::Scope(akt_data.main_polymake_session->newScope());
469
470
return True;
471
472
}
473
474
Obj FuncPOLYMAKE_F_VECTOR_OF_FAN( Obj self, Obj fan ){
475
476
return REAL_F_VECTOR( &akt_data, fan );
477
478
}
479
480
Obj FuncPOLYMAKE_PROPERTIES( Obj self, Obj cone ){
481
482
return REAL_POLYMAKE_PROPERTIES( &akt_data, cone );
483
484
}
485
486
/******************************************************************************
487
*V GVarFuncs . . . . . . . . . . . . . . . . . . list of functions to export
488
*/
489
static StructGVarFunc GVarFuncs [] = {
490
491
{ "POLYMAKE_CREATE_CONE_BY_RAYS", 1, "rays",
492
(Obj(*)())FuncPOLYMAKE_CREATE_CONE_BY_RAYS,
493
"polymake_main.cpp:POLYMAKE_CREATE_CONE_BY_RAYS" },
494
495
{ "POLYMAKE_CREATE_CONE_BY_RAYS_UNSAVE", 1, "rays",
496
(Obj(*)())FuncPOLYMAKE_CREATE_CONE_BY_RAYS_UNSAVE,
497
"polymake_main.cpp:POLYMAKE_CREATE_CONE_BY_RAYS_UNSAVE" },
498
499
{ "POLYMAKE_CREATE_CONE_BY_INEQUALITIES", 1, "rays",
500
(Obj(*)())FuncPOLYMAKE_CREATE_CONE_BY_INEQUALITIES,
501
"polymake_main.cpp:POLYMAKE_CREATE_CONE_BY_INEQUALITIES" },
502
503
{ "POLYMAKE_CREATE_DUAL_CONE_OF_CONE", 1, "cone",
504
(Obj(*)())FuncPOLYMAKE_CREATE_DUAL_CONE_OF_CONE,
505
"polymake_main.cpp:POLYMAKE_CREATE_DUAL_CONE_OF_CONE" },
506
507
{ "POLYMAKE_IS_NONEMPTY_POLYTOPE", 1, "cone",
508
(Obj(*)())FuncPOLYMAKE_IS_NONEMPTY_POLYTOPE,
509
"polymake_main.cpp:POLYMAKE_IS_NONEMPTY_POLYTOPE" },
510
511
{ "POLYMAKE_IS_SIMPLICIAL_OBJECT", 1, "cone",
512
(Obj(*)())FuncPOLYMAKE_IS_SIMPLICIAL_OBJECT,
513
"polymake_main.cpp:POLYMAKE_IS_SIMPLICIAL_OBJECT" },
514
515
{ "POLYMAKE_IS_SIMPLE_OBJECT", 1, "cone",
516
(Obj(*)())FuncPOLYMAKE_IS_SIMPLE_OBJECT,
517
"polymake_main.cpp:POLYMAKE_IS_SIMPLE_OBJECT" },
518
519
{ "POLYMAKE_IS_SIMPLICIAL_CONE", 1, "cone",
520
(Obj(*)())FuncPOLYMAKE_IS_SIMPLICIAL_CONE,
521
"polymake_main.cpp:POLYMAKE_IS_SIMPLICIAL_CONE" },
522
523
{ "POLYMAKE_IS_LATTICE_OBJECT", 1, "cone",
524
(Obj(*)())FuncPOLYMAKE_IS_LATTICE_OBJECT,
525
"polymake_main.cpp:POLYMAKE_IS_LATTICE_OBJECT" },
526
527
{ "POLYMAKE_IS_NORMAL_OBJECT", 1, "cone",
528
(Obj(*)())FuncPOLYMAKE_IS_NORMAL_OBJECT,
529
"polymake_main.cpp:POLYMAKE_IS_NORMAL_OBJECT" },
530
531
{ "POLYMAKE_IS_VERYAMPLE_OBJECT", 1, "cone",
532
(Obj(*)())FuncPOLYMAKE_IS_VERYAMPLE_OBJECT,
533
"polymake_main.cpp:POLYMAKE_IS_VERYAMPLE_OBJECT" },
534
535
{ "POLYMAKE_IS_SMOOTH_OBJECT", 1, "cone",
536
(Obj(*)())FuncPOLYMAKE_IS_SMOOTH_OBJECT,
537
"polymake_main.cpp:POLYMAKE_IS_SMOOTH_OBJECT" },
538
539
{ "POLYMAKE_IS_STRICTLY_CONVEX_CONE", 1, "cone",
540
(Obj(*)())FuncPOLYMAKE_IS_STRICTLY_CONVEX_CONE,
541
"polymake_main.cpp:POLYMAKE_IS_STRICTLY_CONVEX_CONE" },
542
543
{ "POLYMAKE_IS_SMOOTH_CONE", 1, "cone",
544
(Obj(*)())FuncPOLYMAKE_IS_SMOOTH_CONE,
545
"polymake_main.cpp:POLYMAKE_IS_SMOOTH_CONE" },
546
547
{ "POLYMAKE_GENERATING_RAYS_OF_CONE", 1, "cone",
548
(Obj(*)())FuncPOLYMAKE_GENERATING_RAYS_OF_CONE,
549
"polymake_main.cpp:POLYMAKE_GENERATING_RAYS_OF_CONE" },
550
551
{ "POLYMAKE_CREATE_POLYTOPE_BY_POINTS", 1, "polytope",
552
(Obj(*)())FuncPOLYMAKE_CREATE_POLYTOPE_BY_POINTS,
553
"polymake_main.cpp:POLYMAKE_CREATE_POLYTOPE_BY_POINTS" },
554
555
{ "POLYMAKE_VERTICES_OF_POLYTOPE", 1, "polytope",
556
(Obj(*)())FuncPOLYMAKE_VERTICES_OF_POLYTOPE,
557
"polymake_main.cpp:POLYMAKE_VERTICES_OF_POLYTOPE" },
558
559
{ "POLYMAKE_CREATE_POLYTOPE_BY_INEQUALITIES", 1, "polytope",
560
(Obj(*)())FuncPOLYMAKE_CREATE_POLYTOPE_BY_INEQUALITIES,
561
"polymake_main.cpp:POLYMAKE_CREATE_POLYTOPE_BY_INEQUALITIES" },
562
563
{ "POLYMAKE_AMBIENT_DIM_OF_CONE", 1, "cone",
564
(Obj(*)())FuncPOLYMAKE_AMBIENT_DIM_OF_CONE,
565
"polymake_main.cpp:POLYMAKE_AMBIENT_DIM_OF_CONE" },
566
567
{ "POLYMAKE_DIM_OF_CONE", 1, "cone",
568
(Obj(*)())FuncPOLYMAKE_DIM_OF_CONE,
569
"polymake_main.cpp:POLYMAKE_DIM_OF_CONE" },
570
571
{ "POLYMAKE_HILBERT_BASIS_OF_CONE", 1, "cone",
572
(Obj(*)())FuncPOLYMAKE_HILBERT_BASIS_OF_CONE,
573
"polymake_main.cpp:POLYMAKE_HILBERT_BASIS_OF_CONE" },
574
575
{ "POLYMAKE_RAYS_IN_FACETS", 1, "cone",
576
(Obj(*)())FuncPOLYMAKE_RAYS_IN_FACETS,
577
"polymake_main.cpp:POLYMAKE_RAYS_IN_FACETS" },
578
579
{ "POLYMAKE_LATTICE_POINTS_OF_POLYTOPE", 1, "polytope",
580
(Obj(*)())FuncPOLYMAKE_LATTICE_POINTS_OF_POLYTOPE,
581
"polymake_main.cpp:POLYMAKE_LATTICE_POINTS_OF_POLYTOPE" },
582
583
{ "POLYMAKE_FAN_BY_CONES", 1, "cones",
584
(Obj(*)())FuncPOLYMAKE_FAN_BY_CONES,
585
"polymake_main.cpp:POLYMAKE_FAN_BY_CONES" },
586
587
{ "POLYMAKE_FAN_BY_RAYS_AND_CONES", 2, "rays,cones",
588
(Obj(*)())FuncPOLYMAKE_FAN_BY_RAYS_AND_CONES,
589
"polymake_main.cpp:POLYMAKE_FAN_BY_RAYS_AND_CONES" },
590
591
{ "POLYMAKE_FAN_BY_RAYS_AND_CONES_UNSAVE", 2, "rays,cones",
592
(Obj(*)())FuncPOLYMAKE_FAN_BY_RAYS_AND_CONES_UNSAVE,
593
"polymake_main.cpp:POLYMAKE_FAN_BY_RAYS_AND_CONES_UNSAVE" },
594
595
{ "POLYMAKE_RAYS_IN_MAXCONES_OF_FAN", 1, "fan",
596
(Obj(*)())FuncPOLYMAKE_RAYS_IN_MAXCONES_OF_FAN,
597
"polymake_main.cpp:POLYMAKE_RAYS_IN_MAXCONES_OF_FAN" },
598
599
{ "POLYMAKE_RAYS_OF_FAN", 1, "fan",
600
(Obj(*)())FuncPOLYMAKE_RAYS_OF_FAN,
601
"polymake_main.cpp:POLYMAKE_RAYS_OF_FAN" },
602
603
{ "POLYMAKE_IS_POINTED_FAN", 1, "fan",
604
(Obj(*)())FuncPOLYMAKE_IS_POINTED_FAN,
605
"polymake_main.cpp:POLYMAKE_IS_POINTED_FAN" },
606
607
{ "POLYMAKE_IS_SMOOTH_FAN", 1, "fan",
608
(Obj(*)())FuncPOLYMAKE_IS_SMOOTH_FAN,
609
"polymake_main.cpp:POLYMAKE_IS_SMOOTH_FAN" },
610
611
{ "POLYMAKE_IS_COMPLETE_FAN", 1, "fan",
612
(Obj(*)())FuncPOLYMAKE_IS_COMPLETE_FAN,
613
"polymake_main.cpp:POLYMAKE_IS_COMPLETE_FAN" },
614
615
{ "POLYMAKE_OBJECT_HAS_PROPERTY", 2, "conv,prop",
616
(Obj(*)())FuncPOLYMAKE_OBJECT_HAS_PROPERTY,
617
"polymake_main.cpp:POLYMAKE_OBJECT_HAS_PROPERTY" },
618
619
{ "POLYMAKE_OBJECT_HAS_INT_PROPERTY", 2, "conv,prop",
620
(Obj(*)())FuncPOLYMAKE_OBJECT_HAS_INT_PROPERTY,
621
"polymake_main.cpp:POLYMAKE_OBJECT_HAS_INT_PROPERTY" },
622
623
{ "POLYMAKE_IS_REGULAR_OBJECT", 1, "fan",
624
(Obj(*)())FuncPOLYMAKE_IS_REGULAR_OBJECT,
625
"polymake_main.cpp:POLYMAKE_IS_REGULAR_OBJECT" },
626
627
{ "POLYMAKE_NORMALFAN_OF_POLYTOPE", 1, "polytope",
628
(Obj(*)())FuncPOLYMAKE_NORMALFAN_OF_POLYTOPE,
629
"polymake_main.cpp:POLYMAKE_NORMALFAN_OF_POLYTOPE" },
630
631
{ "POLYMAKE_AMBIENT_DIM_OF_FAN", 1, "fan",
632
(Obj(*)())FuncPOLYMAKE_AMBIENT_DIM_OF_FAN,
633
"polymake_main.cpp:POLYMAKE_AMBIENT_DIM_OF_FAN" },
634
635
{ "POLYMAKE_DIM_OF_FAN", 1, "fan",
636
(Obj(*)())FuncPOLYMAKE_DIM_OF_FAN,
637
"polymake_main.cpp:POLYMAKE_DIM_OF_FAN" },
638
639
{ "POLYMAKE_IS_FULL_DIMENSIONAL_OBJECT", 1, "cone",
640
(Obj(*)())FuncPOLYMAKE_IS_FULL_DIMENSIONAL_OBJECT,
641
"polymake_main.cpp:POLYMAKE_IS_FULL_DIMENSIONAL_OBJECT" },
642
643
{ "POLYMAKE_DRAW", 1, "cone",
644
(Obj(*)())FuncPOLYMAKE_DRAW,
645
"polymake_main.cpp:POLYMAKE_DRAW" },
646
647
{ "POLYMAKE_SKETCH", 1, "cone",
648
(Obj(*)())FuncPOLYMAKE_SKETCH,
649
"polymake_main.cpp:POLYMAKE_SKETCH" },
650
651
{ "POLYMAKE_SKETCH_WITH_OPTIONS_KERNEL", 3, "cone,filename,options",
652
(Obj(*)())FuncPOLYMAKE_SKETCH_WITH_OPTIONS_KERNEL,
653
"polymake_main.cpp:POLYMAKE_SKETCH_WITH_OPTIONS_KERNEL" },
654
655
{ "POLYMAKE_DEFINING_INEQUALITIES_OF_CONE", 1, "cone",
656
(Obj(*)())FuncPOLYMAKE_DEFINING_INEQUALITIES_OF_CONE,
657
"polymake_main.cpp:POLYMAKE_DEFINING_INEQUALITIES_OF_CONE" },
658
659
{ "POLYMAKE_RESET_WORKSPACE", 0, "",
660
(Obj(*)())FuncPOLYMAKE_RESET_WORKSPACE,
661
"polymake_main.cpp:POLYMAKE_RESET_WORKSPACE" },
662
663
{ "POLYMAKE_FACET_INEQUALITIES_OF_POLYTOPE", 1, "poly",
664
(Obj(*)())FuncPOLYMAKE_FACET_INEQUALITIES_OF_POLYTOPE,
665
"polymake_main.cpp:POLYMAKE_FACET_INEQUALITIES_OF_POLYTOPE" },
666
667
{ "POLYMAKE_EQUALITIES_OF_POLYTOPE", 1, "poly",
668
(Obj(*)())FuncPOLYMAKE_EQUALITIES_OF_POLYTOPE,
669
"polymake_main.cpp:POLYMAKE_EQUALITIES_OF_POLYTOPE" },
670
671
{ "POLYMAKE_INTERIOR_LATTICE_POINTS", 1, "poly",
672
(Obj(*)())FuncPOLYMAKE_INTERIOR_LATTICE_POINTS,
673
"polymake_main.cpp:POLYMAKE_INTERIOR_LATTICE_POINTS" },
674
675
{ "POLYMAKE_IS_BOUNDED_POLYTOPE", 1, "polytope",
676
(Obj(*)())FuncPOLYMAKE_IS_BOUNDED_POLYTOPE,
677
"polymake_main.cpp:POLYMAKE_IS_BOUNDED_POLYTOPE" },
678
679
{ "POLYMAKE_CREATE_POLYTOPE_BY_HOMOGENEOUS_POINTS", 1, "points",
680
(Obj(*)())FuncPOLYMAKE_CREATE_POLYTOPE_BY_HOMOGENEOUS_POINTS,
681
"polymake_main.cpp:POLYMAKE_CREATE_POLYTOPE_BY_HOMOGENEOUS_POINTS" },
682
683
{ "POLYMAKE_HOMOGENEOUS_POINTS_OF_POLYTOPE", 1, "polytope",
684
(Obj(*)())FuncPOLYMAKE_HOMOGENEOUS_POINTS_OF_POLYTOPE,
685
"polymake_main.cpp:POLYMAKE_HOMOGENEOUS_POINTS_OF_POLYTOPE" },
686
687
{ "POLYMAKE_TAIL_CONE_OF_POLYTOPE", 1, "polytope",
688
(Obj(*)())FuncPOLYMAKE_TAIL_CONE_OF_POLYTOPE,
689
"polymake_main.cpp:POLYMAKE_TAIL_CONE_OF_POLYTOPE" },
690
691
{ "POLYMAKE_MINKOWSKI_SUM", 2, "polytope1,polytope2",
692
(Obj(*)())FuncPOLYMAKE_MINKOWSKI_SUM,
693
"polymake_main.cpp:POLYMAKE_MINKOWSKI_SUM" },
694
695
{ "POLYMAKE_LINEALITY_SPACE_OF_CONE", 1, "cone",
696
(Obj(*)())FuncPOLYMAKE_LINEALITY_SPACE_OF_CONE,
697
"polymake_main.cpp:POLYMAKE_LINEALITY_SPACE_OF_CONE" },
698
699
{ "POLYMAKE_EQUALITIES_OF_CONE", 1, "cone",
700
(Obj(*)())FuncPOLYMAKE_EQUALITIES_OF_CONE,
701
"polymake_main.cpp:POLYMAKE_EQUALITIES_OF_CONE" },
702
703
{ "POLYMAKE_STELLAR_SUBDIVISION", 2, "ray,fan",
704
(Obj(*)())FuncPOLYMAKE_STELLAR_SUBDIVISION,
705
"polymake_main.cpp:STELLAR_SUBDIVSION" },
706
707
{ "POLYMAKE_SET_PROPERTY_TRUE", 2, "conv,prop",
708
(Obj(*)())FuncPOLYMAKE_SET_PROPERTY_TRUE,
709
"polymake_main.cpp:POLYMAKE_SET_PROPERTY_TRUE" },
710
711
{ "POLYMAKE_CREATE_CONE_BY_EQUALITIES_AND_INEQUALITIES", 2, "equalities,inequalities",
712
(Obj(*)())FuncPOLYMAKE_CREATE_CONE_BY_EQUALITIES_AND_INEQUALITIES,
713
"polymake_main.cpp:POLYMAKE_CREATE_CONE_BY_EQUALITIES_AND_INEQUALITIES" },
714
715
{ "POLYMAKE_INTERSECTION_OF_CONES", 2, "cone1,cone2",
716
(Obj(*)())FuncPOLYMAKE_INTERSECTION_OF_CONES,
717
"polymake_main.cpp:POLYMAKE_INTERSECTION_OF_CONES" },
718
719
{ "POLYMAKE_INTERSECTION_OF_POLYTOPES", 2, "cone1,cone2",
720
(Obj(*)())FuncPOLYMAKE_INTERSECTION_OF_POLYTOPES,
721
"polymake_main.cpp:POLYMAKE_INTERSECTION_OF_POLYTOPES" },
722
723
{ "POLYMAKE_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS", 2, "mon,coeff",
724
(Obj(*)())FuncPOLYMAKE_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS,
725
"polymake_main.cpp:POLYMAKE_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS" },
726
727
{ "POLYMAKE_MONOMIALS_OF_HYPERSURFACE", 1, "surf",
728
(Obj(*)())FuncPOLYMAKE_MONOMIALS_OF_HYPERSURFACE,
729
"polymake_main.cpp:POLYMAKE_MONOMIALS_OF_HYPERSURFACE" },
730
731
{ "POLYMAKE_LATTICE_POINTS_GENERATORS", 1, "polytope",
732
(Obj(*)())FuncPOLYMAKE_LATTICE_POINTS_GENERATORS,
733
"polymake_main.cpp:POLYMAKE_LATTICE_POINTS_GENERATORS" },
734
735
{ "POLYMAKE_TROPICAL_POLYTOPE_BY_POINTS", 1, "points",
736
(Obj(*)())FuncPOLYMAKE_TROPICAL_POLYTOPE_BY_POINTS,
737
"polymake_main.cpp:POLYMAKE_TROPICAL_POLYTOPE_BY_POINTS" },
738
739
{ "POLYMAKE_F_VECTOR_OF_FAN", 1, "fan",
740
(Obj(*)())FuncPOLYMAKE_F_VECTOR_OF_FAN,
741
"polymake_main.cpp:POLYMAKE_F_VECTOR_OF_FAN" },
742
743
{ "POLYMAKE_PROPERTIES", 1, "cone",
744
(Obj(*)())FuncPOLYMAKE_PROPERTIES,
745
"polymake_main.cpp:POLYMAKE_PROPERTIES" },
746
747
{ 0 }
748
};
749
750
/******************************************************************************
751
*F InitKernel( <module> ) . . . . . . . . initialise kernel data structures
752
*/
753
static Int InitKernel ( StructInitInfo *module )
754
{
755
756
polymake_start( &akt_data );
757
/* init filters and functions */
758
InitHdlrFuncsFromTable( GVarFuncs );
759
760
761
InitCopyGVar( "TheTypeExternalPolymakeCone", &TheTypeExternalPolymakeCone );
762
InitCopyGVar( "TheTypeExternalPolymakeFan", &TheTypeExternalPolymakeFan );
763
InitCopyGVar( "TheTypeExternalPolymakePolytope", &TheTypeExternalPolymakePolytope );
764
InitCopyGVar( "TheTypeExternalPolymakeTropicalHypersurface", &TheTypeExternalPolymakeTropicalHypersurface );
765
InitCopyGVar( "TheTypeExternalPolymakeTropicalPolytope", &TheTypeExternalPolymakeTropicalPolytope );
766
767
InfoBags[T_POLYMAKE].name = "ExternalPolymakeObject";
768
InitMarkFuncBags(T_POLYMAKE, &MarkOneSubBags);
769
InitFreeFuncBag(T_POLYMAKE, &ExternalPolymakeObjectFreeFunc);
770
TypeObjFuncs[T_POLYMAKE] = &ExternalPolymakeObjectTypeFunc;
771
772
773
/* return success */
774
return 0;
775
}
776
777
/******************************************************************************
778
*F InitLibrary( <module> ) . . . . . . . initialise library data structures
779
*/
780
static Int InitLibrary ( StructInitInfo *module )
781
{
782
// Int i, gvar;
783
//
784
// // We start with initialising the polymake classes.
785
// akt_data.initialized = false;
786
// // akt_data.main_polymake_session = new polymake::Main;
787
// // akt_data.main_polymake_scope = new polymake::perl::Scope(akt_data.main_polymake_session->newScope());
788
// // akt_data.main_polymake_session->set_application("polytope");
789
// // akt_data.main_polymake_session->set_custom("$Verbose::scheduler",1);
790
// //This is pretty slow.
791
// //akt_data.polymake_objects = new map<int, pm::perl::Object*>;
792
// //akt_data.new_polymake_object_number=0;
793
// // We now have everything to handle polymake, lets do the gapthings
794
795
InitGVarFuncsFromTable(GVarFuncs);
796
/* return success */
797
return 0;
798
}
799
800
/******************************************************************************
801
*F InitInfopl() . . . . . . . . . . . . . . . . . table of init functions
802
*/
803
static StructInitInfo module = {
804
/* type = */ MODULE_DYNAMIC,
805
/* name = */ "polymake_main",
806
/* revision_c = */ 0,
807
/* revision_h = */ 0,
808
/* version = */ 0,
809
/* crc = */ 0,
810
/* initKernel = */ InitKernel,
811
/* initLibrary = */ InitLibrary,
812
/* checkInit = */ 0,
813
/* preSave = */ 0,
814
/* postSave = */ 0,
815
/* postRestore = */ 0
816
};
817
818
extern "C" {
819
820
StructInitInfo * Init__Dynamic ( void )
821
{
822
return &module;
823
}
824
825
}
826
827
828
/*
829
*
830
* This program is free software; you can redistribute it and/or modify
831
* it under the terms of the GNU General Public License as published by
832
* the Free Software Foundation; version 2 of the License.
833
*
834
* This program is distributed in the hope that it will be useful,
835
* but WITHOUT ANY WARRANTY; without even the implied warranty of
836
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
837
* GNU General Public License for more details.
838
*
839
* You should have received a copy of the GNU General Public License
840
* along with this program; if not, write to the Free Software
841
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
842
*
843
*/
844
845