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
#include "polymake_polytopes.h"
2
3
4
Obj REAL_CREATE_POLYTOPE_BY_POINTS( Polymake_Data* data, Obj polytope ){
5
6
#ifdef MORE_TESTS
7
if( ! IS_PLIST( polytope ) ){
8
ErrorMayQuit( "not a plain list", 0, 0);
9
return NULL;
10
}
11
#endif
12
13
int len = LEN_PLIST( polytope );
14
Obj akt = ELM_PLIST( polytope, 1 );
15
Obj elem;
16
17
#ifdef MORE_TESTS
18
if( !IS_PLIST( akt ) ){
19
ErrorMayQuit( "not a plain list", 0, 0);
20
return NULL;
21
}
22
#endif
23
24
int len_elem = LEN_PLIST( akt );
25
data->main_polymake_session->set_application("polytope");
26
27
pm::Integer* ratarray;
28
ratarray = new pm::Integer[(len)*(len_elem+1)];
29
30
for(int i=1;i<=len;i++){
31
akt = ELM_PLIST( polytope, i );
32
#ifdef MORE_TESTS
33
if( !IS_PLIST( akt ) ){
34
delete [] ratarray;
35
ErrorMayQuit( "not a plain list", 0, 0);
36
return NULL;
37
}
38
if( LEN_PLIST( akt ) != len_elem ){
39
delete [] ratarray;
40
ErrorMayQuit( "raygenerators are not of the same lenght", 0, 0);
41
return NULL;
42
}
43
#endif
44
45
ratarray[(i-1)*(len_elem+1)] = 1;
46
for(int j = 1; j <= len_elem; j++){
47
elem = ELM_PLIST( akt, j);
48
49
#ifdef MORE_TESTS
50
if( ! IS_INTOBJ( elem ) ){
51
delete [] ratarray;
52
ErrorMayQuit( "some entries are not integers", 0, 0);
53
return NULL;
54
}
55
#endif
56
57
ratarray[(i-1)*(len_elem+1)+j] = INT_INTOBJ( elem );
58
}
59
60
}
61
62
pm::Matrix<pm::Integer>* matr = new pm::Matrix<pm::Integer>(len,len_elem+1,ratarray);
63
delete [] ratarray;
64
perlobj* p = new perlobj("LatticePolytope");
65
p->take("POINTS") << *matr;
66
delete matr;
67
elem = NewPolymakeExternalObject( T_POLYMAKE_EXTERNAL_POLYTOPE );
68
POLYMAKEOBJ_SET_PERLOBJ( elem, p );
69
return elem;
70
}
71
72
73
74
Obj REAL_VERTICES_OF_POLYTOPE( Polymake_Data* data, Obj polytope){
75
76
#ifdef MORE_TESTS
77
if(! IS_POLYMAKE_POLYTOPE(polytope) ){
78
ErrorMayQuit(" parameter is not a polytope.",0,0);
79
return NULL;
80
}
81
#endif
82
83
perlobj* polyobj = PERLOBJ_POLYMAKEOBJ( polytope );
84
data->main_polymake_session->set_application_of(*polyobj);
85
pm::Matrix<pm::Rational> matr;
86
try{
87
pm::Matrix<pm::Rational> matr_temp = polyobj->give("VERTICES");
88
matr = matr_temp;
89
}
90
91
POLYMAKE_GAP_CATCH
92
93
UInt l = 10;
94
Obj RETLI = NEW_PLIST( T_PLIST , l );
95
SET_LEN_PLIST(RETLI, l );
96
UInt k = 0;
97
Obj LIZeil;
98
UInt matr_cols = matr.cols() - 1;
99
for(int i = 0;i<matr.rows();i++){
100
if( matr(i,0) == 1 ){
101
if( ++k > l){
102
GROW_PLIST(RETLI,l*=2);
103
SET_LEN_PLIST(RETLI, l );
104
}
105
LIZeil = NEW_PLIST( T_PLIST, matr.cols()-1);
106
SET_LEN_PLIST( LIZeil , matr_cols );
107
for(int j = 1;j<matr.cols();j++){
108
SET_ELM_PLIST(LIZeil,j,INTOBJ_INT((matr(i,j)).to_int()));
109
}
110
SET_ELM_PLIST(RETLI,k,LIZeil);
111
CHANGED_BAG(RETLI);
112
}
113
}
114
SHRINK_PLIST(RETLI,k);
115
SET_LEN_PLIST(RETLI, k );
116
return RETLI;
117
118
}
119
120
121
122
Obj REAL_LATTICE_POINTS_OF_POLYTOPE( Polymake_Data* data, Obj polytope){
123
124
#ifdef MORE_TESTS
125
if(! IS_POLYMAKE_POLYTOPE(polytope) ){
126
ErrorMayQuit(" parameter is not a polytope.",0,0);
127
return NULL;
128
}
129
#endif
130
131
perlobj* polyobj = PERLOBJ_POLYMAKEOBJ( polytope );
132
data->main_polymake_session->set_application_of(*polyobj);
133
pm::Matrix<pm::Rational> matr;
134
try{
135
pm::Array<pm::Matrix<pm::Rational> > matr_temp = polyobj->give("LATTICE_POINTS_GENERATORS");
136
matr = matr_temp[ 1 ];
137
}
138
139
POLYMAKE_GAP_CATCH
140
141
Obj RETLI = NEW_PLIST( T_PLIST , matr.rows());
142
UInt matr_rows = matr.rows();
143
SET_LEN_PLIST( RETLI , matr_rows );
144
Obj LIZeil;
145
UInt matr_cols = matr.cols() - 1;
146
for(int i = 0;i<matr.rows();i++){
147
LIZeil = NEW_PLIST( T_PLIST, matr.cols()-1);
148
SET_LEN_PLIST( LIZeil , matr_cols );
149
for(int j = 1;j<matr.cols();j++){
150
SET_ELM_PLIST(LIZeil,j,INTOBJ_INT((matr(i,j)).to_int()));
151
}
152
SET_ELM_PLIST(RETLI,i+1,LIZeil);
153
CHANGED_BAG(RETLI);
154
}
155
return RETLI;
156
157
}
158
159
160
161
Obj REAL_CREATE_POLYTOPE_BY_INEQUALITIES( Polymake_Data* data, Obj polytope){
162
163
#ifdef MORE_TESTS
164
if( ! IS_PLIST( polytope ) ){
165
ErrorMayQuit( "not a plain list", 0, 0);
166
return NULL;
167
}
168
#endif
169
170
int len = LEN_PLIST( polytope );
171
Obj akt = ELM_PLIST( polytope, 1 );
172
Obj elem;
173
174
#ifdef MORE_TESTS
175
if( !IS_PLIST( akt ) ){
176
ErrorMayQuit( "not a plain list", 0, 0);
177
return NULL;
178
}
179
#endif
180
181
int len_elem = LEN_PLIST( akt );
182
data->main_polymake_session->set_application("polytope");
183
184
pm::Integer* ratarray;
185
ratarray = new pm::Integer[(len)*(len_elem)];
186
187
for(int i=0;i<len;i++){
188
akt = ELM_PLIST( polytope, i+1 );
189
#ifdef MORE_TESTS
190
if( !IS_PLIST( akt ) ){
191
delete [] ratarray;
192
ErrorMayQuit( "not a plain list", 0, 0);
193
return NULL;
194
}
195
if( LEN_PLIST( akt ) != len_elem ){
196
delete [] ratarray;
197
ErrorMayQuit( "raygenerators are not of the same lenght", 0, 0);
198
return NULL;
199
}
200
#endif
201
for(int j = 0; j < len_elem; j++){
202
elem = ELM_PLIST( akt, j+1);
203
#ifdef MORE_TESTS
204
if( ! IS_INTOBJ( elem ) ){
205
delete [] ratarray;
206
ErrorMayQuit( "some entries are not integers", 0, 0);
207
return NULL;
208
}
209
#endif
210
ratarray[i*(len_elem)+j] = INT_INTOBJ( elem );
211
}
212
213
}
214
215
pm::Matrix<pm::Integer>* matr = new pm::Matrix<pm::Integer>(len,len_elem,ratarray);
216
delete [] ratarray;
217
perlobj* p = new perlobj("LatticePolytope"); //Maybe Name the Polytope by the Number
218
p->take("INEQUALITIES") << *matr;
219
delete matr;
220
elem = NewPolymakeExternalObject( T_POLYMAKE_EXTERNAL_POLYTOPE );
221
POLYMAKEOBJ_SET_PERLOBJ( elem, p );
222
return elem;
223
}
224
225
226
227
Obj REAL_FACET_INEQUALITIES_OF_POLYTOPE( Polymake_Data* data, Obj polytope){
228
229
#ifdef MORE_TESTS
230
if(! IS_POLYMAKE_POLYTOPE(polytope) ){
231
ErrorMayQuit(" parameter is not a polytope.",0,0);
232
return NULL;
233
}
234
#endif
235
236
perlobj* polyobj = PERLOBJ_POLYMAKEOBJ( polytope );
237
data->main_polymake_session->set_application_of(*polyobj);
238
pm::Matrix<pm::Rational> matr;
239
try{
240
pm::Matrix<pm::Rational> matr_temp = polyobj->give("FACETS");
241
matr = matr_temp;
242
}
243
244
POLYMAKE_GAP_CATCH
245
246
Obj RETLI = NEW_PLIST( T_PLIST , matr.rows());
247
UInt matr_rows = matr.rows();
248
SET_LEN_PLIST( RETLI , matr_rows );
249
Obj LIZeil;
250
UInt matr_cols = matr.cols();
251
for(int i = 0;i<matr.rows();i++){
252
LIZeil = NEW_PLIST( T_PLIST, matr.cols() );
253
SET_LEN_PLIST( LIZeil , matr_cols );
254
for(int j = 0;j<matr.cols();j++){
255
SET_ELM_PLIST(LIZeil,j+1,INTOBJ_INT((matr(i,j)).to_int()));
256
}
257
SET_ELM_PLIST(RETLI,i+1,LIZeil);
258
CHANGED_BAG(RETLI);
259
}
260
return RETLI;
261
262
}
263
264
265
Obj REAL_EQUALITIES_OF_POLYTOPE( Polymake_Data* data, Obj polytope){
266
267
#ifdef MORE_TESTS
268
if(! IS_POLYMAKE_POLYTOPE(polytope) ){
269
ErrorMayQuit(" parameter is not a polytope.",0,0);
270
return NULL;
271
}
272
#endif
273
274
perlobj* polyobj = PERLOBJ_POLYMAKEOBJ( polytope );
275
data->main_polymake_session->set_application_of(*polyobj);
276
pm::Matrix<pm::Rational> matr;
277
try{
278
pm::Matrix<pm::Rational> matr_temp = polyobj->give("AFFINE_HULL");
279
matr = matr_temp;
280
}
281
282
POLYMAKE_GAP_CATCH
283
284
Obj RETLI = NEW_PLIST( T_PLIST , matr.rows());
285
UInt matr_rows = matr.rows();
286
SET_LEN_PLIST( RETLI , matr_rows );
287
Obj LIZeil;
288
UInt matr_cols = matr.cols();
289
for(int i = 0;i<matr.rows();i++){
290
LIZeil = NEW_PLIST( T_PLIST, matr.cols() );
291
SET_LEN_PLIST( LIZeil , matr_cols );
292
for(int j = 0;j<matr.cols();j++){
293
SET_ELM_PLIST(LIZeil,j+1,INTOBJ_INT((matr(i,j)).to_int()));
294
}
295
SET_ELM_PLIST(RETLI,i+1,LIZeil);
296
CHANGED_BAG(RETLI);
297
}
298
return RETLI;
299
300
}
301
302
303
Obj REAL_INTERIOR_LATTICE_POINTS( Polymake_Data* data, Obj polytope){
304
305
#ifdef MORE_TESTS
306
if(! IS_POLYMAKE_POLYTOPE(polytope) ){
307
ErrorMayQuit(" parameter is not a polytope.",0,0);
308
return NULL;
309
}
310
#endif
311
312
perlobj* polyobj = PERLOBJ_POLYMAKEOBJ( polytope );
313
data->main_polymake_session->set_application_of(*polyobj);
314
pm::Matrix<pm::Rational> matr;
315
try{
316
pm::Matrix<pm::Rational> matr_temp = polyobj->give("INTERIOR_LATTICE_POINTS");
317
matr = matr_temp;
318
}
319
320
POLYMAKE_GAP_CATCH
321
322
Obj RETLI = NEW_PLIST( T_PLIST , matr.rows());
323
UInt matr_rows = matr.rows();
324
SET_LEN_PLIST( RETLI , matr_rows );
325
Obj LIZeil;
326
UInt matr_cols = matr.cols() - 1;
327
for(int i = 0;i<matr.rows();i++){
328
LIZeil = NEW_PLIST( T_PLIST, matr.cols()-1);
329
SET_LEN_PLIST( LIZeil , matr_cols );
330
for(int j = 1;j<matr.cols();j++){
331
SET_ELM_PLIST(LIZeil,j,INTOBJ_INT((matr(i,j)).to_int()));
332
}
333
SET_ELM_PLIST(RETLI,i+1,LIZeil);
334
CHANGED_BAG(RETLI);
335
}
336
return RETLI;
337
338
}
339
340
341
342
Obj REAL_CREATE_POLYTOPE_BY_HOMOGENEOUS_POINTS( Polymake_Data* data, Obj points ){
343
344
if( ! IS_PLIST( points ) ){
345
ErrorMayQuit( "not a plain list", 0, 0);
346
return NULL;
347
}
348
349
int len = LEN_PLIST( points );
350
Obj akt = ELM_PLIST( points, 1 );
351
Obj elem;
352
353
#ifdef MORE_TESTS
354
if( !IS_PLIST( akt ) ){
355
ErrorMayQuit( "first ray is not a plain list", 0, 0);
356
return NULL;
357
}
358
#endif
359
360
int len_elem = LEN_PLIST( akt );
361
data->main_polymake_session->set_application("polytope");
362
363
pm::Integer* ratarray;
364
ratarray = new pm::Integer[(len)*(len_elem)];
365
366
for(int i=0;i<len;i++){
367
akt = ELM_PLIST( points, i+1 );
368
#ifdef MORE_TESTS
369
if( !IS_PLIST( akt ) ){
370
delete [] ratarray;
371
ErrorMayQuit( "one ray is not a plain list", 0, 0);
372
return NULL;
373
}
374
if( LEN_PLIST( akt ) != len_elem ){
375
delete [] ratarray;
376
ErrorMayQuit( "raygenerators are not of the same lenght", 0, 0);
377
return NULL;
378
}
379
#endif
380
for(int j = 0; j < len_elem; j++){
381
elem = ELM_PLIST( akt, j+1);
382
#ifdef MORE_TESTS
383
if( ! IS_INTOBJ( elem) ){
384
delete [] ratarray;
385
ErrorMayQuit( "some entries are not integers", 0, 0);
386
return NULL;
387
}
388
#endif
389
ratarray[ ( i * len_elem ) + j] = INT_INTOBJ( elem );
390
}
391
392
}
393
394
pm::Matrix<pm::Integer>* matr = new pm::Matrix<pm::Integer>(len,len_elem,ratarray);
395
delete [] ratarray;
396
perlobj* p = new perlobj("Polytope<Rational>");
397
p->take("POINTS") << *matr;
398
delete matr;
399
elem = NewPolymakeExternalObject(T_POLYMAKE_EXTERNAL_POLYTOPE);
400
401
POLYMAKEOBJ_SET_PERLOBJ(elem, p);
402
403
return elem;
404
}
405
406
407
408
Obj REAL_HOMOGENEOUS_POINTS_OF_POLYTOPE( Polymake_Data* data, Obj polytope){
409
410
#ifdef MORE_TESTS
411
if( ( ! IS_POLYMAKE_POLYTOPE(polytope) ) ){
412
ErrorMayQuit(" parameter is not a polytope.",0,0);
413
return NULL;
414
}
415
#endif
416
417
perlobj* coneobj = PERLOBJ_POLYMAKEOBJ( polytope );
418
data->main_polymake_session->set_application_of(*coneobj);
419
pm::Matrix<pm::Rational> matr;
420
try{
421
pm::Matrix<pm::Rational> matr_temp = coneobj->give("VERTICES");
422
matr = matr_temp;
423
}
424
425
POLYMAKE_GAP_CATCH
426
427
Obj RETLI = NEW_PLIST( T_PLIST , matr.rows());
428
UInt matr_rows = matr.rows();
429
SET_LEN_PLIST( RETLI , matr_rows );
430
Obj LIZeil;
431
polymake::common::primitive( matr );
432
UInt matr_cols = matr.cols();
433
for(int i = 0;i<matr.rows();i++){
434
LIZeil = NEW_PLIST( T_PLIST, matr.cols());
435
SET_LEN_PLIST( LIZeil , matr_cols );
436
for(int j = 0;j<matr.cols();j++){
437
SET_ELM_PLIST(LIZeil,j+1,INTOBJ_INT((matr(i,j)).to_int()));
438
}
439
SET_ELM_PLIST(RETLI,i+1,LIZeil);
440
CHANGED_BAG(RETLI);
441
}
442
return RETLI;
443
444
}
445
446
447
448
Obj REAL_TAIL_CONE_OF_POLYTOPE( Polymake_Data* data, Obj polytope){
449
450
#ifdef MORE_TESTS
451
if(! IS_POLYMAKE_POLYTOPE(polytope) ){
452
ErrorMayQuit(" parameter is not a polytope.",0,0);
453
return NULL;
454
}
455
#endif
456
457
perlobj* polyobj = PERLOBJ_POLYMAKEOBJ( polytope );
458
data->main_polymake_session->set_application_of(*polyobj);
459
pm::Matrix<pm::Rational> matr;
460
try{
461
pm::Matrix<pm::Rational> matr_temp = polyobj->give("VERTICES");
462
matr = matr_temp;
463
}
464
465
POLYMAKE_GAP_CATCH
466
467
UInt l = 10;
468
Obj RETLI = NEW_PLIST( T_PLIST , l );
469
SET_LEN_PLIST(RETLI, l );
470
Obj LIZeil;
471
UInt k = 0;
472
UInt matr_cols = matr.cols() - 1;
473
for(int i = 0;i<matr.rows();i++){
474
if( matr(i,0)==0 ){
475
if(++k>l){
476
GROW_PLIST(RETLI,l*=2);
477
SET_LEN_PLIST(RETLI, l );
478
}
479
LIZeil = NEW_PLIST( T_PLIST, matr.cols()-1);
480
SET_LEN_PLIST( LIZeil , matr_cols );
481
for(int j = 1;j<matr.cols();j++){
482
SET_ELM_PLIST(LIZeil,j, INTOBJ_INT( (matr(i,j)).to_int() ) );
483
}
484
SET_ELM_PLIST(RETLI,k,LIZeil);
485
CHANGED_BAG(RETLI);
486
}
487
}
488
SHRINK_PLIST(RETLI,k);
489
SET_LEN_PLIST(RETLI, k );
490
return RETLI;
491
492
}
493
494
495
Obj REAL_MINKOWSKI_SUM( Polymake_Data* data, Obj polytope1, Obj polytope2 ){
496
497
#ifdef MORE_TESTS
498
if( (!IS_POLYMAKE_POLYTOPE(polytope1)) || (!IS_POLYMAKE_POLYTOPE(polytope2)) ){
499
ErrorMayQuit("one parameter is not a polytope.",0,0);
500
return NULL;
501
}
502
#endif
503
perlobj* poly1 = PERLOBJ_POLYMAKEOBJ( polytope1 );
504
perlobj* poly2 = PERLOBJ_POLYMAKEOBJ( polytope2 );
505
data->main_polymake_session->set_application_of(*poly1);
506
507
perlobj sum;
508
try{
509
CallPolymakeFunction("minkowski_sum",*poly1,*poly2) >> sum;
510
}
511
512
POLYMAKE_GAP_CATCH
513
514
perlobj* sumpointer = new perlobj(sum);
515
Obj elem = NewPolymakeExternalObject(T_POLYMAKE_EXTERNAL_POLYTOPE);
516
POLYMAKEOBJ_SET_PERLOBJ(elem, sumpointer);
517
return elem;
518
}
519
520
521
522
Obj REAL_MINKOWSKI_SUM_WITH_COEFFICIENTS( Polymake_Data* data, Obj fact1, Obj polytope1, Obj fact2, Obj polytope2 ){
523
524
#ifdef MORE_TESTS
525
if( (!IS_POLYMAKE_POLYTOPE(polytope1)) || (!IS_POLYMAKE_POLYTOPE(polytope2)) ){
526
ErrorMayQuit("one parameter is not a polytope.",0,0);
527
return NULL;
528
}
529
#endif
530
531
#ifdef MORE_TESTS
532
if( (!IS_INTOBJ(fact1)) || (!IS_INTOBJ(fact2)) ){
533
ErrorMayQuit("one parameter is not an integer.",0,0);
534
return NULL;
535
}
536
#endif
537
538
perlobj* poly1 = PERLOBJ_POLYMAKEOBJ( polytope1 );
539
perlobj* poly2 = PERLOBJ_POLYMAKEOBJ( polytope2 );
540
data->main_polymake_session->set_application_of(*poly1);
541
542
perlobj sum;
543
try{
544
CallPolymakeFunction("minkowski_sum",INT_INTOBJ(fact1),*poly1,INT_INTOBJ(fact2),*poly2) >> sum;
545
}
546
547
POLYMAKE_GAP_CATCH
548
549
perlobj* sumpointer = new perlobj(sum);
550
Obj elem = NewPolymakeExternalObject(T_POLYMAKE_EXTERNAL_POLYTOPE);
551
POLYMAKEOBJ_SET_PERLOBJ(elem, sumpointer);
552
return elem;
553
}
554
555
556
Obj REAL_LATTICE_POINTS_GENERATORS( Polymake_Data* data, Obj polytope ){
557
#ifdef MORE_TESTS
558
if(! IS_POLYMAKE_POLYTOPE(polytope) ){
559
ErrorMayQuit(" parameter is not a polytope.",0,0);
560
return NULL;
561
}
562
#endif
563
564
perlobj* polyobj = PERLOBJ_POLYMAKEOBJ( polytope );
565
data->main_polymake_session->set_application_of(*polyobj);
566
pm::Array<pm::Matrix<pm::Rational> > array;
567
try{
568
pm::Array<pm::Matrix<pm::Rational> > matr_temp = polyobj->give("LATTICE_POINTS_GENERATORS");
569
array = matr_temp;
570
}
571
572
POLYMAKE_GAP_CATCH
573
574
pm::Matrix<pm::Rational> matr = array[ 0 ];
575
576
for(int i=0;i<matr.rows();i++){
577
for(int j=0;j<matr.cols();j++){
578
}
579
}
580
581
Obj RET_ARRAY = NEW_PLIST( T_PLIST, 3 );
582
SET_LEN_PLIST( RET_ARRAY, (UInt)3 );
583
for( int index_of_array=0;index_of_array<3;index_of_array++ ){
584
pm::Matrix<pm::Rational> matr = array[index_of_array];
585
Obj RETLI = NEW_PLIST( T_PLIST , matr.rows());
586
UInt matr_rows = matr.rows();
587
SET_LEN_PLIST( RETLI , matr_rows );
588
Obj LIZeil;
589
UInt matr_cols = matr.cols() - 1;
590
for(int i = 0;i<matr.rows();i++){
591
LIZeil = NEW_PLIST( T_PLIST, matr.cols()-1);
592
SET_LEN_PLIST( LIZeil , matr_cols );
593
for(int j = 1;j<matr.cols();j++){
594
SET_ELM_PLIST(LIZeil,j,INTOBJ_INT((matr(i,j)).to_int()));
595
}
596
SET_ELM_PLIST(RETLI,i+1,LIZeil);
597
CHANGED_BAG(RETLI);
598
}
599
SET_ELM_PLIST( RET_ARRAY, index_of_array + 1, RETLI );
600
CHANGED_BAG( RET_ARRAY );
601
}
602
return RET_ARRAY;
603
604
}
605
606
607
Obj REAL_INTERSECTION_OF_POLYTOPES( Polymake_Data* data, Obj cone1, Obj cone2){
608
609
#ifdef MORE_TESTS
610
if(! IS_POLYMAKE_POLYTOPE(cone1) || ! IS_POLYMAKE_POLYTOPE(cone2) ){
611
ErrorMayQuit(" parameter is not a cone.",0,0);
612
return NULL;
613
}
614
#endif
615
616
perlobj* coneobj1 = PERLOBJ_POLYMAKEOBJ( cone1 );
617
perlobj* coneobj2 = PERLOBJ_POLYMAKEOBJ( cone2 );
618
619
data->main_polymake_session->set_application_of( *coneobj1 );
620
621
perlobj intersec;
622
623
CallPolymakeFunction( "intersection", *coneobj1, *coneobj2 ) >> intersec;
624
625
perlobj* returnobj = new perlobj(intersec);
626
627
Obj elem = NewPolymakeExternalObject(T_POLYMAKE_EXTERNAL_POLYTOPE);
628
629
POLYMAKEOBJ_SET_PERLOBJ( elem, returnobj );
630
631
return elem;
632
633
}
634