Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/LinearInterpolated.java @ 6152:0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sun, 02 Jun 2013 17:52:53 +0200 |
parents | |
children | 12af732c9d0f |
rev | line source |
---|---|
6152
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
3 * |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
7 */ |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
8 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
9 package org.dive4elements.river.artifacts.model; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
10 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
11 import gnu.trove.TDoubleArrayList; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
12 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
13 import java.io.Serializable; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
14 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
15 import java.util.ArrayList; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
16 import java.util.List; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
17 import java.util.Set; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
18 import java.util.TreeSet; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
19 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
20 import org.apache.commons.math.stat.descriptive.moment.StandardDeviation; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
21 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
22 import org.dive4elements.river.artifacts.math.Linear; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
23 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
24 import org.dive4elements.river.utils.EpsilonComparator; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
25 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
26 public class LinearInterpolated |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
27 implements Serializable |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
28 { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
29 public static final double EPSILON = 1e-5; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
30 public static final double MULTIPLE_STD_DEV = 4d; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
31 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
32 public static final EpsilonComparator CMP = new EpsilonComparator(EPSILON); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
33 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
34 private TDoubleArrayList xs; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
35 private TDoubleArrayList ys; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
36 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
37 private List<Range> gaps; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
38 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
39 public interface Operator { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
40 double evaluate(double y1, double y2); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
41 } // interface Operator |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
42 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
43 public static final Operator SUB = new Operator() { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
44 @Override |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
45 public double evaluate(double y1, double y2) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
46 return y1 - y2; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
47 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
48 }; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
49 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
50 public static final Operator MAX = new Operator() { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
51 @Override |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
52 public double evaluate(double y1, double y2) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
53 return Math.max(y1, y2); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
54 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
55 }; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
56 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
57 public LinearInterpolated() { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
58 xs = new TDoubleArrayList(); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
59 ys = new TDoubleArrayList(); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
60 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
61 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
62 public LinearInterpolated(int capacity) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
63 xs = new TDoubleArrayList(capacity); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
64 ys = new TDoubleArrayList(capacity); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
65 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
66 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
67 public void add(double x, double y) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
68 xs.add(x); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
69 ys.add(y); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
70 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
71 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
72 public int size() { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
73 return xs.size(); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
74 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
75 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
76 public void pointsInRange(double from, double to, Set<Double> points) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
77 if (from > to) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
78 double t = from; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
79 from = to; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
80 to = t; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
81 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
82 for (int i = 0, S = size(); i < S; ++i) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
83 double x = xs.getQuick(i); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
84 if (x >= from && x <= to) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
85 points.add(x); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
86 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
87 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
88 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
89 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
90 public boolean inGap(double x) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
91 if (gaps != null) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
92 for (Range gap: gaps) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
93 if (gap.inside(x)) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
94 return true; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
95 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
96 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
97 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
98 return false; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
99 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
100 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
101 public void detectGaps(double threshold) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
102 List<Range> gabs = new ArrayList<Range>(); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
103 for (int i = 1, S = size(); i < S; ++i) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
104 double x0 = xs.getQuick(i-1); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
105 double x1 = xs.getQuick(i); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
106 double minX, maxX; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
107 if (x0 < x1) { minX = x0; maxX = x1; } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
108 else { minX = x1; maxX = x0; } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
109 double diff = maxX - minX - 2d*EPSILON; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
110 if (diff > threshold) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
111 gaps.add(new Range(minX+EPSILON, maxX-EPSILON)); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
112 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
113 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
114 this.gaps = gaps.isEmpty() ? null : gabs; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
115 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
116 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
117 public void resetGaps() { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
118 gaps = null; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
119 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
120 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
121 public double guessGapThreshold() { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
122 return guessGapThreshold(MULTIPLE_STD_DEV); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
123 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
124 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
125 public double guessGapThreshold(double scale) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
126 int S = size(); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
127 if (S < 5) { // Too less points. |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
128 return Double.MAX_VALUE; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
129 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
130 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
131 StandardDeviation s = new StandardDeviation(); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
132 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
133 for (int i = 1; i < S; ++i) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
134 double diff = Math.abs(xs.getQuick(i-1) - xs.getQuick(i)); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
135 s.increment(diff); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
136 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
137 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
138 return scale*s.getResult(); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
139 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
140 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
141 public double value(double x) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
142 for (int i = 0, S = size(); i < S; ++i) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
143 double x1 = xs.getQuick(i); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
144 if (Math.abs(x1 - x) < EPSILON) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
145 return ys.getQuick(i); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
146 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
147 if (i > 0) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
148 double x0 = xs.getQuick(i-1); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
149 double minX, maxX; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
150 if (x0 < x1) { minX = x0; maxX = x1; } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
151 else { minX = x1; maxX = x0; } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
152 if (x > minX && x < maxX) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
153 return Linear.linear( |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
154 x, |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
155 x0, x1, |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
156 ys.getQuick(i-1), ys.getQuick(i)); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
157 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
158 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
159 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
160 return Double.NaN; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
161 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
162 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
163 public LinearInterpolated sub( |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
164 LinearInterpolated other, |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
165 double from, |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
166 double to |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
167 ) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
168 return apply(SUB, other, from, to); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
169 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
170 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
171 public LinearInterpolated max( |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
172 LinearInterpolated other, |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
173 double from, |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
174 double to |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
175 ) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
176 return apply(MAX, other, from, to); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
177 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
178 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
179 public LinearInterpolated apply( |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
180 Operator operator, |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
181 LinearInterpolated other, |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
182 double from, |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
183 double to |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
184 ) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
185 Set<Double> points = new TreeSet<Double>(CMP); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
186 points.add(from); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
187 points.add(to); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
188 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
189 this .pointsInRange(from, to, points); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
190 other.pointsInRange(from, to, points); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
191 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
192 LinearInterpolated result = new LinearInterpolated(); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
193 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
194 for (double x: points) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
195 if (!inGap(x) && !other.inGap(x)) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
196 double y1 = this .value(x); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
197 double y2 = other.value(x); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
198 double y = operator.evaluate(y1, y2); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
199 if (!Double.isNaN(y)) { |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
200 result.add(x, y); |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
201 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
202 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
203 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
204 |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
205 return result; |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
206 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
207 } |
0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
208 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |