Debian Codegraph @

src/gen/lib/dotgen/cluster__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.dotgen;
47 import static gen.lib.cgraph.edge__c.agfstedge;
48 import static gen.lib.cgraph.edge__c.agfstout;
49 import static gen.lib.cgraph.edge__c.aghead;
50 import static gen.lib.cgraph.edge__c.agnxtedge;
51 import static gen.lib.cgraph.edge__c.agnxtout;
52 import static gen.lib.cgraph.edge__c.agtail;
53 import static gen.lib.cgraph.node__c.agfstnode;
54 import static gen.lib.cgraph.node__c.agnxtnode;
55 import static gen.lib.cgraph.obj__c.agcontains;
56 import static gen.lib.cgraph.obj__c.agroot;
57 import static gen.lib.common.utils__c.UF_setname;
58 import static gen.lib.common.utils__c.UF_singleton;
59 import static gen.lib.dotgen.class2__c.class2;
60 import static gen.lib.dotgen.class2__c.merge_chain;
61 import static gen.lib.dotgen.class2__c.mergeable;
62 import static gen.lib.dotgen.dotinit__c.dot_root;
63 import static gen.lib.dotgen.fastgr__c.delete_fast_edge;
64 import static gen.lib.dotgen.fastgr__c.delete_fast_node;
65 import static gen.lib.dotgen.fastgr__c.fast_node;
66 import static gen.lib.dotgen.fastgr__c.find_fast_edge;
67 import static gen.lib.dotgen.fastgr__c.find_flat_edge;
68 import static gen.lib.dotgen.fastgr__c.flat_edge;
69 import static gen.lib.dotgen.fastgr__c.merge_oneway;
70 import static gen.lib.dotgen.fastgr__c.other_edge;
71 import static gen.lib.dotgen.fastgr__c.safe_other_edge;
72 import static gen.lib.dotgen.fastgr__c.virtual_edge;
73 import static gen.lib.dotgen.fastgr__c.virtual_node;
74 import static gen.lib.dotgen.mincross__c.allocate_ranks;
75 import static gen.lib.dotgen.mincross__c.build_ranks;
76 import static gen.lib.dotgen.mincross__c.enqueue_neighbors;
77 import static gen.lib.dotgen.mincross__c.install_in_rank;
78 import static gen.lib.dotgen.position__c.ports_eq;
79 import static smetana.core.JUtils.EQ;
80 import static smetana.core.JUtils.NEQ;
81 import static smetana.core.JUtilsDebug.ENTERING;
82 import static smetana.core.JUtilsDebug.LEAVING;
83 import static smetana.core.Macro.AGMKOUT;
84 import static smetana.core.Macro.ED_count;
85 import static smetana.core.Macro.ED_edge_type;
86 import static smetana.core.Macro.ED_to_virt;
87 import static smetana.core.Macro.ED_xpenalty;
88 import static smetana.core.Macro.GD_clust;
89 import static smetana.core.Macro.GD_comp;
90 import static smetana.core.Macro.GD_expanded;
91 import static smetana.core.Macro.GD_installed;
92 import static smetana.core.Macro.GD_leader;
93 import static smetana.core.Macro.GD_maxrank;
94 import static smetana.core.Macro.GD_minrank;
95 import static smetana.core.Macro.GD_n_cluster;
96 import static smetana.core.Macro.GD_n_nodes;
97 import static smetana.core.Macro.GD_nlist;
98 import static smetana.core.Macro.GD_rank;
99 import static smetana.core.Macro.GD_rankleader;
100 import static smetana.core.Macro.ND_UF_size;
101 import static smetana.core.Macro.ND_clust;
102 import static smetana.core.Macro.ND_in;
103 import static smetana.core.Macro.ND_lw;
104 import static smetana.core.Macro.ND_node_type;
105 import static smetana.core.Macro.ND_order;
106 import static smetana.core.Macro.ND_out;
107 import static smetana.core.Macro.ND_rank;
108 import static smetana.core.Macro.ND_ranktype;
109 import static smetana.core.Macro.ND_rw;
110 import static smetana.core.Macro.NOT;
111 import static smetana.core.Macro.UNSUPPORTED;
112 import h.ST_Agedge_s;
113 import h.ST_Agnode_s;
114 import h.ST_Agraph_s;
115 import h.ST_nodequeue;
116 import h.ST_pointf;
117
118 public class cluster__c {
119 //1 2digov3edok6d5srhgtlmrycs
120 // extern lt_symlist_t lt_preloaded_symbols[]
121
122
123 //1 baedz5i9est5csw3epz3cv7z
124 // typedef Ppoly_t Ppolyline_t
125
126
127 //1 9k44uhd5foylaeoekf3llonjq
128 // extern Dtmethod_t* Dtset
129
130
131 //1 1ahfywsmzcpcig2oxm7pt9ihj
132 // extern Dtmethod_t* Dtbag
133
134
135 //1 anhghfj3k7dmkudy2n7rvt31v
136 // extern Dtmethod_t* Dtoset
137
138
139 //1 5l6oj1ux946zjwvir94ykejbc
140 // extern Dtmethod_t* Dtobag
141
142
143 //1 2wtf222ak6cui8cfjnw6w377z
144 // extern Dtmethod_t* Dtlist
145
146
147 //1 d1s1s6ibtcsmst88e3057u9r7
148 // extern Dtmethod_t* Dtstack
149
150
151 //1 axa7mflo824p6fspjn1rdk0mt
152 // extern Dtmethod_t* Dtqueue
153
154
155 //1 ega812utobm4xx9oa9w9ayij6
156 // extern Dtmethod_t* Dtdeque
157
158
159 //1 cyfr996ur43045jv1tjbelzmj
160 // extern Dtmethod_t* Dtorder
161
162
163 //1 wlofoiftbjgrrabzb2brkycg
164 // extern Dtmethod_t* Dttree
165
166
167 //1 12bds94t7voj7ulwpcvgf6agr
168 // extern Dtmethod_t* Dthash
169
170
171 //1 9lqknzty480cy7zsubmabkk8h
172 // extern Dtmethod_t _Dttree
173
174
175 //1 bvn6zkbcp8vjdhkccqo1xrkrb
176 // extern Dtmethod_t _Dthash
177
178
179 //1 9lidhtd6nsmmv3e7vjv9e10gw
180 // extern Dtmethod_t _Dtlist
181
182
183 //1 34ujfamjxo7xn89u90oh2k6f8
184 // extern Dtmethod_t _Dtqueue
185
186
187 //1 3jy4aceckzkdv950h89p4wjc8
188 // extern Dtmethod_t _Dtstack
189
190
191 //1 8dfqgf3u1v830qzcjqh9o8ha7
192 // extern Agmemdisc_t AgMemDisc
193
194
195 //1 18k2oh2t6llfsdc5x0wlcnby8
196 // extern Agiddisc_t AgIdDisc
197
198
199 //1 a4r7hi80gdxtsv4hdoqpyiivn
200 // extern Agiodisc_t AgIoDisc
201
202
203 //1 bnzt5syjb7mgeru19114vd6xx
204 // extern Agdisc_t AgDefaultDisc
205
206
207 //1 35y2gbegsdjilegaribes00mg
208 // extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, Agstrictundirected
209
210
211 //1 c2rygslq6bcuka3awmvy2b3ow
212 // typedef Agsubnode_t Agnoderef_t
213
214
215 //1 xam6yv0dcsx57dtg44igpbzn
216 // typedef Dtlink_t Agedgeref_t
217
218
219 //1 nye6dsi1twkbddwo9iffca1j
220 // extern char *Version
221
222
223 //1 65mu6k7h7lb7bx14jpiw7iyxr
224 // extern char **Files
225
226
227 //1 2rpjdzsdyrvomf00zcs3u3dyn
228 // extern const char **Lib
229
230
231 //1 6d2f111lntd2rsdt4gswh5909
232 // extern char *CmdName
233
234
235 //1 a0ltq04fpeg83soa05a2fkwb2
236 // extern char *specificFlags
237
238
239 //1 1uv30qeqq2jh6uznlr4dziv0y
240 // extern char *specificItems
241
242
243 //1 7i4hkvngxe3x7lmg5h6b3t9g3
244 // extern char *Gvfilepath
245
246
247 //1 9jp96pa73kseya3w6sulxzok6
248 // extern char *Gvimagepath
249
250
251 //1 40ylumfu7mrvawwf4v2asvtwk
252 // extern unsigned char Verbose
253
254
255 //1 93st8awjy1z0h07n28qycbaka
256 // extern unsigned char Reduce
257
258
259 //1 f2vs67ts992erf8onwfglurzp
260 // extern int MemTest
261
262
263 //1 c6f8whijgjwwagjigmxlwz3gb
264 // extern char *HTTPServerEnVar
265
266
267 //1 cp4hzj7p87m7arw776d3bt7aj
268 // extern char *Output_file_name
269
270
271 //1 a3rqagofsgraie6mx0krzkgsy
272 // extern int graphviz_errors
273
274
275 //1 5up05203r4kxvjn1m4njcgq5x
276 // extern int Nop
277
278
279 //1 umig46cco431x14b3kosde2t
280 // extern double PSinputscale
281
282
283 //1 52bj6v8fqz39khasobljfukk9
284 // extern int Syntax_errors
285
286
287 //1 9ekf2ina8fsjj6y6i0an6somj
288 // extern int Show_cnt
289
290
291 //1 38di5qi3nkxkq65onyvconk3r
292 // extern char** Show_boxes
293
294
295 //1 6ri6iu712m8mpc7t2670etpcw
296 // extern int CL_type
297
298
299 //1 bomxiw3gy0cgd1ydqtek7fpxr
300 // extern unsigned char Concentrate
301
302
303 //1 cqy3gqgcq8empdrbnrhn84058
304 // extern double Epsilon
305
306
307 //1 64slegfoouqeg0rmbyjrm8wgr
308 // extern int MaxIter
309
310
311 //1 88wdinpnmfs4mab4aw62yb0bg
312 // extern int Ndim
313
314
315 //1 8bbad3ogcelqnnvo5br5s05gq
316 // extern int State
317
318
319 //1 17rnd8q45zclfn68qqst2vxxn
320 // extern int EdgeLabelsDone
321
322
323 //1 ymx1z4s8cznjifl2d9f9m8jr
324 // extern double Initial_dist
325
326
327 //1 a33bgl0c3uqb3trx419qulj1x
328 // extern double Damping
329
330
331 //1 d9lvrpjg1r0ojv40pod1xwk8n
332 // extern int Y_invert
333
334
335 //1 71efkfs77q5tq9ex6y0f4kanh
336 // extern int GvExitOnUsage
337
338
339 //1 4xy2dkdkv0acs2ue9eca8hh2e
340 // 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
341
342
343 //1 9js5gxgzr74eakgtfhnbws3t9
344 // 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
345
346
347 //1 anqllp9sj7wo45w6bm11j8trn
348 // 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
349
350
351 //1 bh0z9puipqw7gymjd5h5b8s6i
352 // extern struct fdpParms_s* fdp_parms
353
354
355
356
357 //3 ciez0pfggxdljedzsbklq49f0
358 // static inline point pointof(int x, int y)
359 public static Object pointof(Object... arg) {
360 UNSUPPORTED("8e4tj258yvfq5uhsdpk37n5eq"); // static inline point pointof(int x, int y)
361 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
362 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
363 UNSUPPORTED("12jimkrzqxavaie0cpapbx18c"); // r.x = x;
364 UNSUPPORTED("7ivmviysahgsc5nn9gtp7q2if"); // r.y = y;
365 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
366 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
367
368 throw new UnsupportedOperationException();
369 }
370
371
372
373
374 //3 c1s4k85p1cdfn176o3uryeros
375 // static inline pointf pointfof(double x, double y)
376 public static ST_pointf pointfof(double x, double y) {
377 // WARNING!! STRUCT
378 return pointfof_w_(x, y).copy();
379 }
380 private static ST_pointf pointfof_w_(double x, double y) {
381 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
382 try {
383 final ST_pointf r = new ST_pointf();
384 r.setDouble("x", x);
385 r.setDouble("y", y);
386 return r;
387 } finally {
388 LEAVING("c1s4k85p1cdfn176o3uryeros","pointfof");
389 }
390 }
391
392
393
394
395 //3 7cufnfitrh935ew093mw0i4b7
396 // static inline box boxof(int llx, int lly, int urx, int ury)
397 public static Object boxof(Object... arg) {
398 UNSUPPORTED("3lzesfdd337h31jrlib1czocm"); // static inline box boxof(int llx, int lly, int urx, int ury)
399 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
400 UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); // box b;
401 UNSUPPORTED("cylhjlutoc0sc0uy7g98m9fb8"); // b.LL.x = llx, b.LL.y = lly;
402 UNSUPPORTED("242of6revxzx8hpe7yerrchz6"); // b.UR.x = urx, b.UR.y = ury;
403 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
404 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
405
406 throw new UnsupportedOperationException();
407 }
408
409
410
411
412
413
414
415 //3 1n5xl70wxuabyf97mclvilsm6
416 // static inline point add_point(point p, point q)
417 public static Object add_point(Object... arg) {
418 UNSUPPORTED("6iamka1fx8fk1rohzzse8phte"); // static inline point add_point(point p, point q)
419 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
420 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
421 UNSUPPORTED("3n2sizjd0civbzm6iq7su1s2p"); // r.x = p.x + q.x;
422 UNSUPPORTED("65ygdo31w09i5i6bd2f7azcd3"); // r.y = p.y + q.y;
423 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
424 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
425
426 throw new UnsupportedOperationException();
427 }
428
429
430
431
432 //3 arrsbik9b5tnfcbzsm8gr2chx
433 // static inline pointf add_pointf(pointf p, pointf q)
434 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
435 // WARNING!! STRUCT
436 return add_pointf_w_(p.copy(), q.copy()).copy();
437 }
438 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
439 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
440 try {
441 final ST_pointf r = new ST_pointf();
442 r.setDouble("x", p.x + q.x);
443 r.setDouble("y", p.y + q.y);
444 return r;
445 } finally {
446 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
447 }
448 }
449
450
451
452
453 //3 ai2dprak5y6obdsflguh5qbd7
454 // static inline point sub_point(point p, point q)
455 public static Object sub_point(Object... arg) {
456 UNSUPPORTED("cd602849h0bce8lu9xegka0ia"); // static inline point sub_point(point p, point q)
457 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
458 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
459 UNSUPPORTED("4q4q9dveah93si8ajfv59gz27"); // r.x = p.x - q.x;
460 UNSUPPORTED("9f90ik0o2yqhanzntpy3d2ydy"); // r.y = p.y - q.y;
461 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
462 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
463
464 throw new UnsupportedOperationException();
465 }
466
467
468
469
470 //3 16f6pyogcv3j7n2p0n8giqqgh
471 // static inline pointf sub_pointf(pointf p, pointf q)
472 public static Object sub_pointf(Object... arg) {
473 UNSUPPORTED("dmufj44lddsnj0wjyxsg2fcso"); // static inline pointf sub_pointf(pointf p, pointf q)
474 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
475 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
476 UNSUPPORTED("4q4q9dveah93si8ajfv59gz27"); // r.x = p.x - q.x;
477 UNSUPPORTED("9f90ik0o2yqhanzntpy3d2ydy"); // r.y = p.y - q.y;
478 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
479 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
480
481 throw new UnsupportedOperationException();
482 }
483
484
485
486
487 //3 9k50jgrhc4f9824vf8ony74rw
488 // static inline point mid_point(point p, point q)
489 public static Object mid_point(Object... arg) {
490 UNSUPPORTED("evy44tdsmu3erff9dp2x835u2"); // static inline point mid_point(point p, point q)
491 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
492 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
493 UNSUPPORTED("1a6p6fm57o0wt5ze2btsx06c7"); // r.x = (p.x + q.x) / 2;
494 UNSUPPORTED("1kbj5tgdmfi6kf4jgg6skhr6e"); // r.y = (p.y + q.y) / 2;
495 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
496 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
497
498 throw new UnsupportedOperationException();
499 }
500
501
502
503
504 //3 59c4f7im0ftyowhnzzq2v9o1x
505 // static inline pointf mid_pointf(pointf p, pointf q)
506 public static Object mid_pointf(Object... arg) {
507 UNSUPPORTED("381o63o9kb04d7gzg65v0r3q"); // static inline pointf mid_pointf(pointf p, pointf q)
508 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
509 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
510 UNSUPPORTED("c5vboetlr3mf43wns7iik6m1w"); // r.x = (p.x + q.x) / 2.;
511 UNSUPPORTED("bcdf562ldr3bjn78hcay5xd63"); // r.y = (p.y + q.y) / 2.;
512 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
513 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
514
515 throw new UnsupportedOperationException();
516 }
517
518
519
520
521 //3 5r18p38gisvcx3zsvbb9saixx
522 // static inline pointf interpolate_pointf(double t, pointf p, pointf q)
523 public static Object interpolate_pointf(Object... arg) {
524 UNSUPPORTED("894yimn33kmtm454llwdaotu8"); // static inline pointf interpolate_pointf(double t, pointf p, pointf q)
525 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
526 UNSUPPORTED("ef2acl8wa2ooqcb5vz3098maz"); // pointf r;
527 UNSUPPORTED("5tpwuyf5iidesy80v8o4nwkmk"); // r.x = p.x + t * (q.x - p.x);
528 UNSUPPORTED("ewnrc5uloj3w5jbmsjcn3wja0"); // r.y = p.y + t * (q.y - p.y);
529 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
530 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
531
532 throw new UnsupportedOperationException();
533 }
534
535
536
537
538 //3 bxzrv2ghq04qk5cbyy68s4mol
539 // static inline point exch_xy(point p)
540 public static Object exch_xy(Object... arg) {
541 UNSUPPORTED("2vxya0v2fzlv5e0vjaa8d414"); // static inline point exch_xy(point p)
542 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
543 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
544 UNSUPPORTED("60cojdwc2h7f0m51s9jdwvup7"); // r.x = p.y;
545 UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); // r.y = p.x;
546 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
547 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
548
549 throw new UnsupportedOperationException();
550 }
551
552
553
554
555 //3 9lt3e03tac6h6sydljrcws8fd
556 // static inline pointf exch_xyf(pointf p)
557 public static Object exch_xyf(Object... arg) {
558 UNSUPPORTED("8qamrobrqi8jsvvfrxkimrsnw"); // static inline pointf exch_xyf(pointf p)
559 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
560 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
561 UNSUPPORTED("60cojdwc2h7f0m51s9jdwvup7"); // r.x = p.y;
562 UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); // r.y = p.x;
563 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
564 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
565
566 throw new UnsupportedOperationException();
567 }
568
569
570
571
572 //3 8l9qhieokthntzdorlu5zn29b
573 // static inline box box_bb(box b0, box b1)
574 public static Object box_bb(Object... arg) {
575 UNSUPPORTED("36et5gmnjrby6o7bq9sgh1hx6"); // static inline box box_bb(box b0, box b1)
576 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
577 UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); // box b;
578 UNSUPPORTED("8mr2c9xitsqi8z1plbp7ox1hu"); // b.LL.x = MIN(b0.LL.x, b1.LL.x);
579 UNSUPPORTED("2egu55ef4u1i03nwz01k7kcrl"); // b.LL.y = MIN(b0.LL.y, b1.LL.y);
580 UNSUPPORTED("9n6ei3odbgefwfxvql9whcpe"); // b.UR.x = MAX(b0.UR.x, b1.UR.x);
581 UNSUPPORTED("19ocysbuh4pxyft2bqhyhigr1"); // b.UR.y = MAX(b0.UR.y, b1.UR.y);
582 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
583 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
584
585 throw new UnsupportedOperationException();
586 }
587
588
589
590
591 //3 clws9h3bbjm0lw3hexf8nl4c4
592 // static inline boxf boxf_bb(boxf b0, boxf b1)
593 public static Object boxf_bb(Object... arg) {
594 UNSUPPORTED("dyrqu4ww9osr9c86gqgmifcp6"); // static inline boxf boxf_bb(boxf b0, boxf b1)
595 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
596 UNSUPPORTED("c57pq0f87j6dnbcvygu7v6k84"); // boxf b;
597 UNSUPPORTED("8mr2c9xitsqi8z1plbp7ox1hu"); // b.LL.x = MIN(b0.LL.x, b1.LL.x);
598 UNSUPPORTED("2egu55ef4u1i03nwz01k7kcrl"); // b.LL.y = MIN(b0.LL.y, b1.LL.y);
599 UNSUPPORTED("9n6ei3odbgefwfxvql9whcpe"); // b.UR.x = MAX(b0.UR.x, b1.UR.x);
600 UNSUPPORTED("19ocysbuh4pxyft2bqhyhigr1"); // b.UR.y = MAX(b0.UR.y, b1.UR.y);
601 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
602 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
603
604 throw new UnsupportedOperationException();
605 }
606
607
608
609
610 //3 bit6ycxo1iqd2al92y8gkzlvb
611 // static inline box box_intersect(box b0, box b1)
612 public static Object box_intersect(Object... arg) {
613 UNSUPPORTED("34gv28cldst09bl71itjgviue"); // static inline box box_intersect(box b0, box b1)
614 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
615 UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); // box b;
616 UNSUPPORTED("9slu7bixuymxttjic76ha2nl2"); // b.LL.x = MAX(b0.LL.x, b1.LL.x);
617 UNSUPPORTED("3uv943c2f82yuif249pf5azob"); // b.LL.y = MAX(b0.LL.y, b1.LL.y);
618 UNSUPPORTED("74tf5h16bc9zabq3s3dyny543"); // b.UR.x = MIN(b0.UR.x, b1.UR.x);
619 UNSUPPORTED("d99gcv3i7xes7y7rqf8ii20ux"); // b.UR.y = MIN(b0.UR.y, b1.UR.y);
620 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
621 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
622
623 throw new UnsupportedOperationException();
624 }
625
626
627
628
629 //3 8gfybie7k6pgb3o1a6llgpwng
630 // static inline boxf boxf_intersect(boxf b0, boxf b1)
631 public static Object boxf_intersect(Object... arg) {
632 UNSUPPORTED("ape22b8z6jfg17gvo42hok9eb"); // static inline boxf boxf_intersect(boxf b0, boxf b1)
633 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
634 UNSUPPORTED("c57pq0f87j6dnbcvygu7v6k84"); // boxf b;
635 UNSUPPORTED("9slu7bixuymxttjic76ha2nl2"); // b.LL.x = MAX(b0.LL.x, b1.LL.x);
636 UNSUPPORTED("3uv943c2f82yuif249pf5azob"); // b.LL.y = MAX(b0.LL.y, b1.LL.y);
637 UNSUPPORTED("74tf5h16bc9zabq3s3dyny543"); // b.UR.x = MIN(b0.UR.x, b1.UR.x);
638 UNSUPPORTED("d99gcv3i7xes7y7rqf8ii20ux"); // b.UR.y = MIN(b0.UR.y, b1.UR.y);
639 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
640 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
641
642 throw new UnsupportedOperationException();
643 }
644
645
646
647
648 //3 7z8j2quq65govaaejrz7b4cvb
649 // static inline int box_overlap(box b0, box b1)
650 public static Object box_overlap(Object... arg) {
651 UNSUPPORTED("1e9k599x7ygct7r4cfdxlk9u9"); // static inline int box_overlap(box b0, box b1)
652 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
653 UNSUPPORTED("7a9wwpu7dhdphd08y1ecw54w5"); // return OVERLAP(b0, b1);
654 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
655
656 throw new UnsupportedOperationException();
657 }
658
659
660
661
662 //3 4z0suuut2acsay5m8mg9dqjdu
663 // static inline int boxf_overlap(boxf b0, boxf b1)
664 public static Object boxf_overlap(Object... arg) {
665 UNSUPPORTED("905nejsewihwhhc3bhnrz9nwo"); // static inline int boxf_overlap(boxf b0, boxf b1)
666 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
667 UNSUPPORTED("7a9wwpu7dhdphd08y1ecw54w5"); // return OVERLAP(b0, b1);
668 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
669
670 throw new UnsupportedOperationException();
671 }
672
673
674
675
676 //3 dd34swz5rmdgu3a2np2a4h1dy
677 // static inline int box_contains(box b0, box b1)
678 public static Object box_contains(Object... arg) {
679 UNSUPPORTED("aputfc30fjkvy6jx4otljaczq"); // static inline int box_contains(box b0, box b1)
680 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
681 UNSUPPORTED("87ap80vrh2a4gpprbxr33lrg3"); // return CONTAINS(b0, b1);
682 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
683
684 throw new UnsupportedOperationException();
685 }
686
687
688
689
690 //3 8laj1bspbu2i1cjd9upr7xt32
691 // static inline int boxf_contains(boxf b0, boxf b1)
692 public static Object boxf_contains(Object... arg) {
693 UNSUPPORTED("7ccnttkiwt834yfyw0evcm18v"); // static inline int boxf_contains(boxf b0, boxf b1)
694 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
695 UNSUPPORTED("87ap80vrh2a4gpprbxr33lrg3"); // return CONTAINS(b0, b1);
696 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
697
698 throw new UnsupportedOperationException();
699 }
700
701
702
703
704 //3 4wf5swkz24xx51ja2dynbycu1
705 // static inline pointf perp (pointf p)
706 public static Object perp(Object... arg) {
707 UNSUPPORTED("567wpqlg9rv63ynyvxd9sgkww"); // static inline pointf perp (pointf p)
708 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
709 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
710 UNSUPPORTED("2fyydy6t6yifjsczccsb9szeg"); // r.x = -p.y;
711 UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); // r.y = p.x;
712 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
713 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
714
715 throw new UnsupportedOperationException();
716 }
717
718
719
720
721 //3 6dtlpzv4mvgzb9o0b252yweuv
722 // static inline pointf scale (double c, pointf p)
723 public static Object scale(Object... arg) {
724 UNSUPPORTED("c1ngytew34bmkdb7vps5h3dh8"); // static inline pointf scale (double c, pointf p)
725 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
726 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
727 UNSUPPORTED("dznf7nac14snww4usquyd6r3r"); // r.x = c * p.x;
728 UNSUPPORTED("33kk73m8vjcux5tnjl8co2pe6"); // r.y = c * p.y;
729 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
730 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
731
732 throw new UnsupportedOperationException();
733 }
734
735
736
737
738 //3 8bd317q0mykfu6wpr3e4cxmh2
739 // static node_t* map_interclust_node(node_t * n)
740 public static ST_Agnode_s map_interclust_node(ST_Agnode_s n) {
741 ENTERING("8bd317q0mykfu6wpr3e4cxmh2","map_interclust_node");
742 try {
743 ST_Agnode_s rv;
744 if ((ND_clust(n) == null) || ( GD_expanded(ND_clust(n))) )
745 rv = n;
746 else
747 rv = (ST_Agnode_s) GD_rankleader(ND_clust(n)).plus(ND_rank(n)).getPtr();
748 return rv;
749 } finally {
750 LEAVING("8bd317q0mykfu6wpr3e4cxmh2","map_interclust_node");
751 }
752 }
753
754
755
756
757 //3 5ib4nnt2ah5fdd22zs0xds29r
758 // static void make_slots(graph_t * root, int r, int pos, int d)
759 public static void make_slots(ST_Agraph_s root, int r, int pos, int d) {
760 ENTERING("5ib4nnt2ah5fdd22zs0xds29r","make_slots");
761 try {
762 int i;
763 ST_Agnode_s v;
764 ST_Agnode_s.ArrayOfStar vlist;
765 vlist = GD_rank(root).get(r).v;
766 if (d <= 0) {
767 for (i = pos - d + 1; i < GD_rank(root).get(r).n; i++) {
768 v = (ST_Agnode_s) vlist.get(i);
769 ND_order(v, i + d - 1);
770 vlist.plus(ND_order(v)).setPtr(v);
771 }
772 for (i = GD_rank(root).get(r).n + d - 1; i < GD_rank(root).get(r).n; i++)
773 vlist.plus(i).setPtr(null);
774 } else {
775 /*assert(ND_rank(root)[r].n + d - 1 <= ND_rank(root)[r].an);*/
776 for (i = GD_rank(root).get(r).n - 1; i > pos; i--) {
777 v = (ST_Agnode_s) vlist.get(i);
778 ND_order(v, i + d - 1);
779 vlist.plus(ND_order(v)).setPtr(v);
780 }
781 for (i = pos + 1; i < pos + d; i++)
782 vlist.plus(i).setPtr(null);
783 }
784 GD_rank(root).get(r).setInt("n", GD_rank(root).get(r).n + d - 1);
785 } finally {
786 LEAVING("5ib4nnt2ah5fdd22zs0xds29r","make_slots");
787 }
788 }
789
790
791
792
793 //3 d4mwxesl56uh9dyttg9cjlq70
794 // static node_t* clone_vn(graph_t * g, node_t * vn)
795 public static ST_Agnode_s clone_vn(ST_Agraph_s g, ST_Agnode_s vn) {
796 ENTERING("d4mwxesl56uh9dyttg9cjlq70","clone_vn");
797 try {
798 ST_Agnode_s rv;
799 int r;
800 r = ND_rank(vn);
801 make_slots(g, r, ND_order(vn), 2);
802 rv = virtual_node(g);
803 ND_lw(rv, ND_lw(vn));
804 ND_rw(rv, ND_rw(vn));
805 ND_rank(rv, ND_rank(vn));
806 UNSUPPORTED("adc0qfdhup29vh8qu1cwl5jgj"); // GD_rank(g)[r].v[ND_order(rv)] = rv;
807 UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); // return rv;
808 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
809
810 throw new UnsupportedOperationException();
811 } finally {
812 LEAVING("d4mwxesl56uh9dyttg9cjlq70","clone_vn");
813 }
814 }
815
816
817
818
819 //3 6o86r59v2ujlxqcw7761y6o5b
820 // static void map_path(node_t * from, node_t * to, edge_t * orig, edge_t * ve, int type)
821 public static void map_path(ST_Agnode_s from, ST_Agnode_s to, ST_Agedge_s orig, ST_Agedge_s ve, int type) {
822 ENTERING("6o86r59v2ujlxqcw7761y6o5b","map_path");
823 try {
824 int r;
825 ST_Agnode_s u, v;
826 ST_Agedge_s e;
827 assert(ND_rank(from) < ND_rank(to));
828 if (EQ(agtail(ve), from) && EQ(aghead(ve), to))
829 return;
830 if (ED_count(ve) > 1) {
831 ED_to_virt(orig, null);
832 if (ND_rank(to) - ND_rank(from) == 1) {
833 if ((e = find_fast_edge(from, to))!=null && (ports_eq(orig, e))) {
834 merge_oneway(orig, e);
835 if ((ND_node_type(from) == 0)
836 && (ND_node_type(to) == 0))
837 other_edge(orig);
838 return;
839 }
840 }
841 u = from;
842 for (r = ND_rank(from); r < ND_rank(to); r++) {
843 if (r < ND_rank(to) - 1)
844 v = clone_vn(dot_root(from), aghead(ve));
845 else
846 v = to;
847 e = virtual_edge(u, v, orig);
848 ED_edge_type(e, type);
849 u = v;
850 ED_count(ve, ED_count(ve) - 1);
851 ve = (ST_Agedge_s) ND_out(aghead(ve)).getFromList(0);
852 }
853 } else {
854 if (ND_rank(to) - ND_rank(from) == 1) {
855 if ((ve = find_fast_edge(from, to))!=null && (ports_eq(orig, ve))) {
856 /*ED_to_orig(ve) = orig; */
857 ED_to_virt(orig, ve);
858 ED_edge_type(ve, type);
859 ED_count(ve, ED_count(ve)+1);
860 if ((ND_node_type(from) == 0)
861 && (ND_node_type(to) == 0))
862 other_edge(orig);
863 } else {
864 ED_to_virt(orig, null);
865 ve = virtual_edge(from, to, orig);
866 ED_edge_type(ve, type);
867 }
868 }
869 if (ND_rank(to) - ND_rank(from) > 1) {
870 e = ve;
871 if (NEQ(agtail(ve), from)) {
872 ED_to_virt(orig, null);
873 e = virtual_edge(from, aghead(ve), orig);
874 ED_to_virt(orig, e);
875 delete_fast_edge(ve);
876 } else
877 e = ve;
878 while (ND_rank(aghead(e)) != ND_rank(to))
879 e = (ST_Agedge_s) ND_out(aghead(e)).getFromList(0);
880 if (NEQ(aghead(e), to)) {
881 ve = e;
882 e = virtual_edge(agtail(e), to, orig);
883 ED_edge_type(e, type);
884 delete_fast_edge(ve);
885 }
886 }
887 }
888 } finally {
889 LEAVING("6o86r59v2ujlxqcw7761y6o5b","map_path");
890 }
891 }
892
893
894
895
896 //3 69xbflgja0gvrsl5xcv7o7dia
897 // static void make_interclust_chain(graph_t * g, node_t * from, node_t * to, edge_t * orig)
898 public static void make_interclust_chain(ST_Agraph_s g, ST_Agnode_s from, ST_Agnode_s to, ST_Agedge_s orig) {
899 ENTERING("69xbflgja0gvrsl5xcv7o7dia","make_interclust_chain");
900 try {
901 int newtype;
902 ST_Agnode_s u, v;
903 u = map_interclust_node(from);
904 v = map_interclust_node(to);
905 if (EQ(u, from) && EQ(v, to))
906 newtype = 1;
907 else
908 newtype = 5;
909 map_path(u, v, orig, ED_to_virt(orig), newtype);
910 } finally {
911 LEAVING("69xbflgja0gvrsl5xcv7o7dia","make_interclust_chain");
912 }
913 }
914
915
916
917
918 //3 6g2m2y44x66lajznvnon2gubv
919 // void interclexp(graph_t * subg)
920 public static void interclexp(ST_Agraph_s subg) {
921 ENTERING("6g2m2y44x66lajznvnon2gubv","interclexp");
922 try {
923 ST_Agraph_s g;
924 ST_Agnode_s n;
925 ST_Agedge_s e, prev, next;
926 g = dot_root(subg);
927 for (n = agfstnode(subg); n!=null; n = agnxtnode(subg, n)) {
928 /* N.B. n may be in a sub-cluster of subg */
929 prev = null;
930 for (e = agfstedge(g, n); e!=null; e = next) {
931 next = agnxtedge(g, e, n);
932 if (agcontains(subg, e))
933 continue;
934 /* canonicalize edge */
935 e = AGMKOUT(e);
936 /* short/flat multi edges */
937 if (mergeable(prev, e)) {
938 if (ND_rank(agtail(e)) == ND_rank(aghead(e)))
939 ED_to_virt(e, prev);
940 else
941 ED_to_virt(e, null);
942 if (ED_to_virt(prev) == null)
943 continue; /* internal edge */
944 merge_chain(subg, e, ED_to_virt(prev), false);
945 safe_other_edge(e);
946 continue;
947 }
948 /* flat edges */
949 if (ND_rank(agtail(e)) == ND_rank(aghead(e))) {
950 ST_Agedge_s fe;
951 if ((fe = find_flat_edge(agtail(e), aghead(e))) == null) {
952 flat_edge(g, e);
953 prev = e;
954 } else if (NEQ(e, fe)) {
955 UNSUPPORTED("ckfinb4h4twp1ry02y9peyhz"); // safe_other_edge(e);
956 UNSUPPORTED("dg3e0udctqa7xtfynplc7wdpj"); // if (!ED_to_virt(e)) merge_oneway(e, fe);
957 }
958 continue;
959 }
960 /* forward edges */
961 if (ND_rank(aghead(e)) > ND_rank(agtail(e))) {
962 make_interclust_chain(g, agtail(e), aghead(e), e);
963 prev = e;
964 continue;
965 }
966 /* backward edges */
967 else {
968 /*
969 I think that make_interclust_chain should create call other_edge(e) anyway
970 if (agcontains(subg,agtail(e))
971 && agfindedge(g,aghead(e),agtail(e))) other_edge(e);
972 */
973 make_interclust_chain(g, aghead(e), agtail(e), e);
974 prev = e;
975 }
976 }
977 }
978 } finally {
979 LEAVING("6g2m2y44x66lajznvnon2gubv","interclexp");
980 }
981 }
982
983
984
985
986 //3 85nhs7tnmwunw0fsjj1kxao7l
987 // static void merge_ranks(graph_t * subg)
988 public static void merge_ranks(ST_Agraph_s subg) {
989 ENTERING("85nhs7tnmwunw0fsjj1kxao7l","merge_ranks");
990 try {
991 int i, d, r, pos, ipos;
992 ST_Agnode_s v;
993 ST_Agraph_s root;
994 root = dot_root(subg);
995 if (GD_minrank(subg) > 0)
996 GD_rank(root).plus(GD_minrank(subg) - 1).getPtr().setInt("valid", 0);
997 for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) {
998 d = GD_rank(subg).get(r).n;
999 ipos = pos = ND_order(GD_rankleader(subg).get(r));
1000 make_slots(root, r, pos, d);
1001 for (i = 0; i < GD_rank(subg).get(r).n; i++) {
1002 v = (ST_Agnode_s) GD_rank(subg).get(r).v.get(i);
1003 GD_rank(root).get(r).v.plus(pos).setPtr(v);
1004 ND_order(v, pos++);
1005 /* real nodes automatically have v->root = root graph */
1006 if (ND_node_type(v) == 1)
1007 v.setPtr("root", agroot(root));
1008 delete_fast_node(subg, v);
1009 fast_node(root, v);
1010 GD_n_nodes(root, GD_n_nodes(root)+1);
1011 }
1012 GD_rank(subg).get(r).setPtr("v", GD_rank(root).get(r).v.plus(ipos));
1013 GD_rank(root).get(r).setInt("valid", 0);
1014 }
1015 if (r < GD_maxrank(root))
1016 GD_rank(root).get(r).setInt("valid", 0);
1017 GD_expanded(subg, NOT(false));
1018 } finally {
1019 LEAVING("85nhs7tnmwunw0fsjj1kxao7l","merge_ranks");
1020 }
1021 }
1022
1023
1024
1025
1026 //3 c9p7dm16i13qktnh95os0sv58
1027 // static void remove_rankleaders(graph_t * g)
1028 public static void remove_rankleaders(ST_Agraph_s g) {
1029 ENTERING("c9p7dm16i13qktnh95os0sv58","remove_rankleaders");
1030 try {
1031 int r;
1032 ST_Agnode_s v;
1033 ST_Agedge_s e;
1034 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1035 v = (ST_Agnode_s) GD_rankleader(g).get(r);
1036 /* remove the entire chain */
1037 while ((e = (ST_Agedge_s) ND_out(v).getFromList(0))!=null)
1038 delete_fast_edge(e);
1039 while ((e = (ST_Agedge_s) ND_in(v).getFromList(0))!=null)
1040 delete_fast_edge(e);
1041 delete_fast_node(dot_root(g), v);
1042 GD_rankleader(g).plus(r).setPtr(null);
1043 }
1044 } finally {
1045 LEAVING("c9p7dm16i13qktnh95os0sv58","remove_rankleaders");
1046 }
1047 }
1048
1049
1050
1051
1052 //3 ecrplg8hsyl484f9kxc5xp0go
1053 // void expand_cluster(graph_t * subg)
1054 public static void expand_cluster(ST_Agraph_s subg) {
1055 ENTERING("ecrplg8hsyl484f9kxc5xp0go","expand_cluster");
1056 try {
1057 /* build internal structure of the cluster */
1058 class2(subg);
1059 GD_comp(subg).size = 1;
1060 // GD_comp(subg).list.plus(0).setPtr(GD_nlist(subg));
1061 GD_comp(subg).setInList(0, GD_nlist(subg));
1062 allocate_ranks(subg);
1063 build_ranks(subg, 0);
1064 merge_ranks(subg);
1065 /* build external structure of the cluster */
1066 interclexp(subg);
1067 remove_rankleaders(subg);
1068 } finally {
1069 LEAVING("ecrplg8hsyl484f9kxc5xp0go","expand_cluster");
1070 }
1071 }
1072
1073
1074
1075
1076 //3 cxuirggihlap2iv2khmb1w5l5
1077 // void mark_clusters(graph_t * g)
1078 public static void mark_clusters(ST_Agraph_s g) {
1079 ENTERING("cxuirggihlap2iv2khmb1w5l5","mark_clusters");
1080 try {
1081 int c;
1082 ST_Agnode_s n, nn=null, vn;
1083 ST_Agedge_s orig, e;
1084 ST_Agraph_s clust;
1085 /* remove sub-clusters below this level */
1086 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
1087 if (ND_ranktype(n) == 7)
1088 UF_singleton(n);
1089 ND_clust(n, null);
1090 }
1091 for (c = 1; c <= GD_n_cluster(g); c++) {
1092 clust = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
1093 for (n = agfstnode(clust); n!=null; n = nn) {
1094 nn = agnxtnode(clust,n);
1095 if (ND_ranktype(n) != 0) {
1096 UNSUPPORTED("5l8jenkv77ax02t47zzxyv1k0"); // agerr(AGWARN,
1097 UNSUPPORTED("2ipl4umxgijawr7756ysp9hhd"); // "%s was already in a rankset, deleted from cluster %s\n",
1098 UNSUPPORTED("7r0ulsiau9cygesawzzjnpt5j"); // agnameof(n), agnameof(g));
1099 UNSUPPORTED("4zqc8357rwnd9xe7zaoqooqv3"); // agdelete(clust,n);
1100 UNSUPPORTED("6hyelvzskqfqa07xtgjtvg2is"); // continue;
1101 }
1102 UF_setname(n, GD_leader(clust));
1103 ND_clust(n, clust);
1104 ND_ranktype(n, 7);
1105 /* here we mark the vnodes of edges in the cluster */
1106 for (orig = agfstout(clust, n); orig!=null;
1107 orig = agnxtout(clust, orig)) {
1108 if ((e = ED_to_virt(orig))!=null) {
1109 while (e!=null && ND_node_type(vn =aghead(e)) == 1) {
1110 ND_clust(vn, clust);
1111 e = (ST_Agedge_s) ND_out(aghead(e)).getFromList(0);
1112 /* trouble if concentrators and clusters are mixed */
1113 }
1114 }
1115 }
1116 }
1117 }
1118 } finally {
1119 LEAVING("cxuirggihlap2iv2khmb1w5l5","mark_clusters");
1120 }
1121 }
1122
1123
1124
1125
1126 //3 bwrw5u0gi2rgah1cn9h0glpse
1127 // void build_skeleton(graph_t * g, graph_t * subg)
1128 public static void build_skeleton(ST_Agraph_s g, ST_Agraph_s subg) {
1129 ENTERING("bwrw5u0gi2rgah1cn9h0glpse","build_skeleton");
1130 try {
1131 int r;
1132 ST_Agnode_s v, prev, rl;
1133 ST_Agedge_s e;
1134 prev = null;
1135 // GD_rankleader(subg, zmalloc(sizeof_starstar_empty(Agnode_s.class, GD_maxrank(subg) + 2)));
1136 GD_rankleader(subg, new ST_Agnode_s.Array(GD_maxrank(subg) + 2));
1137 for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) {
1138 v = virtual_node(g);
1139 GD_rankleader(subg).plus(r).setPtr(v);
1140 ND_rank(v, r);
1141 ND_ranktype(v, 7);
1142 ND_clust(v, subg);
1143 if (prev!=null) {
1144 e = virtual_edge(prev, v, null);
1145 ED_xpenalty(e, ED_xpenalty(e) * 1000);
1146 }
1147 prev = v;
1148 }
1149 /* set the counts on virtual edges of the cluster skeleton */
1150 for (v = agfstnode(subg); v!=null; v = agnxtnode(subg, v)) {
1151 rl = (ST_Agnode_s) GD_rankleader(subg).plus(ND_rank(v)).getPtr();
1152 ND_UF_size(rl, ND_UF_size(rl)+1);
1153 for (e = agfstout(subg, v); e!=null; e = agnxtout(subg, e)) {
1154 for (r = ND_rank(agtail(e)); r < ND_rank(aghead(e)); r++) {
1155 ED_count(ND_out(rl).getFromList(0), ED_count(ND_out(rl).getFromList(0))+1);
1156 }
1157 }
1158 }
1159 for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) {
1160 rl = (ST_Agnode_s) GD_rankleader(subg).get(r);
1161 if (ND_UF_size(rl) > 1)
1162 ND_UF_size(rl, ND_UF_size(rl)-1);
1163 }
1164 } finally {
1165 LEAVING("bwrw5u0gi2rgah1cn9h0glpse","build_skeleton");
1166 }
1167 }
1168
1169
1170
1171
1172 //3 75yt3xwcwnxipi827t1r8zcmn
1173 // void install_cluster(graph_t * g, node_t * n, int pass, nodequeue * q)
1174 public static void install_cluster(ST_Agraph_s g, ST_Agnode_s n, int pass, ST_nodequeue q) {
1175 ENTERING("75yt3xwcwnxipi827t1r8zcmn","install_cluster");
1176 try {
1177 int r;
1178 ST_Agraph_s clust;
1179 clust = ND_clust(n);
1180 if (GD_installed(clust) != pass + 1) {
1181 for (r = GD_minrank(clust); r <= GD_maxrank(clust); r++)
1182 install_in_rank(g, (ST_Agnode_s) GD_rankleader(clust).get(r));
1183 for (r = GD_minrank(clust); r <= GD_maxrank(clust); r++)
1184 enqueue_neighbors(q, (ST_Agnode_s) GD_rankleader(clust).get(r), pass);
1185 GD_installed(clust, pass + 1);
1186 }
1187 } finally {
1188 LEAVING("75yt3xwcwnxipi827t1r8zcmn","install_cluster");
1189 }
1190 }
1191
1192
1193
1194
1195 //3 4muksvb3ec03mt6cvaqpb5c7a
1196 // void mark_lowclusters(Agraph_t * root)
1197 public static void mark_lowclusters(ST_Agraph_s root) {
1198 ENTERING("4muksvb3ec03mt6cvaqpb5c7a","mark_lowclusters");
1199 try {
1200 ST_Agnode_s n, vn;
1201 ST_Agedge_s orig, e;
1202 /* first, zap any previous cluster labelings */
1203 for (n = agfstnode(root); n!=null; n = agnxtnode(root, n)) {
1204 ND_clust(n, null);
1205 for (orig = agfstout(root, n); orig!=null; orig = agnxtout(root, orig)) {
1206 if ((e = ED_to_virt(orig))!=null) {
1207 while (e!=null && (ND_node_type(vn = aghead(e))) == 1) {
1208 ND_clust(vn, null);
1209 e = (ST_Agedge_s) ND_out(aghead(e)).getFromList(0);
1210 }
1211 }
1212 }
1213 }
1214 /* do the recursion */
1215 mark_lowcluster_basic(root);
1216 } finally {
1217 LEAVING("4muksvb3ec03mt6cvaqpb5c7a","mark_lowclusters");
1218 }
1219 }
1220
1221
1222
1223
1224 //3 48j6fdymvkcgeh4wde060ctac
1225 // static void mark_lowcluster_basic(Agraph_t * g)
1226 public static void mark_lowcluster_basic(ST_Agraph_s g) {
1227 ENTERING("48j6fdymvkcgeh4wde060ctac","mark_lowcluster_basic");
1228 try {
1229 ST_Agraph_s clust;
1230 ST_Agnode_s n, vn;
1231 ST_Agedge_s orig, e;
1232 int c;
1233 for (c = 1; c <= GD_n_cluster(g); c++) {
1234 clust = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
1235 mark_lowcluster_basic(clust);
1236 }
1237 /* see what belongs to this graph that wasn't already marked */
1238 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
1239 if (ND_clust(n) == null)
1240 ND_clust(n, g);
1241 for (orig = agfstout(g, n); orig!=null; orig = agnxtout(g, orig)) {
1242 if ((e = ED_to_virt(orig))!=null) {
1243 while (e!=null && (ND_node_type(vn = aghead(e))) == 1) {
1244 if (ND_clust(vn) == null)
1245 ND_clust(vn, g);
1246 e = (ST_Agedge_s) ND_out(aghead(e)).getFromList(0);
1247 }
1248 }
1249 }
1250 }
1251 } finally {
1252 LEAVING("48j6fdymvkcgeh4wde060ctac","mark_lowcluster_basic");
1253 }
1254 }
1255
1256
1257 }