comparison flys-artifacts/src/main/java/de/intevation/flys/utils/DoubleUtil.java @ 4821:bcf25d8c183e

Moved NaN removal code from W to DoubleUtil. Create QKms when calculating the 'Umhuellende'.
author Sascha L. Teichmann <teichmann@intevation.de>
date Mon, 21 Jan 2013 14:03:22 +0100
parents 5b8919ef601d
children 5f70c73b11ed
comparison
equal deleted inserted replaced
4820:26c849cf54e7 4821:bcf25d8c183e
207 for (double d: values) { 207 for (double d: values) {
208 if (d > max) max = d; 208 if (d > max) max = d;
209 } 209 }
210 return max; 210 return max;
211 } 211 }
212
213 public static void removeNaNs(TDoubleArrayList [] arrays) {
214
215 int dest = 0;
216
217 int A = arrays.length;
218 int N = arrays[0].size();
219
220 OUTER: for (int i = 0; i < N; ++i) {
221 for (int j = 0; j < A; ++j) {
222 TDoubleArrayList a = arrays[j];
223 double v = a.getQuick(i);
224 if (Double.isNaN(v)) {
225 continue OUTER;
226 }
227 a.setQuick(dest, v);
228 }
229 ++dest;
230 }
231
232 if (dest < N) {
233 for (int i = 0; i < A; ++i) {
234 arrays[i].remove(dest, N-dest);
235 }
236 }
237 }
212 } 238 }
213 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 239 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org