List of usage examples for org.apache.commons.math3.analysis.function StepFunction StepFunction
public StepFunction(double[] x, double[] y) throws NullArgumentException, NoDataException, DimensionMismatchException
From source file:de.bund.bfr.math.InterpolationFactory.java
public UnivariateFunction createInterpolationFunction(double[] x, double[] y) { switch (type) { case STEP://from ww w .j av a2 s . c o m return new StepFunction(x, y); case SPLINE: return new SplineInterpolator().interpolate(x, y); default: throw new RuntimeException("Unknown type of InterpolationFactory: " + type); } }
From source file:eu.crisis_economics.abm.markets.clearing.heterogeneous.StepResponseFunction.java
private void initCommon(final BoundedUnivariateFunction existingResponseFunction, final double[] stepCoordinates) { double[] stepYCoordinates = new double[stepCoordinates.length]; for (int i = 0; i < stepYCoordinates.length; ++i) stepYCoordinates[i] = 1. - i / (double) stepYCoordinates.length; this.stepFunction = new StepFunction(stepCoordinates, stepYCoordinates); this.existingResponseFunction = existingResponseFunction; }