FreeHEP API
Version current

hep.aida.ref.optimizer
Class AbstractOptimizer

java.lang.Object
  extended byhep.aida.ref.optimizer.AbstractOptimizer
All Implemented Interfaces:
IOptimizer
Direct Known Subclasses:
FminOptimizer, MinpackOptimizer, MinuitOptimizer, UncminOptimizer

public abstract class AbstractOptimizer
extends Object
implements IOptimizer

Abstract implementation of IOptimizer

Author:
Tony Johnson, Victor Serbo, Max Turri
Source Code:
AbstractOptimizer.java

Field Summary
protected  IOptimizerConfiguration configuration
           
protected  IDomainConstraint domainConstraint
           
protected  hep.aida.IFunction function
           
protected  OptimizerResult result
           
 
Constructor Summary
AbstractOptimizer()
          Creates a new instance of AbstractOptimizer
 
Method Summary
 boolean acceptsConstraints()
          Check if this IOptimizer accept constraints.
 double[][] calculateContour(String par1, String par2, int npts, double nSigmas)
          Calculate the contour for two given parameters.
 boolean canCalculateContours()
          Check if this IOptimizer can calculate contours.
 IOptimizerConfiguration configuration()
          Get the IOptimizer configuration
 String[] listVariableSettings()
          Get the list of the names of the IVariableSettings defined.
abstract  void optimize()
          Perform the optimization.
 void reset()
          Reset the function, the domain of constraints and the internal configuration.
 void resetVariableSettings()
          Reset all variable settings.
 IOptimizerResult result()
          Get the optimization results.
 void setConfiguration(IOptimizerConfiguration configuration)
          Set the internal configuration of the Optimizer.
 void setConstraints(IDomainConstraint iDomainConstraint)
          Set the domain of constraints for the IOptimizer.
 void setFunction(hep.aida.IFunction iFunction)
          Set the IFunction to be optimized.
 IVariableSettings variableSettings(String name)
          Get the IVariableSettings corresponding to a give variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

function

protected hep.aida.IFunction function

result

protected OptimizerResult result

configuration

protected IOptimizerConfiguration configuration

domainConstraint

protected IDomainConstraint domainConstraint
Constructor Detail

AbstractOptimizer

public AbstractOptimizer()
Creates a new instance of AbstractOptimizer

Method Detail

configuration

public IOptimizerConfiguration configuration()
Get the IOptimizer configuration

Specified by:
configuration in interface IOptimizer
Returns:
The configuration.

optimize

public abstract void optimize()
Perform the optimization.

Specified by:
optimize in interface IOptimizer
Returns:
true if the optimization was successfull, false otherwise.

reset

public void reset()
Reset the function, the domain of constraints and the internal configuration.

Specified by:
reset in interface IOptimizer

result

public IOptimizerResult result()
Get the optimization results.

Specified by:
result in interface IOptimizer
Returns:
The result.

setConfiguration

public void setConfiguration(IOptimizerConfiguration configuration)
Set the internal configuration of the Optimizer.

Specified by:
setConfiguration in interface IOptimizer
Parameters:
configuration - The configuration.
Returns:
true if the configuration was set succesfully, false otherwise.

setConstraints

public void setConstraints(IDomainConstraint iDomainConstraint)
Set the domain of constraints for the IOptimizer. If a domain of constraints already exists it will be overwritten.

Specified by:
setConstraints in interface IOptimizer
Parameters:
iDomainConstraint - The domain of constraints.
Returns:
true if the IDomainConstraint is set succesfully, false otherwise.

setFunction

public void setFunction(hep.aida.IFunction iFunction)
Set the IFunction to be optimized. When setting a function the current configuration is reset.

Specified by:
setFunction in interface IOptimizer
Parameters:
iFunction - The IFunction to be optimized.
Returns:
true if the IFunction is set succesfully, false otherwise.

listVariableSettings

public String[] listVariableSettings()
Description copied from interface: IOptimizer
Get the list of the names of the IVariableSettings defined.

Specified by:
listVariableSettings in interface IOptimizer
Returns:
The list of the names.

resetVariableSettings

public void resetVariableSettings()
Description copied from interface: IOptimizer
Reset all variable settings.

Specified by:
resetVariableSettings in interface IOptimizer

variableSettings

public IVariableSettings variableSettings(String name)
Description copied from interface: IOptimizer
Get the IVariableSettings corresponding to a give variable. If the IVariableSettings does not exist, a new one is created.

Specified by:
variableSettings in interface IOptimizer
Parameters:
name - The variable's name.
Returns:
The corresponging IVariableSettings

acceptsConstraints

public boolean acceptsConstraints()
Description copied from interface: IOptimizer
Check if this IOptimizer accept constraints.

Specified by:
acceptsConstraints in interface IOptimizer
Returns:
true if the IOptimizer accepts contraints. false otherwise.

canCalculateContours

public boolean canCalculateContours()
Description copied from interface: IOptimizer
Check if this IOptimizer can calculate contours.

Specified by:
canCalculateContours in interface IOptimizer
Returns:
true if the IOptimizer can calculate contours. false otherwise.

calculateContour

public double[][] calculateContour(String par1,
                                   String par2,
                                   int npts,
                                   double nSigmas)
Description copied from interface: IOptimizer
Calculate the contour for two given parameters. The number of points and the number of sigmas can also be specified.

Specified by:
calculateContour in interface IOptimizer
Parameters:
par1 - The name of the first parameter.
par2 - The name of the second parameter.
npts - The number of points on the contour.
nSigmas - The number of sigmas for this contour.
Returns:
A double array of dimension [2][npts]. For each point on the contour the value of (par1,par2) is returned.

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.