comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java @ 742:c09c9e05ecfa

Removed trailing whitespace. flys-artifacts/trunk@2243 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 26 Jun 2011 17:18:59 +0000
parents eab5e5089d77
children 1ea7eb72aaa6
comparison
equal deleted inserted replaced
741:e54203e52097 742:c09c9e05ecfa
228 228
229 return new double [][] { outWs, outQs }; 229 return new double [][] { outWs, outQs };
230 } 230 }
231 231
232 public double [][] interpolateWQ( 232 public double [][] interpolateWQ(
233 int steps, 233 int steps,
234 WstValueTable table, 234 WstValueTable table,
235 Calculation errors 235 Calculation errors
236 ) { 236 ) {
237 int W = ws.length; 237 int W = ws.length;
238 238
244 return new double[2][0]; 244 return new double[2][0];
245 } 245 }
246 246
247 double [] splineQ = new double[W]; 247 double [] splineQ = new double[W];
248 248
249 double minQ = Double.MAX_VALUE; 249 double minQ = Double.MAX_VALUE;
250 double maxQ = -Double.MAX_VALUE; 250 double maxQ = -Double.MAX_VALUE;
251 251
252 for (int i = 0; i < W; ++i) { 252 for (int i = 0; i < W; ++i) {
253 double sq = table.getQIndex(i, km); 253 double sq = table.getQIndex(i, km);
254 if (Double.isNaN(sq)) { 254 if (Double.isNaN(sq)) {
255 if (errors != null) { 255 if (errors != null) {
268 double stepWidth = (maxQ - minQ)/steps; 268 double stepWidth = (maxQ - minQ)/steps;
269 269
270 SplineInterpolator interpolator = new SplineInterpolator(); 270 SplineInterpolator interpolator = new SplineInterpolator();
271 271
272 PolynomialSplineFunction spline; 272 PolynomialSplineFunction spline;
273 273
274 try { 274 try {
275 spline = interpolator.interpolate(splineQ, ws); 275 spline = interpolator.interpolate(splineQ, ws);
276 } 276 }
277 catch (MathIllegalArgumentException miae) { 277 catch (MathIllegalArgumentException miae) {
278 if (errors != null) { 278 if (errors != null) {
331 if (weight == 1.0) { 331 if (weight == 1.0) {
332 tw = ws[index]; 332 tw = ws[index];
333 ow = other.ws[index]; 333 ow = other.ws[index];
334 } 334 }
335 else { 335 else {
336 tw = Linear.weight(weight, ws[index-1], ws[index]); 336 tw = Linear.weight(weight, ws[index-1], ws[index]);
337 ow = Linear.weight(weight, other.ws[index-1], other.ws[index]); 337 ow = Linear.weight(weight, other.ws[index-1], other.ws[index]);
338 } 338 }
339 339
340 return Linear.weight(kmWeight, tw, ow); 340 return Linear.weight(kmWeight, tw, ow);
341 } 341 }
342 } // class Row 342 } // class Row
367 return interpolateW(km, qs, ws, null); 367 return interpolateW(km, qs, ws, null);
368 } 368 }
369 369
370 public double [] interpolateW( 370 public double [] interpolateW(
371 double km, 371 double km,
372 double [] qs, 372 double [] qs,
373 double [] ws, 373 double [] ws,
374 Calculation errors 374 Calculation errors
375 ) { 375 ) {
376 int rowIndex = Collections.binarySearch(rows, new Row(km)); 376 int rowIndex = Collections.binarySearch(rows, new Row(km));
377 377

http://dive4elements.wald.intevation.org