edu.jhu.bme.smile.commons.optimize
Class MinToMaxNDDifferentiable

java.lang.Object
  extended by edu.jhu.bme.smile.commons.optimize.MinToMaxNDDifferentiable
All Implemented Interfaces:
OptimizableNDContinuous, OptimizableNDContinuousDifferentiable

public class MinToMaxNDDifferentiable
extends java.lang.Object
implements OptimizableNDContinuousDifferentiable

Finds the maximum of Differentiable ND functions by negating the function and finding the minimum.

Author:
Hanlin Wam

Constructor Summary
MinToMaxNDDifferentiable(OptimizableNDContinuousDifferentiable func)
          Constructor to create the negated function
 
Method Summary
 double[][] get2ndDerivative(double[] x)
          Gets the negated hessian
 double get2ndDerivative(double[] x, int dim1, int dim2)
          Gets the negated second derivative in a specific direction
 double[] getDerivative(double[] x)
          Gets the negated gradient
 double[] getDomainMax()
          Gets the domain maximum
 double[] getDomainMin()
          Gets the domain minimum
 double getDomainTolerance()
          Gets the tolerance
 int getNumberOfDimensions()
          Gets the number of dimensions
 double getValue(double[] x)
          Gets the negated value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinToMaxNDDifferentiable

public MinToMaxNDDifferentiable(OptimizableNDContinuousDifferentiable func)
Constructor to create the negated function

Parameters:
func - function to negate
Method Detail

get2ndDerivative

public double[][] get2ndDerivative(double[] x)
Gets the negated hessian

Specified by:
get2ndDerivative in interface OptimizableNDContinuousDifferentiable
Parameters:
x - location to calculate derivative
Returns:
the negated hessian

get2ndDerivative

public double get2ndDerivative(double[] x,
                               int dim1,
                               int dim2)
Gets the negated second derivative in a specific direction

Specified by:
get2ndDerivative in interface OptimizableNDContinuousDifferentiable
Parameters:
x - location to calculate derivative
dim1 - dimension to take the first derivative
dim2 - dimension to take the second derivative
Returns:
the negated second derivative in the specified direction

getDerivative

public double[] getDerivative(double[] x)
Gets the negated gradient

Specified by:
getDerivative in interface OptimizableNDContinuousDifferentiable
Parameters:
x - location to calculate derivative
Returns:
the negated gradient

getDomainMax

public double[] getDomainMax()
Gets the domain maximum

Specified by:
getDomainMax in interface OptimizableNDContinuous
Returns:
domain max

getDomainMin

public double[] getDomainMin()
Gets the domain minimum

Specified by:
getDomainMin in interface OptimizableNDContinuous
Returns:
domain min

getDomainTolerance

public double getDomainTolerance()
Gets the tolerance

Specified by:
getDomainTolerance in interface OptimizableNDContinuous
Returns:
tolerance

getValue

public double getValue(double[] x)
Gets the negated value

Specified by:
getValue in interface OptimizableNDContinuous
Parameters:
x - location to get value at
Returns:
negated value at location x

getNumberOfDimensions

public int getNumberOfDimensions()
Gets the number of dimensions

Specified by:
getNumberOfDimensions in interface OptimizableNDContinuous
Returns:
number of dimensions