de.jstacs.sequenceScores.statisticalModels.trainable.discrete.inhomogeneous
Class MEMTools.DualFunction

java.lang.Object
  extended by de.jstacs.algorithms.optimization.DifferentiableFunction
      extended by de.jstacs.sequenceScores.statisticalModels.trainable.discrete.inhomogeneous.MEMTools.DualFunction
All Implemented Interfaces:
Function
Enclosing class:
MEMTools

public static class MEMTools.DualFunction
extends DifferentiableFunction

The dual function to the constraint problem of learning MEM's.

Author:
Jens Keilwagen

Constructor Summary
MEMTools.DualFunction(SequenceIterator it, MEMConstraint[] constraints)
          The constructor of a dual function.
 
Method Summary
 double evaluateFunction(double[] x)
          Evaluates the function at a certain vector (in mathematical sense) x.
 double[] evaluateGradientOfFunction(double[] x)
          Evaluates the gradient of a function at a certain vector (in mathematical sense) x, i.e., $\nabla f(\underline{x}) = \left(\frac{\partial f(\underline{x})}{\partial x_1},\ldots,\frac{\partial f(\underline{x})}{\partial x_n}\right)$.
 int getDimensionOfScope()
          Returns the dimension of the scope of the Function.
 void setValues(double[] x)
          This method set the values of the Lagrange multiplicators of the constraints
 
Methods inherited from class de.jstacs.algorithms.optimization.DifferentiableFunction
findOneDimensionalMin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MEMTools.DualFunction

public MEMTools.DualFunction(SequenceIterator it,
                             MEMConstraint[] constraints)
The constructor of a dual function.

Parameters:
it - the correct initialized SequenceIterator
constraints - the constraints used in this MEMTools.DualFunction
Throws:
IllegalArgumentException - if the constraints are not correct
Method Detail

evaluateFunction

public double evaluateFunction(double[] x)
                        throws DimensionException
Description copied from interface: Function
Evaluates the function at a certain vector (in mathematical sense) x.

Parameters:
x - the current vector
Returns:
the evaluation of the function
Throws:
DimensionException - if dim(x) != n, with $f: \mathbb{R}^n \to \mathbb{R}$

evaluateGradientOfFunction

public double[] evaluateGradientOfFunction(double[] x)
                                    throws DimensionException
Description copied from class: DifferentiableFunction
Evaluates the gradient of a function at a certain vector (in mathematical sense) x, i.e., $\nabla f(\underline{x}) = \left(\frac{\partial f(\underline{x})}{\partial x_1},\ldots,\frac{\partial f(\underline{x})}{\partial x_n}\right)$.

Specified by:
evaluateGradientOfFunction in class DifferentiableFunction
Parameters:
x - the current vector
Returns:
the evaluation of the gradient of a function, has dimension Function.getDimensionOfScope()
Throws:
DimensionException - if dim(x) != n, with $f: \mathbb{R}^n \to \mathbb{R}$
See Also:
Function.getDimensionOfScope()

getDimensionOfScope

public int getDimensionOfScope()
Description copied from interface: Function
Returns the dimension of the scope of the Function.

Returns:
the dimension of the scope: n with $f: \mathbb{R}^n \to \mathbb{R}$

setValues

public void setValues(double[] x)
This method set the values of the Lagrange multiplicators of the constraints

Parameters:
x - the new values