The Encog Project

org.encog.util.math.rbf
Class GaussianFunctionMulti

java.lang.Object
  extended by org.encog.util.math.rbf.GaussianFunctionMulti
All Implemented Interfaces:
RadialBasisFunctionMulti

public class GaussianFunctionMulti
extends java.lang.Object
implements RadialBasisFunctionMulti

Multi-dimensional gaussian function. Do not use this to implement a 1d function, simply use GaussianFunction for that.


Constructor Summary
GaussianFunctionMulti(double peak, double[] center, double[] width)
          Construct a multi-dimension Gaussian function with the specified peak, centers and widths.
GaussianFunctionMulti(int dimensions, double peak, double center, double width)
          Construct a Gaussian function with the specified number of dimensions.
 
Method Summary
 double calculate(double[] x)
          Calculate thre result from the function.
 double getCenter(int dimension)
          Get the center for the specified dimension.
 int getDimensions()
           
 double getPeak()
          Get the center of this RBD.
 double getWidth(int dimension)
          Get the width for one dimension.
 void setWidth(double w)
          Set the width for all dimensions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaussianFunctionMulti

public GaussianFunctionMulti(double peak,
                             double[] center,
                             double[] width)
Construct a multi-dimension Gaussian function with the specified peak, centers and widths.

Parameters:
peak - The peak for all dimensions.
center - The centers for each dimension.
width - The widths for each dimension.

GaussianFunctionMulti

public GaussianFunctionMulti(int dimensions,
                             double peak,
                             double center,
                             double width)
Construct a Gaussian function with the specified number of dimensions. The peak, center and widths are all the same.

Parameters:
dimensions - The number of dimensions.
peak - The peak used for all dimensions.
center - The center used for all dimensions.
width - The widths used for all dimensions.
Method Detail

calculate

public double calculate(double[] x)
Calculate thre result from the function.

Specified by:
calculate in interface RadialBasisFunctionMulti
Parameters:
x - The parameters for the function, one for each dimension.
Returns:
The result of the function.

getCenter

public double getCenter(int dimension)
Get the center for the specified dimension.

Specified by:
getCenter in interface RadialBasisFunctionMulti
Parameters:
dimension - The dimension.
Returns:
The center.

getDimensions

public int getDimensions()
Specified by:
getDimensions in interface RadialBasisFunctionMulti
Returns:
The number of dimensions.

getPeak

public double getPeak()
Description copied from interface: RadialBasisFunctionMulti
Get the center of this RBD.

Specified by:
getPeak in interface RadialBasisFunctionMulti
Returns:
The peak.

getWidth

public double getWidth(int dimension)
Get the width for one dimension.

Specified by:
getWidth in interface RadialBasisFunctionMulti
Parameters:
dimension - The dimension.
Returns:
The width.

setWidth

public void setWidth(double w)
Set the width for all dimensions.

Specified by:
setWidth in interface RadialBasisFunctionMulti
Parameters:
w - The width.

The Encog Project