Changeset 1082b9 in git
- Timestamp:
- Jan 19, 2017, 2:57:38 PM (7 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
- Children:
- b08fbfc7220b87075c808c15b35900abd6636899
- Parents:
- 0091f520ce1d05c31263015fbc74956dd9b73454
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/polymake/polymake_wrapper.cc
r0091f5 r1082b9 27 27 if (i2->Typ()==polytopeID || i2->Typ()==coneID) 28 28 { 29 gfan::initializeCddlibIfRequired(); 29 30 gfan::ZCone* zq = (gfan::ZCone*) i2->Data(); 30 31 gfan::ZCone* ms; … … 41 42 catch (const std::exception& ex) 42 43 { 44 gfan::deinitializeCddlibIfRequired(); 43 45 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 44 46 return TRUE; 45 47 } 48 gfan::deinitializeCddlibIfRequired(); 46 49 res->rtyp = polytopeID; 47 50 res->data = (void*) ms; … … 54 57 if (i2->Typ()==INT_CMD) 55 58 { 59 gfan::initializeCddlibIfRequired(); 56 60 int s = (int)(long) i2->Data(); 57 61 gfan::ZMatrix zm = zp->extremeRays(); … … 61 65 gfan::ZCone* zs = new gfan::ZCone(); 62 66 *zs = gfan::ZCone::givenByRays(zm,gfan::ZMatrix(0, zm.getWidth())); 67 gfan::deinitializeCddlibIfRequired(); 63 68 res->rtyp = polytopeID; 64 69 res->data = (void*) zs; … … 71 76 if (i2->Typ()==polytopeID) 72 77 { 78 gfan::initializeCddlibIfRequired(); 73 79 gfan::ZCone* zq = (gfan::ZCone*) i2->Data(); 74 80 int d1 = zp->ambientDimension(); … … 76 82 if (d1 != d2) 77 83 { 84 gfan::deinitializeCddlibIfRequired(); 78 85 WerrorS("mismatching ambient dimensions"); 79 86 return TRUE; … … 82 89 *zs = gfan::intersection(*zp, *zq); 83 90 zs->canonicalize(); 91 gfan::deinitializeCddlibIfRequired(); 84 92 res->rtyp = polytopeID; 85 93 res->data = (void*) zs; … … 92 100 if(i2->Typ()==polytopeID) 93 101 { 102 gfan::initializeCddlibIfRequired(); 94 103 gfan::ZCone* zq = (gfan::ZCone*) i2->Data(); 95 104 int d1 = zp->ambientDimension(); … … 97 106 if (d1 != d2) 98 107 { 108 gfan::deinitializeCddlibIfRequired(); 99 109 WerrorS("mismatching ambient dimensions"); 100 110 return TRUE; … … 107 117 *zs = gfan::ZCone::givenByRays(rays,lineality); 108 118 zs->canonicalize(); 119 gfan::deinitializeCddlibIfRequired(); 109 120 res->rtyp = polytopeID; 110 121 res->data = (void*) zs; … … 117 128 if(i2->Typ()==polytopeID) 118 129 { 130 gfan::initializeCddlibIfRequired(); 119 131 gfan::ZCone* zq = (gfan::ZCone*) i2->Data(); 120 132 zp->canonicalize(); 121 133 zq->canonicalize(); 122 134 bool b = !((*zp)!=(*zq)); 135 gfan::deinitializeCddlibIfRequired(); 123 136 res->rtyp = INT_CMD; 124 137 res->data = (char*) (long) b; … … 203 216 if ((u != NULL) && (u->Typ() == polytopeID)) 204 217 { 218 gfan::initializeCddlibIfRequired(); 205 219 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 206 220 bool b; … … 213 227 catch (const std::exception& ex) 214 228 { 215 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 216 return TRUE; 217 } 229 gfan::deinitializeCddlibIfRequired(); 230 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 231 return TRUE; 232 } 233 gfan::deinitializeCddlibIfRequired(); 218 234 res->rtyp = INT_CMD; 219 235 res->data = (char*) (long) b; … … 230 246 if ((u != NULL) && (u->Typ() == polytopeID)) 231 247 { 248 gfan::initializeCddlibIfRequired(); 232 249 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 233 250 bool b; … … 240 257 catch (const std::exception& ex) 241 258 { 242 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 243 return TRUE; 244 } 259 gfan::deinitializeCddlibIfRequired(); 260 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 261 return TRUE; 262 } 263 gfan::deinitializeCddlibIfRequired(); 245 264 res->rtyp = INT_CMD; 246 265 res->data = (char*) (long) b; … … 257 276 if ((u != NULL) && (u->Typ() == polytopeID)) 258 277 { 278 gfan::initializeCddlibIfRequired(); 259 279 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 260 280 bool b; … … 267 287 catch (const std::exception& ex) 268 288 { 269 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 270 return TRUE; 271 } 289 gfan::deinitializeCddlibIfRequired(); 290 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 291 return TRUE; 292 } 293 gfan::deinitializeCddlibIfRequired(); 272 294 res->rtyp = INT_CMD; 273 295 res->data = (char*) (long) b; … … 284 306 if ((u != NULL) && (u->Typ() == polytopeID)) 285 307 { 308 gfan::initializeCddlibIfRequired(); 286 309 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 287 310 bool b; … … 294 317 catch (const std::exception& ex) 295 318 { 296 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 297 return TRUE; 298 } 319 gfan::deinitializeCddlibIfRequired(); 320 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 321 return TRUE; 322 } 323 gfan::deinitializeCddlibIfRequired(); 299 324 res->rtyp = INT_CMD; 300 325 res->data = (char*) (long) b; … … 311 336 if ((u != NULL) && (u->Typ() == polytopeID)) 312 337 { 338 gfan::initializeCddlibIfRequired(); 313 339 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 314 340 int gi; … … 327 353 { 328 354 delete p; 355 gfan::deinitializeCddlibIfRequired(); 329 356 WerrorS("gorensteinIndex: input polytope not gorenstein"); 330 357 return TRUE; … … 333 360 catch (const std::exception& ex) 334 361 { 335 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 336 return TRUE; 337 } 362 gfan::deinitializeCddlibIfRequired(); 363 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 364 return TRUE; 365 } 366 gfan::deinitializeCddlibIfRequired(); 338 367 if (!ok) 339 368 { … … 355 384 if ((u != NULL) && (u->Typ() == polytopeID)) 356 385 { 386 gfan::initializeCddlibIfRequired(); 357 387 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 358 388 intvec* gv; … … 371 401 { 372 402 delete p; 403 gfan::deinitializeCddlibIfRequired(); 373 404 WerrorS("gorensteinVector: input polytope not gorenstein"); 374 405 return TRUE; … … 377 408 catch (const std::exception& ex) 378 409 { 379 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 380 return TRUE; 381 } 410 gfan::deinitializeCddlibIfRequired(); 411 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 412 return TRUE; 413 } 414 gfan::deinitializeCddlibIfRequired(); 382 415 if (!ok) 383 416 { … … 399 432 if ((u != NULL) && (u->Typ() == polytopeID)) 400 433 { 434 gfan::initializeCddlibIfRequired(); 401 435 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 402 436 bool b; … … 409 443 catch (const std::exception& ex) 410 444 { 411 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 412 return TRUE; 413 } 445 gfan::deinitializeCddlibIfRequired(); 446 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 447 return TRUE; 448 } 449 gfan::deinitializeCddlibIfRequired(); 414 450 res->rtyp = INT_CMD; 415 451 res->data = (char*) (long) b; … … 426 462 if ((u != NULL) && (u->Typ() == polytopeID)) 427 463 { 464 gfan::initializeCddlibIfRequired(); 428 465 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 429 466 bool b; … … 436 473 catch (const std::exception& ex) 437 474 { 438 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 439 return TRUE; 440 } 475 gfan::deinitializeCddlibIfRequired(); 476 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 477 return TRUE; 478 } 479 gfan::deinitializeCddlibIfRequired(); 441 480 res->rtyp = INT_CMD; 442 481 res->data = (char*) (long) b; … … 453 492 if ((u != NULL) && (u->Typ() == polytopeID)) 454 493 { 494 gfan::initializeCddlibIfRequired(); 455 495 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 456 496 bool b; … … 463 503 catch (const std::exception& ex) 464 504 { 465 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 466 return TRUE; 467 } 505 gfan::deinitializeCddlibIfRequired(); 506 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 507 return TRUE; 508 } 509 gfan::deinitializeCddlibIfRequired(); 468 510 res->rtyp = INT_CMD; 469 511 res->data = (char*) (long) b; … … 480 522 if ((u != NULL) && (u->Typ() == polytopeID)) 481 523 { 524 gfan::initializeCddlibIfRequired(); 482 525 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 483 526 int lv; … … 492 535 catch (const std::exception& ex) 493 536 { 494 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 495 return TRUE; 496 } 537 gfan::deinitializeCddlibIfRequired(); 538 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 539 return TRUE; 540 } 541 gfan::deinitializeCddlibIfRequired(); 497 542 if (!ok) 498 543 { … … 514 559 if ((u != NULL) && (u->Typ() == polytopeID)) 515 560 { 561 gfan::initializeCddlibIfRequired(); 516 562 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 517 563 int ld; … … 526 572 catch (const std::exception& ex) 527 573 { 528 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 529 return TRUE; 530 } 574 gfan::deinitializeCddlibIfRequired(); 575 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 576 return TRUE; 577 } 578 gfan::deinitializeCddlibIfRequired(); 531 579 if (!ok) 532 580 { … … 548 596 if ((u != NULL) && (u->Typ() == polytopeID)) 549 597 { 598 gfan::initializeCddlibIfRequired(); 550 599 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 551 600 int lc; … … 560 609 catch (const std::exception& ex) 561 610 { 562 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 563 return TRUE; 564 } 611 gfan::deinitializeCddlibIfRequired(); 612 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 613 return TRUE; 614 } 615 gfan::deinitializeCddlibIfRequired(); 565 616 if (!ok) 566 617 { … … 582 633 if ((u != NULL) && (u->Typ() == polytopeID)) 583 634 { 635 gfan::initializeCddlibIfRequired(); 584 636 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 585 637 intvec* ec; … … 594 646 catch (const std::exception& ex) 595 647 { 596 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 597 return TRUE; 598 } 648 gfan::deinitializeCddlibIfRequired(); 649 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 650 return TRUE; 651 } 652 gfan::deinitializeCddlibIfRequired(); 599 653 if (!ok) 600 654 { … … 616 670 if ((u != NULL) && (u->Typ() == polytopeID)) 617 671 { 672 gfan::initializeCddlibIfRequired(); 618 673 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 619 674 intvec* hv; … … 628 683 catch (const std::exception& ex) 629 684 { 630 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 631 return TRUE; 632 } 685 gfan::deinitializeCddlibIfRequired(); 686 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 687 return TRUE; 688 } 689 gfan::deinitializeCddlibIfRequired(); 633 690 if (!ok) 634 691 { … … 650 707 if ((u != NULL) && (u->Typ() == polytopeID)) 651 708 { 709 gfan::initializeCddlibIfRequired(); 652 710 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 653 711 intvec* hv; … … 662 720 catch (const std::exception& ex) 663 721 { 664 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 665 return TRUE; 666 } 722 gfan::deinitializeCddlibIfRequired(); 723 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 724 return TRUE; 725 } 726 gfan::deinitializeCddlibIfRequired(); 667 727 if (!ok) 668 728 { … … 684 744 if ((u != NULL) && (u->Typ() == polytopeID)) 685 745 { 746 gfan::initializeCddlibIfRequired(); 686 747 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 687 748 intvec* hv; … … 696 757 catch (const std::exception& ex) 697 758 { 698 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 699 return TRUE; 700 } 759 gfan::deinitializeCddlibIfRequired(); 760 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 761 return TRUE; 762 } 763 gfan::deinitializeCddlibIfRequired(); 701 764 if (!ok) 702 765 { … … 718 781 if ((u != NULL) && (u->Typ() == polytopeID)) 719 782 { 783 gfan::initializeCddlibIfRequired(); 720 784 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 721 785 bool b; … … 728 792 catch (const std::exception& ex) 729 793 { 730 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 731 return TRUE; 732 } 794 gfan::deinitializeCddlibIfRequired(); 795 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 796 return TRUE; 797 } 798 gfan::deinitializeCddlibIfRequired(); 733 799 res->rtyp = INT_CMD; 734 800 res->data = (char*) (long) b; … … 745 811 if ((u != NULL) && (u->Typ() == polytopeID)) 746 812 { 813 gfan::initializeCddlibIfRequired(); 747 814 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 748 815 intvec* fw; … … 757 824 catch (const std::exception& ex) 758 825 { 759 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 760 return TRUE; 761 } 826 gfan::deinitializeCddlibIfRequired(); 827 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 828 return TRUE; 829 } 830 gfan::deinitializeCddlibIfRequired(); 762 831 if (!ok) 763 832 { … … 779 848 if ((u != NULL) && (u->Typ() == polytopeID)) 780 849 { 850 gfan::initializeCddlibIfRequired(); 781 851 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 782 852 int fw; … … 791 861 catch (const std::exception& ex) 792 862 { 793 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 794 return TRUE; 795 } 863 gfan::deinitializeCddlibIfRequired(); 864 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 865 return TRUE; 866 } 867 gfan::deinitializeCddlibIfRequired(); 796 868 if (!ok) 797 869 { … … 813 885 if ((u != NULL) && (u->Typ() == polytopeID)) 814 886 { 887 gfan::initializeCddlibIfRequired(); 815 888 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 816 889 intvec* ld; … … 825 898 catch (const std::exception& ex) 826 899 { 827 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 828 return TRUE; 829 } 900 gfan::deinitializeCddlibIfRequired(); 901 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 902 return TRUE; 903 } 904 gfan::deinitializeCddlibIfRequired(); 830 905 if (!ok) 831 906 { … … 847 922 if ((u != NULL) && (u->Typ() == polytopeID)) 848 923 { 924 gfan::initializeCddlibIfRequired(); 849 925 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 850 926 bool b; … … 857 933 catch (const std::exception& ex) 858 934 { 859 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 860 return TRUE; 861 } 935 gfan::deinitializeCddlibIfRequired(); 936 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 937 return TRUE; 938 } 939 gfan::deinitializeCddlibIfRequired(); 862 940 res->rtyp = INT_CMD; 863 941 res->data = (char*) (long) b; … … 874 952 if ((u != NULL) && (u->Typ() == coneID)) 875 953 { 954 gfan::initializeCddlibIfRequired(); 876 955 gfan::ZCone* zc = (gfan::ZCone*)u->Data(); 877 956 bool b; … … 884 963 catch (const std::exception& ex) 885 964 { 886 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 887 return TRUE; 888 } 965 gfan::deinitializeCddlibIfRequired(); 966 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 967 return TRUE; 968 } 969 gfan::deinitializeCddlibIfRequired(); 889 970 res->rtyp = INT_CMD; 890 971 res->data = (char*) (long) b; … … 893 974 if ((u != NULL) && (u->Typ() == polytopeID)) 894 975 { 976 gfan::initializeCddlibIfRequired(); 895 977 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 896 978 bool b; … … 903 985 catch (const std::exception& ex) 904 986 { 905 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 906 return TRUE; 907 } 987 gfan::deinitializeCddlibIfRequired(); 988 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 989 return TRUE; 990 } 991 gfan::deinitializeCddlibIfRequired(); 908 992 res->rtyp = INT_CMD; 909 993 res->data = (char*) (long) b; … … 912 996 if ((u != NULL) && (u->Typ() == fanID)) 913 997 { 998 gfan::initializeCddlibIfRequired(); 914 999 gfan::ZFan* zf = (gfan::ZFan*)u->Data(); 915 1000 bool b; … … 922 1007 catch (const std::exception& ex) 923 1008 { 924 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 925 return TRUE; 926 } 1009 gfan::deinitializeCddlibIfRequired(); 1010 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1011 return TRUE; 1012 } 1013 gfan::deinitializeCddlibIfRequired(); 927 1014 res->rtyp = INT_CMD; 928 1015 res->data = (char*) (long) b; … … 939 1026 if ((u != NULL) && (u->Typ() == polytopeID)) 940 1027 { 1028 gfan::initializeCddlibIfRequired(); 941 1029 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 942 1030 bool b; … … 949 1037 catch (const std::exception& ex) 950 1038 { 951 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 952 return TRUE; 953 } 1039 gfan::deinitializeCddlibIfRequired(); 1040 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1041 return TRUE; 1042 } 1043 gfan::deinitializeCddlibIfRequired(); 954 1044 res->rtyp = INT_CMD; 955 1045 res->data = (char*) (long) b; … … 966 1056 if ((u != NULL) && (u->Typ() == polytopeID)) 967 1057 { 1058 gfan::initializeCddlibIfRequired(); 968 1059 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 969 1060 intvec* iv; … … 984 1075 catch (const std::exception& ex) 985 1076 { 986 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 987 return TRUE; 988 } 1077 gfan::deinitializeCddlibIfRequired(); 1078 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1079 return TRUE; 1080 } 1081 gfan::deinitializeCddlibIfRequired(); 989 1082 if (!ok) 990 1083 { … … 1006 1099 if ((u != NULL) && (u->Typ() == polytopeID)) 1007 1100 { 1101 gfan::initializeCddlibIfRequired(); 1008 1102 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1009 1103 int n; … … 1018 1112 catch (const std::exception& ex) 1019 1113 { 1020 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1021 return TRUE; 1022 } 1114 gfan::deinitializeCddlibIfRequired(); 1115 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1116 return TRUE; 1117 } 1118 gfan::deinitializeCddlibIfRequired(); 1023 1119 if (!ok) 1024 1120 { … … 1040 1136 if ((u != NULL) && (u->Typ() == polytopeID)) 1041 1137 { 1138 gfan::initializeCddlibIfRequired(); 1042 1139 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1043 1140 intvec* iv; … … 1052 1149 catch (const std::exception& ex) 1053 1150 { 1054 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1055 return TRUE; 1056 } 1151 gfan::deinitializeCddlibIfRequired(); 1152 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1153 return TRUE; 1154 } 1155 gfan::deinitializeCddlibIfRequired(); 1057 1156 if (!ok) 1058 1157 { … … 1074 1173 if ((u != NULL) && (u->Typ() == polytopeID)) 1075 1174 { 1175 gfan::initializeCddlibIfRequired(); 1076 1176 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1077 1177 int n; … … 1086 1186 catch (const std::exception& ex) 1087 1187 { 1088 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1089 return TRUE; 1090 } 1188 gfan::deinitializeCddlibIfRequired(); 1189 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1190 return TRUE; 1191 } 1192 gfan::deinitializeCddlibIfRequired(); 1091 1193 if (!ok) 1092 1194 { … … 1108 1210 if ((u != NULL) && (u->Typ() == polytopeID)) 1109 1211 { 1212 gfan::initializeCddlibIfRequired(); 1110 1213 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1111 1214 intvec* iv; … … 1120 1223 catch (const std::exception& ex) 1121 1224 { 1122 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1123 return TRUE; 1124 } 1225 gfan::deinitializeCddlibIfRequired(); 1226 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1227 return TRUE; 1228 } 1229 gfan::deinitializeCddlibIfRequired(); 1125 1230 if (!ok) 1126 1231 { … … 1142 1247 if ((u != NULL) && (u->Typ() == polytopeID)) 1143 1248 { 1249 gfan::initializeCddlibIfRequired(); 1144 1250 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1145 1251 int n; … … 1154 1260 catch (const std::exception& ex) 1155 1261 { 1156 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1157 return TRUE; 1158 } 1262 gfan::deinitializeCddlibIfRequired(); 1263 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1264 return TRUE; 1265 } 1266 gfan::deinitializeCddlibIfRequired(); 1159 1267 if (!ok) 1160 1268 { … … 1176 1284 if ((u != NULL) && (u->Typ() == coneID)) 1177 1285 { 1286 gfan::initializeCddlibIfRequired(); 1178 1287 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1179 1288 intvec* iv; … … 1194 1303 catch (const std::exception& ex) 1195 1304 { 1196 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1197 return TRUE; 1198 } 1305 gfan::deinitializeCddlibIfRequired(); 1306 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1307 return TRUE; 1308 } 1309 gfan::deinitializeCddlibIfRequired(); 1199 1310 if (!ok) 1200 1311 { … … 1216 1327 if ((u != NULL) && (u->Typ() == coneID)) 1217 1328 { 1329 gfan::initializeCddlibIfRequired(); 1218 1330 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1219 1331 int n; … … 1228 1340 catch (const std::exception& ex) 1229 1341 { 1230 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1231 return TRUE; 1232 } 1342 gfan::deinitializeCddlibIfRequired(); 1343 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1344 return TRUE; 1345 } 1346 gfan::deinitializeCddlibIfRequired(); 1233 1347 if (!ok) 1234 1348 { … … 1253 1367 if ((v != NULL) && (v->Typ() == polytopeID)) 1254 1368 { 1369 gfan::initializeCddlibIfRequired(); 1255 1370 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1256 1371 gfan::ZCone* zq = (gfan::ZCone*)v->Data(); … … 1268 1383 catch (const std::exception& ex) 1269 1384 { 1385 gfan::deinitializeCddlibIfRequired(); 1270 1386 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1271 1387 return TRUE; 1272 1388 } 1389 gfan::deinitializeCddlibIfRequired(); 1273 1390 res->rtyp = polytopeID; 1274 1391 res->data = (char*) ms; … … 1277 1394 if ((v != NULL) && (v->Typ() == coneID)) 1278 1395 { 1396 gfan::initializeCddlibIfRequired(); 1279 1397 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1280 1398 gfan::ZCone* zc = (gfan::ZCone*)v->Data(); … … 1293 1411 catch (const std::exception& ex) 1294 1412 { 1413 delete zq; 1414 gfan::deinitializeCddlibIfRequired(); 1295 1415 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1296 delete zq;1297 1416 return TRUE; 1298 1417 } 1418 delete zq; 1419 gfan::deinitializeCddlibIfRequired(); 1299 1420 res->rtyp = polytopeID; 1300 1421 res->data = (char*) ms; 1301 delete zq;1302 1422 return FALSE; 1303 1423 } … … 1308 1428 if ((v != NULL) && (v->Typ() == polytopeID)) 1309 1429 { 1430 gfan::initializeCddlibIfRequired(); 1310 1431 gfan::ZCone* zc = (gfan::ZCone*)u->Data(); 1311 1432 gfan::ZCone* zp = new gfan::ZCone(liftUp(*zc)); … … 1324 1445 catch (const std::exception& ex) 1325 1446 { 1447 delete zp; 1448 gfan::deinitializeCddlibIfRequired(); 1326 1449 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1327 delete zp;1328 1450 return TRUE; 1329 1451 } 1452 delete zp; 1453 gfan::deinitializeCddlibIfRequired(); 1330 1454 res->rtyp = polytopeID; 1331 1455 res->data = (char*) ms; 1332 delete zp;1333 1456 return FALSE; 1334 1457 } 1335 1458 if ((v != NULL) && (v->Typ() == coneID)) 1336 1459 { 1460 gfan::initializeCddlibIfRequired(); 1337 1461 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1338 1462 gfan::ZCone* zq = (gfan::ZCone*)v->Data(); … … 1351 1475 { 1352 1476 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1477 gfan::deinitializeCddlibIfRequired(); 1353 1478 return TRUE; 1354 1479 } 1480 gfan::deinitializeCddlibIfRequired(); 1355 1481 res->rtyp = coneID; 1356 1482 res->data = (char*) ms; … … 1389 1515 if ((v != NULL) && (v->Typ() == INTVEC_CMD)) 1390 1516 { 1517 gfan::initializeCddlibIfRequired(); 1391 1518 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1392 1519 intvec* iv = (intvec*) v->Data(); … … 1407 1534 { 1408 1535 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1536 gfan::deinitializeCddlibIfRequired(); 1409 1537 return TRUE; 1410 1538 } 1539 gfan::deinitializeCddlibIfRequired(); 1411 1540 if (!ok) 1412 1541 { … … 1432 1561 if ((v != NULL) && (v->Typ() == INTVEC_CMD)) 1433 1562 { 1563 gfan::initializeCddlibIfRequired(); 1434 1564 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1435 1565 intvec* iv = (intvec*) v->Data(); … … 1450 1580 { 1451 1581 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1582 gfan::deinitializeCddlibIfRequired(); 1452 1583 return TRUE; 1453 1584 } 1585 gfan::deinitializeCddlibIfRequired(); 1454 1586 if (!ok) 1455 1587 { … … 1475 1607 if ((v != NULL) && (v->Typ() == INTVEC_CMD)) 1476 1608 { 1609 gfan::initializeCddlibIfRequired(); 1477 1610 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1478 1611 intvec* iv = (intvec*) v->Data(); … … 1495 1628 { 1496 1629 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1630 gfan::deinitializeCddlibIfRequired(); 1497 1631 return TRUE; 1498 1632 } 1633 gfan::deinitializeCddlibIfRequired(); 1499 1634 if (!ok) 1500 1635 { … … 1522 1657 if ((v != NULL) && (v->Typ() == INTVEC_CMD)) 1523 1658 { 1659 gfan::initializeCddlibIfRequired(); 1524 1660 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1525 1661 intvec* iv = (intvec*) v->Data(); … … 1542 1678 { 1543 1679 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1680 gfan::deinitializeCddlibIfRequired(); 1544 1681 return TRUE; 1545 1682 } 1683 gfan::deinitializeCddlibIfRequired(); 1546 1684 if (!ok) 1547 1685 { … … 1567 1705 if ((u != NULL) && (u->Typ() == polytopeID)) 1568 1706 { 1707 gfan::initializeCddlibIfRequired(); 1569 1708 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1570 1709 try … … 1577 1716 { 1578 1717 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1579 return TRUE; 1580 } 1718 gfan::deinitializeCddlibIfRequired(); 1719 return TRUE; 1720 } 1721 gfan::deinitializeCddlibIfRequired(); 1581 1722 res->rtyp = NONE; 1582 1723 res->data = NULL; … … 1585 1726 if ((u != NULL) && (u->Typ() == fanID)) 1586 1727 { 1728 gfan::initializeCddlibIfRequired(); 1587 1729 gfan::ZFan* zf = (gfan::ZFan*)u->Data(); 1588 1730 try … … 1593 1735 catch (const std::exception& ex) 1594 1736 { 1595 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1596 return TRUE; 1597 } 1737 gfan::deinitializeCddlibIfRequired(); 1738 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1739 return TRUE; 1740 } 1741 gfan::deinitializeCddlibIfRequired(); 1598 1742 res->rtyp = NONE; 1599 1743 res->data = NULL; … … 1609 1753 if ((u != NULL) && (u->Typ() == polytopeID)) 1610 1754 { 1755 gfan::initializeCddlibIfRequired(); 1611 1756 gfan::ZCone* zp = (gfan::ZCone*)u->Data(); 1612 1757 gfan::ZFan* zf = new gfan::ZFan(0); … … 1621 1766 catch (const std::exception& ex) 1622 1767 { 1623 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1624 return TRUE; 1625 } 1768 gfan::deinitializeCddlibIfRequired(); 1769 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1770 return TRUE; 1771 } 1772 gfan::deinitializeCddlibIfRequired(); 1626 1773 res->rtyp = fanID; 1627 1774 res->data = (char*) zf; … … 1637 1784 if ((u != NULL) && (u->Typ() == INTMAT_CMD)) 1638 1785 { 1786 gfan::initializeCddlibIfRequired(); 1639 1787 polymake::perl::Object pc("Cone<Rational>"); 1640 1788 intvec* hlines = (intvec*) u->Data(); // these will are half lines in the cone … … 1657 1805 } 1658 1806 gfan::ZCone* zc = PmCone2ZCone(&pc); 1807 gfan::deinitializeCddlibIfRequired(); 1659 1808 res->rtyp = coneID; 1660 1809 res->data = (char*) zc; … … 1671 1820 if ((u != NULL) && (u->Typ() == INTMAT_CMD)) 1672 1821 { 1822 gfan::initializeCddlibIfRequired(); 1673 1823 polymake::perl::Object pp("Polytope<Rational>"); 1674 1824 intvec* points = (intvec*) u->Data(); // these will be vertices of or points in the polytope … … 1690 1840 1691 1841 gfan::ZCone* zp = PmPolytope2ZPolytope(&pp); 1842 gfan::deinitializeCddlibIfRequired(); 1692 1843 res->rtyp = polytopeID; 1693 1844 res->data = (char*) zp; … … 1704 1855 if ((u != NULL) && (u->Typ() == polytopeID)) 1705 1856 { 1857 gfan::initializeCddlibIfRequired(); 1706 1858 gfan::ZCone* zp = (gfan::ZCone*) u->Data(); 1707 1859 lists output=(lists)omAllocBin(slists_bin); output->Init(2); … … 1723 1875 catch (const std::exception& ex) 1724 1876 { 1725 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1726 return TRUE; 1727 } 1877 gfan::deinitializeCddlibIfRequired(); 1878 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1879 return TRUE; 1880 } 1881 gfan::deinitializeCddlibIfRequired(); 1728 1882 res->rtyp = LIST_CMD; 1729 1883 res->data = (void*) output; … … 1740 1894 if ((u != NULL) && (u->Typ() == polytopeID)) 1741 1895 { 1896 gfan::initializeCddlibIfRequired(); 1742 1897 gfan::ZCone* zp = (gfan::ZCone*) u->Data(); 1743 1898 lists output=(lists)omAllocBin(slists_bin); output->Init(2); … … 1759 1914 catch (const std::exception& ex) 1760 1915 { 1761 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1762 return TRUE; 1763 } 1916 gfan::deinitializeCddlibIfRequired(); 1917 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1918 return TRUE; 1919 } 1920 gfan::deinitializeCddlibIfRequired(); 1764 1921 res->rtyp = LIST_CMD; 1765 1922 res->data = (void*) output; -
gfanlib/gfanlib_zcone.cpp
r0091f5 r1082b9 13 13 14 14 #include <config.h> 15 extern "C" 16 { 15 17 #ifdef HAVE_CDD_SETOPER_H 16 18 #include <cdd/setoper.h> … … 25 27 #endif //HAVE_CDDLIB_SETOPER_H 26 28 #endif //HAVE_CDD_SETOPER_H 27 29 } 30 extern "C" time_t dd_statStartTime; /*cddlib*/ 28 31 29 32 namespace gfan{ … … 34 37 void initializeCddlibIfRequired() // calling this frequently will cause memory leaks because deinitialisation is not possible with old versions of cddlib. 35 38 { 39 if (dd_statStartTime==0) 40 { 36 41 dd_set_global_constants(); 42 printf("dd_set_global_constansts\n"); 43 } 37 44 } 38 45 void deinitializeCddlibIfRequired() 39 46 { 40 47 #ifdef HAVE_DD_FREE_GLOBAL_CONSTANTS 41 dd_free_global_constants();48 // dd_free_global_constants(); 42 49 #endif 43 50 }
Note: See TracChangeset
for help on using the changeset viewer.