Debian Codegraph @

src/gen/lib/common/ns__c.java

raw symbols SCIP
1 /* ========================================================================
2 * PlantUML : a free UML diagram generator
3 * ========================================================================
4 *
5 * Project Info: http://plantuml.com
6 *
7 * If you like this project or if you find it useful, you can support us at:
8 *
9 * http://plantuml.com/patreon (only 1$ per month!)
10 * http://plantuml.com/paypal
11 *
12 * This file is part of Smetana.
13 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
14 *
15 * (C) Copyright 2009-2020, Arnaud Roques
16 *
17 * This translation is distributed under the same Licence as the original C program:
18 *
19 *************************************************************************
20 * Copyright (c) 2011 AT&T Intellectual Property
21 * All rights reserved. This program and the accompanying materials
22 * are made available under the terms of the Eclipse Public License v1.0
23 * which accompanies this distribution, and is available at
24 * http://www.eclipse.org/legal/epl-v10.html
25 *
26 * Contributors: See CVS logs. Details at http://www.graphviz.org/
27 *************************************************************************
28 *
29 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
30 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
31 *
32 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
33 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
34 *
35 * You may obtain a copy of the License at
36 *
37 * http://www.eclipse.org/legal/epl-v10.html
38 *
39 * Unless required by applicable law or agreed to in writing, software
40 * distributed under the License is distributed on an "AS IS" BASIS,
41 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42 * See the License for the specific language governing permissions and
43 * limitations under the License.
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 //1 2digov3edok6d5srhgtlmrycs
102 // extern lt_symlist_t lt_preloaded_symbols[]
103
104
105 //1 baedz5i9est5csw3epz3cv7z
106 // typedef Ppoly_t Ppolyline_t
107
108
109 //1 9k44uhd5foylaeoekf3llonjq
110 // extern Dtmethod_t* Dtset
111
112
113 //1 1ahfywsmzcpcig2oxm7pt9ihj
114 // extern Dtmethod_t* Dtbag
115
116
117 //1 anhghfj3k7dmkudy2n7rvt31v
118 // extern Dtmethod_t* Dtoset
119
120
121 //1 5l6oj1ux946zjwvir94ykejbc
122 // extern Dtmethod_t* Dtobag
123
124
125 //1 2wtf222ak6cui8cfjnw6w377z
126 // extern Dtmethod_t* Dtlist
127
128
129 //1 d1s1s6ibtcsmst88e3057u9r7
130 // extern Dtmethod_t* Dtstack
131
132
133 //1 axa7mflo824p6fspjn1rdk0mt
134 // extern Dtmethod_t* Dtqueue
135
136
137 //1 ega812utobm4xx9oa9w9ayij6
138 // extern Dtmethod_t* Dtdeque
139
140
141 //1 cyfr996ur43045jv1tjbelzmj
142 // extern Dtmethod_t* Dtorder
143
144
145 //1 wlofoiftbjgrrabzb2brkycg
146 // extern Dtmethod_t* Dttree
147
148
149 //1 12bds94t7voj7ulwpcvgf6agr
150 // extern Dtmethod_t* Dthash
151
152
153 //1 9lqknzty480cy7zsubmabkk8h
154 // extern Dtmethod_t _Dttree
155
156
157 //1 bvn6zkbcp8vjdhkccqo1xrkrb
158 // extern Dtmethod_t _Dthash
159
160
161 //1 9lidhtd6nsmmv3e7vjv9e10gw
162 // extern Dtmethod_t _Dtlist
163
164
165 //1 34ujfamjxo7xn89u90oh2k6f8
166 // extern Dtmethod_t _Dtqueue
167
168
169 //1 3jy4aceckzkdv950h89p4wjc8
170 // extern Dtmethod_t _Dtstack
171
172
173 //1 8dfqgf3u1v830qzcjqh9o8ha7
174 // extern Agmemdisc_t AgMemDisc
175
176
177 //1 18k2oh2t6llfsdc5x0wlcnby8
178 // extern Agiddisc_t AgIdDisc
179
180
181 //1 a4r7hi80gdxtsv4hdoqpyiivn
182 // extern Agiodisc_t AgIoDisc
183
184
185 //1 bnzt5syjb7mgeru19114vd6xx
186 // extern Agdisc_t AgDefaultDisc
187
188
189 //1 35y2gbegsdjilegaribes00mg
190 // extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, Agstrictundirected
191
192
193 //1 c2rygslq6bcuka3awmvy2b3ow
194 // typedef Agsubnode_t Agnoderef_t
195
196
197 //1 xam6yv0dcsx57dtg44igpbzn
198 // typedef Dtlink_t Agedgeref_t
199
200
201 //1 nye6dsi1twkbddwo9iffca1j
202 // extern char *Version
203
204
205 //1 65mu6k7h7lb7bx14jpiw7iyxr
206 // extern char **Files
207
208
209 //1 2rpjdzsdyrvomf00zcs3u3dyn
210 // extern const char **Lib
211
212
213 //1 6d2f111lntd2rsdt4gswh5909
214 // extern char *CmdName
215
216
217 //1 a0ltq04fpeg83soa05a2fkwb2
218 // extern char *specificFlags
219
220
221 //1 1uv30qeqq2jh6uznlr4dziv0y
222 // extern char *specificItems
223
224
225 //1 7i4hkvngxe3x7lmg5h6b3t9g3
226 // extern char *Gvfilepath
227
228
229 //1 9jp96pa73kseya3w6sulxzok6
230 // extern char *Gvimagepath
231
232
233 //1 40ylumfu7mrvawwf4v2asvtwk
234 // extern unsigned char Verbose
235
236
237 //1 93st8awjy1z0h07n28qycbaka
238 // extern unsigned char Reduce
239
240
241 //1 f2vs67ts992erf8onwfglurzp
242 // extern int MemTest
243
244
245 //1 c6f8whijgjwwagjigmxlwz3gb
246 // extern char *HTTPServerEnVar
247
248
249 //1 cp4hzj7p87m7arw776d3bt7aj
250 // extern char *Output_file_name
251
252
253 //1 a3rqagofsgraie6mx0krzkgsy
254 // extern int graphviz_errors
255
256
257 //1 5up05203r4kxvjn1m4njcgq5x
258 // extern int Nop
259
260
261 //1 umig46cco431x14b3kosde2t
262 // extern double PSinputscale
263
264
265 //1 52bj6v8fqz39khasobljfukk9
266 // extern int Syntax_errors
267
268
269 //1 9ekf2ina8fsjj6y6i0an6somj
270 // extern int Show_cnt
271
272
273 //1 38di5qi3nkxkq65onyvconk3r
274 // extern char** Show_boxes
275
276
277 //1 6ri6iu712m8mpc7t2670etpcw
278 // extern int CL_type
279
280
281 //1 bomxiw3gy0cgd1ydqtek7fpxr
282 // extern unsigned char Concentrate
283
284
285 //1 cqy3gqgcq8empdrbnrhn84058
286 // extern double Epsilon
287
288
289 //1 64slegfoouqeg0rmbyjrm8wgr
290 // extern int MaxIter
291
292
293 //1 88wdinpnmfs4mab4aw62yb0bg
294 // extern int Ndim
295
296
297 //1 8bbad3ogcelqnnvo5br5s05gq
298 // extern int State
299
300
301 //1 17rnd8q45zclfn68qqst2vxxn
302 // extern int EdgeLabelsDone
303
304
305 //1 ymx1z4s8cznjifl2d9f9m8jr
306 // extern double Initial_dist
307
308
309 //1 a33bgl0c3uqb3trx419qulj1x
310 // extern double Damping
311
312
313 //1 d9lvrpjg1r0ojv40pod1xwk8n
314 // extern int Y_invert
315
316
317 //1 71efkfs77q5tq9ex6y0f4kanh
318 // extern int GvExitOnUsage
319
320
321 //1 4xy2dkdkv0acs2ue9eca8hh2e
322 // extern Agsym_t *G_activepencolor, *G_activefillcolor, *G_selectedpencolor, *G_selectedfillcolor, *G_visitedpencolor, *G_visitedfillcolor, *G_deletedpencolor, *G_deletedfillcolor, *G_ordering, *G_peripheries, *G_penwidth, *G_gradientangle, *G_margin
323
324
325 //1 9js5gxgzr74eakgtfhnbws3t9
326 // extern Agsym_t *N_height, *N_width, *N_shape, *N_color, *N_fillcolor, *N_activepencolor, *N_activefillcolor, *N_selectedpencolor, *N_selectedfillcolor, *N_visitedpencolor, *N_visitedfillcolor, *N_deletedpencolor, *N_deletedfillcolor, *N_fontsize, *N_fontname, *N_fontcolor, *N_margin, *N_label, *N_xlabel, *N_nojustify, *N_style, *N_showboxes, *N_sides, *N_peripheries, *N_ordering, *N_orientation, *N_skew, *N_distortion, *N_fixed, *N_imagescale, *N_layer, *N_group, *N_comment, *N_vertices, *N_z, *N_penwidth, *N_gradientangle
327
328
329 //1 anqllp9sj7wo45w6bm11j8trn
330 // extern Agsym_t *E_weight, *E_minlen, *E_color, *E_fillcolor, *E_activepencolor, *E_activefillcolor, *E_selectedpencolor, *E_selectedfillcolor, *E_visitedpencolor, *E_visitedfillcolor, *E_deletedpencolor, *E_deletedfillcolor, *E_fontsize, *E_fontname, *E_fontcolor, *E_label, *E_xlabel, *E_dir, *E_style, *E_decorate, *E_showboxes, *E_arrowsz, *E_constr, *E_layer, *E_comment, *E_label_float, *E_samehead, *E_sametail, *E_arrowhead, *E_arrowtail, *E_headlabel, *E_taillabel, *E_labelfontsize, *E_labelfontname, *E_labelfontcolor, *E_labeldistance, *E_labelangle, *E_tailclip, *E_headclip, *E_penwidth
331
332
333 //1 bh0z9puipqw7gymjd5h5b8s6i
334 // extern struct fdpParms_s* fdp_parms
335
336
337
338
339 //3 ciez0pfggxdljedzsbklq49f0
340 // static inline point pointof(int x, int y)
341 public static Object pointof(Object... arg) {
342 UNSUPPORTED("8e4tj258yvfq5uhsdpk37n5eq"); // static inline point pointof(int x, int y)
343 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
344 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
345 UNSUPPORTED("12jimkrzqxavaie0cpapbx18c"); // r.x = x;
346 UNSUPPORTED("7ivmviysahgsc5nn9gtp7q2if"); // r.y = y;
347 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
348 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
349
350 throw new UnsupportedOperationException();
351 }
352
353
354
355
356 //3 c1s4k85p1cdfn176o3uryeros
357 // static inline pointf pointfof(double x, double y)
358 public static ST_pointf pointfof(double x, double y) {
359 // WARNING!! STRUCT
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 //3 7cufnfitrh935ew093mw0i4b7
378 // static inline box boxof(int llx, int lly, int urx, int ury)
379 public static Object boxof(Object... arg) {
380 UNSUPPORTED("3lzesfdd337h31jrlib1czocm"); // static inline box boxof(int llx, int lly, int urx, int ury)
381 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
382 UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); // box b;
383 UNSUPPORTED("cylhjlutoc0sc0uy7g98m9fb8"); // b.LL.x = llx, b.LL.y = lly;
384 UNSUPPORTED("242of6revxzx8hpe7yerrchz6"); // b.UR.x = urx, b.UR.y = ury;
385 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
386 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
387
388 throw new UnsupportedOperationException();
389 }
390
391
392
393
394
395
396
397 //3 1n5xl70wxuabyf97mclvilsm6
398 // static inline point add_point(point p, point q)
399 public static Object add_point(Object... arg) {
400 UNSUPPORTED("6iamka1fx8fk1rohzzse8phte"); // static inline point add_point(point p, point q)
401 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
402 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
403 UNSUPPORTED("3n2sizjd0civbzm6iq7su1s2p"); // r.x = p.x + q.x;
404 UNSUPPORTED("65ygdo31w09i5i6bd2f7azcd3"); // r.y = p.y + q.y;
405 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
406 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
407
408 throw new UnsupportedOperationException();
409 }
410
411
412
413
414 //3 arrsbik9b5tnfcbzsm8gr2chx
415 // static inline pointf add_pointf(pointf p, pointf q)
416 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
417 // WARNING!! STRUCT
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 //3 ai2dprak5y6obdsflguh5qbd7
436 // static inline point sub_point(point p, point q)
437 public static Object sub_point(Object... arg) {
438 UNSUPPORTED("cd602849h0bce8lu9xegka0ia"); // static inline point sub_point(point p, point q)
439 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
440 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
441 UNSUPPORTED("4q4q9dveah93si8ajfv59gz27"); // r.x = p.x - q.x;
442 UNSUPPORTED("9f90ik0o2yqhanzntpy3d2ydy"); // r.y = p.y - q.y;
443 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
444 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
445
446 throw new UnsupportedOperationException();
447 }
448
449
450
451
452 //3 16f6pyogcv3j7n2p0n8giqqgh
453 // static inline pointf sub_pointf(pointf p, pointf q)
454 public static Object sub_pointf(Object... arg) {
455 UNSUPPORTED("dmufj44lddsnj0wjyxsg2fcso"); // static inline pointf sub_pointf(pointf p, pointf q)
456 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
457 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
458 UNSUPPORTED("4q4q9dveah93si8ajfv59gz27"); // r.x = p.x - q.x;
459 UNSUPPORTED("9f90ik0o2yqhanzntpy3d2ydy"); // r.y = p.y - q.y;
460 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
461 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
462
463 throw new UnsupportedOperationException();
464 }
465
466
467
468
469 //3 9k50jgrhc4f9824vf8ony74rw
470 // static inline point mid_point(point p, point q)
471 public static Object mid_point(Object... arg) {
472 UNSUPPORTED("evy44tdsmu3erff9dp2x835u2"); // static inline point mid_point(point p, point q)
473 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
474 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
475 UNSUPPORTED("1a6p6fm57o0wt5ze2btsx06c7"); // r.x = (p.x + q.x) / 2;
476 UNSUPPORTED("1kbj5tgdmfi6kf4jgg6skhr6e"); // r.y = (p.y + q.y) / 2;
477 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
478 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
479
480 throw new UnsupportedOperationException();
481 }
482
483
484
485
486 //3 59c4f7im0ftyowhnzzq2v9o1x
487 // static inline pointf mid_pointf(pointf p, pointf q)
488 public static Object mid_pointf(Object... arg) {
489 UNSUPPORTED("381o63o9kb04d7gzg65v0r3q"); // static inline pointf mid_pointf(pointf p, pointf q)
490 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
491 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
492 UNSUPPORTED("c5vboetlr3mf43wns7iik6m1w"); // r.x = (p.x + q.x) / 2.;
493 UNSUPPORTED("bcdf562ldr3bjn78hcay5xd63"); // r.y = (p.y + q.y) / 2.;
494 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
495 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
496
497 throw new UnsupportedOperationException();
498 }
499
500
501
502
503 //3 5r18p38gisvcx3zsvbb9saixx
504 // static inline pointf interpolate_pointf(double t, pointf p, pointf q)
505 public static Object interpolate_pointf(Object... arg) {
506 UNSUPPORTED("894yimn33kmtm454llwdaotu8"); // static inline pointf interpolate_pointf(double t, pointf p, pointf q)
507 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
508 UNSUPPORTED("ef2acl8wa2ooqcb5vz3098maz"); // pointf r;
509 UNSUPPORTED("5tpwuyf5iidesy80v8o4nwkmk"); // r.x = p.x + t * (q.x - p.x);
510 UNSUPPORTED("ewnrc5uloj3w5jbmsjcn3wja0"); // r.y = p.y + t * (q.y - p.y);
511 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
512 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
513
514 throw new UnsupportedOperationException();
515 }
516
517
518
519
520 //3 bxzrv2ghq04qk5cbyy68s4mol
521 // static inline point exch_xy(point p)
522 public static Object exch_xy(Object... arg) {
523 UNSUPPORTED("2vxya0v2fzlv5e0vjaa8d414"); // static inline point exch_xy(point p)
524 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
525 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
526 UNSUPPORTED("60cojdwc2h7f0m51s9jdwvup7"); // r.x = p.y;
527 UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); // r.y = p.x;
528 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
529 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
530
531 throw new UnsupportedOperationException();
532 }
533
534
535
536
537 //3 9lt3e03tac6h6sydljrcws8fd
538 // static inline pointf exch_xyf(pointf p)
539 public static Object exch_xyf(Object... arg) {
540 UNSUPPORTED("8qamrobrqi8jsvvfrxkimrsnw"); // static inline pointf exch_xyf(pointf p)
541 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
542 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
543 UNSUPPORTED("60cojdwc2h7f0m51s9jdwvup7"); // r.x = p.y;
544 UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); // r.y = p.x;
545 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
546 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
547
548 throw new UnsupportedOperationException();
549 }
550
551
552
553
554 //3 8l9qhieokthntzdorlu5zn29b
555 // static inline box box_bb(box b0, box b1)
556 public static Object box_bb(Object... arg) {
557 UNSUPPORTED("36et5gmnjrby6o7bq9sgh1hx6"); // static inline box box_bb(box b0, box b1)
558 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
559 UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); // box b;
560 UNSUPPORTED("8mr2c9xitsqi8z1plbp7ox1hu"); // b.LL.x = MIN(b0.LL.x, b1.LL.x);
561 UNSUPPORTED("2egu55ef4u1i03nwz01k7kcrl"); // b.LL.y = MIN(b0.LL.y, b1.LL.y);
562 UNSUPPORTED("9n6ei3odbgefwfxvql9whcpe"); // b.UR.x = MAX(b0.UR.x, b1.UR.x);
563 UNSUPPORTED("19ocysbuh4pxyft2bqhyhigr1"); // b.UR.y = MAX(b0.UR.y, b1.UR.y);
564 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
565 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
566
567 throw new UnsupportedOperationException();
568 }
569
570
571
572
573 //3 clws9h3bbjm0lw3hexf8nl4c4
574 // static inline boxf boxf_bb(boxf b0, boxf b1)
575 public static Object boxf_bb(Object... arg) {
576 UNSUPPORTED("dyrqu4ww9osr9c86gqgmifcp6"); // static inline boxf boxf_bb(boxf b0, boxf b1)
577 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
578 UNSUPPORTED("c57pq0f87j6dnbcvygu7v6k84"); // boxf b;
579 UNSUPPORTED("8mr2c9xitsqi8z1plbp7ox1hu"); // b.LL.x = MIN(b0.LL.x, b1.LL.x);
580 UNSUPPORTED("2egu55ef4u1i03nwz01k7kcrl"); // b.LL.y = MIN(b0.LL.y, b1.LL.y);
581 UNSUPPORTED("9n6ei3odbgefwfxvql9whcpe"); // b.UR.x = MAX(b0.UR.x, b1.UR.x);
582 UNSUPPORTED("19ocysbuh4pxyft2bqhyhigr1"); // b.UR.y = MAX(b0.UR.y, b1.UR.y);
583 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
584 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
585
586 throw new UnsupportedOperationException();
587 }
588
589
590
591
592 //3 bit6ycxo1iqd2al92y8gkzlvb
593 // static inline box box_intersect(box b0, box b1)
594 public static Object box_intersect(Object... arg) {
595 UNSUPPORTED("34gv28cldst09bl71itjgviue"); // static inline box box_intersect(box b0, box b1)
596 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
597 UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); // box b;
598 UNSUPPORTED("9slu7bixuymxttjic76ha2nl2"); // b.LL.x = MAX(b0.LL.x, b1.LL.x);
599 UNSUPPORTED("3uv943c2f82yuif249pf5azob"); // b.LL.y = MAX(b0.LL.y, b1.LL.y);
600 UNSUPPORTED("74tf5h16bc9zabq3s3dyny543"); // b.UR.x = MIN(b0.UR.x, b1.UR.x);
601 UNSUPPORTED("d99gcv3i7xes7y7rqf8ii20ux"); // b.UR.y = MIN(b0.UR.y, b1.UR.y);
602 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
603 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
604
605 throw new UnsupportedOperationException();
606 }
607
608
609
610
611 //3 8gfybie7k6pgb3o1a6llgpwng
612 // static inline boxf boxf_intersect(boxf b0, boxf b1)
613 public static Object boxf_intersect(Object... arg) {
614 UNSUPPORTED("ape22b8z6jfg17gvo42hok9eb"); // static inline boxf boxf_intersect(boxf b0, boxf b1)
615 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
616 UNSUPPORTED("c57pq0f87j6dnbcvygu7v6k84"); // boxf b;
617 UNSUPPORTED("9slu7bixuymxttjic76ha2nl2"); // b.LL.x = MAX(b0.LL.x, b1.LL.x);
618 UNSUPPORTED("3uv943c2f82yuif249pf5azob"); // b.LL.y = MAX(b0.LL.y, b1.LL.y);
619 UNSUPPORTED("74tf5h16bc9zabq3s3dyny543"); // b.UR.x = MIN(b0.UR.x, b1.UR.x);
620 UNSUPPORTED("d99gcv3i7xes7y7rqf8ii20ux"); // b.UR.y = MIN(b0.UR.y, b1.UR.y);
621 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
622 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
623
624 throw new UnsupportedOperationException();
625 }
626
627
628
629
630 //3 7z8j2quq65govaaejrz7b4cvb
631 // static inline int box_overlap(box b0, box b1)
632 public static Object box_overlap(Object... arg) {
633 UNSUPPORTED("1e9k599x7ygct7r4cfdxlk9u9"); // static inline int box_overlap(box b0, box b1)
634 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
635 UNSUPPORTED("7a9wwpu7dhdphd08y1ecw54w5"); // return OVERLAP(b0, b1);
636 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
637
638 throw new UnsupportedOperationException();
639 }
640
641
642
643
644 //3 4z0suuut2acsay5m8mg9dqjdu
645 // static inline int boxf_overlap(boxf b0, boxf b1)
646 public static Object boxf_overlap(Object... arg) {
647 UNSUPPORTED("905nejsewihwhhc3bhnrz9nwo"); // static inline int boxf_overlap(boxf b0, boxf b1)
648 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
649 UNSUPPORTED("7a9wwpu7dhdphd08y1ecw54w5"); // return OVERLAP(b0, b1);
650 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
651
652 throw new UnsupportedOperationException();
653 }
654
655
656
657
658 //3 dd34swz5rmdgu3a2np2a4h1dy
659 // static inline int box_contains(box b0, box b1)
660 public static Object box_contains(Object... arg) {
661 UNSUPPORTED("aputfc30fjkvy6jx4otljaczq"); // static inline int box_contains(box b0, box b1)
662 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
663 UNSUPPORTED("87ap80vrh2a4gpprbxr33lrg3"); // return CONTAINS(b0, b1);
664 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
665
666 throw new UnsupportedOperationException();
667 }
668
669
670
671
672 //3 8laj1bspbu2i1cjd9upr7xt32
673 // static inline int boxf_contains(boxf b0, boxf b1)
674 public static Object boxf_contains(Object... arg) {
675 UNSUPPORTED("7ccnttkiwt834yfyw0evcm18v"); // static inline int boxf_contains(boxf b0, boxf b1)
676 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
677 UNSUPPORTED("87ap80vrh2a4gpprbxr33lrg3"); // return CONTAINS(b0, b1);
678 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
679
680 throw new UnsupportedOperationException();
681 }
682
683
684
685
686 //3 4wf5swkz24xx51ja2dynbycu1
687 // static inline pointf perp (pointf p)
688 public static Object perp(Object... arg) {
689 UNSUPPORTED("567wpqlg9rv63ynyvxd9sgkww"); // static inline pointf perp (pointf p)
690 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
691 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
692 UNSUPPORTED("2fyydy6t6yifjsczccsb9szeg"); // r.x = -p.y;
693 UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); // r.y = p.x;
694 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
695 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
696
697 throw new UnsupportedOperationException();
698 }
699
700
701
702
703 //3 6dtlpzv4mvgzb9o0b252yweuv
704 // static inline pointf scale (double c, pointf p)
705 public static Object scale(Object... arg) {
706 UNSUPPORTED("c1ngytew34bmkdb7vps5h3dh8"); // static inline pointf scale (double c, pointf p)
707 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
708 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
709 UNSUPPORTED("dznf7nac14snww4usquyd6r3r"); // r.x = c * p.x;
710 UNSUPPORTED("33kk73m8vjcux5tnjl8co2pe6"); // r.y = c * p.y;
711 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
712 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
713
714 throw new UnsupportedOperationException();
715 }
716
717
718 //1 540u5gu9i0x1wzoxqqx5n2vwp
719 // static jmp_buf jbuf
720 private static jmp_buf jbuf = new jmp_buf();
721
722 //1 5kbimjtsi4ulxiyk2w1brj6py
723 // static graph_t *G
724 //private static Agraph_s G;
725 //1 608xz3ruk6qq4bs1sagl9fuav
726 // static int N_nodes, N_edges
727 //private static int N_nodes, N_edges;
728
729 //1 cfz1upsuq7ct75nfqmyg925bo
730 // static int Minrank, Maxrank
731 //static private int Minrank, Maxrank;
732
733 //1 1xxb2cip20ls1938be1sgpc8s
734 // static int S_i
735 //private static int S_i;
736
737 //1 2ahnzxrqoz8eoicu88g9jzic7
738 // static int Search_size
739 //private static int Search_size;
740
741 //1 3t9aql1n1eclyvy7p2nwyacor
742 // static nlist_t Tree_node
743 //private static final __struct__<nlist_t> Tree_node = JUtils.from(nlist_t.class);
744
745 //1 11b7xeg0x1f09v305mxwvgbhs
746 // static elist Tree_edge
747 //private static final __struct__<elist> Tree_edge = JUtils.from(elist.class);
748
749
750
751 //3 6au5htcaxhw0blmx5c48v03u0
752 // static void add_tree_edge(edge_t * e)
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"); // agerr(AGERR, "add_tree_edge: missing tree edge\n");
759 UNSUPPORTED("6fzmgjpkhmnx0a2cnt0q0rceg"); // longjmp (jbuf, 1);
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"); // agerr(AGERR, "add_tree_edge: empty outedge list\n");
784 UNSUPPORTED("6fzmgjpkhmnx0a2cnt0q0rceg"); // longjmp (jbuf, 1);
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"); // agerr(AGERR, "add_tree_edge: empty inedge list\n");
795 UNSUPPORTED("6fzmgjpkhmnx0a2cnt0q0rceg"); // longjmp (jbuf, 1);
796 }
797 } finally {
798 LEAVING("6au5htcaxhw0blmx5c48v03u0","add_tree_edge");
799 }
800 }
801
802
803
804
805 //3 9b7b78pmafynmvffztrqnlxtn
806 // static void exchange_tree_edges(edge_t * e, edge_t * f)
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 //3 dbxco6m0mabzhsqfo3pb8nctk
848 // static void init_rank(void)
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"); // agerr(AGERR, "trouble in init_rank\n");
875 UNSUPPORTED("bwwunxmw4kgz6qntbn6xp0cur"); // for (v = (((Agraphinfo_t*)(((Agobj_t*)(G))->data))->nlist); v; v = (((Agnodeinfo_t*)(((Agobj_t*)(v))->data))->next))
876 UNSUPPORTED("3dk132mz1u2pf0tla64kl6hv0"); // if ((((Agnodeinfo_t*)(((Agobj_t*)(v))->data))->priority))
877 UNSUPPORTED("916bi45h6sjvte1rgig12b1v2"); // agerr(AGPREV, "\t%s %d\n", agnameof(v), (((Agnodeinfo_t*)(((Agobj_t*)(v))->data))->priority));
878 }
879 free_queue(Q);
880 } finally {
881 LEAVING("dbxco6m0mabzhsqfo3pb8nctk","init_rank");
882 }
883 }
884
885
886
887
888 //3 bj7ux5kz8ls2lnfh0ix6i00b9
889 // static node_t *incident(edge_t * e)
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 //3 4i9tcvid2iql874c6k70s9aqm
910 // static edge_t *leave_edge(void)
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 //1 3wm7ej298st1xk7rbhbtnbk64
952 // static edge_t *Enter
953 //private static Agedge_s Enter;
954
955 //1 dx9f0e947f5kjhc2eftn43t90
956 // static int Low, Lim, Slack
957 //private static int Low, Lim, Slack;
958
959
960
961 //3 10lkpr4y40luvy2idlozfiva3
962 // static void dfs_enter_outedge(node_t * v)
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 //3 2z9nii6380p8qlql8nznzgvof
992 // static void dfs_enter_inedge(node_t * v)
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 //3 aeu2po1o1rvibmafk0k8dw0fh
1022 // static edge_t *enter_edge(edge_t * e)
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 /* v is the down node */
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 //3 1gvyafmercq92v3lg6gb33cbt
1054 // static int treesearch(node_t * v)
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 //3 c98bj1u8j43cdezeczn33mec0
1084 // static int tight_tree(void)
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 //3 10o7oe8d097fx7swmpqd4tf0h
1113 // static void init_cutvalues(void)
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 //3 756raqohoxdeiddqbyr37h7ig
1128 // static int feasible_tree(void)
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 //3 49un8m43odrf89cedvin3wz3r
1172 // static node_t *treeupdate(node_t * v, node_t * w, int cutvalue, int dir)
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 //3 e66n8gern1fejjsn8nefypo0g
1203 // static void rerank(node_t * v, int delta)
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 //3 xww1p8bentf1qk7mgfhi1q6m
1225 // static void update(edge_t * e, edge_t * f)
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 /* "for (v = in nodes in tail side of e) do ND_rank(v) -= delta;" */
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"); // agerr(AGERR, "update: mismatched lca in treeupdates\n");
1254 UNSUPPORTED("6fzmgjpkhmnx0a2cnt0q0rceg"); // longjmp (jbuf, 1);
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 //3 3yw7w42hz7af67d6qse3b2172
1269 // static void scan_and_normalize(void)
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 //3 7eg6zti36nbg4tqyo8yunh86r
1297 // static void freeTreeList (graph_t* g)
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 //3 9gx8p7md3v3mzp640xdjj814a
1316 // static void LR_balance(void)
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 //3 5c01jnao2ubmy4l0vi5jol0jz
1347 // static void TB_balance(void)
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 /* find nodes that are not tight and move to less populated ranks */
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; /* vnodes can have ranks < 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 //3 37hg5w7ywmyljdiebgp5ltl22
1403 // static int init_graph(graph_t * g)
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 // Z.z().Tree_edge.setPtr("list", ALLOC_empty(Z.z().N_nodes, Z.z().Tree_edge.getPtr("list"), Agedge_s.class));
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 // ND_tree_in(n).setPtr("list", zmalloc(sizeof(Agedge_s.class, i+1)));;
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 // ND_tree_out(n).setPtr("list", zmalloc(sizeof(Agedge_s.class, i+1)));
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 //3 4jv545ixndzfz0hmy2ck1kvre
1452 // static void graphSize (graph_t * g, int* nn, int* ne)
1453 public static Object graphSize(Object... arg) {
1454 UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
1455 UNSUPPORTED("d95292hibn08mh6rbguy3zeib"); // graphSize (graph_t * g, int* nn, int* ne)
1456 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1457 UNSUPPORTED("4i46dhl8eqbh29vq1vn3ipo70"); // int i, nnodes, nedges;
1458 UNSUPPORTED("cjx5v6hayed3q8eeub1cggqca"); // node_t *n;
1459 UNSUPPORTED("5gypxs09iuryx5a2eho9lgdcp"); // edge_t *e;
1460 UNSUPPORTED("359m8vuzzte7zl5lru7vf4bga"); // nnodes = nedges = 0;
1461 UNSUPPORTED("8g62mxpap4eeua2lkn9a1iosi"); // for (n = GD_nlist(g); n; n = ND_next(n)) {
1462 UNSUPPORTED("a5hcy2vbfyq09svspfdvsreu1"); // nnodes++;
1463 UNSUPPORTED("az80xiplaqv1i8gmq2feyyrea"); // for (i = 0; (e = ND_out(n).list[i]); i++) {
1464 UNSUPPORTED("1sy3rnb8qjw3nmyka290izgi2"); // nedges++;
1465 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1466 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1467 UNSUPPORTED("h7rj9k6bm1iatjqeqmhlinoi"); // *nn = nnodes;
1468 UNSUPPORTED("7whkfg1zlimqk163vbj7cgxmt"); // *ne = nedges;
1469 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1470
1471 throw new UnsupportedOperationException();
1472 }
1473
1474
1475
1476
1477 //3 5n0ipwzhr8urlx0fsdzr02gwq
1478 // int rank2(graph_t * g, int balance, int maxiter, int search_size)
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 /*if (Verbose) {
1486 int nn, ne;
1487 graphSize (g, &nn, &ne);
1488 fprintf(stderr, "%s %d nodes %d edges maxiter=%d balance=%d\n", ns,
1489 nn, ne, maxiter, balance);
1490 start_timer();
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 /*if (Verbose && (iter % 100 == 0)) {
1515 if (iter % 1000 == 100)
1516 fputs(ns, stderr);
1517 fprintf(stderr, "%d ", iter);
1518 if (iter % 1000 == 0)
1519 fputc('\n', stderr);
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 /*if (Verbose) {
1537 if (iter >= 100)
1538 fputc('\n', stderr);
1539 fprintf(stderr, "%s%d nodes %d edges %d iter %.2f sec\n",
1540 ns, N_nodes, N_edges, iter, elapsed_sec());
1541 }*/
1542 return 0;
1543 } finally {
1544 LEAVING("5n0ipwzhr8urlx0fsdzr02gwq","rank2");
1545 }
1546 }
1547
1548
1549
1550
1551 //3 aqly8eniwjr5bmh4hzwc7ftdr
1552 // int rank(graph_t * g, int balance, int maxiter)
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 //3 2q59mz8qtn0biifbezb8uxz17
1572 // static void x_cutval(edge_t * f)
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 /* set v to the node on the side of the edge already searched */
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 //3 bfeafmsmmnblgizs37qj03dy4
1602 // static int x_val(edge_t * e, node_t * v, int dir)
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 //3 ah65iqmwa5j0qwotm6amhijlg
1648 // static void dfs_cutval(node_t * v, edge_t * par)
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 //3 cgqr48qol9p8bsqjnryo5z5x9
1671 // static int dfs_range(node_t * v, edge_t * par, int low)
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 }