Mercurial > dive4elements > river
view flys-artifacts/src/main/java/de/intevation/flys/artifacts/math/fitting/InvLog.java @ 5122:5ba502e78e05 dami
Fix import of hws_* on Oracle
The OCI driver needs a field named OGR_FID as the first element
of a table, otherwise it gets confused and tries to add the
fid twice in the insert statement leading to the "too many
values" error.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 28 Feb 2013 10:09:31 +0100 |
parents | 9422b559b2d5 |
children |
line wrap: on
line source
package de.intevation.flys.artifacts.math.fitting; public class InvLog extends Function { public static final Derivative DERIVATIVE = new Derivative("Q'(W) = exp(W/m)/m") { @Override public de.intevation.flys.artifacts.math.Function instantiate(double [] parameters) { final double _1m = 1d / parameters[0]; return new de.intevation.flys.artifacts.math.Function() { @Override public double value(double W) { return Math.exp(W*_1m)*_1m; } }; } }; public static final Function INSTANCE = new InvLog(); public InvLog() { super("inv-log", "Q(W) = e^(W/m) - b", new String [] { "m", "b" }); } @Override public double value(double w, double [] parameters) { double m = parameters[0]; double b = parameters[1]; return Math.exp(w/m) - b; } @Override public double [] gradient(double w, double [] parameters) { double m = parameters[0]; double b = parameters[1]; double ewm = Math.exp(w/m); return new double [] { -w*ewm/(m*m), -1 }; } @Override public Derivative getDerivative() { return DERIVATIVE; } @Override public Function getInverse() { return Log.INSTANCE; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :