diff artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/fitting/ArraySubstraction.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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/fitting/ArraySubstraction.java	Mon Dec 02 17:56:15 2019 +0100
@@ -0,0 +1,30 @@
+/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
+ * Software engineering by
+ *  Björnsen Beratende Ingenieure GmbH
+ *  Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+package org.dive4elements.river.artifacts.model.fixings.fitting;
+
+/**
+ * @author Gernot Belger
+ */
+final class ArraySubstraction {
+
+    private final double[] minuend;
+
+    public ArraySubstraction(final double[] minuend) {
+        this.minuend = minuend;
+    }
+
+    public double[] evaluate(final double[] subtrahend) {
+
+        final double[] difference = new double[this.minuend.length];
+        for (int i = 0; i < difference.length; i++)
+            difference[i] = this.minuend[i] - subtrahend[i];
+        return difference;
+    }
+}
\ No newline at end of file

http://dive4elements.wald.intevation.org