|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.omegahat.Numerics.Optimizers.OptimizerAlgorithmBasic
A class with some basic methods for any optimizer.
Mostly, this provides utilities, such as for handling the state, which can be used by algorithms with specific numerical methods.
| Field Summary | |
protected java.lang.Class |
arrayClass
|
protected NumericArray |
arrayTemplate
An object of the class to be used for NumericMatrix objects in the optimizer algorithm. |
protected boolean |
gradient
Does this algorithm expect gradients to be computed for model points? |
protected boolean |
hessian
Does this algorithm expect hessians (the matrix of second partial derivatives) to be computed for model points? |
protected java.lang.Class |
matrixClass
|
protected DynamicPackage |
matrixPackage
The package from which classes implementing NumericMatrix and NumericArray will be extracted. |
protected NumericMatrix |
matrixTemplate
An object of the class to be used for NumericMatrix objects in the optimizer algorithm. |
protected ModelObjective |
model
|
protected java.lang.Class |
modelPointClass
|
protected ModelPoint |
modelPointTemplate
|
protected ModelPointNumericInt |
start
The starting point for the optimization. |
protected int |
state
|
| Constructor Summary | |
OptimizerAlgorithmBasic()
|
|
| Method Summary | |
java.lang.Class |
getArrayClass()
Accessor for arrayClass field |
NumericArray |
getArrayTemplate()
Accessor for arrayTemplate field |
java.lang.Class |
getMatrixClass()
Accessor for matrixClass field |
DynamicPackage |
getMatrixPackage()
Accessor for matrixPackage field |
NumericMatrix |
getMatrixTemplate()
Accessor for matrixTemplate field |
ModelObjective |
getModel()
Accessor for model field |
java.lang.Class |
getModelPointClass()
Accessor for modelPointClass field |
ModelPoint |
getModelPointTemplate()
Accessor for modelPointTemplate field |
ModelPointNumericInt |
getStart()
Accessor for start field |
int |
getState()
Accessor for state field |
boolean |
hasGradient()
Accessor for gradient field |
boolean |
hasHessian()
Accessor for hessian field |
ModelPoint |
initialize(double[] parameters,
OptimizerIterator opt)
Initialize the iteration with these numerical values for the parameter estimates. |
ModelPoint |
initialize(ModelPoint theta,
OptimizerIterator i)
Initialize from a ModelPoint starting value and an iterator. |
NumericArray |
newArray()
Generate a new object from the NumericArray class defined by the matrixPackage for this object. |
NumericMatrix |
newMatrix()
Generate a new object from the NumericMatrix class defined by the matrixPackage for this object. |
ModelPoint |
newModelPoint()
Generate a new object from the ModelPoint class defined by the matrixPackage for this object. |
java.lang.Class |
setArrayClass(java.lang.Class value)
Accessor for setting arrayClass field |
NumericArray |
setArrayTemplate(NumericArray value)
Accessor for setting arrayTemplate field |
boolean |
setGradient(boolean value)
Accessor for setting gradient field |
boolean |
setHessian(boolean value)
Accessor for setting hessian field |
java.lang.Class |
setMatrixClass(java.lang.Class value)
Accessor for setting matrixClass field |
DynamicPackage |
setMatrixPackage()
Establish the actual classes corresponding to the current matrixPackage property. |
DynamicPackage |
setMatrixPackage(DynamicPackage value)
Accessor for setting matrixPackage field from a
LinearAlgebra.Package object. |
DynamicPackage |
setMatrixPackage(java.lang.String packageName)
Set the package to that corresponding to the specified name. |
NumericMatrix |
setMatrixTemplate(NumericMatrix value)
Accessor for setting matrixTemplate field |
ModelObjective |
setModel(ModelObjective value)
Accessor for setting model field |
java.lang.Class |
setModelPointClass(java.lang.Class value)
Accessor for setting modelPointClass field |
ModelPoint |
setModelPointTemplate(ModelPoint value)
Accessor for setting modelPointTemplate field |
ModelPointNumericInt |
setStart(ModelPointNumericInt value)
Accessor for setting start field. |
ModelPointNumericInt |
setStart(NumericArray value)
Set the start from a numeric array of parameter values. |
int |
setState(int value)
Accessor for setting state field |
ModelPoint |
wrapup(ModelPoint pars,
OptimizerIterator opt)
Wrap up the completed iteration. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.omegahat.Numerics.Optimizers.OptimizerAlgorithm |
refine |
| Field Detail |
protected ModelObjective model
protected ModelPointNumericInt start
This property is normally set during initialization. If the specified ModelPoint includes the definition of the objective function, setting the start property defines the model objective as well.
protected int state
protected DynamicPackage matrixPackage
protected boolean gradient
protected boolean hessian
protected java.lang.Class matrixClass
protected java.lang.Class arrayClass
protected java.lang.Class modelPointClass
protected ModelPoint modelPointTemplate
protected NumericMatrix matrixTemplate
matrixPackage for the
ways the package or class can be specified.protected NumericArray arrayTemplate
matrixPackage for the
ways the package or class can be specified.| Constructor Detail |
public OptimizerAlgorithmBasic()
| Method Detail |
public ModelObjective getModel()
model fieldpublic ModelObjective setModel(ModelObjective value)
model fieldpublic ModelPointNumericInt getStart()
start fieldpublic ModelPointNumericInt setStart(ModelPointNumericInt value)
start field.public ModelPointNumericInt setStart(NumericArray value)
Uses the matrix package specified for this optimizer algorithm to create the internal start object with parameters of the same class the algorithm will use, independent of the arguments to setStart.
public int getState()
state fieldpublic int setState(int value)
state fieldpublic DynamicPackage getMatrixPackage()
matrixPackage fieldpublic DynamicPackage setMatrixPackage(DynamicPackage value)
matrixPackage field from a
LinearAlgebra.Package object.public boolean hasGradient()
gradient fieldpublic boolean setGradient(boolean value)
gradient fieldpublic boolean hasHessian()
hessian fieldpublic boolean setHessian(boolean value)
hessian fieldpublic java.lang.Class getMatrixClass()
matrixClass fieldpublic java.lang.Class setMatrixClass(java.lang.Class value)
matrixClass fieldpublic java.lang.Class getArrayClass()
arrayClass fieldpublic java.lang.Class setArrayClass(java.lang.Class value)
arrayClass fieldpublic java.lang.Class getModelPointClass()
modelPointClass fieldpublic java.lang.Class setModelPointClass(java.lang.Class value)
modelPointClass fieldpublic ModelPoint getModelPointTemplate()
modelPointTemplate fieldpublic ModelPoint setModelPointTemplate(ModelPoint value)
modelPointTemplate fieldpublic NumericMatrix getMatrixTemplate()
matrixTemplate fieldpublic NumericMatrix setMatrixTemplate(NumericMatrix value)
matrixTemplate fieldpublic NumericArray getArrayTemplate()
arrayTemplate fieldpublic NumericArray setArrayTemplate(NumericArray value)
arrayTemplate field
public ModelPoint initialize(double[] parameters,
OptimizerIterator opt)
The model to be used for the start property must
have been defined before this initialize method is called, since only the numeric values
of the parameters are supplied here.
public ModelPoint initialize(ModelPoint theta,
OptimizerIterator i)
The returned value is not necessarily identical to the argument, because the particular NumericArray class used to store the parameter values must match that needed for the computations of this algorithm. The initializer will in this case replace the parameter estimates in theta with an array of the correct class, but with the same numerical values.
initialize in interface OptimizerAlgorithm
public ModelPoint wrapup(ModelPoint pars,
OptimizerIterator opt)
The basic method does nothing. Over-riding methods may want to complete some estimates at the convergent parameter values (after testing the state of the optimization iterator against OptimizerIterator.CONVERGED).
wrapup in interface OptimizerAlgorithmpublic DynamicPackage setMatrixPackage(java.lang.String packageName)
Individual classes then have names corresponding to the convention of appending the package name to the corresponding interface's name (see DynamicPackage documentation for details).
public DynamicPackage setMatrixPackage()
matrixPackage property.
See matrixPackage for the options.public NumericMatrix newMatrix()
matrixPackage for this object.public NumericArray newArray()
matrixPackage for this object.public ModelPoint newModelPoint()
matrixPackage for this object.newModelPoint in interface OptimizerAlgorithm
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||