1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642
|
/* Implementation of the C interface: variables and non-inline functions.
Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
This file is part of the Parma Polyhedra Library (PPL).
The PPL is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
The PPL is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
For the most up-to-date information see the Parma Polyhedra Library
site: http://bugseng.com/products/ppl/ . */
/* Interface for Coefficient. */
#include "ppl_c_implementation_common_defs.hh"
namespace Parma_Polyhedra_Library {
namespace Interfaces {
namespace C {
error_handler_type user_error_handler = 0;
extern "C" const char*
c_variable_default_output_function(ppl_dimension_type var) {
#if PPL_SIZEOF_SIZE_T == PPL_SIZEOF_INT
# define FORMAT "%u"
# define CONVERSION (unsigned)
#elif PPL_SIZEOF_SIZE_T == PPL_SIZEOF_LONG
# define FORMAT "%lu"
# define CONVERSION (unsigned long)
#elif PPL_SIZEOF_SIZE_T == PPL_SIZEOF_LONG_LONG
# define FORMAT "%llu"
# define CONVERSION (unsigned long long)
#else
# error "Unsupported definition for `size_t'."
#endif
// On a 64-bits architecture, `var' will not be more than 2^64-1,
// (2^64-1)/26 is written with 18 decimal digits, plus one letter,
// plus one terminator makes 20.
#if defined(ULLONG_MAX) && ULLONG_MAX > 18446744073709551615ULL
# error "Please enlarge the buffer in the following line."
#endif
static char buffer[20];
buffer[0] = static_cast<char>('A' + var % 26);
if (ppl_dimension_type i = var / 26) {
int r = sprintf(buffer+1, FORMAT, CONVERSION i);
if (r < 0)
return 0;
else if (r >= 19) {
errno = ERANGE;
return 0;
}
}
else
buffer[1] = '\0';
return buffer;
}
// Holds a pointer to the C current output function.
ppl_io_variable_output_function_type* c_variable_output_function;
void
cxx_Variable_output_function(std::ostream& s, const Variable v) {
const char* b = c_variable_output_function(v.id());
if (b == 0)
// Something went wrong in the client's output function.
// Client code will know what to do: we do nothing.
return;
s << b;
}
extern "C" typedef const char*
c_variable_output_function_type(ppl_dimension_type var);
// Holds a pointer to the C++ saved output function.
Variable::output_function_type* saved_cxx_Variable_output_function;
void
notify_error(enum ppl_enum_error_code code, const char* description) {
if (user_error_handler != 0)
user_error_handler(code, description);
}
Parma_Polyhedra_Library::Watchdog* p_timeout_object = 0;
typedef
Parma_Polyhedra_Library::Threshold_Watcher
<Parma_Polyhedra_Library::Weightwatch_Traits> Weightwatch;
Weightwatch* p_deterministic_timeout_object = 0;
void
reset_timeout() {
if (p_timeout_object != 0) {
delete p_timeout_object;
p_timeout_object = 0;
abandon_expensive_computations = 0;
}
}
void
reset_deterministic_timeout() {
if (p_deterministic_timeout_object != 0) {
delete p_deterministic_timeout_object;
p_deterministic_timeout_object = 0;
abandon_expensive_computations = 0;
}
}
} // namespace C
} // namespace Interfaces
} // namespace Parma_Polyhedra_Library
using namespace Parma_Polyhedra_Library;
using namespace Parma_Polyhedra_Library::Interfaces::C;
unsigned int PPL_POLY_CON_RELATION_IS_DISJOINT;
unsigned int PPL_POLY_CON_RELATION_STRICTLY_INTERSECTS;
unsigned int PPL_POLY_CON_RELATION_IS_INCLUDED;
unsigned int PPL_POLY_CON_RELATION_SATURATES;
unsigned int PPL_POLY_GEN_RELATION_SUBSUMES;
unsigned int PPL_COMPLEXITY_CLASS_POLYNOMIAL;
unsigned int PPL_COMPLEXITY_CLASS_SIMPLEX;
unsigned int PPL_COMPLEXITY_CLASS_ANY;
int PPL_MIP_PROBLEM_STATUS_UNFEASIBLE;
int PPL_MIP_PROBLEM_STATUS_UNBOUNDED;
int PPL_MIP_PROBLEM_STATUS_OPTIMIZED;
int PPL_MIP_PROBLEM_CONTROL_PARAMETER_NAME_PRICING;
int PPL_MIP_PROBLEM_CONTROL_PARAMETER_PRICING_STEEPEST_EDGE_FLOAT;
int PPL_MIP_PROBLEM_CONTROL_PARAMETER_PRICING_STEEPEST_EDGE_EXACT;
int PPL_MIP_PROBLEM_CONTROL_PARAMETER_PRICING_TEXTBOOK;
int PPL_PIP_PROBLEM_STATUS_UNFEASIBLE;
int PPL_PIP_PROBLEM_STATUS_OPTIMIZED;
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_NAME_CUTTING_STRATEGY;
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_CUTTING_STRATEGY_FIRST;
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_CUTTING_STRATEGY_DEEPEST;
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_CUTTING_STRATEGY_ALL;
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_NAME_PIVOT_ROW_STRATEGY;
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_PIVOT_ROW_STRATEGY_FIRST;
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_PIVOT_ROW_STRATEGY_MAX_COLUMN;
int PPL_OPTIMIZATION_MODE_MINIMIZATION;
int PPL_OPTIMIZATION_MODE_MAXIMIZATION;
int
ppl_set_error_handler(error_handler_type h) {
user_error_handler = h;
return 0;
}
int
ppl_initialize(void) try {
initialize();
PPL_POLY_CON_RELATION_IS_DISJOINT
= Poly_Con_Relation::is_disjoint().get_flags();
PPL_POLY_CON_RELATION_STRICTLY_INTERSECTS
= Poly_Con_Relation::strictly_intersects().get_flags();
PPL_POLY_CON_RELATION_IS_INCLUDED
= Poly_Con_Relation::is_included().get_flags();
PPL_POLY_CON_RELATION_SATURATES
= Poly_Con_Relation::saturates().get_flags();
PPL_POLY_GEN_RELATION_SUBSUMES
= Poly_Gen_Relation::subsumes().get_flags();
PPL_COMPLEXITY_CLASS_POLYNOMIAL = POLYNOMIAL_COMPLEXITY;
PPL_COMPLEXITY_CLASS_SIMPLEX = SIMPLEX_COMPLEXITY;
PPL_COMPLEXITY_CLASS_ANY = ANY_COMPLEXITY;
PPL_MIP_PROBLEM_STATUS_UNFEASIBLE = UNFEASIBLE_MIP_PROBLEM;
PPL_MIP_PROBLEM_STATUS_UNBOUNDED = UNBOUNDED_MIP_PROBLEM;
PPL_MIP_PROBLEM_STATUS_OPTIMIZED = OPTIMIZED_MIP_PROBLEM;
PPL_MIP_PROBLEM_CONTROL_PARAMETER_NAME_PRICING
= MIP_Problem::PRICING;
PPL_MIP_PROBLEM_CONTROL_PARAMETER_PRICING_STEEPEST_EDGE_FLOAT
= MIP_Problem::PRICING_STEEPEST_EDGE_FLOAT;
PPL_MIP_PROBLEM_CONTROL_PARAMETER_PRICING_STEEPEST_EDGE_EXACT
= MIP_Problem::PRICING_STEEPEST_EDGE_EXACT;
PPL_MIP_PROBLEM_CONTROL_PARAMETER_PRICING_TEXTBOOK
= MIP_Problem::PRICING_TEXTBOOK;
PPL_PIP_PROBLEM_STATUS_UNFEASIBLE = UNFEASIBLE_PIP_PROBLEM;
PPL_PIP_PROBLEM_STATUS_OPTIMIZED = OPTIMIZED_PIP_PROBLEM;
PPL_PIP_PROBLEM_CONTROL_PARAMETER_NAME_CUTTING_STRATEGY
= PIP_Problem::CUTTING_STRATEGY;
PPL_PIP_PROBLEM_CONTROL_PARAMETER_CUTTING_STRATEGY_FIRST
= PIP_Problem::CUTTING_STRATEGY_FIRST;
PPL_PIP_PROBLEM_CONTROL_PARAMETER_CUTTING_STRATEGY_DEEPEST
= PIP_Problem::CUTTING_STRATEGY_DEEPEST;
PPL_PIP_PROBLEM_CONTROL_PARAMETER_CUTTING_STRATEGY_ALL
= PIP_Problem::CUTTING_STRATEGY_ALL;
PPL_PIP_PROBLEM_CONTROL_PARAMETER_NAME_PIVOT_ROW_STRATEGY
= PIP_Problem::PIVOT_ROW_STRATEGY;
PPL_PIP_PROBLEM_CONTROL_PARAMETER_PIVOT_ROW_STRATEGY_FIRST
= PIP_Problem::PIVOT_ROW_STRATEGY_FIRST;
PPL_PIP_PROBLEM_CONTROL_PARAMETER_PIVOT_ROW_STRATEGY_MAX_COLUMN
= PIP_Problem::PIVOT_ROW_STRATEGY_MAX_COLUMN;
PPL_OPTIMIZATION_MODE_MINIMIZATION = MINIMIZATION;
PPL_OPTIMIZATION_MODE_MAXIMIZATION = MAXIMIZATION;
c_variable_output_function = c_variable_default_output_function;
saved_cxx_Variable_output_function = Variable::get_output_function();
Variable::set_output_function(cxx_Variable_output_function);
return 0;
}
CATCH_ALL
int
ppl_finalize(void) try {
Variable::set_output_function(saved_cxx_Variable_output_function);
finalize();
return 0;
}
CATCH_ALL
int
ppl_set_timeout(unsigned csecs) try {
// In case a timeout was already set.
reset_timeout();
static timeout_exception e;
using Parma_Polyhedra_Library::Watchdog;
p_timeout_object = new Watchdog(csecs, abandon_expensive_computations, e);
return 0;
}
CATCH_ALL
int
ppl_reset_timeout(void) try {
reset_timeout();
return 0;
}
CATCH_ALL
int
ppl_set_deterministic_timeout(unsigned long unscaled_weight,
unsigned scale) try {
// In case a deterministic timeout was already set.
reset_deterministic_timeout();
static timeout_exception e;
typedef Parma_Polyhedra_Library::Weightwatch_Traits Traits;
p_deterministic_timeout_object
= new Weightwatch(Traits::compute_delta(unscaled_weight, scale),
abandon_expensive_computations, e);
return 0;
}
CATCH_ALL
int
ppl_reset_deterministic_timeout(void) try {
reset_deterministic_timeout();
return 0;
}
CATCH_ALL
int
ppl_set_rounding_for_PPL(void) try {
set_rounding_for_PPL();
return 0;
}
CATCH_ALL
int
ppl_restore_pre_PPL_rounding(void) try {
restore_pre_PPL_rounding();
return 0;
}
CATCH_ALL
int
ppl_irrational_precision(unsigned* p) try {
*p = irrational_precision();
return 0;
}
CATCH_ALL
int
ppl_set_irrational_precision(unsigned p) try {
set_irrational_precision(p);
return 0;
}
CATCH_ALL
int
ppl_version_major(void) try {
return static_cast<int>(version_major());
}
CATCH_ALL
int
ppl_version_minor(void) try {
return static_cast<int>(version_minor());
}
CATCH_ALL
int
ppl_version_revision(void) try {
return static_cast<int>(version_revision());
}
CATCH_ALL
int
ppl_version_beta(void) try {
return static_cast<int>(version_beta());
}
CATCH_ALL
int
ppl_version(const char** p) try {
// Note: use explicit qualification to avoid clashes on, e.g.,
// Solaris 2.9, where `version' is the name of an enum defined in
// math.h.
*p = Parma_Polyhedra_Library::version();
return 0;
}
CATCH_ALL
int
ppl_banner(const char** p) try {
*p = banner();
return 0;
}
CATCH_ALL
int
ppl_max_space_dimension(ppl_dimension_type* m) try {
*m = max_space_dimension();
return 0;
}
CATCH_ALL
int
ppl_not_a_dimension(ppl_dimension_type* m) try {
*m = not_a_dimension();
return 0;
}
CATCH_ALL
int
ppl_new_Coefficient(ppl_Coefficient_t* pc) try {
*pc = to_nonconst(new Coefficient(0));
return 0;
}
CATCH_ALL
int
ppl_new_Coefficient_from_mpz_t(ppl_Coefficient_t* pc, mpz_t z) try {
*pc = to_nonconst(new Coefficient(reinterpret_mpz_class(z)));
return 0;
}
CATCH_ALL
int
ppl_new_Coefficient_from_Coefficient(ppl_Coefficient_t* pc,
ppl_const_Coefficient_t c) try {
const Coefficient& cc = *to_const(c);
*pc = to_nonconst(new Coefficient(cc));
return 0;
}
CATCH_ALL
int
ppl_Coefficient_to_mpz_t(ppl_const_Coefficient_t c, mpz_t z) try {
assign_r(reinterpret_mpz_class(z), *to_const(c), ROUND_NOT_NEEDED);
return 0;
}
CATCH_ALL
int
ppl_delete_Coefficient(ppl_const_Coefficient_t c) try {
delete to_const(c);
return 0;
}
CATCH_ALL
int
ppl_assign_Coefficient_from_mpz_t(ppl_Coefficient_t dst, mpz_t z) try {
Coefficient& ddst = *to_nonconst(dst);
ddst = reinterpret_mpz_class(z);
return 0;
}
CATCH_ALL
int
ppl_assign_Coefficient_from_Coefficient(ppl_Coefficient_t dst,
ppl_const_Coefficient_t src) try {
const Coefficient& ssrc = *to_const(src);
Coefficient& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Coefficient_OK(ppl_const_Coefficient_t /* c */) try {
return 1;
}
CATCH_ALL
int
ppl_Coefficient_is_bounded(void) try {
return std::numeric_limits<Coefficient>::is_bounded ? 1 : 0;
}
CATCH_ALL
int
ppl_Coefficient_min(mpz_t min) try {
if (std::numeric_limits<Coefficient>::is_bounded) {
assign_r(reinterpret_mpz_class(min),
std::numeric_limits<Coefficient>::min(),
ROUND_NOT_NEEDED);
return 1;
}
else
return 0;
}
CATCH_ALL
int
ppl_Coefficient_max(mpz_t max) try {
if (std::numeric_limits<Coefficient>::is_bounded) {
assign_r(reinterpret_mpz_class(max),
std::numeric_limits<Coefficient>::max(),
ROUND_NOT_NEEDED);
return 1;
}
else
return 0;
}
CATCH_ALL
/* Interface for Linear_Expression. */
int
ppl_new_Linear_Expression(ppl_Linear_Expression_t* ple) try {
*ple = to_nonconst(new Linear_Expression());
return 0;
}
CATCH_ALL
int
ppl_new_Linear_Expression_with_dimension(ppl_Linear_Expression_t* ple,
ppl_dimension_type d) try {
*ple = to_nonconst(d == 0
? new Linear_Expression(0)
: new Linear_Expression(0*Variable(d-1)));
return 0;
}
CATCH_ALL
int
ppl_new_Linear_Expression_from_Linear_Expression
(ppl_Linear_Expression_t* ple, ppl_const_Linear_Expression_t le) try {
const Linear_Expression& lle = *to_const(le);
*ple = to_nonconst(new Linear_Expression(lle));
return 0;
}
CATCH_ALL
int
ppl_delete_Linear_Expression(ppl_const_Linear_Expression_t le) try {
delete to_const(le);
return 0;
}
CATCH_ALL
int
ppl_assign_Linear_Expression_from_Linear_Expression
(ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src) try {
const Linear_Expression& ssrc = *to_const(src);
Linear_Expression& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Linear_Expression_add_to_coefficient(ppl_Linear_Expression_t le,
ppl_dimension_type var,
ppl_const_Coefficient_t n) try {
Linear_Expression& lle = *to_nonconst(le);
const Coefficient& nn = *to_const(n);
add_mul_assign(lle, nn, Variable(var));
return 0;
}
CATCH_ALL
int
ppl_Linear_Expression_add_to_inhomogeneous(ppl_Linear_Expression_t le,
ppl_const_Coefficient_t n) try {
Linear_Expression& lle = *to_nonconst(le);
const Coefficient& nn = *to_const(n);
lle += nn;
return 0;
}
CATCH_ALL
int
ppl_add_Linear_Expression_to_Linear_Expression
(ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src) try {
Linear_Expression& ddst = *to_nonconst(dst);
const Linear_Expression& ssrc = *to_const(src);
ddst += ssrc;
return 0;
}
CATCH_ALL
int
ppl_subtract_Linear_Expression_from_Linear_Expression
(ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src) try {
Linear_Expression& ddst = *to_nonconst(dst);
const Linear_Expression& ssrc = *to_const(src);
ddst -= ssrc;
return 0;
}
CATCH_ALL
int
ppl_multiply_Linear_Expression_by_Coefficient(ppl_Linear_Expression_t le,
ppl_const_Coefficient_t n) try {
Linear_Expression& lle = *to_nonconst(le);
const Coefficient& nn = *to_const(n);
lle *= nn;
return 0;
}
CATCH_ALL
int
ppl_Linear_Expression_space_dimension(ppl_const_Linear_Expression_t le,
ppl_dimension_type* m) try {
*m = to_const(le)->space_dimension();
return 0;
}
CATCH_ALL
int
ppl_Linear_Expression_coefficient(ppl_const_Linear_Expression_t le,
ppl_dimension_type var,
ppl_Coefficient_t n) try {
const Linear_Expression& lle = *to_const(le);
Coefficient& nn = *to_nonconst(n);
nn = lle.coefficient(Variable(var));
return 0;
}
CATCH_ALL
int
ppl_Linear_Expression_inhomogeneous_term(ppl_const_Linear_Expression_t le,
ppl_Coefficient_t n) try {
const Linear_Expression& lle = *to_const(le);
Coefficient& nn = *to_nonconst(n);
nn = lle.inhomogeneous_term();
return 0;
}
CATCH_ALL
int
ppl_Linear_Expression_OK(ppl_const_Linear_Expression_t le) try {
return to_const(le)->OK() ? 1 : 0;
}
CATCH_ALL
int
ppl_Linear_Expression_is_zero(ppl_const_Linear_Expression_t le) try {
return to_const(le)->is_zero() ? 1 : 0;
}
CATCH_ALL
int
ppl_Linear_Expression_all_homogeneous_terms_are_zero
(ppl_const_Linear_Expression_t le) try {
return to_const(le)->all_homogeneous_terms_are_zero() ? 1 : 0;
}
CATCH_ALL
/* Interface for Constraint. */
int
ppl_new_Constraint(ppl_Constraint_t* pc,
ppl_const_Linear_Expression_t le,
enum ppl_enum_Constraint_Type t) try {
Constraint* ppc;
const Linear_Expression& lle = *to_const(le);
switch (t) {
case PPL_CONSTRAINT_TYPE_EQUAL:
ppc = new Constraint(lle == 0);
break;
case PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL:
ppc = new Constraint(lle >= 0);
break;
case PPL_CONSTRAINT_TYPE_GREATER_THAN:
ppc = new Constraint(lle > 0);
break;
case PPL_CONSTRAINT_TYPE_LESS_OR_EQUAL:
ppc = new Constraint(lle <= 0);
break;
case PPL_CONSTRAINT_TYPE_LESS_THAN:
ppc = new Constraint(lle < 0);
break;
default:
throw std::invalid_argument("ppl_new_Constraint(pc, le, t): "
"t invalid");
}
*pc = to_nonconst(ppc);
return 0;
}
CATCH_ALL
int
ppl_new_Constraint_zero_dim_false(ppl_Constraint_t* pc) try {
*pc = to_nonconst(new Constraint(Constraint::zero_dim_false()));
return 0;
}
CATCH_ALL
int
ppl_new_Constraint_zero_dim_positivity(ppl_Constraint_t* pc) try {
*pc = to_nonconst(new Constraint(Constraint::zero_dim_positivity()));
return 0;
}
CATCH_ALL
int
ppl_new_Constraint_from_Constraint(ppl_Constraint_t* pc,
ppl_const_Constraint_t c) try {
const Constraint& cc = *to_const(c);
*pc = to_nonconst(new Constraint(cc));
return 0;
}
CATCH_ALL
int
ppl_delete_Constraint(ppl_const_Constraint_t le) try {
delete to_const(le);
return 0;
}
CATCH_ALL
int
ppl_assign_Constraint_from_Constraint(ppl_Constraint_t dst,
ppl_const_Constraint_t src) try {
const Constraint& ssrc = *to_const(src);
Constraint& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Constraint_space_dimension(ppl_const_Constraint_t c,
ppl_dimension_type* m) try {
*m = to_const(c)->space_dimension();
return 0;
}
CATCH_ALL
int
ppl_Constraint_type(ppl_const_Constraint_t c) try {
switch (to_const(c)->type()) {
case Constraint::EQUALITY:
return PPL_CONSTRAINT_TYPE_EQUAL;
case Constraint::NONSTRICT_INEQUALITY:
return PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL;
case Constraint::STRICT_INEQUALITY:
return PPL_CONSTRAINT_TYPE_GREATER_THAN;
}
PPL_UNREACHABLE;
}
CATCH_ALL
int
ppl_Constraint_coefficient(ppl_const_Constraint_t c,
ppl_dimension_type var,
ppl_Coefficient_t n) try {
const Constraint& cc = *to_const(c);
Coefficient& nn = *to_nonconst(n);
nn = cc.coefficient(Variable(var));
return 0;
}
CATCH_ALL
int
ppl_Constraint_inhomogeneous_term(ppl_const_Constraint_t c,
ppl_Coefficient_t n) try {
const Constraint& cc = *to_const(c);
Coefficient& nn = *to_nonconst(n);
nn = cc.inhomogeneous_term();
return 0;
}
CATCH_ALL
int
ppl_Constraint_OK(ppl_const_Constraint_t c) try {
return to_const(c)->OK() ? 1 : 0;
}
CATCH_ALL
int
ppl_new_Linear_Expression_from_Constraint(ppl_Linear_Expression_t* ple,
ppl_const_Constraint_t c) try {
const Constraint& cc = *to_const(c);
*ple = to_nonconst(new Linear_Expression(cc.expression()));
return 0;
}
CATCH_ALL
/* Interface for Constraint_System. */
int
ppl_new_Constraint_System(ppl_Constraint_System_t* pcs) try {
*pcs = to_nonconst(new Constraint_System());
return 0;
}
CATCH_ALL
int
ppl_new_Constraint_System_zero_dim_empty(ppl_Constraint_System_t* pcs) try {
*pcs = to_nonconst(new
Constraint_System(Constraint_System::zero_dim_empty()));
return 0;
}
CATCH_ALL
int
ppl_new_Constraint_System_from_Constraint(ppl_Constraint_System_t* pcs,
ppl_const_Constraint_t c) try {
const Constraint& cc = *to_const(c);
*pcs = to_nonconst(new Constraint_System(cc));
return 0;
}
CATCH_ALL
int
ppl_new_Constraint_System_from_Constraint_System
(ppl_Constraint_System_t* pcs, ppl_const_Constraint_System_t cs) try {
const Constraint_System& ccs = *to_const(cs);
*pcs = to_nonconst(new Constraint_System(ccs));
return 0;
}
CATCH_ALL
int
ppl_delete_Constraint_System(ppl_const_Constraint_System_t cs) try {
delete to_const(cs);
return 0;
}
CATCH_ALL
int
ppl_assign_Constraint_System_from_Constraint_System
(ppl_Constraint_System_t dst, ppl_const_Constraint_System_t src) try {
const Constraint_System& ssrc = *to_const(src);
Constraint_System& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Constraint_System_space_dimension(ppl_const_Constraint_System_t cs,
ppl_dimension_type* m) try {
*m = to_const(cs)->space_dimension();
return 0;
}
CATCH_ALL
int
ppl_Constraint_System_empty
(ppl_const_Constraint_System_t cs) try {
const Constraint_System& ccs = *to_const(cs);
return ccs.empty() ? 1 : 0;
}
CATCH_ALL
int
ppl_Constraint_System_has_strict_inequalities
(ppl_const_Constraint_System_t cs) try {
const Constraint_System& ccs = *to_const(cs);
return ccs.has_strict_inequalities() ? 1 : 0;
}
CATCH_ALL
int
ppl_Constraint_System_clear(ppl_Constraint_System_t cs) try {
to_nonconst(cs)->clear();
return 0;
}
CATCH_ALL
int
ppl_Constraint_System_insert_Constraint(ppl_Constraint_System_t cs,
ppl_const_Constraint_t c) try {
const Constraint& cc = *to_const(c);
Constraint_System& ccs = *to_nonconst(cs);
ccs.insert(cc);
return 0;
}
CATCH_ALL
int
ppl_Constraint_System_OK(ppl_const_Constraint_System_t cs) try {
return to_const(cs)->OK() ? 1 : 0;
}
CATCH_ALL
/* Interface for Constraint_System::const_iterator. */
int
ppl_new_Constraint_System_const_iterator
(ppl_Constraint_System_const_iterator_t* pcit) try {
*pcit = to_nonconst(new Constraint_System::const_iterator());
return 0;
}
CATCH_ALL
int
ppl_new_Constraint_System_const_iterator_from_Constraint_System_const_iterator
(ppl_Constraint_System_const_iterator_t* pcit,
ppl_const_Constraint_System_const_iterator_t cit) try {
*pcit = to_nonconst(new Constraint_System::const_iterator(*to_const(cit)));
return 0;
}
CATCH_ALL
int
ppl_delete_Constraint_System_const_iterator
(ppl_const_Constraint_System_const_iterator_t cit)
try {
delete to_const(cit);
return 0;
}
CATCH_ALL
int
ppl_assign_Constraint_System_const_iterator_from_Constraint_System_const_iterator
(ppl_Constraint_System_const_iterator_t dst,
ppl_const_Constraint_System_const_iterator_t src) try {
const Constraint_System::const_iterator& ssrc = *to_const(src);
Constraint_System::const_iterator& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Constraint_System_begin(ppl_const_Constraint_System_t cs,
ppl_Constraint_System_const_iterator_t cit) try {
const Constraint_System& ccs = *to_const(cs);
Constraint_System::const_iterator& ccit = *to_nonconst(cit);
ccit = ccs.begin();
return 0;
}
CATCH_ALL
int
ppl_Constraint_System_end(ppl_const_Constraint_System_t cs,
ppl_Constraint_System_const_iterator_t cit) try {
const Constraint_System& ccs = *to_const(cs);
Constraint_System::const_iterator& ccit = *to_nonconst(cit);
ccit = ccs.end();
return 0;
}
CATCH_ALL
int
ppl_Constraint_System_const_iterator_dereference
(ppl_const_Constraint_System_const_iterator_t cit,
ppl_const_Constraint_t* pc) try {
const Constraint_System::const_iterator& ccit = *to_const(cit);
const Constraint& c = *ccit;
*pc = to_const(&c);
return 0;
}
CATCH_ALL
int
ppl_Constraint_System_const_iterator_increment
(ppl_Constraint_System_const_iterator_t cit) try {
Constraint_System::const_iterator& ccit = *to_nonconst(cit);
++ccit;
return 0;
}
CATCH_ALL
int
ppl_Constraint_System_const_iterator_equal_test
(ppl_const_Constraint_System_const_iterator_t x,
ppl_const_Constraint_System_const_iterator_t y) try {
const Constraint_System::const_iterator& xx = *to_const(x);
const Constraint_System::const_iterator& yy = *to_const(y);
return (xx == yy) ? 1 : 0;
}
CATCH_ALL
/* Interface for Generator. */
int
ppl_new_Generator(ppl_Generator_t* pg,
ppl_const_Linear_Expression_t le,
enum ppl_enum_Generator_Type t,
ppl_const_Coefficient_t d) try {
Generator* ppg;
const Linear_Expression& lle = *to_const(le);
const Coefficient& dd = *to_const(d);
switch (t) {
case PPL_GENERATOR_TYPE_POINT:
ppg = new Generator(Generator::point(lle, dd));
break;
case PPL_GENERATOR_TYPE_CLOSURE_POINT:
ppg = new Generator(Generator::closure_point(lle, dd));
break;
case PPL_GENERATOR_TYPE_RAY:
ppg = new Generator(Generator::ray(lle));
break;
case PPL_GENERATOR_TYPE_LINE:
ppg = new Generator(Generator::line(lle));
break;
default:
throw std::invalid_argument("ppl_new_Generator(pg, le, t, d): t invalid");
}
*pg = to_nonconst(ppg);
return 0;
}
CATCH_ALL
int
ppl_new_Generator_zero_dim_point(ppl_Generator_t* pg) try {
*pg = to_nonconst(new Generator(Generator::zero_dim_point()));
return 0;
}
CATCH_ALL
int
ppl_new_Generator_zero_dim_closure_point(ppl_Generator_t* pg) try {
*pg = to_nonconst(new Generator(Generator::zero_dim_closure_point()));
return 0;
}
CATCH_ALL
int
ppl_new_Generator_from_Generator(ppl_Generator_t* pg,
ppl_const_Generator_t g) try {
const Generator& gg = *to_const(g);
*pg = to_nonconst(new Generator(gg));
return 0;
}
CATCH_ALL
int
ppl_delete_Generator(ppl_const_Generator_t le) try {
delete to_const(le);
return 0;
}
CATCH_ALL
int
ppl_assign_Generator_from_Generator(ppl_Generator_t dst,
ppl_const_Generator_t src) try {
const Generator& ssrc = *to_const(src);
Generator& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Generator_space_dimension(ppl_const_Generator_t g,
ppl_dimension_type* m) try {
*m = to_const(g)->space_dimension();
return 0;
}
CATCH_ALL
int
ppl_Generator_type(ppl_const_Generator_t g) try {
switch (to_const(g)->type()) {
case Generator::LINE:
return PPL_GENERATOR_TYPE_LINE;
case Generator::RAY:
return PPL_GENERATOR_TYPE_RAY;
case Generator::POINT:
return PPL_GENERATOR_TYPE_POINT;
case Generator::CLOSURE_POINT:
return PPL_GENERATOR_TYPE_CLOSURE_POINT;
}
PPL_UNREACHABLE;
}
CATCH_ALL
int
ppl_Generator_coefficient(ppl_const_Generator_t g,
ppl_dimension_type var,
ppl_Coefficient_t n) try {
const Generator& gg = *to_const(g);
Coefficient& nn = *to_nonconst(n);
nn = gg.coefficient(Variable(var));
return 0;
}
CATCH_ALL
int
ppl_Generator_divisor(ppl_const_Generator_t g,
ppl_Coefficient_t n) try {
const Generator& gg = *to_const(g);
Coefficient& nn = *to_nonconst(n);
nn = gg.divisor();
return 0;
}
CATCH_ALL
int
ppl_Generator_OK(ppl_const_Generator_t g) try {
return to_const(g)->OK() ? 1 : 0;
}
CATCH_ALL
int
ppl_new_Linear_Expression_from_Generator(ppl_Linear_Expression_t* ple,
ppl_const_Generator_t g) try {
const Generator& gg = *to_const(g);
*ple = to_nonconst(new Linear_Expression(gg.expression()));
return 0;
}
CATCH_ALL
/* Interface for Generator_System. */
int
ppl_new_Generator_System(ppl_Generator_System_t* pgs) try {
*pgs = to_nonconst(new Generator_System());
return 0;
}
CATCH_ALL
int
ppl_new_Generator_System_zero_dim_univ(ppl_Generator_System_t* pgs) try {
*pgs = to_nonconst(new Generator_System(Generator_System::zero_dim_univ()));
return 0;
}
CATCH_ALL
int
ppl_new_Generator_System_from_Generator(ppl_Generator_System_t* pgs,
ppl_const_Generator_t g) try {
const Generator& gg = *to_const(g);
*pgs = to_nonconst(new Generator_System(gg));
return 0;
}
CATCH_ALL
int
ppl_new_Generator_System_from_Generator_System
(ppl_Generator_System_t* pgs, ppl_const_Generator_System_t gs) try {
const Generator_System& ggs = *to_const(gs);
*pgs = to_nonconst(new Generator_System(ggs));
return 0;
}
CATCH_ALL
int
ppl_delete_Generator_System(ppl_const_Generator_System_t gs) try {
delete to_const(gs);
return 0;
}
CATCH_ALL
int
ppl_assign_Generator_System_from_Generator_System
(ppl_Generator_System_t dst, ppl_const_Generator_System_t src) try {
const Generator_System& ssrc = *to_const(src);
Generator_System& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Generator_System_space_dimension(ppl_const_Generator_System_t gs,
ppl_dimension_type* m) try {
*m = to_const(gs)->space_dimension();
return 0;
}
CATCH_ALL
int
ppl_Generator_System_empty
(ppl_const_Generator_System_t gs) try {
const Generator_System& cgs = *to_const(gs);
return cgs.empty() ? 1 : 0;
}
CATCH_ALL
int
ppl_Generator_System_clear(ppl_Generator_System_t gs) try {
to_nonconst(gs)->clear();
return 0;
}
CATCH_ALL
int
ppl_Generator_System_insert_Generator(ppl_Generator_System_t gs,
ppl_const_Generator_t g) try {
const Generator& gg = *to_const(g);
Generator_System& ggs = *to_nonconst(gs);
ggs.insert(gg);
return 0;
}
CATCH_ALL
int
ppl_Generator_System_OK(ppl_const_Generator_System_t gs) try {
return to_const(gs)->OK() ? 1 : 0;
}
CATCH_ALL
/* Interface for Generator_System::const_iterator. */
int
ppl_new_Generator_System_const_iterator
(ppl_Generator_System_const_iterator_t* pgit) try {
*pgit = to_nonconst(new Generator_System::const_iterator());
return 0;
}
CATCH_ALL
int
ppl_new_Generator_System_const_iterator_from_Generator_System_const_iterator
(ppl_Generator_System_const_iterator_t* pgit,
ppl_const_Generator_System_const_iterator_t git) try {
*pgit = to_nonconst(new Generator_System::const_iterator(*to_const(git)));
return 0;
}
CATCH_ALL
int
ppl_delete_Generator_System_const_iterator
(ppl_const_Generator_System_const_iterator_t git) try {
delete to_const(git);
return 0;
}
CATCH_ALL
int
ppl_assign_Generator_System_const_iterator_from_Generator_System_const_iterator
(ppl_Generator_System_const_iterator_t dst,
ppl_const_Generator_System_const_iterator_t src) try {
const Generator_System::const_iterator& ssrc = *to_const(src);
Generator_System::const_iterator& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Generator_System_begin(ppl_const_Generator_System_t gs,
ppl_Generator_System_const_iterator_t git) try {
const Generator_System& ggs = *to_const(gs);
Generator_System::const_iterator& ggit = *to_nonconst(git);
ggit = ggs.begin();
return 0;
}
CATCH_ALL
int
ppl_Generator_System_end(ppl_const_Generator_System_t gs,
ppl_Generator_System_const_iterator_t git) try {
const Generator_System& ggs = *to_const(gs);
Generator_System::const_iterator& ggit = *to_nonconst(git);
ggit = ggs.end();
return 0;
}
CATCH_ALL
int
ppl_Generator_System_const_iterator_dereference
(ppl_const_Generator_System_const_iterator_t git,
ppl_const_Generator_t* pg) try {
const Generator_System::const_iterator& ggit = *to_const(git);
const Generator& c = *ggit;
*pg = to_const(&c);
return 0;
}
CATCH_ALL
int
ppl_Generator_System_const_iterator_increment
(ppl_Generator_System_const_iterator_t git) try {
Generator_System::const_iterator& ggit = *to_nonconst(git);
++ggit;
return 0;
}
CATCH_ALL
int
ppl_Generator_System_const_iterator_equal_test
(ppl_const_Generator_System_const_iterator_t x,
ppl_const_Generator_System_const_iterator_t y) try {
const Generator_System::const_iterator& xx = *to_const(x);
const Generator_System::const_iterator& yy = *to_const(y);
return (xx == yy) ? 1 : 0;
}
CATCH_ALL
/* Interface for Congruence. */
int
ppl_new_Congruence(ppl_Congruence_t* pc,
ppl_const_Linear_Expression_t le,
ppl_const_Coefficient_t m) try {
Congruence* ppc;
const Linear_Expression& lle = *to_const(le);
const Coefficient& mm = *to_const(m);
ppc = new Congruence((lle %= 0) / mm);
*pc = to_nonconst(ppc);
return 0;
}
CATCH_ALL
int
ppl_new_Congruence_zero_dim_false(ppl_Congruence_t* pc) try {
*pc = to_nonconst(new Congruence(Congruence::zero_dim_false()));
return 0;
}
CATCH_ALL
int
ppl_new_Congruence_zero_dim_integrality(ppl_Congruence_t* pc) try {
*pc = to_nonconst(new Congruence(Congruence::zero_dim_integrality()));
return 0;
}
CATCH_ALL
int
ppl_new_Congruence_from_Congruence(ppl_Congruence_t* pc,
ppl_const_Congruence_t c) try {
const Congruence& cc = *to_const(c);
*pc = to_nonconst(new Congruence(cc));
return 0;
}
CATCH_ALL
int
ppl_delete_Congruence(ppl_const_Congruence_t le) try {
delete to_const(le);
return 0;
}
CATCH_ALL
int
ppl_assign_Congruence_from_Congruence(ppl_Congruence_t dst,
ppl_const_Congruence_t src) try {
const Congruence& ssrc = *to_const(src);
Congruence& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Congruence_space_dimension(ppl_const_Congruence_t c,
ppl_dimension_type* m) try {
*m = to_const(c)->space_dimension();
return 0;
}
CATCH_ALL
int
ppl_Congruence_coefficient(ppl_const_Congruence_t c,
ppl_dimension_type var,
ppl_Coefficient_t n) try {
const Congruence& cc = *to_const(c);
Coefficient& nn = *to_nonconst(n);
nn = cc.coefficient(Variable(var));
return 0;
}
CATCH_ALL
int
ppl_Congruence_inhomogeneous_term(ppl_const_Congruence_t c,
ppl_Coefficient_t n) try {
const Congruence& cc = *to_const(c);
Coefficient& nn = *to_nonconst(n);
nn = cc.inhomogeneous_term();
return 0;
}
CATCH_ALL
int
ppl_Congruence_modulus(ppl_const_Congruence_t c,
ppl_Coefficient_t m) try {
const Congruence& cc = *to_const(c);
Coefficient& mm = *to_nonconst(m);
mm = cc.modulus();
return 0;
}
CATCH_ALL
int
ppl_Congruence_OK(ppl_const_Congruence_t c) try {
return to_const(c)->OK() ? 1 : 0;
}
CATCH_ALL
int
ppl_new_Linear_Expression_from_Congruence(ppl_Linear_Expression_t* ple,
ppl_const_Congruence_t c) try {
const Congruence& cc = *to_const(c);
*ple = to_nonconst(new Linear_Expression(cc.expression()));
return 0;
}
CATCH_ALL
/* Interface for Congruence_System. */
int
ppl_new_Congruence_System(ppl_Congruence_System_t* pcs) try {
*pcs = to_nonconst(new Congruence_System());
return 0;
}
CATCH_ALL
int
ppl_new_Congruence_System_zero_dim_empty(ppl_Congruence_System_t* pcs) try {
*pcs = to_nonconst(new
Congruence_System(Congruence_System::zero_dim_empty()));
return 0;
}
CATCH_ALL
int
ppl_new_Congruence_System_from_Congruence(ppl_Congruence_System_t* pcs,
ppl_const_Congruence_t c) try {
const Congruence& cc = *to_const(c);
*pcs = to_nonconst(new Congruence_System(cc));
return 0;
}
CATCH_ALL
int
ppl_new_Congruence_System_from_Congruence_System
(ppl_Congruence_System_t* pcs, ppl_const_Congruence_System_t cs) try {
const Congruence_System& ccs = *to_const(cs);
*pcs = to_nonconst(new Congruence_System(ccs));
return 0;
}
CATCH_ALL
int
ppl_delete_Congruence_System(ppl_const_Congruence_System_t cs) try {
delete to_const(cs);
return 0;
}
CATCH_ALL
int
ppl_assign_Congruence_System_from_Congruence_System
(ppl_Congruence_System_t dst, ppl_const_Congruence_System_t src) try {
const Congruence_System& ssrc = *to_const(src);
Congruence_System& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Congruence_System_space_dimension(ppl_const_Congruence_System_t cs,
ppl_dimension_type* m) try {
*m = to_const(cs)->space_dimension();
return 0;
}
CATCH_ALL
int
ppl_Congruence_System_empty
(ppl_const_Congruence_System_t cs) try {
const Congruence_System& ccs = *to_const(cs);
return ccs.empty() ? 1 : 0;
}
CATCH_ALL
int
ppl_Congruence_System_clear(ppl_Congruence_System_t cs) try {
to_nonconst(cs)->clear();
return 0;
}
CATCH_ALL
int
ppl_Congruence_System_insert_Congruence(ppl_Congruence_System_t cs,
ppl_const_Congruence_t c) try {
const Congruence& cc = *to_const(c);
Congruence_System& ccs = *to_nonconst(cs);
ccs.insert(cc);
return 0;
}
CATCH_ALL
int
ppl_Congruence_System_OK(ppl_const_Congruence_System_t cs) try {
return to_const(cs)->OK() ? 1 : 0;
}
CATCH_ALL
/* Interface for Congruence_System::const_iterator. */
int
ppl_new_Congruence_System_const_iterator
(ppl_Congruence_System_const_iterator_t* pcit) try {
*pcit = to_nonconst(new Congruence_System::const_iterator());
return 0;
}
CATCH_ALL
int
ppl_new_Congruence_System_const_iterator_from_Congruence_System_const_iterator
(ppl_Congruence_System_const_iterator_t* pcit,
ppl_const_Congruence_System_const_iterator_t cit) try {
*pcit = to_nonconst(new Congruence_System::const_iterator(*to_const(cit)));
return 0;
}
CATCH_ALL
int
ppl_delete_Congruence_System_const_iterator
(ppl_const_Congruence_System_const_iterator_t cit)
try {
delete to_const(cit);
return 0;
}
CATCH_ALL
int
ppl_assign_Congruence_System_const_iterator_from_Congruence_System_const_iterator
(ppl_Congruence_System_const_iterator_t dst,
ppl_const_Congruence_System_const_iterator_t src) try {
const Congruence_System::const_iterator& ssrc = *to_const(src);
Congruence_System::const_iterator& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Congruence_System_begin(ppl_const_Congruence_System_t cs,
ppl_Congruence_System_const_iterator_t cit) try {
const Congruence_System& ccs = *to_const(cs);
Congruence_System::const_iterator& ccit = *to_nonconst(cit);
ccit = ccs.begin();
return 0;
}
CATCH_ALL
int
ppl_Congruence_System_end(ppl_const_Congruence_System_t cs,
ppl_Congruence_System_const_iterator_t cit) try {
const Congruence_System& ccs = *to_const(cs);
Congruence_System::const_iterator& ccit = *to_nonconst(cit);
ccit = ccs.end();
return 0;
}
CATCH_ALL
int
ppl_Congruence_System_const_iterator_dereference
(ppl_const_Congruence_System_const_iterator_t cit,
ppl_const_Congruence_t* pc) try {
const Congruence_System::const_iterator& ccit = *to_const(cit);
const Congruence& c = *ccit;
*pc = to_const(&c);
return 0;
}
CATCH_ALL
int
ppl_Congruence_System_const_iterator_increment
(ppl_Congruence_System_const_iterator_t cit) try {
Congruence_System::const_iterator& ccit = *to_nonconst(cit);
++ccit;
return 0;
}
CATCH_ALL
int
ppl_Congruence_System_const_iterator_equal_test
(ppl_const_Congruence_System_const_iterator_t x,
ppl_const_Congruence_System_const_iterator_t y) try {
const Congruence_System::const_iterator& xx = *to_const(x);
const Congruence_System::const_iterator& yy = *to_const(y);
return (xx == yy) ? 1 : 0;
}
CATCH_ALL
/* Interface for Grid_Generator. */
int
ppl_new_Grid_Generator(ppl_Grid_Generator_t* pg,
ppl_const_Linear_Expression_t le,
enum ppl_enum_Grid_Generator_Type t,
ppl_const_Coefficient_t d) try {
Grid_Generator* ppg;
const Linear_Expression& lle = *to_const(le);
const Coefficient& dd = *to_const(d);
switch (t) {
case PPL_GRID_GENERATOR_TYPE_LINE:
ppg = new Grid_Generator(Grid_Generator::grid_line(lle));
break;
case PPL_GRID_GENERATOR_TYPE_PARAMETER:
ppg = new Grid_Generator(Grid_Generator::parameter(lle));
break;
case PPL_GRID_GENERATOR_TYPE_POINT:
ppg = new Grid_Generator(Grid_Generator::grid_point(lle, dd));
break;
default:
throw std::invalid_argument("ppl_new_Grid_Generator(pg, le, t, d): "
"t invalid");
}
*pg = to_nonconst(ppg);
return 0;
}
CATCH_ALL
int
ppl_new_Grid_Generator_zero_dim_point(ppl_Grid_Generator_t* pg) try {
*pg = to_nonconst(new Grid_Generator(Grid_Generator::zero_dim_point()));
return 0;
}
CATCH_ALL
int
ppl_new_Grid_Generator_from_Grid_Generator(ppl_Grid_Generator_t* pg,
ppl_const_Grid_Generator_t g) try {
const Grid_Generator& gg = *to_const(g);
*pg = to_nonconst(new Grid_Generator(gg));
return 0;
}
CATCH_ALL
int
ppl_delete_Grid_Generator(ppl_const_Grid_Generator_t le) try {
delete to_const(le);
return 0;
}
CATCH_ALL
int
ppl_assign_Grid_Generator_from_Grid_Generator
(ppl_Grid_Generator_t dst,
ppl_const_Grid_Generator_t src) try {
const Grid_Generator& ssrc = *to_const(src);
Grid_Generator& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_space_dimension(ppl_const_Grid_Generator_t g,
ppl_dimension_type* m) try {
*m = to_const(g)->space_dimension();
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_type(ppl_const_Grid_Generator_t g) try {
switch (to_const(g)->type()) {
case Grid_Generator::LINE:
return PPL_GRID_GENERATOR_TYPE_LINE;
case Grid_Generator::PARAMETER:
return PPL_GRID_GENERATOR_TYPE_PARAMETER;
case Grid_Generator::POINT:
return PPL_GRID_GENERATOR_TYPE_POINT;
}
PPL_UNREACHABLE;
}
CATCH_ALL
int
ppl_Grid_Generator_coefficient(ppl_const_Grid_Generator_t g,
ppl_dimension_type var,
ppl_Coefficient_t n) try {
const Grid_Generator& gg = *to_const(g);
Coefficient& nn = *to_nonconst(n);
nn = gg.coefficient(Variable(var));
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_divisor(ppl_const_Grid_Generator_t g,
ppl_Coefficient_t n) try {
const Grid_Generator& gg = *to_const(g);
Coefficient& nn = *to_nonconst(n);
nn = gg.divisor();
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_OK(ppl_const_Grid_Generator_t g) try {
return to_const(g)->OK() ? 1 : 0;
}
CATCH_ALL
// FIXME: to be restored soon.
// int
// ppl_new_Linear_Expression_from_Grid_Generator
// (ppl_Linear_Expression_t* ple,
// ppl_const_Grid_Generator_t g) try {
// const Grid_Generator& gg = *to_const(g);
// *ple = to_nonconst(new Linear_Expression(gg));
// return 0;
// }
// CATCH_ALL
/* Interface for Grid_Generator_System. */
int
ppl_new_Grid_Generator_System(ppl_Grid_Generator_System_t* pgs) try {
*pgs = to_nonconst(new Grid_Generator_System());
return 0;
}
CATCH_ALL
int
ppl_new_Grid_Generator_System_zero_dim_univ
(ppl_Grid_Generator_System_t* pgs) try {
*pgs = to_nonconst
(new Grid_Generator_System(Grid_Generator_System::zero_dim_univ()));
return 0;
}
CATCH_ALL
int
ppl_new_Grid_Generator_System_from_Grid_Generator
(ppl_Grid_Generator_System_t* pgs, ppl_const_Grid_Generator_t g) try {
const Grid_Generator& gg = *to_const(g);
*pgs = to_nonconst(new Grid_Generator_System(gg));
return 0;
}
CATCH_ALL
int
ppl_new_Grid_Generator_System_from_Grid_Generator_System
(ppl_Grid_Generator_System_t* pgs, ppl_const_Grid_Generator_System_t gs) try {
const Grid_Generator_System& ggs = *to_const(gs);
*pgs = to_nonconst(new Grid_Generator_System(ggs));
return 0;
}
CATCH_ALL
int
ppl_delete_Grid_Generator_System(ppl_const_Grid_Generator_System_t gs) try {
delete to_const(gs);
return 0;
}
CATCH_ALL
int
ppl_assign_Grid_Generator_System_from_Grid_Generator_System
(ppl_Grid_Generator_System_t dst, ppl_const_Grid_Generator_System_t src) try {
const Grid_Generator_System& ssrc = *to_const(src);
Grid_Generator_System& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_System_space_dimension(ppl_const_Grid_Generator_System_t gs,
ppl_dimension_type* m) try {
*m = to_const(gs)->space_dimension();
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_System_empty
(ppl_const_Grid_Generator_System_t gs) try {
const Grid_Generator_System& cgs = *to_const(gs);
return cgs.empty() ? 1 : 0;
}
CATCH_ALL
int
ppl_Grid_Generator_System_clear(ppl_Grid_Generator_System_t gs) try {
to_nonconst(gs)->clear();
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_System_insert_Grid_Generator
(ppl_Grid_Generator_System_t gs,
ppl_const_Grid_Generator_t g) try {
const Grid_Generator& gg = *to_const(g);
Grid_Generator_System& ggs = *to_nonconst(gs);
ggs.insert(gg);
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_System_OK(ppl_const_Grid_Generator_System_t gs) try {
return to_const(gs)->OK() ? 1 : 0;
}
CATCH_ALL
/* Interface for Grid_Generator_System::const_iterator. */
int
ppl_new_Grid_Generator_System_const_iterator
(ppl_Grid_Generator_System_const_iterator_t* pgit) try {
*pgit = to_nonconst(new Grid_Generator_System::const_iterator());
return 0;
}
CATCH_ALL
int
ppl_new_Grid_Generator_System_const_iterator_from_Grid_Generator_System_const_iterator
(ppl_Grid_Generator_System_const_iterator_t* pgit,
ppl_const_Grid_Generator_System_const_iterator_t git) try {
*pgit = to_nonconst
(new Grid_Generator_System::const_iterator(*to_const(git)));
return 0;
}
CATCH_ALL
int
ppl_delete_Grid_Generator_System_const_iterator
(ppl_const_Grid_Generator_System_const_iterator_t git) try {
delete to_const(git);
return 0;
}
CATCH_ALL
int
ppl_assign_Grid_Generator_System_const_iterator_from_Grid_Generator_System_const_iterator
(ppl_Grid_Generator_System_const_iterator_t dst,
ppl_const_Grid_Generator_System_const_iterator_t src) try {
const Grid_Generator_System::const_iterator& ssrc = *to_const(src);
Grid_Generator_System::const_iterator& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_System_begin
(ppl_const_Grid_Generator_System_t gs,
ppl_Grid_Generator_System_const_iterator_t git) try {
const Grid_Generator_System& ggs = *to_const(gs);
Grid_Generator_System::const_iterator& ggit = *to_nonconst(git);
ggit = ggs.begin();
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_System_end
(ppl_const_Grid_Generator_System_t gs,
ppl_Grid_Generator_System_const_iterator_t git) try {
const Grid_Generator_System& ggs = *to_const(gs);
Grid_Generator_System::const_iterator& ggit = *to_nonconst(git);
ggit = ggs.end();
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_System_const_iterator_dereference
(ppl_const_Grid_Generator_System_const_iterator_t git,
ppl_const_Grid_Generator_t* pg) try {
const Grid_Generator_System::const_iterator& ggit = *to_const(git);
const Grid_Generator& g = *ggit;
*pg = to_const(&g);
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_System_const_iterator_increment
(ppl_Grid_Generator_System_const_iterator_t git) try {
Grid_Generator_System::const_iterator& ggit = *to_nonconst(git);
++ggit;
return 0;
}
CATCH_ALL
int
ppl_Grid_Generator_System_const_iterator_equal_test
(ppl_const_Grid_Generator_System_const_iterator_t x,
ppl_const_Grid_Generator_System_const_iterator_t y) try {
const Grid_Generator_System::const_iterator& xx = *to_const(x);
const Grid_Generator_System::const_iterator& yy = *to_const(y);
return (xx == yy) ? 1 : 0;
}
CATCH_ALL
int
ppl_new_MIP_Problem_from_space_dimension(ppl_MIP_Problem_t* pmip,
ppl_dimension_type d) try {
*pmip = to_nonconst(new MIP_Problem(d));
return 0;
}
CATCH_ALL
int
ppl_new_MIP_Problem(ppl_MIP_Problem_t* pmip,
ppl_dimension_type d,
ppl_const_Constraint_System_t cs,
ppl_const_Linear_Expression_t le, int m) try {
const Constraint_System& ccs = *to_const(cs);
const Linear_Expression& lle = *to_const(le);
Optimization_Mode mm = (m == PPL_OPTIMIZATION_MODE_MINIMIZATION)
? MINIMIZATION : MAXIMIZATION;
*pmip = to_nonconst(new MIP_Problem(d, ccs, lle, mm));
return 0;
}
CATCH_ALL
int
ppl_new_MIP_Problem_from_MIP_Problem(ppl_MIP_Problem_t* pmip,
ppl_const_MIP_Problem_t mip) try {
const MIP_Problem& mmip = *to_const(mip);
*pmip = to_nonconst(new MIP_Problem(mmip));
return 0;
}
CATCH_ALL
int
ppl_delete_MIP_Problem(ppl_const_MIP_Problem_t mip) try {
delete to_const(mip);
return 0;
}
CATCH_ALL
int
ppl_assign_MIP_Problem_from_MIP_Problem(ppl_MIP_Problem_t dst,
ppl_const_MIP_Problem_t src) try {
const MIP_Problem& ssrc = *to_const(src);
MIP_Problem& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_space_dimension(ppl_const_MIP_Problem_t mip,
ppl_dimension_type* m) try {
*m = to_const(mip)->space_dimension();
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_number_of_integer_space_dimensions(ppl_const_MIP_Problem_t mip,
ppl_dimension_type* m) try {
const MIP_Problem& mmip = *to_const(mip);
*m = mmip.integer_space_dimensions().size();
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_integer_space_dimensions(ppl_const_MIP_Problem_t mip,
ppl_dimension_type ds[]) try {
const Variables_Set& vars = to_const(mip)->integer_space_dimensions();
ppl_dimension_type* ds_i = ds;
for (Variables_Set::const_iterator v_iter = vars.begin(),
v_end = vars.end(); v_iter != v_end; ++v_iter, ++ds_i)
*ds_i = *v_iter;
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_number_of_constraints(ppl_const_MIP_Problem_t mip,
ppl_dimension_type* m) try {
const MIP_Problem& mmip = *to_const(mip);
*m = static_cast<ppl_dimension_type>(mmip.constraints_end() - mmip.constraints_begin());
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_constraint_at_index(ppl_const_MIP_Problem_t mip,
ppl_dimension_type i,
ppl_const_Constraint_t* pc) try {
#ifndef NDEBUG
ppl_dimension_type num_constraints;
ppl_MIP_Problem_number_of_constraints(mip, &num_constraints);
assert(i < num_constraints);
#endif
const MIP_Problem& mmip = *to_const(mip);
const Constraint& c = *(mmip.constraints_begin() + i);
*pc = to_const(&c);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_objective_function(ppl_const_MIP_Problem_t mip,
ppl_const_Linear_Expression_t* ple) try {
const Linear_Expression& le = to_const(mip)->objective_function();
*ple = to_const(&le);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_optimization_mode(ppl_const_MIP_Problem_t mip) try {
return to_const(mip)->optimization_mode();
}
CATCH_ALL
int
ppl_MIP_Problem_clear(ppl_MIP_Problem_t mip) try {
to_nonconst(mip)->clear();
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_add_space_dimensions_and_embed(ppl_MIP_Problem_t mip,
ppl_dimension_type d) try {
MIP_Problem& mmip = *to_nonconst(mip);
mmip.add_space_dimensions_and_embed(d);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_add_to_integer_space_dimensions(ppl_MIP_Problem_t mip,
ppl_dimension_type ds[],
size_t n) try {
MIP_Problem& mmip = *to_nonconst(mip);
Variables_Set vars;
for (ppl_dimension_type i = n; i-- > 0; )
vars.insert(ds[i]);
mmip.add_to_integer_space_dimensions(vars);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_add_constraint(ppl_MIP_Problem_t mip,
ppl_const_Constraint_t c) try {
const Constraint& cc = *to_const(c);
MIP_Problem& mmip = *to_nonconst(mip);
mmip.add_constraint(cc);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_add_constraints(ppl_MIP_Problem_t mip,
ppl_const_Constraint_System_t cs) try {
const Constraint_System& ccs = *to_const(cs);
MIP_Problem& mmip = *to_nonconst(mip);
mmip.add_constraints(ccs);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_set_objective_function(ppl_MIP_Problem_t mip,
ppl_const_Linear_Expression_t le) try {
const Linear_Expression& lle = *to_const(le);
MIP_Problem& mmip = *to_nonconst(mip);
mmip.set_objective_function(lle);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_set_optimization_mode(ppl_MIP_Problem_t mip, int mode) try {
MIP_Problem& mmip = *to_nonconst(mip);
Optimization_Mode m = (mode == PPL_OPTIMIZATION_MODE_MINIMIZATION)
? MINIMIZATION : MAXIMIZATION;
mmip.set_optimization_mode(m);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_is_satisfiable(ppl_const_MIP_Problem_t mip) try {
return to_const(mip)->is_satisfiable() ? 1 : 0;
}
CATCH_ALL
int
ppl_MIP_Problem_solve(ppl_const_MIP_Problem_t mip) try {
return to_const(mip)->solve();
}
CATCH_ALL
int
ppl_MIP_Problem_evaluate_objective_function(ppl_const_MIP_Problem_t mip,
ppl_const_Generator_t g,
ppl_Coefficient_t num,
ppl_Coefficient_t den) try {
const MIP_Problem& mmip = *to_const(mip);
const Generator& gg = *to_const(g);
Coefficient& nnum = *to_nonconst(num);
Coefficient& dden = *to_nonconst(den);
mmip.evaluate_objective_function(gg, nnum, dden);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_feasible_point(ppl_const_MIP_Problem_t mip,
ppl_const_Generator_t* pg) try {
const Generator& g = to_const(mip)->feasible_point();
*pg = to_const(&g);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_optimizing_point(ppl_const_MIP_Problem_t mip,
ppl_const_Generator_t* pg) try {
const Generator& g = to_const(mip)->optimizing_point();
*pg = to_const(&g);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_optimal_value(ppl_const_MIP_Problem_t mip,
ppl_Coefficient_t num,
ppl_Coefficient_t den) try {
Coefficient& nnum = *to_nonconst(num);
Coefficient& dden = *to_nonconst(den);
to_const(mip)->optimal_value(nnum, dden);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_get_control_parameter(ppl_const_MIP_Problem_t mip,
int name) try {
MIP_Problem::Control_Parameter_Name n
= static_cast<MIP_Problem::Control_Parameter_Name>(name);
return to_const(mip)->get_control_parameter(n);
}
CATCH_ALL
int
ppl_MIP_Problem_set_control_parameter(ppl_MIP_Problem_t mip,
int value) try {
MIP_Problem::Control_Parameter_Value v
= static_cast<MIP_Problem::Control_Parameter_Value>(value);
to_nonconst(mip)->set_control_parameter(v);
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_OK(ppl_const_MIP_Problem_t mip) try {
return to_const(mip)->OK() ? 1 : 0;
}
CATCH_ALL
int
ppl_MIP_Problem_total_memory_in_bytes(ppl_const_MIP_Problem_t mip,
size_t* sz) try {
*sz = to_const(mip)->total_memory_in_bytes();
return 0;
}
CATCH_ALL
int
ppl_MIP_Problem_external_memory_in_bytes(ppl_const_MIP_Problem_t mip,
size_t* sz) try {
*sz = to_const(mip)->external_memory_in_bytes();
return 0;
}
CATCH_ALL
int
ppl_new_PIP_Problem_from_space_dimension(ppl_PIP_Problem_t* ppip,
ppl_dimension_type d) try {
*ppip = to_nonconst(new PIP_Problem(d));
return 0;
}
CATCH_ALL
int
ppl_new_PIP_Problem_from_PIP_Problem(ppl_PIP_Problem_t* dpip,
ppl_const_PIP_Problem_t pip) try {
const PIP_Problem& spip = *to_const(pip);
*dpip = to_nonconst(new PIP_Problem(spip));
return 0;
}
CATCH_ALL
int
ppl_new_PIP_Problem_from_constraints
(ppl_PIP_Problem_t* ppip,
ppl_dimension_type d,
ppl_Constraint_System_const_iterator_t first,
ppl_Constraint_System_const_iterator_t last,
size_t n,
ppl_dimension_type ds[]) try {
Variables_Set p_vars;
for (ppl_dimension_type i = n; i-- > 0; )
p_vars.insert(ds[i]);
*ppip = to_nonconst(new PIP_Problem(d, *to_const(first),
*to_const(last), p_vars));
return 0;
}
CATCH_ALL
int
ppl_assign_PIP_Problem_from_PIP_Problem(ppl_PIP_Problem_t dst,
ppl_const_PIP_Problem_t src) try {
const PIP_Problem& ssrc = *to_const(src);
PIP_Problem& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_delete_PIP_Problem(ppl_const_PIP_Problem_t pip) try {
delete to_const(pip);
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_space_dimension(ppl_const_PIP_Problem_t pip,
ppl_dimension_type* m) try {
*m = to_const(pip)->space_dimension();
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_number_of_parameter_space_dimensions
(ppl_const_PIP_Problem_t pip, ppl_dimension_type* m) try {
const PIP_Problem& ppip = *to_const(pip);
*m = ppip.parameter_space_dimensions().size();
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_parameter_space_dimensions(ppl_const_PIP_Problem_t pip,
ppl_dimension_type ds[]) try {
const Variables_Set& vars = to_const(pip)->parameter_space_dimensions();
ppl_dimension_type* ds_i = ds;
for (Variables_Set::const_iterator v_iter = vars.begin(),
v_end = vars.end(); v_iter != v_end; ++v_iter, ++ds_i)
*ds_i = *v_iter;
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_number_of_constraints(ppl_const_PIP_Problem_t pip,
ppl_dimension_type* m) try {
const PIP_Problem& ppip = *to_const(pip);
*m = static_cast<ppl_dimension_type>(ppip.constraints_end() - ppip.constraints_begin());
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_constraint_at_index(ppl_const_PIP_Problem_t pip,
ppl_dimension_type i,
ppl_const_Constraint_t* pc) try {
#ifndef NDEBUG
ppl_dimension_type num_constraints;
ppl_PIP_Problem_number_of_constraints(pip, &num_constraints);
assert(i < num_constraints);
#endif
const PIP_Problem& ppip = *to_const(pip);
const Constraint& c = *(ppip.constraints_begin() + i);
*pc = to_const(&c);
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_clear(ppl_PIP_Problem_t pip) try {
to_nonconst(pip)->clear();
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_add_space_dimensions_and_embed(ppl_PIP_Problem_t pip,
ppl_dimension_type pip_vars,
ppl_dimension_type pip_params)
try {
PIP_Problem& spip = *to_nonconst(pip);
spip.add_space_dimensions_and_embed(pip_vars,pip_params);
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_add_to_parameter_space_dimensions(ppl_PIP_Problem_t pip,
ppl_dimension_type ds[],
size_t n) try {
PIP_Problem& ppip = *to_nonconst(pip);
Variables_Set vars;
for (ppl_dimension_type i = n; i-- > 0; )
vars.insert(ds[i]);
ppip.add_to_parameter_space_dimensions(vars);
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_add_constraint(ppl_PIP_Problem_t pip,
ppl_const_Constraint_t c) try {
const Constraint& cc = *to_const(c);
PIP_Problem& ppip = *to_nonconst(pip);
ppip.add_constraint(cc);
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_add_constraints(ppl_PIP_Problem_t pip,
ppl_const_Constraint_System_t cs) try {
const Constraint_System& ccs = *to_const(cs);
PIP_Problem& ppip = *to_nonconst(pip);
ppip.add_constraints(ccs);
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_is_satisfiable(ppl_const_PIP_Problem_t pip) try {
return to_const(pip)->is_satisfiable() ? 1 : 0;
}
CATCH_ALL
int
ppl_PIP_Problem_solve(ppl_const_PIP_Problem_t pip) try {
return to_const(pip)->solve();
}
CATCH_ALL
int
ppl_PIP_Problem_solution(ppl_const_PIP_Problem_t pip,
ppl_const_PIP_Tree_Node_t* ppip_tree) try {
*ppip_tree = to_const(to_const(pip)->solution());
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_optimizing_solution(ppl_const_PIP_Problem_t pip,
ppl_const_PIP_Tree_Node_t* ppip_tree) try {
*ppip_tree = to_const(to_const(pip)->optimizing_solution());
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_OK(ppl_const_PIP_Problem_t pip) try {
return to_const(pip)->OK() ? 1 : 0;
}
CATCH_ALL
int
ppl_PIP_Problem_get_control_parameter(ppl_const_PIP_Problem_t pip,
int name) try {
PIP_Problem::Control_Parameter_Name n
= static_cast<PIP_Problem::Control_Parameter_Name>(name);
return to_const(pip)->get_control_parameter(n);
}
CATCH_ALL
int
ppl_PIP_Problem_set_control_parameter(ppl_PIP_Problem_t pip,
int value) try {
PIP_Problem::Control_Parameter_Value v
= static_cast<PIP_Problem::Control_Parameter_Value>(value);
to_nonconst(pip)->set_control_parameter(v);
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_get_big_parameter_dimension(ppl_const_PIP_Problem_t pip,
ppl_dimension_type* pd) try {
*pd = to_const(pip)->get_big_parameter_dimension();
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_set_big_parameter_dimension(ppl_PIP_Problem_t pip,
ppl_dimension_type d) try {
to_nonconst(pip)->set_big_parameter_dimension(d);
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_total_memory_in_bytes(ppl_const_PIP_Problem_t pip,
size_t* sz) try {
*sz = to_const(pip)->total_memory_in_bytes();
return 0;
}
CATCH_ALL
int
ppl_PIP_Problem_external_memory_in_bytes(ppl_const_PIP_Problem_t pip,
size_t* sz) try {
*sz = to_const(pip)->external_memory_in_bytes();
return 0;
}
CATCH_ALL
int
ppl_PIP_Tree_Node_as_solution(ppl_const_PIP_Tree_Node_t spip_tree,
ppl_const_PIP_Solution_Node_t* dpip_tree) try {
*dpip_tree = to_const(to_const(spip_tree)->as_solution());
return 0;
}
CATCH_ALL
int
ppl_PIP_Tree_Node_as_decision(ppl_const_PIP_Tree_Node_t spip_tree,
ppl_const_PIP_Decision_Node_t* dpip_tree) try {
*dpip_tree = to_const(to_const(spip_tree)->as_decision());
return 0;
}
CATCH_ALL
int
ppl_PIP_Tree_Node_get_constraints(ppl_const_PIP_Tree_Node_t pip_tree,
ppl_const_Constraint_System_t* pcs) try {
const PIP_Tree_Node& spip_tree = *to_const(pip_tree);
const Constraint_System& cs = spip_tree.constraints();
*pcs = to_const(&cs);
return 0;
}
CATCH_ALL
int
ppl_PIP_Tree_Node_OK(ppl_const_PIP_Tree_Node_t pip_tree) try {
return to_const(pip_tree)->OK() ? 1 : 0;
}
CATCH_ALL
int
ppl_PIP_Tree_Node_number_of_artificials(ppl_const_PIP_Tree_Node_t pip_tree,
ppl_dimension_type* m) try {
const PIP_Tree_Node& node = *to_const(pip_tree);
*m = node.art_parameter_count();
return 0;
}
CATCH_ALL
int
ppl_PIP_Tree_Node_begin
(ppl_const_PIP_Tree_Node_t pip_tree,
ppl_Artificial_Parameter_Sequence_const_iterator_t pit) try {
PIP_Tree_Node::Artificial_Parameter_Sequence::const_iterator& spit
= *to_nonconst(pit);
spit = to_const(pip_tree)->art_parameter_begin();
return 0;
}
CATCH_ALL
int
ppl_PIP_Tree_Node_end
(ppl_const_PIP_Tree_Node_t pip_tree,
ppl_Artificial_Parameter_Sequence_const_iterator_t pit) try {
PIP_Tree_Node::Artificial_Parameter_Sequence::const_iterator& spit
= *to_nonconst(pit);
spit = to_const(pip_tree)->art_parameter_end();
return 0;
}
CATCH_ALL
int
ppl_PIP_Solution_Node_get_parametric_values
(ppl_const_PIP_Solution_Node_t pip_sol,
ppl_dimension_type var,
ppl_const_Linear_Expression_t* le) try {
const PIP_Solution_Node& spip_sol = *to_const(pip_sol);
const Linear_Expression& lle = spip_sol.parametric_values(Variable(var));
*le = to_const(&lle);
return 0;
}
CATCH_ALL
int
ppl_PIP_Solution_Node_OK(ppl_const_PIP_Solution_Node_t pip_sol) try {
return to_const(pip_sol)->OK() ? 1 : 0;
}
CATCH_ALL
int
ppl_PIP_Decision_Node_OK(ppl_const_PIP_Decision_Node_t pip_dec) try {
return to_const(pip_dec)->OK() ? 1 : 0;
}
CATCH_ALL
int
ppl_PIP_Decision_Node_get_child_node(ppl_const_PIP_Decision_Node_t pip_dec,
int b,
ppl_const_PIP_Tree_Node_t* pip_tree) try {
*pip_tree = to_const(to_const(pip_dec)->child_node(b != 0));
return 0;
}
CATCH_ALL
int
ppl_Artificial_Parameter_get_Linear_Expression
(ppl_const_Artificial_Parameter_t ap,
ppl_Linear_Expression_t le) try {
const Artificial_Parameter& sap = *to_const(ap);
Linear_Expression& lle = *to_nonconst(le);
lle = sap;
return 0;
}
CATCH_ALL
int
ppl_Artificial_Parameter_coefficient(ppl_const_Artificial_Parameter_t ap,
ppl_dimension_type var,
ppl_Coefficient_t n) try {
const Artificial_Parameter& sap = *to_const(ap);
Coefficient& nn = *to_nonconst(n);
nn = sap.coefficient(Variable(var));
return 0;
}
CATCH_ALL
int
ppl_Artificial_Parameter_inhomogeneous_term
(ppl_const_Artificial_Parameter_t ap, ppl_Coefficient_t n) try {
const Artificial_Parameter& sap = *to_const(ap);
Coefficient& nn = *to_nonconst(n);
nn = sap.inhomogeneous_term();
return 0;
}
CATCH_ALL
int
ppl_Artificial_Parameter_denominator(ppl_const_Artificial_Parameter_t ap,
ppl_Coefficient_t n) try {
const Artificial_Parameter& sap = *to_const(ap);
Coefficient& nn = *to_nonconst(n);
nn = sap.denominator();
return 0;
}
CATCH_ALL
/* Interface for Artificial_Parameter_Sequence::const_iterator. */
int
ppl_new_Artificial_Parameter_Sequence_const_iterator
(ppl_Artificial_Parameter_Sequence_const_iterator_t* papit) try {
*papit = to_nonconst(new Artificial_Parameter_Sequence::const_iterator());
return 0;
}
CATCH_ALL
int
ppl_new_Artificial_Parameter_Sequence_const_iterator_from_Artificial_Parameter_Sequence_const_iterator
(ppl_Artificial_Parameter_Sequence_const_iterator_t* papit,
ppl_const_Artificial_Parameter_Sequence_const_iterator_t apit) try {
*papit = to_nonconst(new Artificial_Parameter_Sequence::const_iterator(*to_const(apit)));
return 0;
}
CATCH_ALL
int
ppl_delete_Artificial_Parameter_Sequence_const_iterator
(ppl_const_Artificial_Parameter_Sequence_const_iterator_t apit)
try {
delete to_const(apit);
return 0;
}
CATCH_ALL
int
ppl_assign_Artificial_Parameter_Sequence_const_iterator_from_Artificial_Parameter_Sequence_const_iterator
(ppl_Artificial_Parameter_Sequence_const_iterator_t dst,
ppl_const_Artificial_Parameter_Sequence_const_iterator_t src) try {
const Artificial_Parameter_Sequence::const_iterator& ssrc = *to_const(src);
Artificial_Parameter_Sequence::const_iterator& ddst = *to_nonconst(dst);
ddst = ssrc;
return 0;
}
CATCH_ALL
int
ppl_Artificial_Parameter_Sequence_const_iterator_dereference
(ppl_const_Artificial_Parameter_Sequence_const_iterator_t apit,
ppl_const_Artificial_Parameter_t* pap) try {
const Artificial_Parameter_Sequence::const_iterator& papit = *to_const(apit);
const Artificial_Parameter& ap = *papit;
*pap = to_const(&ap);
return 0;
}
CATCH_ALL
int
ppl_Artificial_Parameter_Sequence_const_iterator_increment
(ppl_Artificial_Parameter_Sequence_const_iterator_t apit) try {
Artificial_Parameter_Sequence::const_iterator& papit = *to_nonconst(apit);
++papit;
return 0;
}
CATCH_ALL
int
ppl_Artificial_Parameter_Sequence_const_iterator_equal_test
(ppl_const_Artificial_Parameter_Sequence_const_iterator_t x,
ppl_const_Artificial_Parameter_Sequence_const_iterator_t y) try {
const Artificial_Parameter_Sequence::const_iterator& xx = *to_const(x);
const Artificial_Parameter_Sequence::const_iterator& yy = *to_const(y);
return (xx == yy) ? 1 : 0;
}
CATCH_ALL
int
ppl_io_print_variable(ppl_dimension_type var) try {
const char* b = c_variable_output_function(var);
if (b == 0 || puts(b) < 0)
return PPL_STDIO_ERROR;
return 0;
}
CATCH_ALL
int
ppl_io_fprint_variable(FILE* stream, ppl_dimension_type var) try {
const char* b = c_variable_output_function(var);
if (b == 0 || fputs(b, stream) < 0)
return PPL_STDIO_ERROR;
return 0;
}
CATCH_ALL
int
ppl_io_asprint_variable(char** strp, ppl_dimension_type var) try {
const char* b = c_variable_output_function(var);
if (b == 0)
return PPL_STDIO_ERROR;
*strp = strdup(b);
if (*strp == 0)
return PPL_ERROR_OUT_OF_MEMORY;
return 0;
}
CATCH_ALL
/* No ascii dump for Coefficient. */
DEFINE_PRINT_FUNCTIONS(Coefficient)
DEFINE_OUTPUT_FUNCTIONS(Linear_Expression)
DEFINE_OUTPUT_FUNCTIONS(Constraint)
DEFINE_OUTPUT_FUNCTIONS(Constraint_System)
DEFINE_OUTPUT_FUNCTIONS(Generator)
DEFINE_OUTPUT_FUNCTIONS(Generator_System)
DEFINE_OUTPUT_FUNCTIONS(Congruence)
DEFINE_OUTPUT_FUNCTIONS(Congruence_System)
DEFINE_OUTPUT_FUNCTIONS(Grid_Generator)
DEFINE_OUTPUT_FUNCTIONS(Grid_Generator_System)
DEFINE_OUTPUT_FUNCTIONS(MIP_Problem)
DEFINE_OUTPUT_FUNCTIONS(PIP_Problem)
DEFINE_OUTPUT_FUNCTIONS(PIP_Tree_Node)
DEFINE_OUTPUT_FUNCTIONS(PIP_Decision_Node)
DEFINE_OUTPUT_FUNCTIONS(PIP_Solution_Node)
DEFINE_OUTPUT_FUNCTIONS(Artificial_Parameter)
char*
ppl_io_wrap_string(const char* src,
unsigned indent_depth,
unsigned preferred_first_line_length,
unsigned preferred_line_length) {
using namespace IO_Operators;
return strdup(wrap_string(src, indent_depth,
preferred_first_line_length,
preferred_line_length).c_str());
}
int
ppl_io_set_variable_output_function(ppl_io_variable_output_function_type* p)
try {
c_variable_output_function = p;
return 0;
}
CATCH_ALL
int
ppl_io_get_variable_output_function(ppl_io_variable_output_function_type** pp)
try {
*pp = c_variable_output_function;
return 0;
}
CATCH_ALL
|