/*
* AbstractIFunction.java
*
* Created on February 18, 2004, 12:02 PM
*/
package hep.aida.ref.function;
import hep.aida.IModelFunction;
import hep.aida.IRangeSet;
import hep.aida.ref.Annotation;
import hep.aida.ref.ManagedObject;
import java.util.ArrayList;
/**
* AbstractIFunction is implementation of the IFunction.
* User has to implement "value" method.
* @author serbo
*/
public abstract class AbstractIFunction extends ManagedObject implements IModelFunction, Cloneable, FunctionDispatcher {
protected String[] variableNames;
protected String[] parameterNames;
protected String codeletString;
private Annotation annotation;
private int dimension;
private int numberOfParameters;
private ArrayList listeners = new ArrayList();
private RangeSet[] rangeSet;
// chekanov. Changed from protected to public for simple scripting in Jython
public double[] p;
public double[] gradient;
/** No-argument constructor to be used for cloning.
* Created function can not be used directly
*/
public AbstractIFunction() {
super("");
String className = this.getClass().getName();
codeletString = "codelet:"+className+":classPath:";
}
/** Creates a new instance of AbstractIFunction
* with default variable names (x0, x1, ...)
* and default parameter names (p0, p1, ...)
*/
public AbstractIFunction(String title, int dimension, int numberOfParameters) {
this();
variableNames = new String[dimension];
for (int i=0; i
Ads help maintain this website.