| 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.pathplan; |
| 47 | import static smetana.core.Macro.UNSUPPORTED; |
| 48 | |
| 49 | public class shortestpth__c { |
| 50 | //1 baedz5i9est5csw3epz3cv7z |
| 51 | // typedef Ppoly_t Ppolyline_t |
| 52 | |
| 53 | |
| 54 | //1 7pb9zum2n4wlgil34lvh8i0ts |
| 55 | // typedef double COORD |
| 56 | |
| 57 | |
| 58 | //1 e75el5ykqd72ikokwkl7j2epc |
| 59 | // typedef COORD **array2 |
| 60 | |
| 61 | |
| 62 | //1 4lqn82dcexmb1ujfx7ciwkq7t |
| 63 | // static COORD unseen = (double) INT_MAX |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | //3 3vmsnhxv064fhv23juvb3901f |
| 69 | // int *shortestPath(int root, int target, int V, array2 wadj) |
| 70 | public static Object shortestPath(Object... arg) { |
| 71 | UNSUPPORTED("ck9i1aidj3wocmwgkt8103ov9"); // int *shortestPath(int root, int target, int V, array2 wadj) |
| 72 | UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // { |
| 73 | UNSUPPORTED("7q38vtznktnwi60z79t1yl7kn"); // int *dad; |
| 74 | UNSUPPORTED("3n8lsf3bhkta5dw01y6dosbhw"); // COORD *vl; |
| 75 | UNSUPPORTED("emjv9wq86wxaz1mkis592qedk"); // COORD *val; |
| 76 | UNSUPPORTED("985nf8jew0zg19ydmlmarwyl1"); // int min; |
| 77 | UNSUPPORTED("5tszi7ot461b5xrq7t6i2p9jw"); // int k, t; |
| 78 | UNSUPPORTED("8lhpkwmemj4ejagiby4wce1tp"); // /* allocate arrays */ |
| 79 | UNSUPPORTED("70ahd60yay9ycxlgxj1zuyqwk"); // dad = (int *) malloc(V * sizeof(int)); |
| 80 | UNSUPPORTED("cwcxxkaw0opazqbubfd67ylkw"); // vl = (COORD *) malloc((V + 1) * sizeof(COORD)); /* One extra for sentinel */ |
| 81 | UNSUPPORTED("30bnpu1p596ets2fp9d9fcuuo"); // val = vl + 1; |
| 82 | UNSUPPORTED("6usgmh9di07cghsmczuausuqv"); // /* initialize arrays */ |
| 83 | UNSUPPORTED("7s35obmd4mmmswain6cq6kjyz"); // for (k = 0; k < V; k++) { |
| 84 | UNSUPPORTED("9g1fv9lo3mqgozp0hgspk0jfx"); // dad[k] = -1; |
| 85 | UNSUPPORTED("3dfr2o54vzdz7ow35rvkkupwp"); // val[k] = -unseen; |
| 86 | UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // } |
| 87 | UNSUPPORTED("6vvn9wwyfshecuati4wkh0hb1"); // val[-1] = -(unseen + (COORD) 1); /* Set sentinel */ |
| 88 | UNSUPPORTED("ail1ie6r4omx0srfndd7uhkx8"); // min = root; |
| 89 | UNSUPPORTED("8iguu5odqkwyske4dcuz2zh5c"); // /* use (min >= 0) to fill entire tree */ |
| 90 | UNSUPPORTED("3b9mo25ltl9ubqm9ptv305emr"); // while (min != target) { |
| 91 | UNSUPPORTED("37uwanwupwkgvkiatkocsnwmi"); // k = min; |
| 92 | UNSUPPORTED("2yk23r7ym8txau8t7w94um5l9"); // val[k] *= -1; |
| 93 | UNSUPPORTED("d8r99m4cpfcmbygzpwrb87waf"); // min = -1; |
| 94 | UNSUPPORTED("99ykmzy96436vip14lubfa2jo"); // if (val[k] == unseen) |
| 95 | UNSUPPORTED("9vb74y52jxvq4iptd1w4dewnu"); // val[k] = 0; |
| 96 | UNSUPPORTED("45pfcyfo86ei9srti6g0iz6xo"); // for (t = 0; t < V; t++) { |
| 97 | UNSUPPORTED("didw0ewjf6uo68oewapzly1rv"); // if (val[t] < 0) { |
| 98 | UNSUPPORTED("ekeykiipkt1z2a3sn2ilt5gx7"); // COORD newpri; |
| 99 | UNSUPPORTED("bczxeah6ns9u23ey094g25kjz"); // COORD wkt; |
| 100 | UNSUPPORTED("cctfdc4m6tunpeulyd30cbdma"); // /* Use lower triangle */ |
| 101 | UNSUPPORTED("akz9x35nrpcyklhz1a227a4xh"); // if (k >= t) |
| 102 | UNSUPPORTED("6cx7tblgrev9yzb4ppafglzh7"); // wkt = wadj[k][t]; |
| 103 | UNSUPPORTED("7e1uy5mzei37p66t8jp01r3mk"); // else |
| 104 | UNSUPPORTED("bbx44cas4y4rgf8fnytgoavog"); // wkt = wadj[t][k]; |
| 105 | UNSUPPORTED("2p64h5oxifdj0iau4zuiebitc"); // newpri = -(val[k] + wkt); |
| 106 | UNSUPPORTED("1skepgmjhmtk882tbnh0ny10o"); // if ((wkt != 0) && (val[t] < newpri)) { |
| 107 | UNSUPPORTED("73wirchpqpajql6a751nimkyu"); // val[t] = newpri; |
| 108 | UNSUPPORTED("4hhrf0py8taqfmqeg3uvrx081"); // dad[t] = k; |
| 109 | UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // } |
| 110 | UNSUPPORTED("98nv5m3wkh33gdi3z4vns4n4k"); // if (val[t] > val[min]) |
| 111 | UNSUPPORTED("cpb83eu6rulsmbhc2rwsi9i5l"); // min = t; |
| 112 | UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // } |
| 113 | UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // } |
| 114 | UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // } |
| 115 | UNSUPPORTED("yxn5pc6i3jmimfvzmmhfotak"); // free(vl); |
| 116 | UNSUPPORTED("60tomuwdovbmgh94zzb3yeqib"); // return dad; |
| 117 | UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // } |
| 118 | |
| 119 | throw new UnsupportedOperationException(); |
| 120 | } |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | //3 eb1kiq1ildiyme0qn3xszjyvk |
| 126 | // int *makePath(Ppoint_t p, int pp, COORD * pvis, Ppoint_t q, int qp, COORD * qvis, vconfig_t * conf) |
| 127 | public static Object makePath(Object... arg) { |
| 128 | UNSUPPORTED("2jth0bos9lrgk2xi5083p5rvp"); // int *makePath(Ppoint_t p, int pp, COORD * pvis, |
| 129 | UNSUPPORTED("a6dn81zxyfp9ydvajebmx15wt"); // Ppoint_t q, int qp, COORD * qvis, vconfig_t * conf) |
| 130 | UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // { |
| 131 | UNSUPPORTED("9e683sch2jealt2ckz48v9f0j"); // int V = conf->N; |
| 132 | UNSUPPORTED("5ykvw66ec1v4dm5wm0ujsfgt9"); // if (directVis(p, pp, q, qp, conf)) { |
| 133 | UNSUPPORTED("8y9o9xskc3crv3uecpyrsdakg"); // int *dad = (int *) malloc(sizeof(int) * (V + 2)); |
| 134 | UNSUPPORTED("7oo70ckt9z1mf09uljyji5zud"); // dad[V] = V + 1; |
| 135 | UNSUPPORTED("3akorfrpmzhjtlnjmmos6z20q"); // dad[V + 1] = -1; |
| 136 | UNSUPPORTED("7x27015v5wfafitei6hpx0rii"); // return dad; |
| 137 | UNSUPPORTED("c07up7zvrnu2vhzy6d7zcu94g"); // } else { |
| 138 | UNSUPPORTED("946fxixcelejjif01eiioqduy"); // array2 wadj = conf->vis; |
| 139 | UNSUPPORTED("5ynkls19r2ylvtzz36h6vjy0t"); // wadj[V] = qvis; |
| 140 | UNSUPPORTED("a8gy96zl4x1lwid18nfp48pbm"); // wadj[V + 1] = pvis; |
| 141 | UNSUPPORTED("1fm1wr69gee2idjkv025ovvwh"); // return (shortestPath(V + 1, V, V + 2, wadj)); |
| 142 | UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // } |
| 143 | UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // } |
| 144 | |
| 145 | throw new UnsupportedOperationException(); |
| 146 | } |
| 147 | |
| 148 | |
| 149 | } |