ingo@1115: /* ingo@1115: * Copyright (c) 2010 by Intevation GmbH ingo@1115: * ingo@1115: * This program is free software under the LGPL (>=v2.1) ingo@1115: * Read the file LGPL.txt coming with the software for details ingo@1115: * or visit http://www.gnu.org/licenses/ if it does not exist. ingo@1115: */ ingo@1115: sascha@433: package de.intevation.gnv.math; sascha@433: sascha@433: import org.apache.commons.math.analysis.UnivariateRealFunction; sascha@433: sascha@433: /** sascha@807: * Models a constant function to be used in function evaluation. sascha@807: * sascha@780: * @author Sascha L. Teichmann sascha@433: */ sascha@433: public class ConstantFunction sascha@433: implements UnivariateRealFunction sascha@433: { sascha@807: /** sascha@807: * The constant value. sascha@807: */ sascha@433: protected double value; sascha@778: sascha@807: /** sascha@807: * Defaut constructor. sascha@807: */ sascha@433: public ConstantFunction() { sascha@433: } sascha@433: sascha@807: /** sascha@807: * Constructor to create a ConstantFunction with sascha@807: * a given constant value. sascha@807: * @param value The constant value. sascha@807: */ sascha@433: public ConstantFunction(double value) { sascha@433: this.value = value; sascha@433: } sascha@433: sascha@433: public double value(double x) { sascha@433: return value; sascha@433: } sascha@433: } sascha@798: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :