Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/extreme/Curve.java @ 4259:5cc9453456a7
First complete but untested version of the 'Auslagerung extremer Wasserspiegellagen' calculation.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Oct 2012 17:25:37 +0200 |
parents | 467efea19d15 |
children | 2e8e00026059 |
comparison
equal
deleted
inserted
replaced
4258:2c6e571f366a | 4259:5cc9453456a7 |
---|---|
23 | 23 |
24 protected double [] qs; | 24 protected double [] qs; |
25 protected double [] ws; | 25 protected double [] ws; |
26 protected String function; | 26 protected String function; |
27 protected double [] coeffs; | 27 protected double [] coeffs; |
28 protected double chiSqr; | |
28 | 29 |
29 // The spline is pretty heavy weight so cache it with a soft ref only. | 30 // The spline is pretty heavy weight so cache it with a soft ref only. |
30 protected transient SoftReference<Function> spline; | 31 protected transient SoftReference<Function> spline; |
31 protected transient Function extrapolation; | 32 protected transient Function extrapolation; |
32 | 33 |
35 | 36 |
36 public Curve( | 37 public Curve( |
37 double [] qs, | 38 double [] qs, |
38 double [] ws, | 39 double [] ws, |
39 String function, | 40 String function, |
40 double [] coeffs | 41 double [] coeffs, |
42 double chiSqr | |
41 ) { | 43 ) { |
42 this.qs = qs; | 44 this.qs = qs; |
43 this.ws = ws; | 45 this.ws = ws; |
44 this.function = function; | 46 this.function = function; |
45 this.coeffs = coeffs; | 47 this.coeffs = coeffs; |
79 : NaNFunction.INSTANCE; | 81 : NaNFunction.INSTANCE; |
80 } | 82 } |
81 return extrapolation; | 83 return extrapolation; |
82 } | 84 } |
83 | 85 |
86 /** | |
87 * Gets the chiSqr for this instance. | |
88 * | |
89 * @return The chiSqr. | |
90 */ | |
91 public double getChiSqr() { | |
92 return this.chiSqr; | |
93 } | |
94 | |
95 /** | |
96 * Sets the chiSqr for this instance. | |
97 * | |
98 * @param chiSqr The chiSqr. | |
99 */ | |
100 public void setChiSqr(double chiSqr) { | |
101 this.chiSqr = chiSqr; | |
102 } | |
103 | |
84 protected synchronized Function getSpline() { | 104 protected synchronized Function getSpline() { |
85 Function sp; | 105 Function sp; |
86 if (spline != null) { | 106 if (spline != null) { |
87 if ((sp = spline.get()) != null) { | 107 if ((sp = spline.get()) != null) { |
88 return sp; | 108 return sp; |