Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearFunction.java @ 805:bb7afd783321
Removed trailing whitespace. Added more javadoc.
gnv-artifacts/trunk@887 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 08 Apr 2010 11:31:44 +0000 |
parents | c4156275c1e1 |
children | a645bd23c1c8 |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearFunction.java Thu Apr 08 10:10:04 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearFunction.java Thu Apr 08 11:31:44 2010 +0000 @@ -7,22 +7,49 @@ import org.apache.commons.math.optimization.fitting.ParametricRealFunction; /** + * Models a linear function to be usable in the fitting frame of + * the Apache Commons Mathematics Library. + * * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> */ public class LinearFunction implements ParametricRealFunction { + /** + * Instance to prevent needless creations of instances. + */ public static final LinearFunction INSTANCE = new LinearFunction(); + /** + * Specialized class to be useful in function evaluating + * in the Apache Commons Mathematics Library. + */ public static class Univariate implements UnivariateRealFunction { + /** + * The linear scaling factor. + */ protected double m; + /** + * The linear offset. + */ protected double b; + /** + * Default constructor. + */ public Univariate() { } + /** + * Constructor to create a Univariate with the linear parameters + * of the line between (x1, y1) and (x2, y2). + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ public Univariate(double x1, double y1, double x2, double y2) { if (y1 == y2) { m = 0d; @@ -39,6 +66,9 @@ } } // class Univariate + /** + * Default constructor. + */ public LinearFunction() { }