/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 1.3.31 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package hep.aida.swig; import hep.aida.jni.AIDAJNIUtil; public class IFunction implements hep.aida.IFunction { private long swigCPtr; protected boolean swigCMemOwn; public IFunction(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr(hep.aida.IFunction obj) { if (obj instanceof IFunction) { return (obj == null) ? 0 : ((IFunction)obj).swigCPtr; } else { long cPtr = AIDAJNI.new_IFunction(); // FIXME, memory leak if Java class gets finalized, since C++ director is not freed. AIDAJNI.IFunction_director_connect(obj, cPtr, true, true); return cPtr; } } protected void finalize() { delete(); } public synchronized void delete() { if(swigCPtr != 0 && swigCMemOwn) { swigCMemOwn = false; AIDAJNI.delete_IFunction(swigCPtr); } swigCPtr = 0; } protected void swigDirectorDisconnect() { swigCMemOwn = false; delete(); } public void swigReleaseOwnership() { swigCMemOwn = false; AIDAJNI.IFunction_change_ownership(this, swigCPtr, false); } public void swigTakeOwnership() { swigCMemOwn = true; AIDAJNI.IFunction_change_ownership(this, swigCPtr, true); } public String title() { return AIDAJNI.IFunction_title(swigCPtr, this); } public void setTitle(String title) { AIDAJNI.IFunction_setTitle(swigCPtr, this, title); } public double value(double[] x) { return AIDAJNI.IFunction_value(swigCPtr, this, x); } public int dimension() { return AIDAJNI.IFunction_dimension(swigCPtr, this); } public boolean isEqual(hep.aida.IFunction f) { return AIDAJNI.IFunction_isEqual(swigCPtr, this, IFunction.getCPtr(f), (hep.aida.IFunction)f); } public double[] gradient(double[] x) { return AIDAJNI.IFunction_gradient(swigCPtr, this, x); } public boolean providesGradient() { return AIDAJNI.IFunction_providesGradient(swigCPtr, this); } public String variableName(int i) { return AIDAJNI.IFunction_variableName(swigCPtr, this, i); } public String[] variableNames() { return AIDAJNIUtil.toStringArray(AIDAJNI.IFunction_variableNames(swigCPtr, this)); } public void setParameters(double[] params) { AIDAJNI.IFunction_setParameters(swigCPtr, this, params); } public double[] parameters() { return AIDAJNI.IFunction_parameters(swigCPtr, this); } public int numberOfParameters() { return AIDAJNI.IFunction_numberOfParameters(swigCPtr, this); } public String[] parameterNames() { return AIDAJNIUtil.toStringArray(AIDAJNI.IFunction_parameterNames(swigCPtr, this)); } public void setParameter(String name, double x) { AIDAJNI.IFunction_setParameter(swigCPtr, this, name, x); } public double parameter(String name) { return AIDAJNI.IFunction_parameter(swigCPtr, this, name); } public int indexOfParameter(String name) { return AIDAJNI.IFunction_indexOfParameter(swigCPtr, this, name); } public hep.aida.IAnnotation annotation() { return new IAnnotation(AIDAJNI.IFunction_annotation(swigCPtr, this), false); } public String codeletString() { return AIDAJNI.IFunction_codeletString(swigCPtr, this); } public IFunction() { this(AIDAJNI.new_IFunction(), true); AIDAJNI.IFunction_director_connect(this, swigCPtr, swigCMemOwn, true); } }