Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java @ 2197:5781847433d8
"Bezugslinienverfahren": Implemented the on-the-flys shift to (0, 0).
flys-artifacts/trunk@3813 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 27 Jan 2012 17:59:24 +0000 |
parents | ec2574eb2d32 |
children | 672a41efe222 |
comparison
equal
deleted
inserted
replaced
2196:5f3726f31f00 | 2197:5781847433d8 |
---|---|
27 this.name = name; | 27 this.name = name; |
28 this.ws = new TDoubleArrayList(ws); | 28 this.ws = new TDoubleArrayList(ws); |
29 this.ws2 = new TDoubleArrayList(ws2); | 29 this.ws2 = new TDoubleArrayList(ws2); |
30 } | 30 } |
31 | 31 |
32 public WW(String name, TDoubleArrayList ws, TDoubleArrayList ws2) { | |
33 this.name = name; | |
34 this.ws = ws; | |
35 this.ws2 = ws2; | |
36 } | |
37 | |
32 public void add(double w1, double w2) { | 38 public void add(double w1, double w2) { |
33 ws .add(w1); | 39 ws .add(w1); |
34 ws2.add(w2); | 40 ws2.add(w2); |
35 } | 41 } |
36 | 42 |
56 | 62 |
57 @Override | 63 @Override |
58 public void removeNaNs() { | 64 public void removeNaNs() { |
59 removeNaNs(new TDoubleArrayList [] { ws, ws2 }); | 65 removeNaNs(new TDoubleArrayList [] { ws, ws2 }); |
60 } | 66 } |
67 | |
68 public WW createNormalized() { | |
69 | |
70 double minW1 = ws. min(); | |
71 double minW2 = ws2.min(); | |
72 | |
73 int N = size(); | |
74 | |
75 TDoubleArrayList ws1c = new TDoubleArrayList(N); | |
76 TDoubleArrayList ws2c = new TDoubleArrayList(N); | |
77 | |
78 for (int i = 0; i < N; ++i) { | |
79 ws1c.add(ws. getQuick(i) - minW1); | |
80 ws2c.add(ws2.getQuick(i) - minW2); | |
81 } | |
82 | |
83 return new WW(getName(), ws1c, ws2c); | |
84 } | |
61 } | 85 } |
62 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 86 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |