| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
package h; |
| 47 |
|
| 48 |
import java.util.ArrayList; |
| 49 |
import java.util.List; |
| 50 |
|
| 51 |
import smetana.core.UnsupportedArrayOfPtr; |
| 52 |
import smetana.core.UnsupportedStructAndPtr; |
| 53 |
import smetana.core.__array_of_ptr__; |
| 54 |
import smetana.core.__ptr__; |
| 55 |
import smetana.core.__struct__; |
| 56 |
import smetana.core.amiga.StarStruct; |
| 57 |
|
| 58 |
public class ST_rank_t extends UnsupportedStructAndPtr { |
| 59 |
|
| 60 |
private final StarStruct parent; |
| 61 |
|
| 62 |
public ST_rank_t() { |
| 63 |
this(null); |
| 64 |
} |
| 65 |
|
| 66 |
public ST_rank_t(StarStruct parent) { |
| 67 |
this.parent = parent; |
| 68 |
} |
| 69 |
|
| 70 |
public int n; |
| 71 |
|
| 72 |
|
| 73 |
public ST_Agnode_s.ArrayOfStar v; |
| 74 |
public int an; |
| 75 |
|
| 76 |
public ST_Agnode_s.ArrayOfStar av; |
| 77 |
|
| 78 |
public double ht1, ht2; |
| 79 |
public double pht1, pht2; |
| 80 |
public boolean candidate; |
| 81 |
public int valid; |
| 82 |
|
| 83 |
public int cache_nc; |
| 84 |
public ST_adjmatrix_t flat; |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
public static class Array2 extends UnsupportedArrayOfPtr implements __ptr__, __array_of_ptr__ { |
| 91 |
|
| 92 |
private final List<ST_rank_t> data; |
| 93 |
private final int pos; |
| 94 |
|
| 95 |
public Array2(int size) { |
| 96 |
this.data = new ArrayList<ST_rank_t>(); |
| 97 |
this.pos = 0; |
| 98 |
for (int i = 0; i < size; i++) { |
| 99 |
data.add(new ST_rank_t()); |
| 100 |
} |
| 101 |
} |
| 102 |
|
| 103 |
@Override |
| 104 |
public void setInt(String fieldName, int data) { |
| 105 |
getPtr().setInt(fieldName, data); |
| 106 |
} |
| 107 |
|
| 108 |
@Override |
| 109 |
public __ptr__ setPtr(String fieldName, __ptr__ newData) { |
| 110 |
return getPtr().setPtr(fieldName, newData); |
| 111 |
} |
| 112 |
|
| 113 |
@Override |
| 114 |
public void setDouble(String fieldName, double data) { |
| 115 |
getPtr().setDouble(fieldName, data); |
| 116 |
} |
| 117 |
|
| 118 |
public ST_rank_t get(int i) { |
| 119 |
return plus(i).getPtr(); |
| 120 |
} |
| 121 |
|
| 122 |
public void swap(int i, int j) { |
| 123 |
ST_rank_t e1 = data.get(i); |
| 124 |
ST_rank_t e2 = data.get(j); |
| 125 |
data.set(i, e2); |
| 126 |
data.set(j, e1); |
| 127 |
} |
| 128 |
|
| 129 |
public Array2(List<ST_rank_t> data, int pos) { |
| 130 |
this.data = data; |
| 131 |
this.pos = pos; |
| 132 |
} |
| 133 |
|
| 134 |
public Array2 reallocJ(int newsize) { |
| 135 |
while (data.size() < newsize) { |
| 136 |
data.add(new ST_rank_t()); |
| 137 |
} |
| 138 |
return this; |
| 139 |
} |
| 140 |
|
| 141 |
@Override |
| 142 |
public Array2 plus(int delta) { |
| 143 |
return new Array2(data, pos + delta); |
| 144 |
} |
| 145 |
|
| 146 |
@Override |
| 147 |
public Array2 asPtr() { |
| 148 |
return this; |
| 149 |
} |
| 150 |
|
| 151 |
@Override |
| 152 |
public void setPtr(__ptr__ value) { |
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
this.data.set(pos, (ST_rank_t) value); |
| 157 |
} |
| 158 |
|
| 159 |
@Override |
| 160 |
public ST_rank_t getPtr() { |
| 161 |
return this.data.get(pos); |
| 162 |
} |
| 163 |
|
| 164 |
@Override |
| 165 |
public int comparePointer(__ptr__ other) { |
| 166 |
final Array2 this2 = (Array2) other; |
| 167 |
if (this.data != this2.data) { |
| 168 |
throw new IllegalArgumentException(); |
| 169 |
} |
| 170 |
return this.pos - this2.pos; |
| 171 |
} |
| 172 |
|
| 173 |
public boolean isSameThan2(Array2 other) { |
| 174 |
if (this.data != other.data) { |
| 175 |
throw new IllegalArgumentException(); |
| 176 |
} |
| 177 |
return this.pos == other.pos; |
| 178 |
} |
| 179 |
} |
| 180 |
|
| 181 |
|
| 182 |
@Override |
| 183 |
public void setStruct(__struct__ value) { |
| 184 |
ST_rank_t this2 = (ST_rank_t) value; |
| 185 |
this.n = this2.n; |
| 186 |
this.v = this2.v; |
| 187 |
this.an = this2.an; |
| 188 |
this.av = this2.av; |
| 189 |
this.ht1 = this2.ht1; |
| 190 |
this.ht2 = this2.ht2; |
| 191 |
this.pht1 = this2.pht1; |
| 192 |
this.pht2 = this2.pht2; |
| 193 |
this.candidate = this2.candidate; |
| 194 |
this.valid = this2.valid; |
| 195 |
this.cache_nc = this2.cache_nc; |
| 196 |
this.flat = this2.flat; |
| 197 |
} |
| 198 |
|
| 199 |
|
| 200 |
@Override |
| 201 |
public void setInt(String fieldName, int data) { |
| 202 |
if (fieldName.equals("n")) { |
| 203 |
this.n = data; |
| 204 |
return; |
| 205 |
} |
| 206 |
if (fieldName.equals("an")) { |
| 207 |
this.an = data; |
| 208 |
return; |
| 209 |
} |
| 210 |
if (fieldName.equals("valid")) { |
| 211 |
this.valid = data; |
| 212 |
return; |
| 213 |
} |
| 214 |
if (fieldName.equals("cache_nc")) { |
| 215 |
this.cache_nc = data; |
| 216 |
return; |
| 217 |
} |
| 218 |
super.setInt(fieldName, data); |
| 219 |
} |
| 220 |
|
| 221 |
@Override |
| 222 |
public void setDouble(String fieldName, double data) { |
| 223 |
if (fieldName.equals("pht1")) { |
| 224 |
this.pht1 = data; |
| 225 |
return; |
| 226 |
} |
| 227 |
if (fieldName.equals("pht2")) { |
| 228 |
this.pht2 = data; |
| 229 |
return; |
| 230 |
} |
| 231 |
if (fieldName.equals("ht1")) { |
| 232 |
this.ht1 = data; |
| 233 |
return; |
| 234 |
} |
| 235 |
if (fieldName.equals("ht2")) { |
| 236 |
this.ht2 = data; |
| 237 |
return; |
| 238 |
} |
| 239 |
super.setDouble(fieldName, data); |
| 240 |
} |
| 241 |
|
| 242 |
@Override |
| 243 |
public __struct__ getStruct() { |
| 244 |
return this; |
| 245 |
} |
| 246 |
|
| 247 |
@Override |
| 248 |
public __ptr__ setPtr(String fieldName, __ptr__ newData) { |
| 249 |
if (fieldName.equals("v")) { |
| 250 |
this.v = (ST_Agnode_s.ArrayOfStar) newData; |
| 251 |
return v; |
| 252 |
} |
| 253 |
if (fieldName.equals("av")) { |
| 254 |
this.av = (ST_Agnode_s.ArrayOfStar) newData; |
| 255 |
return av; |
| 256 |
} |
| 257 |
if (fieldName.equals("flat")) { |
| 258 |
this.flat = (ST_adjmatrix_t) newData; |
| 259 |
return flat; |
| 260 |
} |
| 261 |
return super.setPtr(fieldName, newData); |
| 262 |
} |
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
} |
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|