Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/fitting/SqrtErrorFunction.java @ 9646:0380717105ba
Implemented alternative fitting strategy for Log-Linear function.
author | Gernot Belger <g.belger@bjoernsen.de> |
---|---|
date | Mon, 02 Dec 2019 17:56:15 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9645:eb1a29fe823f | 9646:0380717105ba |
---|---|
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 package org.dive4elements.river.artifacts.model.fixings.fitting; | |
11 | |
12 /** | |
13 * @author Gernot Belger | |
14 */ | |
15 final class SqrtErrorFunction { | |
16 | |
17 private final SQRTFunction sqrtFunction; | |
18 | |
19 private final TargetFunction targetFunction; | |
20 | |
21 public SqrtErrorFunction(final double[] obsWaterlevels, final TargetFunction targetFunction) { | |
22 | |
23 this.targetFunction = targetFunction; | |
24 this.sqrtFunction = new SQRTFunction(obsWaterlevels); | |
25 } | |
26 | |
27 public double value(final double a, final double b, final double m) { | |
28 return calc_sqrt_trans(a, b, m); | |
29 } | |
30 | |
31 private double calc_sqrt_trans(final double a, final double b, final double m) { | |
32 | |
33 final double[] waterlevels = this.targetFunction.calc_stages(a, b, m); | |
34 return this.sqrtFunction.calc_sqrt(waterlevels); | |
35 } | |
36 } |