package jas.hist; import jas.util.DoubleWithError; public abstract class Fittable1DFunction extends Basic1DFunction implements ExtendedStatistics { public abstract double valueAt(double x, double[] param) throws FunctionValueUndefined; abstract public void setFit(Fitter fit, double[] param) throws InvalidFunctionParameter; public boolean[] getIncludeParametersInFit() { initIncludeParametersInFit(getParameterNames().length); return m_fitParms; } public void clearFitParams() { m_fitParms = null; } public void setIncludeParameterInFit(int index, boolean value) { initIncludeParametersInFit(getParameterNames().length); m_fitParms[index] = value; clearFit(); setChanged(); } protected void initIncludeParametersInFit(int nParameters) { if (m_fitParms == null || m_fitParms.length != nParameters) { m_fitParms = new boolean[nParameters]; for (int i=0; ix */ public double[] getDerivatives(double x, double[] a) throws FunctionValueUndefined { int nterms = a.length; double[] result = new double[nterms]; double[] deltaA = getParameterDeltas(); for (int j=0; j