| 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 |
package gen.lib.common; |
| 47 |
import static gen.lib.cgraph.attr__c.agget; |
| 48 |
import static gen.lib.cgraph.edge__c.aghead; |
| 49 |
import static gen.lib.cgraph.edge__c.agtail; |
| 50 |
import static gen.lib.common.memory__c.zmalloc; |
| 51 |
import static gen.lib.common.utils__c.dequeue; |
| 52 |
import static gen.lib.common.utils__c.enqueue; |
| 53 |
import static gen.lib.common.utils__c.free_queue; |
| 54 |
import static gen.lib.common.utils__c.new_queue; |
| 55 |
import static smetana.core.JUtils.EQ; |
| 56 |
import static smetana.core.JUtils.NEQ; |
| 57 |
import static smetana.core.JUtils.atoi; |
| 58 |
import static smetana.core.JUtils.setjmp; |
| 59 |
import static smetana.core.JUtils.size_t_array_of_integer; |
| 60 |
import static smetana.core.JUtilsDebug.ENTERING; |
| 61 |
import static smetana.core.JUtilsDebug.LEAVING; |
| 62 |
import static smetana.core.Macro.ED_cutvalue; |
| 63 |
import static smetana.core.Macro.ED_minlen; |
| 64 |
import static smetana.core.Macro.ED_tree_index; |
| 65 |
import static smetana.core.Macro.ED_weight; |
| 66 |
import static smetana.core.Macro.GD_nlist; |
| 67 |
import static smetana.core.Macro.INT_MAX; |
| 68 |
import static smetana.core.Macro.MAX; |
| 69 |
import static smetana.core.Macro.MIN; |
| 70 |
import static smetana.core.Macro.N; |
| 71 |
import static smetana.core.Macro.ND_in; |
| 72 |
import static smetana.core.Macro.ND_lim; |
| 73 |
import static smetana.core.Macro.ND_low; |
| 74 |
import static smetana.core.Macro.ND_mark; |
| 75 |
import static smetana.core.Macro.ND_next; |
| 76 |
import static smetana.core.Macro.ND_node_type; |
| 77 |
import static smetana.core.Macro.ND_out; |
| 78 |
import static smetana.core.Macro.ND_par; |
| 79 |
import static smetana.core.Macro.ND_priority; |
| 80 |
import static smetana.core.Macro.ND_rank; |
| 81 |
import static smetana.core.Macro.ND_tree_in; |
| 82 |
import static smetana.core.Macro.ND_tree_out; |
| 83 |
import static smetana.core.Macro.NOT; |
| 84 |
import static smetana.core.Macro.SEQ; |
| 85 |
import static smetana.core.Macro.SLACK; |
| 86 |
import static smetana.core.Macro.TREE_EDGE; |
| 87 |
import static smetana.core.Macro.UNSUPPORTED; |
| 88 |
import static smetana.core.Macro.free_list; |
| 89 |
import h.ST_Agedge_s; |
| 90 |
import h.ST_Agnode_s; |
| 91 |
import h.ST_Agraph_s; |
| 92 |
import h.ST_nodequeue; |
| 93 |
import h.ST_pointf; |
| 94 |
import smetana.core.CString; |
| 95 |
import smetana.core.Memory; |
| 96 |
import smetana.core.Z; |
| 97 |
import smetana.core.__ptr__; |
| 98 |
import smetana.core.jmp_buf; |
| 99 |
|
| 100 |
public class ns__c { |
| 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 |
public static Object pointof(Object... arg) { |
| 342 |
UNSUPPORTED("8e4tj258yvfq5uhsdpk37n5eq"); |
| 343 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 344 |
UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); |
| 345 |
UNSUPPORTED("12jimkrzqxavaie0cpapbx18c"); |
| 346 |
UNSUPPORTED("7ivmviysahgsc5nn9gtp7q2if"); |
| 347 |
UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); |
| 348 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 349 |
|
| 350 |
throw new UnsupportedOperationException(); |
| 351 |
} |
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
public static ST_pointf pointfof(double x, double y) { |
| 359 |
|
| 360 |
return pointfof_w_(x, y).copy(); |
| 361 |
} |
| 362 |
private static ST_pointf pointfof_w_(double x, double y) { |
| 363 |
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof"); |
| 364 |
try { |
| 365 |
final ST_pointf r = new ST_pointf(); |
| 366 |
r.setDouble("x", x); |
| 367 |
r.setDouble("y", y); |
| 368 |
return r; |
| 369 |
} finally { |
| 370 |
LEAVING("c1s4k85p1cdfn176o3uryeros","pointfof"); |
| 371 |
} |
| 372 |
} |
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
public static Object boxof(Object... arg) { |
| 380 |
UNSUPPORTED("3lzesfdd337h31jrlib1czocm"); |
| 381 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 382 |
UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); |
| 383 |
UNSUPPORTED("cylhjlutoc0sc0uy7g98m9fb8"); |
| 384 |
UNSUPPORTED("242of6revxzx8hpe7yerrchz6"); |
| 385 |
UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); |
| 386 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 387 |
|
| 388 |
throw new UnsupportedOperationException(); |
| 389 |
} |
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
|
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
public static Object add_point(Object... arg) { |
| 400 |
UNSUPPORTED("6iamka1fx8fk1rohzzse8phte"); |
| 401 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 402 |
UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); |
| 403 |
UNSUPPORTED("3n2sizjd0civbzm6iq7su1s2p"); |
| 404 |
UNSUPPORTED("65ygdo31w09i5i6bd2f7azcd3"); |
| 405 |
UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); |
| 406 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 407 |
|
| 408 |
throw new UnsupportedOperationException(); |
| 409 |
} |
| 410 |
|
| 411 |
|
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
|
| 416 |
public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) { |
| 417 |
|
| 418 |
return add_pointf_w_(p.copy(), q.copy()).copy(); |
| 419 |
} |
| 420 |
private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { |
| 421 |
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); |
| 422 |
try { |
| 423 |
final ST_pointf r = new ST_pointf(); |
| 424 |
r.setDouble("x", p.x + q.x); |
| 425 |
r.setDouble("y", p.y + q.y); |
| 426 |
return r; |
| 427 |
} finally { |
| 428 |
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); |
| 429 |
} |
| 430 |
} |
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
|
| 437 |
public static Object sub_point(Object... arg) { |
| 438 |
UNSUPPORTED("cd602849h0bce8lu9xegka0ia"); |
| 439 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 440 |
UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); |
| 441 |
UNSUPPORTED("4q4q9dveah93si8ajfv59gz27"); |
| 442 |
UNSUPPORTED("9f90ik0o2yqhanzntpy3d2ydy"); |
| 443 |
UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); |
| 444 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 445 |
|
| 446 |
throw new UnsupportedOperationException(); |
| 447 |
} |
| 448 |
|
| 449 |
|
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
public static Object sub_pointf(Object... arg) { |
| 455 |
UNSUPPORTED("dmufj44lddsnj0wjyxsg2fcso"); |
| 456 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 457 |
UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); |
| 458 |
UNSUPPORTED("4q4q9dveah93si8ajfv59gz27"); |
| 459 |
UNSUPPORTED("9f90ik0o2yqhanzntpy3d2ydy"); |
| 460 |
UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); |
| 461 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 462 |
|
| 463 |
throw new UnsupportedOperationException(); |
| 464 |
} |
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
public static Object mid_point(Object... arg) { |
| 472 |
UNSUPPORTED("evy44tdsmu3erff9dp2x835u2"); |
| 473 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 474 |
UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); |
| 475 |
UNSUPPORTED("1a6p6fm57o0wt5ze2btsx06c7"); |
| 476 |
UNSUPPORTED("1kbj5tgdmfi6kf4jgg6skhr6e"); |
| 477 |
UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); |
| 478 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 479 |
|
| 480 |
throw new UnsupportedOperationException(); |
| 481 |
} |
| 482 |
|
| 483 |
|
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
public static Object mid_pointf(Object... arg) { |
| 489 |
UNSUPPORTED("381o63o9kb04d7gzg65v0r3q"); |
| 490 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 491 |
UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); |
| 492 |
UNSUPPORTED("c5vboetlr3mf43wns7iik6m1w"); |
| 493 |
UNSUPPORTED("bcdf562ldr3bjn78hcay5xd63"); |
| 494 |
UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); |
| 495 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 496 |
|
| 497 |
throw new UnsupportedOperationException(); |
| 498 |
} |
| 499 |
|
| 500 |
|
| 501 |
|
| 502 |
|
| 503 |
|
| 504 |
|
| 505 |
public static Object interpolate_pointf(Object... arg) { |
| 506 |
UNSUPPORTED("894yimn33kmtm454llwdaotu8"); |
| 507 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 508 |
UNSUPPORTED("ef2acl8wa2ooqcb5vz3098maz"); |
| 509 |
UNSUPPORTED("5tpwuyf5iidesy80v8o4nwkmk"); |
| 510 |
UNSUPPORTED("ewnrc5uloj3w5jbmsjcn3wja0"); |
| 511 |
UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); |
| 512 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 513 |
|
| 514 |
throw new UnsupportedOperationException(); |
| 515 |
} |
| 516 |
|
| 517 |
|
| 518 |
|
| 519 |
|
| 520 |
|
| 521 |
|
| 522 |
public static Object exch_xy(Object... arg) { |
| 523 |
UNSUPPORTED("2vxya0v2fzlv5e0vjaa8d414"); |
| 524 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 525 |
UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); |
| 526 |
UNSUPPORTED("60cojdwc2h7f0m51s9jdwvup7"); |
| 527 |
UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); |
| 528 |
UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); |
| 529 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 530 |
|
| 531 |
throw new UnsupportedOperationException(); |
| 532 |
} |
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
|
| 538 |
|
| 539 |
public static Object exch_xyf(Object... arg) { |
| 540 |
UNSUPPORTED("8qamrobrqi8jsvvfrxkimrsnw"); |
| 541 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 542 |
UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); |
| 543 |
UNSUPPORTED("60cojdwc2h7f0m51s9jdwvup7"); |
| 544 |
UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); |
| 545 |
UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); |
| 546 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 547 |
|
| 548 |
throw new UnsupportedOperationException(); |
| 549 |
} |
| 550 |
|
| 551 |
|
| 552 |
|
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
public static Object box_bb(Object... arg) { |
| 557 |
UNSUPPORTED("36et5gmnjrby6o7bq9sgh1hx6"); |
| 558 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 559 |
UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); |
| 560 |
UNSUPPORTED("8mr2c9xitsqi8z1plbp7ox1hu"); |
| 561 |
UNSUPPORTED("2egu55ef4u1i03nwz01k7kcrl"); |
| 562 |
UNSUPPORTED("9n6ei3odbgefwfxvql9whcpe"); |
| 563 |
UNSUPPORTED("19ocysbuh4pxyft2bqhyhigr1"); |
| 564 |
UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); |
| 565 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 566 |
|
| 567 |
throw new UnsupportedOperationException(); |
| 568 |
} |
| 569 |
|
| 570 |
|
| 571 |
|
| 572 |
|
| 573 |
|
| 574 |
|
| 575 |
public static Object boxf_bb(Object... arg) { |
| 576 |
UNSUPPORTED("dyrqu4ww9osr9c86gqgmifcp6"); |
| 577 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 578 |
UNSUPPORTED("c57pq0f87j6dnbcvygu7v6k84"); |
| 579 |
UNSUPPORTED("8mr2c9xitsqi8z1plbp7ox1hu"); |
| 580 |
UNSUPPORTED("2egu55ef4u1i03nwz01k7kcrl"); |
| 581 |
UNSUPPORTED("9n6ei3odbgefwfxvql9whcpe"); |
| 582 |
UNSUPPORTED("19ocysbuh4pxyft2bqhyhigr1"); |
| 583 |
UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); |
| 584 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 585 |
|
| 586 |
throw new UnsupportedOperationException(); |
| 587 |
} |
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
|
| 592 |
|
| 593 |
|
| 594 |
public static Object box_intersect(Object... arg) { |
| 595 |
UNSUPPORTED("34gv28cldst09bl71itjgviue"); |
| 596 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 597 |
UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); |
| 598 |
UNSUPPORTED("9slu7bixuymxttjic76ha2nl2"); |
| 599 |
UNSUPPORTED("3uv943c2f82yuif249pf5azob"); |
| 600 |
UNSUPPORTED("74tf5h16bc9zabq3s3dyny543"); |
| 601 |
UNSUPPORTED("d99gcv3i7xes7y7rqf8ii20ux"); |
| 602 |
UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); |
| 603 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 604 |
|
| 605 |
throw new UnsupportedOperationException(); |
| 606 |
} |
| 607 |
|
| 608 |
|
| 609 |
|
| 610 |
|
| 611 |
|
| 612 |
|
| 613 |
public static Object boxf_intersect(Object... arg) { |
| 614 |
UNSUPPORTED("ape22b8z6jfg17gvo42hok9eb"); |
| 615 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 616 |
UNSUPPORTED("c57pq0f87j6dnbcvygu7v6k84"); |
| 617 |
UNSUPPORTED("9slu7bixuymxttjic76ha2nl2"); |
| 618 |
UNSUPPORTED("3uv943c2f82yuif249pf5azob"); |
| 619 |
UNSUPPORTED("74tf5h16bc9zabq3s3dyny543"); |
| 620 |
UNSUPPORTED("d99gcv3i7xes7y7rqf8ii20ux"); |
| 621 |
UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); |
| 622 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 623 |
|
| 624 |
throw new UnsupportedOperationException(); |
| 625 |
} |
| 626 |
|
| 627 |
|
| 628 |
|
| 629 |
|
| 630 |
|
| 631 |
|
| 632 |
public static Object box_overlap(Object... arg) { |
| 633 |
UNSUPPORTED("1e9k599x7ygct7r4cfdxlk9u9"); |
| 634 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 635 |
UNSUPPORTED("7a9wwpu7dhdphd08y1ecw54w5"); |
| 636 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 637 |
|
| 638 |
throw new UnsupportedOperationException(); |
| 639 |
} |
| 640 |
|
| 641 |
|
| 642 |
|
| 643 |
|
| 644 |
|
| 645 |
|
| 646 |
public static Object boxf_overlap(Object... arg) { |
| 647 |
UNSUPPORTED("905nejsewihwhhc3bhnrz9nwo"); |
| 648 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 649 |
UNSUPPORTED("7a9wwpu7dhdphd08y1ecw54w5"); |
| 650 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 651 |
|
| 652 |
throw new UnsupportedOperationException(); |
| 653 |
} |
| 654 |
|
| 655 |
|
| 656 |
|
| 657 |
|
| 658 |
|
| 659 |
|
| 660 |
public static Object box_contains(Object... arg) { |
| 661 |
UNSUPPORTED("aputfc30fjkvy6jx4otljaczq"); |
| 662 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 663 |
UNSUPPORTED("87ap80vrh2a4gpprbxr33lrg3"); |
| 664 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 665 |
|
| 666 |
throw new UnsupportedOperationException(); |
| 667 |
} |
| 668 |
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
|
| 673 |
|
| 674 |
public static Object boxf_contains(Object... arg) { |
| 675 |
UNSUPPORTED("7ccnttkiwt834yfyw0evcm18v"); |
| 676 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 677 |
UNSUPPORTED("87ap80vrh2a4gpprbxr33lrg3"); |
| 678 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 679 |
|
| 680 |
throw new UnsupportedOperationException(); |
| 681 |
} |
| 682 |
|
| 683 |
|
| 684 |
|
| 685 |
|
| 686 |
|
| 687 |
|
| 688 |
public static Object perp(Object... arg) { |
| 689 |
UNSUPPORTED("567wpqlg9rv63ynyvxd9sgkww"); |
| 690 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 691 |
UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); |
| 692 |
UNSUPPORTED("2fyydy6t6yifjsczccsb9szeg"); |
| 693 |
UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); |
| 694 |
UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); |
| 695 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 696 |
|
| 697 |
throw new UnsupportedOperationException(); |
| 698 |
} |
| 699 |
|
| 700 |
|
| 701 |
|
| 702 |
|
| 703 |
|
| 704 |
|
| 705 |
public static Object scale(Object... arg) { |
| 706 |
UNSUPPORTED("c1ngytew34bmkdb7vps5h3dh8"); |
| 707 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 708 |
UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); |
| 709 |
UNSUPPORTED("dznf7nac14snww4usquyd6r3r"); |
| 710 |
UNSUPPORTED("33kk73m8vjcux5tnjl8co2pe6"); |
| 711 |
UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); |
| 712 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 713 |
|
| 714 |
throw new UnsupportedOperationException(); |
| 715 |
} |
| 716 |
|
| 717 |
|
| 718 |
|
| 719 |
|
| 720 |
private static jmp_buf jbuf = new jmp_buf(); |
| 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 |
public static void add_tree_edge(ST_Agedge_s e) { |
| 754 |
ENTERING("6au5htcaxhw0blmx5c48v03u0","add_tree_edge"); |
| 755 |
try { |
| 756 |
ST_Agnode_s n; |
| 757 |
if (TREE_EDGE(e)) { |
| 758 |
UNSUPPORTED("cq4nqjjxvb0dtdfy4c7pwpqai"); |
| 759 |
UNSUPPORTED("6fzmgjpkhmnx0a2cnt0q0rceg"); |
| 760 |
} |
| 761 |
ED_tree_index(e, Z.z().Tree_edge.size); |
| 762 |
|
| 763 |
Z.z().Tree_edge.setInList(Z.z().Tree_edge.size, e); |
| 764 |
Z.z().Tree_edge.size = 1+ Z.z().Tree_edge.size; |
| 765 |
|
| 766 |
if (ND_mark(agtail(e)) == 0) { |
| 767 |
Z.z().Tree_node.setInList(Z.z().Tree_node.size, agtail(e)); |
| 768 |
Z.z().Tree_node.size = 1+ Z.z().Tree_node.size; |
| 769 |
} |
| 770 |
|
| 771 |
if (ND_mark(aghead(e)) == 0) { |
| 772 |
Z.z().Tree_node.setInList(Z.z().Tree_node.size, aghead(e)); |
| 773 |
Z.z().Tree_node.size = 1+ Z.z().Tree_node.size; |
| 774 |
} |
| 775 |
n = agtail(e); |
| 776 |
ND_mark(n, 1); |
| 777 |
|
| 778 |
ND_tree_out(n).setInList(ND_tree_out(n).size, e); |
| 779 |
ND_tree_out(n).size = 1+ND_tree_out(n).size; |
| 780 |
ND_tree_out(n).setInList(ND_tree_out(n).size, null); |
| 781 |
|
| 782 |
if (ND_out(n).getFromList(ND_tree_out(n).size - 1) == null) { |
| 783 |
UNSUPPORTED("9src34zgmgy8yvdzfs1ozlh0w"); |
| 784 |
UNSUPPORTED("6fzmgjpkhmnx0a2cnt0q0rceg"); |
| 785 |
} |
| 786 |
n = aghead(e); |
| 787 |
ND_mark(n, 1); |
| 788 |
|
| 789 |
ND_tree_in(n).setInList(ND_tree_in(n).size, e); |
| 790 |
ND_tree_in(n).size = 1+ND_tree_in(n).size; |
| 791 |
ND_tree_in(n).setInList(ND_tree_in(n).size, null); |
| 792 |
|
| 793 |
if (ND_in(n).getFromList(ND_tree_in(n).size - 1) == null) { |
| 794 |
UNSUPPORTED("f0uri98pv606g2qjpy9k385cy"); |
| 795 |
UNSUPPORTED("6fzmgjpkhmnx0a2cnt0q0rceg"); |
| 796 |
} |
| 797 |
} finally { |
| 798 |
LEAVING("6au5htcaxhw0blmx5c48v03u0","add_tree_edge"); |
| 799 |
} |
| 800 |
} |
| 801 |
|
| 802 |
|
| 803 |
|
| 804 |
|
| 805 |
|
| 806 |
|
| 807 |
public static void exchange_tree_edges(ST_Agedge_s e, ST_Agedge_s f) { |
| 808 |
ENTERING("9b7b78pmafynmvffztrqnlxtn","exchange_tree_edges"); |
| 809 |
try { |
| 810 |
int i, j; |
| 811 |
ST_Agnode_s n; |
| 812 |
ED_tree_index(f, ED_tree_index(e)); |
| 813 |
Z.z().Tree_edge.setInList(ED_tree_index(e), f); |
| 814 |
ED_tree_index(e, -1); |
| 815 |
n = agtail(e); |
| 816 |
ND_tree_out(n).size = ND_tree_out(n).size -1; |
| 817 |
i = ND_tree_out(n).size; |
| 818 |
for (j = 0; j <= i; j++) |
| 819 |
if (EQ(ND_tree_out(n).getFromList(j), e)) |
| 820 |
break; |
| 821 |
ND_tree_out(n).setInList(j, ND_tree_out(n).getFromList(i)); |
| 822 |
ND_tree_out(n).setInList(i, null); |
| 823 |
n = aghead(e); |
| 824 |
ND_tree_in(n).size = ND_tree_in(n).size -1; |
| 825 |
i = ND_tree_in(n).size; |
| 826 |
for (j = 0; j <= i; j++) |
| 827 |
if (EQ(ND_tree_in(n).getFromList(j), e)) |
| 828 |
break; |
| 829 |
ND_tree_in(n).setInList(j, ND_tree_in(n).getFromList(i)); |
| 830 |
ND_tree_in(n).setInList(i, null); |
| 831 |
n = agtail(f); |
| 832 |
ND_tree_out(n).setInList(ND_tree_out(n).size, f); |
| 833 |
ND_tree_out(n).size = ND_tree_out(n).size +1; |
| 834 |
ND_tree_out(n).setInList(ND_tree_out(n).size, null); |
| 835 |
n = aghead(f); |
| 836 |
ND_tree_in(n).setInList(ND_tree_in(n).size, f); |
| 837 |
ND_tree_in(n).size = ND_tree_in(n).size +1; |
| 838 |
ND_tree_in(n).setInList(ND_tree_in(n).size, null); |
| 839 |
} finally { |
| 840 |
LEAVING("9b7b78pmafynmvffztrqnlxtn","exchange_tree_edges"); |
| 841 |
} |
| 842 |
} |
| 843 |
|
| 844 |
|
| 845 |
|
| 846 |
|
| 847 |
|
| 848 |
|
| 849 |
public static void init_rank() { |
| 850 |
ENTERING("dbxco6m0mabzhsqfo3pb8nctk","init_rank"); |
| 851 |
try { |
| 852 |
int i, ctr; |
| 853 |
ST_nodequeue Q; |
| 854 |
ST_Agnode_s v; |
| 855 |
ST_Agedge_s e; |
| 856 |
Q = new_queue(Z.z().N_nodes); |
| 857 |
ctr = 0; |
| 858 |
for (v = GD_nlist(Z.z().G_ns); v!=null; v = ND_next(v)) { |
| 859 |
if (ND_priority(v) == 0) |
| 860 |
enqueue(Q, v); |
| 861 |
} |
| 862 |
while ((v = dequeue(Q))!=null) { |
| 863 |
ND_rank(v, 0); |
| 864 |
ctr++; |
| 865 |
for (i = 0; (e = (ST_Agedge_s) ND_in(v).getFromList(i))!=null; i++) |
| 866 |
ND_rank(v, MAX(ND_rank(v), ND_rank(agtail(e)) + ED_minlen(e))); |
| 867 |
for (i = 0; (e = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++) { |
| 868 |
ND_priority(aghead(e), ND_priority(aghead(e)) -1 ); |
| 869 |
if ((ND_priority(aghead(e))) <= 0) |
| 870 |
enqueue(Q, aghead(e)); |
| 871 |
} |
| 872 |
} |
| 873 |
if (ctr != Z.z().N_nodes) { |
| 874 |
UNSUPPORTED("7sgp99x1l3hzfks5wykxa87gf"); |
| 875 |
UNSUPPORTED("bwwunxmw4kgz6qntbn6xp0cur"); |
| 876 |
UNSUPPORTED("3dk132mz1u2pf0tla64kl6hv0"); |
| 877 |
UNSUPPORTED("916bi45h6sjvte1rgig12b1v2"); |
| 878 |
} |
| 879 |
free_queue(Q); |
| 880 |
} finally { |
| 881 |
LEAVING("dbxco6m0mabzhsqfo3pb8nctk","init_rank"); |
| 882 |
} |
| 883 |
} |
| 884 |
|
| 885 |
|
| 886 |
|
| 887 |
|
| 888 |
|
| 889 |
|
| 890 |
public static ST_Agnode_s incident(ST_Agedge_s e) { |
| 891 |
ENTERING("bj7ux5kz8ls2lnfh0ix6i00b9","incident"); |
| 892 |
try { |
| 893 |
if (ND_mark(agtail(e))!=0) { |
| 894 |
if (ND_mark(aghead(e)) == 0) |
| 895 |
return agtail(e); |
| 896 |
} else { |
| 897 |
if (ND_mark(aghead(e))!=0) |
| 898 |
return aghead(e); |
| 899 |
} |
| 900 |
return null; |
| 901 |
} finally { |
| 902 |
LEAVING("bj7ux5kz8ls2lnfh0ix6i00b9","incident"); |
| 903 |
} |
| 904 |
} |
| 905 |
|
| 906 |
|
| 907 |
|
| 908 |
|
| 909 |
|
| 910 |
|
| 911 |
public static ST_Agedge_s leave_edge() { |
| 912 |
ENTERING("4i9tcvid2iql874c6k70s9aqm","leave_edge"); |
| 913 |
try { |
| 914 |
ST_Agedge_s f, rv = null; |
| 915 |
int j, cnt = 0; |
| 916 |
j = Z.z().S_i; |
| 917 |
while (Z.z().S_i < Z.z().Tree_edge.size) { |
| 918 |
if (ED_cutvalue(f = (ST_Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i)) < 0) { |
| 919 |
if (rv!=null) { |
| 920 |
if (ED_cutvalue(rv) > ED_cutvalue(f)) |
| 921 |
rv = f; |
| 922 |
} else |
| 923 |
rv = (ST_Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i); |
| 924 |
if (++cnt >= Z.z().Search_size) |
| 925 |
return rv; |
| 926 |
} |
| 927 |
Z.z().S_i++; |
| 928 |
} |
| 929 |
if (j > 0) { |
| 930 |
Z.z().S_i = 0; |
| 931 |
while (Z.z().S_i < j) { |
| 932 |
if (ED_cutvalue(f = (ST_Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i)) < 0) { |
| 933 |
if (rv!=null) { |
| 934 |
if (ED_cutvalue(rv) > ED_cutvalue(f)) |
| 935 |
rv = f; |
| 936 |
} else |
| 937 |
rv = (ST_Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i); |
| 938 |
if (++cnt >= Z.z().Search_size) |
| 939 |
return rv; |
| 940 |
} |
| 941 |
Z.z().S_i++; |
| 942 |
} |
| 943 |
} |
| 944 |
return rv; |
| 945 |
} finally { |
| 946 |
LEAVING("4i9tcvid2iql874c6k70s9aqm","leave_edge"); |
| 947 |
} |
| 948 |
} |
| 949 |
|
| 950 |
|
| 951 |
|
| 952 |
|
| 953 |
|
| 954 |
|
| 955 |
|
| 956 |
|
| 957 |
|
| 958 |
|
| 959 |
|
| 960 |
|
| 961 |
|
| 962 |
|
| 963 |
public static void dfs_enter_outedge(ST_Agnode_s v) { |
| 964 |
ENTERING("10lkpr4y40luvy2idlozfiva3","dfs_enter_outedge"); |
| 965 |
try { |
| 966 |
int i, slack; |
| 967 |
ST_Agedge_s e; |
| 968 |
for (i = 0; (e = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++) { |
| 969 |
if (TREE_EDGE(e) == false) { |
| 970 |
if (N(SEQ(Z.z().Low, ND_lim(aghead(e)), Z.z().Lim))) { |
| 971 |
slack = SLACK(e); |
| 972 |
if ((slack < Z.z().Slack) || (Z.z().Enter == null)) { |
| 973 |
Z.z().Enter = e; |
| 974 |
Z.z().Slack = slack; |
| 975 |
} |
| 976 |
} |
| 977 |
} else if (ND_lim(aghead(e)) < ND_lim(v)) |
| 978 |
dfs_enter_outedge(aghead(e)); |
| 979 |
} |
| 980 |
for (i = 0; (e = (ST_Agedge_s) ND_tree_in(v).getFromList(i))!=null && (Z.z().Slack > 0); i++) |
| 981 |
if (ND_lim(agtail(e)) < ND_lim(v)) |
| 982 |
dfs_enter_outedge(agtail(e)); |
| 983 |
} finally { |
| 984 |
LEAVING("10lkpr4y40luvy2idlozfiva3","dfs_enter_outedge"); |
| 985 |
} |
| 986 |
} |
| 987 |
|
| 988 |
|
| 989 |
|
| 990 |
|
| 991 |
|
| 992 |
|
| 993 |
public static void dfs_enter_inedge(ST_Agnode_s v) { |
| 994 |
ENTERING("2z9nii6380p8qlql8nznzgvof","dfs_enter_inedge"); |
| 995 |
try { |
| 996 |
int i, slack; |
| 997 |
ST_Agedge_s e; |
| 998 |
for (i = 0; (e = (ST_Agedge_s) ND_in(v).getFromList(i))!=null; i++) { |
| 999 |
if (TREE_EDGE(e) == false) { |
| 1000 |
if (N(SEQ(Z.z().Low, ND_lim(agtail(e)), Z.z().Lim))) { |
| 1001 |
slack = SLACK(e); |
| 1002 |
if ((slack < Z.z().Slack) || (Z.z().Enter == null)) { |
| 1003 |
Z.z().Enter = e; |
| 1004 |
Z.z().Slack = slack; |
| 1005 |
} |
| 1006 |
} |
| 1007 |
} else if (ND_lim(agtail(e)) < ND_lim(v)) |
| 1008 |
dfs_enter_inedge(agtail(e)); |
| 1009 |
} |
| 1010 |
for (i = 0; (e = (ST_Agedge_s) ND_tree_out(v).getFromList(i))!=null && (Z.z().Slack > 0); i++) |
| 1011 |
if (ND_lim(aghead(e)) < ND_lim(v)) |
| 1012 |
dfs_enter_inedge(aghead(e)); |
| 1013 |
} finally { |
| 1014 |
LEAVING("2z9nii6380p8qlql8nznzgvof","dfs_enter_inedge"); |
| 1015 |
} |
| 1016 |
} |
| 1017 |
|
| 1018 |
|
| 1019 |
|
| 1020 |
|
| 1021 |
|
| 1022 |
|
| 1023 |
public static ST_Agedge_s enter_edge(ST_Agedge_s e) { |
| 1024 |
ENTERING("aeu2po1o1rvibmafk0k8dw0fh","enter_edge"); |
| 1025 |
try { |
| 1026 |
ST_Agnode_s v; |
| 1027 |
int outsearch; |
| 1028 |
|
| 1029 |
if (ND_lim(agtail(e)) < ND_lim(aghead(e))) { |
| 1030 |
v = agtail(e); |
| 1031 |
outsearch = 0; |
| 1032 |
} else { |
| 1033 |
v = aghead(e); |
| 1034 |
outsearch = 1; |
| 1035 |
} |
| 1036 |
Z.z().Enter = null; |
| 1037 |
Z.z().Slack = INT_MAX; |
| 1038 |
Z.z().Low = ND_low(v); |
| 1039 |
Z.z().Lim = ND_lim(v); |
| 1040 |
if (outsearch!=0) |
| 1041 |
dfs_enter_outedge(v); |
| 1042 |
else |
| 1043 |
dfs_enter_inedge(v); |
| 1044 |
return Z.z().Enter; |
| 1045 |
} finally { |
| 1046 |
LEAVING("aeu2po1o1rvibmafk0k8dw0fh","enter_edge"); |
| 1047 |
} |
| 1048 |
} |
| 1049 |
|
| 1050 |
|
| 1051 |
|
| 1052 |
|
| 1053 |
|
| 1054 |
|
| 1055 |
public static boolean treesearch(ST_Agnode_s v) { |
| 1056 |
ENTERING("1gvyafmercq92v3lg6gb33cbt","treesearch"); |
| 1057 |
try { |
| 1058 |
int i; |
| 1059 |
ST_Agedge_s e; |
| 1060 |
for (i = 0; (e = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++) { |
| 1061 |
if ((ND_mark(aghead(e)) == 0) && (SLACK(e) == 0)) { |
| 1062 |
add_tree_edge(e); |
| 1063 |
if ((Z.z().Tree_edge.size == Z.z().N_nodes - 1) || treesearch(aghead(e))) |
| 1064 |
return NOT(0); |
| 1065 |
} |
| 1066 |
} |
| 1067 |
for (i = 0; (e = (ST_Agedge_s) ND_in(v).getFromList(i))!=null; i++) { |
| 1068 |
if ((ND_mark(agtail(e)) == 0) && (SLACK(e) == 0)) { |
| 1069 |
add_tree_edge(e); |
| 1070 |
if ((Z.z().Tree_edge.size == Z.z().N_nodes - 1) || treesearch(agtail(e))) |
| 1071 |
return NOT(0); |
| 1072 |
} |
| 1073 |
} |
| 1074 |
return false; |
| 1075 |
} finally { |
| 1076 |
LEAVING("1gvyafmercq92v3lg6gb33cbt","treesearch"); |
| 1077 |
} |
| 1078 |
} |
| 1079 |
|
| 1080 |
|
| 1081 |
|
| 1082 |
|
| 1083 |
|
| 1084 |
|
| 1085 |
public static int tight_tree() { |
| 1086 |
ENTERING("c98bj1u8j43cdezeczn33mec0","tight_tree"); |
| 1087 |
try { |
| 1088 |
int i; |
| 1089 |
ST_Agnode_s n; |
| 1090 |
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) { |
| 1091 |
ND_mark(n, 0); |
| 1092 |
ND_tree_in(n).setInList(0, null); |
| 1093 |
ND_tree_out(n).setInList(0, null); |
| 1094 |
ND_tree_in(n).size = 0; |
| 1095 |
ND_tree_out(n).size = 0; |
| 1096 |
} |
| 1097 |
for (i = 0; i < Z.z().Tree_edge.size; i++) |
| 1098 |
ED_tree_index(Z.z().Tree_edge.getFromList(i), -1); |
| 1099 |
Z.z().Tree_node.size = 0; |
| 1100 |
Z.z().Tree_edge.size = 0; |
| 1101 |
for (n = GD_nlist(Z.z().G_ns); n!=null && (Z.z().Tree_edge.size == 0); n = ND_next(n)) |
| 1102 |
treesearch(n); |
| 1103 |
return Z.z().Tree_node.size; |
| 1104 |
} finally { |
| 1105 |
LEAVING("c98bj1u8j43cdezeczn33mec0","tight_tree"); |
| 1106 |
} |
| 1107 |
} |
| 1108 |
|
| 1109 |
|
| 1110 |
|
| 1111 |
|
| 1112 |
|
| 1113 |
|
| 1114 |
public static void init_cutvalues() { |
| 1115 |
ENTERING("10o7oe8d097fx7swmpqd4tf0h","init_cutvalues"); |
| 1116 |
try { |
| 1117 |
dfs_range(GD_nlist(Z.z().G_ns), null, 1); |
| 1118 |
dfs_cutval(GD_nlist(Z.z().G_ns), null); |
| 1119 |
} finally { |
| 1120 |
LEAVING("10o7oe8d097fx7swmpqd4tf0h","init_cutvalues"); |
| 1121 |
} |
| 1122 |
} |
| 1123 |
|
| 1124 |
|
| 1125 |
|
| 1126 |
|
| 1127 |
|
| 1128 |
|
| 1129 |
public static int feasible_tree() { |
| 1130 |
ENTERING("756raqohoxdeiddqbyr37h7ig","feasible_tree"); |
| 1131 |
try { |
| 1132 |
int i, delta; |
| 1133 |
ST_Agnode_s n; |
| 1134 |
ST_Agedge_s e, f; |
| 1135 |
if (Z.z().N_nodes <= 1) |
| 1136 |
return 0; |
| 1137 |
while (tight_tree() < Z.z().N_nodes) { |
| 1138 |
e = null; |
| 1139 |
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) { |
| 1140 |
for (i = 0; (f = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++) { |
| 1141 |
if ((TREE_EDGE(f) == false) && incident(f)!=null && ((e == null) |
| 1142 |
|| (SLACK(f) |
| 1143 |
< |
| 1144 |
SLACK |
| 1145 |
(e)))) |
| 1146 |
e = f; |
| 1147 |
} |
| 1148 |
} |
| 1149 |
if (e!=null) { |
| 1150 |
delta = SLACK(e); |
| 1151 |
if (delta!=0) { |
| 1152 |
if (EQ(incident(e), aghead(e))) |
| 1153 |
delta = -delta; |
| 1154 |
for (i = 0; i < Z.z().Tree_node.size; i++) |
| 1155 |
ND_rank(Z.z().Tree_node.getFromList(i), ND_rank(Z.z().Tree_node.getFromList(i)) + delta); |
| 1156 |
} |
| 1157 |
} else { |
| 1158 |
return 1; |
| 1159 |
} |
| 1160 |
} |
| 1161 |
init_cutvalues(); |
| 1162 |
return 0; |
| 1163 |
} finally { |
| 1164 |
LEAVING("756raqohoxdeiddqbyr37h7ig","feasible_tree"); |
| 1165 |
} |
| 1166 |
} |
| 1167 |
|
| 1168 |
|
| 1169 |
|
| 1170 |
|
| 1171 |
|
| 1172 |
|
| 1173 |
public static ST_Agnode_s treeupdate(ST_Agnode_s v, ST_Agnode_s w, int cutvalue, boolean dir) { |
| 1174 |
ENTERING("49un8m43odrf89cedvin3wz3r","treeupdate"); |
| 1175 |
try { |
| 1176 |
ST_Agedge_s e; |
| 1177 |
boolean d; |
| 1178 |
while (N(SEQ(ND_low(v), ND_lim(w), ND_lim(v)))) { |
| 1179 |
e = (ST_Agedge_s) ND_par(v); |
| 1180 |
if (EQ(v, agtail(e))) |
| 1181 |
d = dir; |
| 1182 |
else |
| 1183 |
d = NOT(dir); |
| 1184 |
if (d) |
| 1185 |
ED_cutvalue(e, ED_cutvalue(e) + cutvalue); |
| 1186 |
else |
| 1187 |
ED_cutvalue(e, ED_cutvalue(e) - cutvalue); |
| 1188 |
if (ND_lim(agtail(e)) > ND_lim(aghead(e))) |
| 1189 |
v = agtail(e); |
| 1190 |
else |
| 1191 |
v = aghead(e); |
| 1192 |
} |
| 1193 |
return v; |
| 1194 |
} finally { |
| 1195 |
LEAVING("49un8m43odrf89cedvin3wz3r","treeupdate"); |
| 1196 |
} |
| 1197 |
} |
| 1198 |
|
| 1199 |
|
| 1200 |
|
| 1201 |
|
| 1202 |
|
| 1203 |
|
| 1204 |
public static void rerank(ST_Agnode_s v, int delta) { |
| 1205 |
ENTERING("e66n8gern1fejjsn8nefypo0g","rerank"); |
| 1206 |
try { |
| 1207 |
int i; |
| 1208 |
ST_Agedge_s e; |
| 1209 |
ND_rank(v, ND_rank(v) - delta); |
| 1210 |
for (i = 0; (e = (ST_Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++) |
| 1211 |
if (NEQ(e, ND_par(v))) |
| 1212 |
rerank(aghead(e), delta); |
| 1213 |
for (i = 0; (e = (ST_Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++) |
| 1214 |
if (NEQ(e, ND_par(v))) |
| 1215 |
rerank(agtail(e), delta); |
| 1216 |
} finally { |
| 1217 |
LEAVING("e66n8gern1fejjsn8nefypo0g","rerank"); |
| 1218 |
} |
| 1219 |
} |
| 1220 |
|
| 1221 |
|
| 1222 |
|
| 1223 |
|
| 1224 |
|
| 1225 |
|
| 1226 |
public static void update(ST_Agedge_s e, ST_Agedge_s f) { |
| 1227 |
ENTERING("xww1p8bentf1qk7mgfhi1q6m","update"); |
| 1228 |
try { |
| 1229 |
int cutvalue, delta; |
| 1230 |
ST_Agnode_s lca; |
| 1231 |
delta = SLACK(f); |
| 1232 |
|
| 1233 |
if (delta > 0) { |
| 1234 |
int s; |
| 1235 |
s = ND_tree_in(agtail(e)).size + ND_tree_out(agtail(e)).size; |
| 1236 |
if (s == 1) |
| 1237 |
rerank(agtail(e), delta); |
| 1238 |
else { |
| 1239 |
s = ND_tree_in(aghead(e)).size + ND_tree_out(aghead(e)).size; |
| 1240 |
if (s == 1) |
| 1241 |
rerank(aghead(e), -delta); |
| 1242 |
else { |
| 1243 |
if (ND_lim(agtail(e)) < ND_lim(aghead(e))) |
| 1244 |
rerank(agtail(e), delta); |
| 1245 |
else |
| 1246 |
rerank(aghead(e), -delta); |
| 1247 |
} |
| 1248 |
} |
| 1249 |
} |
| 1250 |
cutvalue = ED_cutvalue(e); |
| 1251 |
lca = treeupdate(agtail(f), aghead(f), cutvalue, true); |
| 1252 |
if (NEQ(treeupdate(aghead(f), agtail(f), cutvalue, false), lca)) { |
| 1253 |
UNSUPPORTED("f2l4c6yhnwnfer3vrasf55fio"); |
| 1254 |
UNSUPPORTED("6fzmgjpkhmnx0a2cnt0q0rceg"); |
| 1255 |
} |
| 1256 |
ED_cutvalue(f, -cutvalue); |
| 1257 |
ED_cutvalue(e, 0); |
| 1258 |
exchange_tree_edges(e, f); |
| 1259 |
dfs_range(lca, ND_par(lca), ND_low(lca)); |
| 1260 |
} finally { |
| 1261 |
LEAVING("xww1p8bentf1qk7mgfhi1q6m","update"); |
| 1262 |
} |
| 1263 |
} |
| 1264 |
|
| 1265 |
|
| 1266 |
|
| 1267 |
|
| 1268 |
|
| 1269 |
|
| 1270 |
public static void scan_and_normalize() { |
| 1271 |
ENTERING("3yw7w42hz7af67d6qse3b2172","scan_and_normalize"); |
| 1272 |
try { |
| 1273 |
ST_Agnode_s n; |
| 1274 |
Z.z().Minrank = Integer.MAX_VALUE; |
| 1275 |
Z.z().Maxrank = -Integer.MAX_VALUE; |
| 1276 |
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) { |
| 1277 |
if (ND_node_type(n) == 0) { |
| 1278 |
Z.z().Minrank = MIN(Z.z().Minrank, ND_rank(n)); |
| 1279 |
Z.z().Maxrank = MAX(Z.z().Maxrank, ND_rank(n)); |
| 1280 |
} |
| 1281 |
} |
| 1282 |
if (Z.z().Minrank != 0) { |
| 1283 |
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) |
| 1284 |
ND_rank(n, ND_rank(n) - Z.z().Minrank); |
| 1285 |
Z.z().Maxrank -= Z.z().Minrank; |
| 1286 |
Z.z().Minrank = 0; |
| 1287 |
} |
| 1288 |
} finally { |
| 1289 |
LEAVING("3yw7w42hz7af67d6qse3b2172","scan_and_normalize"); |
| 1290 |
} |
| 1291 |
} |
| 1292 |
|
| 1293 |
|
| 1294 |
|
| 1295 |
|
| 1296 |
|
| 1297 |
|
| 1298 |
public static void freeTreeList(ST_Agraph_s g) { |
| 1299 |
ENTERING("7eg6zti36nbg4tqyo8yunh86r","freeTreeList"); |
| 1300 |
try { |
| 1301 |
ST_Agnode_s n; |
| 1302 |
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) { |
| 1303 |
free_list(ND_tree_in(n)); |
| 1304 |
free_list(ND_tree_out(n)); |
| 1305 |
ND_mark(n, 0); |
| 1306 |
} |
| 1307 |
} finally { |
| 1308 |
LEAVING("7eg6zti36nbg4tqyo8yunh86r","freeTreeList"); |
| 1309 |
} |
| 1310 |
} |
| 1311 |
|
| 1312 |
|
| 1313 |
|
| 1314 |
|
| 1315 |
|
| 1316 |
|
| 1317 |
public static void LR_balance() { |
| 1318 |
ENTERING("9gx8p7md3v3mzp640xdjj814a","LR_balance"); |
| 1319 |
try { |
| 1320 |
int i, delta; |
| 1321 |
ST_Agedge_s e, f; |
| 1322 |
for (i = 0; i < Z.z().Tree_edge.size; i++) { |
| 1323 |
e = (ST_Agedge_s) Z.z().Tree_edge.getFromList(i); |
| 1324 |
if (ED_cutvalue(e) == 0) { |
| 1325 |
f = enter_edge(e); |
| 1326 |
if (f == null) |
| 1327 |
continue; |
| 1328 |
delta = SLACK(f); |
| 1329 |
if (delta <= 1) |
| 1330 |
continue; |
| 1331 |
if (ND_lim(agtail(e)) < ND_lim(aghead(e))) |
| 1332 |
rerank(agtail(e), delta / 2); |
| 1333 |
else |
| 1334 |
rerank(aghead(e), -delta / 2); |
| 1335 |
} |
| 1336 |
} |
| 1337 |
freeTreeList (Z.z().G_ns); |
| 1338 |
} finally { |
| 1339 |
LEAVING("9gx8p7md3v3mzp640xdjj814a","LR_balance"); |
| 1340 |
} |
| 1341 |
} |
| 1342 |
|
| 1343 |
|
| 1344 |
|
| 1345 |
|
| 1346 |
|
| 1347 |
|
| 1348 |
public static void TB_balance() { |
| 1349 |
ENTERING("5c01jnao2ubmy4l0vi5jol0jz","TB_balance"); |
| 1350 |
try { |
| 1351 |
ST_Agnode_s n; |
| 1352 |
ST_Agedge_s e; |
| 1353 |
int i, low, high, choice; |
| 1354 |
__ptr__ nrank; |
| 1355 |
int inweight, outweight; |
| 1356 |
scan_and_normalize(); |
| 1357 |
|
| 1358 |
nrank = zmalloc(size_t_array_of_integer(Z.z().Maxrank + 1)); |
| 1359 |
for (i = 0; i <= Z.z().Maxrank; i++) |
| 1360 |
nrank.plus(i).setInt(0); |
| 1361 |
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) |
| 1362 |
if (ND_node_type(n) == 0) |
| 1363 |
nrank.plus(ND_rank(n)).setInt(1+nrank.plus(ND_rank(n)).getInt()); |
| 1364 |
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) { |
| 1365 |
if (ND_node_type(n) != 0) |
| 1366 |
continue; |
| 1367 |
inweight = outweight = 0; |
| 1368 |
low = 0; |
| 1369 |
high = Z.z().Maxrank; |
| 1370 |
for (i = 0; (e = (ST_Agedge_s) ND_in(n).getFromList(i))!=null; i++) { |
| 1371 |
inweight += ED_weight(e); |
| 1372 |
low = MAX(low, ND_rank(agtail(e)) + ED_minlen(e)); |
| 1373 |
} |
| 1374 |
for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++) { |
| 1375 |
outweight += ED_weight(e); |
| 1376 |
high = MIN(high, ND_rank(aghead(e)) - ED_minlen(e)); |
| 1377 |
} |
| 1378 |
if (low < 0) |
| 1379 |
low = 0; |
| 1380 |
if (inweight == outweight) { |
| 1381 |
choice = low; |
| 1382 |
for (i = low + 1; i <= high; i++) |
| 1383 |
if (nrank.plus(i).getInt() < nrank.plus(choice).getInt()) |
| 1384 |
choice = i; |
| 1385 |
nrank.plus(ND_rank(n)).setInt(nrank.plus(ND_rank(n)).getInt()-1); |
| 1386 |
nrank.plus(choice).setInt(nrank.plus(choice).getInt()+1); |
| 1387 |
ND_rank(n, choice); |
| 1388 |
} |
| 1389 |
free_list(ND_tree_in(n)); |
| 1390 |
free_list(ND_tree_out(n)); |
| 1391 |
ND_mark(n, 0); |
| 1392 |
} |
| 1393 |
Memory.free(nrank); |
| 1394 |
} finally { |
| 1395 |
LEAVING("5c01jnao2ubmy4l0vi5jol0jz","TB_balance"); |
| 1396 |
} |
| 1397 |
} |
| 1398 |
|
| 1399 |
|
| 1400 |
|
| 1401 |
|
| 1402 |
|
| 1403 |
|
| 1404 |
public static int init_graph(ST_Agraph_s g) { |
| 1405 |
ENTERING("37hg5w7ywmyljdiebgp5ltl22","init_graph"); |
| 1406 |
try { |
| 1407 |
int i, feasible; |
| 1408 |
ST_Agnode_s n; |
| 1409 |
ST_Agedge_s e; |
| 1410 |
Z.z().G_ns = g; |
| 1411 |
Z.z().N_nodes = Z.z().N_edges = Z.z().S_i = 0; |
| 1412 |
for (n = GD_nlist(g); n!=null; n = ND_next(n)) { |
| 1413 |
ND_mark(n, 0); |
| 1414 |
Z.z().N_nodes++; |
| 1415 |
for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++) |
| 1416 |
Z.z().N_edges++; |
| 1417 |
} |
| 1418 |
Z.z().Tree_node.reallocEmpty(Z.z().N_nodes); |
| 1419 |
Z.z().Tree_node.size = 0; |
| 1420 |
|
| 1421 |
Z.z().Tree_edge.realloc(Z.z().N_nodes); |
| 1422 |
Z.z().Tree_edge.size = 0; |
| 1423 |
feasible = 1; |
| 1424 |
for (n = GD_nlist(g); n!=null; n = ND_next(n)) { |
| 1425 |
ND_priority(n, 0); |
| 1426 |
for (i = 0; (e = (ST_Agedge_s) ND_in(n).getFromList(i))!=null; i++) { |
| 1427 |
ND_priority(n, 1+ND_priority(n)); |
| 1428 |
ED_cutvalue(e, 0); |
| 1429 |
ED_tree_index(e, -1); |
| 1430 |
if (feasible!=0 |
| 1431 |
&& (ND_rank(aghead(e)) - ND_rank(agtail(e)) < ED_minlen(e))) |
| 1432 |
feasible = 0; |
| 1433 |
} |
| 1434 |
|
| 1435 |
ND_tree_in(n).mallocEmpty(i+1); |
| 1436 |
ND_tree_in(n).size = 0; |
| 1437 |
for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++); |
| 1438 |
|
| 1439 |
ND_tree_out(n).mallocEmpty(i+1); |
| 1440 |
ND_tree_out(n).size = 0; |
| 1441 |
} |
| 1442 |
return feasible; |
| 1443 |
} finally { |
| 1444 |
LEAVING("37hg5w7ywmyljdiebgp5ltl22","init_graph"); |
| 1445 |
} |
| 1446 |
} |
| 1447 |
|
| 1448 |
|
| 1449 |
|
| 1450 |
|
| 1451 |
|
| 1452 |
|
| 1453 |
public static Object graphSize(Object... arg) { |
| 1454 |
UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); |
| 1455 |
UNSUPPORTED("d95292hibn08mh6rbguy3zeib"); |
| 1456 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 1457 |
UNSUPPORTED("4i46dhl8eqbh29vq1vn3ipo70"); |
| 1458 |
UNSUPPORTED("cjx5v6hayed3q8eeub1cggqca"); |
| 1459 |
UNSUPPORTED("5gypxs09iuryx5a2eho9lgdcp"); |
| 1460 |
UNSUPPORTED("359m8vuzzte7zl5lru7vf4bga"); |
| 1461 |
UNSUPPORTED("8g62mxpap4eeua2lkn9a1iosi"); |
| 1462 |
UNSUPPORTED("a5hcy2vbfyq09svspfdvsreu1"); |
| 1463 |
UNSUPPORTED("az80xiplaqv1i8gmq2feyyrea"); |
| 1464 |
UNSUPPORTED("1sy3rnb8qjw3nmyka290izgi2"); |
| 1465 |
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); |
| 1466 |
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); |
| 1467 |
UNSUPPORTED("h7rj9k6bm1iatjqeqmhlinoi"); |
| 1468 |
UNSUPPORTED("7whkfg1zlimqk163vbj7cgxmt"); |
| 1469 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 1470 |
|
| 1471 |
throw new UnsupportedOperationException(); |
| 1472 |
} |
| 1473 |
|
| 1474 |
|
| 1475 |
|
| 1476 |
|
| 1477 |
|
| 1478 |
|
| 1479 |
public static int rank2(ST_Agraph_s g, int balance, int maxiter, int search_size) { |
| 1480 |
ENTERING("5n0ipwzhr8urlx0fsdzr02gwq","rank2"); |
| 1481 |
try { |
| 1482 |
int iter = 0, feasible; |
| 1483 |
CString ns = new CString("network simplex: "); |
| 1484 |
ST_Agedge_s e, f; |
| 1485 |
|
| 1486 |
|
| 1487 |
|
| 1488 |
|
| 1489 |
|
| 1490 |
|
| 1491 |
|
| 1492 |
feasible = init_graph(g); |
| 1493 |
if (N(feasible)) |
| 1494 |
init_rank(); |
| 1495 |
if (maxiter <= 0) { |
| 1496 |
freeTreeList (g); |
| 1497 |
return 1; |
| 1498 |
} |
| 1499 |
if (search_size >= 0) |
| 1500 |
Z.z().Search_size = search_size; |
| 1501 |
else |
| 1502 |
Z.z().Search_size = 30; |
| 1503 |
if (setjmp (jbuf)!=0) { |
| 1504 |
return 2; |
| 1505 |
} |
| 1506 |
if (feasible_tree()!=0) { |
| 1507 |
freeTreeList (g); |
| 1508 |
return 1; |
| 1509 |
} |
| 1510 |
while ((e = leave_edge())!=null) { |
| 1511 |
f = enter_edge(e); |
| 1512 |
update(e, f); |
| 1513 |
iter++; |
| 1514 |
|
| 1515 |
|
| 1516 |
|
| 1517 |
|
| 1518 |
|
| 1519 |
|
| 1520 |
|
| 1521 |
if (iter >= maxiter) |
| 1522 |
break; |
| 1523 |
} |
| 1524 |
switch (balance) { |
| 1525 |
case 1: |
| 1526 |
TB_balance(); |
| 1527 |
break; |
| 1528 |
case 2: |
| 1529 |
LR_balance(); |
| 1530 |
break; |
| 1531 |
default: |
| 1532 |
scan_and_normalize(); |
| 1533 |
freeTreeList (Z.z().G_ns); |
| 1534 |
break; |
| 1535 |
} |
| 1536 |
|
| 1537 |
|
| 1538 |
|
| 1539 |
|
| 1540 |
|
| 1541 |
|
| 1542 |
return 0; |
| 1543 |
} finally { |
| 1544 |
LEAVING("5n0ipwzhr8urlx0fsdzr02gwq","rank2"); |
| 1545 |
} |
| 1546 |
} |
| 1547 |
|
| 1548 |
|
| 1549 |
|
| 1550 |
|
| 1551 |
|
| 1552 |
|
| 1553 |
public static int rank(ST_Agraph_s g, int balance, int maxiter) { |
| 1554 |
ENTERING("aqly8eniwjr5bmh4hzwc7ftdr","rank"); |
| 1555 |
try { |
| 1556 |
CString s; |
| 1557 |
int search_size; |
| 1558 |
if ((s = agget(g, new CString("searchsize")))!=null) |
| 1559 |
search_size = atoi(s); |
| 1560 |
else |
| 1561 |
search_size = 30; |
| 1562 |
return rank2 (g, balance, maxiter, search_size); |
| 1563 |
} finally { |
| 1564 |
LEAVING("aqly8eniwjr5bmh4hzwc7ftdr","rank"); |
| 1565 |
} |
| 1566 |
} |
| 1567 |
|
| 1568 |
|
| 1569 |
|
| 1570 |
|
| 1571 |
|
| 1572 |
|
| 1573 |
public static void x_cutval(ST_Agedge_s f) { |
| 1574 |
ENTERING("2q59mz8qtn0biifbezb8uxz17","x_cutval"); |
| 1575 |
try { |
| 1576 |
ST_Agnode_s v=null; |
| 1577 |
ST_Agedge_s e; |
| 1578 |
int i, sum, dir=0; |
| 1579 |
|
| 1580 |
if (EQ(ND_par(agtail(f)), f)) { |
| 1581 |
v = agtail(f); |
| 1582 |
dir = 1; |
| 1583 |
} else { |
| 1584 |
v = aghead(f); |
| 1585 |
dir = -1; |
| 1586 |
} |
| 1587 |
sum = 0; |
| 1588 |
for (i = 0; (e = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++) |
| 1589 |
sum += x_val(e, v, dir); |
| 1590 |
for (i = 0; (e = (ST_Agedge_s) ND_in(v).getFromList(i))!=null; i++) |
| 1591 |
sum += x_val(e, v, dir); |
| 1592 |
ED_cutvalue(f, sum); |
| 1593 |
} finally { |
| 1594 |
LEAVING("2q59mz8qtn0biifbezb8uxz17","x_cutval"); |
| 1595 |
} |
| 1596 |
} |
| 1597 |
|
| 1598 |
|
| 1599 |
|
| 1600 |
|
| 1601 |
|
| 1602 |
|
| 1603 |
public static int x_val(ST_Agedge_s e, ST_Agnode_s v, int dir) { |
| 1604 |
ENTERING("bfeafmsmmnblgizs37qj03dy4","x_val"); |
| 1605 |
try { |
| 1606 |
ST_Agnode_s other; |
| 1607 |
int d=0, rv=0, f=0; |
| 1608 |
if (EQ(agtail(e), v)) |
| 1609 |
other = aghead(e); |
| 1610 |
else |
| 1611 |
other = agtail(e); |
| 1612 |
if (N(SEQ(ND_low(v), ND_lim(other), ND_lim(v)))) { |
| 1613 |
f = 1; |
| 1614 |
rv = ED_weight(e); |
| 1615 |
} else { |
| 1616 |
f = 0; |
| 1617 |
if (TREE_EDGE(e)) |
| 1618 |
rv = ED_cutvalue(e); |
| 1619 |
else |
| 1620 |
rv = 0; |
| 1621 |
rv -= ED_weight(e); |
| 1622 |
} |
| 1623 |
if (dir > 0) { |
| 1624 |
if (EQ(aghead(e), v)) |
| 1625 |
d = 1; |
| 1626 |
else |
| 1627 |
d = -1; |
| 1628 |
} else { |
| 1629 |
if (EQ(agtail(e), v)) |
| 1630 |
d = 1; |
| 1631 |
else |
| 1632 |
d = -1; |
| 1633 |
} |
| 1634 |
if (f!=0) |
| 1635 |
d = -d; |
| 1636 |
if (d < 0) |
| 1637 |
rv = -rv; |
| 1638 |
return rv; |
| 1639 |
} finally { |
| 1640 |
LEAVING("bfeafmsmmnblgizs37qj03dy4","x_val"); |
| 1641 |
} |
| 1642 |
} |
| 1643 |
|
| 1644 |
|
| 1645 |
|
| 1646 |
|
| 1647 |
|
| 1648 |
|
| 1649 |
public static void dfs_cutval(ST_Agnode_s v, ST_Agedge_s par) { |
| 1650 |
ENTERING("ah65iqmwa5j0qwotm6amhijlg","dfs_cutval"); |
| 1651 |
try { |
| 1652 |
int i; |
| 1653 |
ST_Agedge_s e; |
| 1654 |
for (i = 0; (e = (ST_Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++) |
| 1655 |
if (NEQ(e, par)) |
| 1656 |
dfs_cutval(aghead(e), e); |
| 1657 |
for (i = 0; (e = (ST_Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++) |
| 1658 |
if (NEQ(e, par)) |
| 1659 |
dfs_cutval(agtail(e), e); |
| 1660 |
if (par!=null) |
| 1661 |
x_cutval(par); |
| 1662 |
} finally { |
| 1663 |
LEAVING("ah65iqmwa5j0qwotm6amhijlg","dfs_cutval"); |
| 1664 |
} |
| 1665 |
} |
| 1666 |
|
| 1667 |
|
| 1668 |
|
| 1669 |
|
| 1670 |
|
| 1671 |
|
| 1672 |
public static int dfs_range(ST_Agnode_s v, ST_Agedge_s par, int low) { |
| 1673 |
ENTERING("cgqr48qol9p8bsqjnryo5z5x9","dfs_range"); |
| 1674 |
try { |
| 1675 |
ST_Agedge_s e; |
| 1676 |
int i, lim; |
| 1677 |
lim = low; |
| 1678 |
ND_par(v, par); |
| 1679 |
ND_low(v, low); |
| 1680 |
for (i = 0; (e = (ST_Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++) |
| 1681 |
if (NEQ(e, par)) |
| 1682 |
lim = dfs_range(aghead(e), e, lim); |
| 1683 |
for (i = 0; (e = (ST_Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++) |
| 1684 |
if (NEQ(e, par)) |
| 1685 |
lim = dfs_range(agtail(e), e, lim); |
| 1686 |
ND_lim(v, lim); |
| 1687 |
return lim + 1; |
| 1688 |
} finally { |
| 1689 |
LEAVING("cgqr48qol9p8bsqjnryo5z5x9","dfs_range"); |
| 1690 |
} |
| 1691 |
} |
| 1692 |
|
| 1693 |
|
| 1694 |
} |