numericalMethods.calculus.minimizing
Class NumericalGradient

java.lang.Object
  extended bynumericalMethods.calculus.minimizing.NumericalGradient
All Implemented Interfaces:
DoubleArrayParametrized, DoubleArrayValued, DoubleValued, java.io.Serializable

public final class NumericalGradient
extends java.lang.Object
implements DoubleValued, DoubleArrayValued, DoubleArrayParametrized, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
NumericalGradient(DoubleValued theF)
           
NumericalGradient(DoubleValued theF, double theH)
           
 
Method Summary
 int getDoubleArrayParameterLength()
          Get the length of the double array parameter.
 double[] getDoubleArrayValue()
           
 void getDoubleArrayValue(double[] value, int offset)
          Writes the double array value into a double[].
 int getDoubleArrayValueLength()
          Get the length of the double array value.
 double getDoubleValue()
          Get the double value.
 double getH()
          Get the value of h.
 void getValue(double[] grad)
           
 void setByParameter(double[] p)
           
 void setDoubleArrayParameter(double[] p, int offset)
          Set the double array parameter by the values in a double[].
 void setH(double v)
          Set the value of h.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericalGradient

public NumericalGradient(DoubleValued theF)

NumericalGradient

public NumericalGradient(DoubleValued theF,
                         double theH)
Method Detail

getH

public double getH()
Get the value of h.

Returns:
Value of h.

setH

public void setH(double v)
Set the value of h.

Parameters:
v - Value to assign to h.

getDoubleValue

public double getDoubleValue()
Description copied from interface: DoubleValued
Get the double value.

Specified by:
getDoubleValue in interface DoubleValued
Returns:
the double value.

setByParameter

public void setByParameter(double[] p)

setDoubleArrayParameter

public void setDoubleArrayParameter(double[] p,
                                    int offset)
Description copied from interface: DoubleArrayParametrized
Set the double array parameter by the values in a double[]. The values for the double array parameter are read from p[offset,…,offset + len - 1], where len is the value returned by DoubleArrayParametrized.getDoubleArrayParameterLength(). The parameter p should not be changed.

Specified by:
setDoubleArrayParameter in interface DoubleArrayParametrized
Parameters:
p - a double[] whith length at least offset+len holding the values to which the double array parameter is set.
offset - the position in p where the double array parameter is read from.

getDoubleArrayParameterLength

public int getDoubleArrayParameterLength()
Description copied from interface: DoubleArrayParametrized
Get the length of the double array parameter.

Specified by:
getDoubleArrayParameterLength in interface DoubleArrayParametrized
Returns:
the length of the double array parameter.

getDoubleArrayValueLength

public int getDoubleArrayValueLength()
Description copied from interface: DoubleArrayValued
Get the length of the double array value.

Specified by:
getDoubleArrayValueLength in interface DoubleArrayValued
Returns:
the length of the double array value.

getDoubleArrayValue

public double[] getDoubleArrayValue()

getValue

public void getValue(double[] grad)

getDoubleArrayValue

public void getDoubleArrayValue(double[] value,
                                int offset)
Description copied from interface: DoubleArrayValued
Writes the double array value into a double[]. When the method returns, value[offset,…,offset+len-1] contains the double array value, where len is the value returned by DoubleArrayValued.getDoubleArrayValueLength(). The other elements of value should not be changed.

Specified by:
getDoubleArrayValue in interface DoubleArrayValued
Parameters:
value - a double[] whith length at least offset+len, into which the double array value is copied.
offset - the position in value where the double array value is copied to.