function
Class VectorFunctionBuilder

java.lang.Object
  extended by function.BasicVectorFunction
      extended by function.VectorFunctionBuilder
All Implemented Interfaces:
Computable, VariableBounds, VariableInputDimension, VariableOutputDimension, VectorFunction

public class VectorFunctionBuilder
extends BasicVectorFunction
implements VariableInputDimension, VariableOutputDimension, VariableBounds

Compose a vector function out of individual ScalarFunctions and VectorFunctions.

Author:
dgorur

Field Summary
 
Fields inherited from class function.BasicVectorFunction
DEFAULT_BOUNDS, DEFAULT_INPUT_DIMENSION, DEFAULT_OUTPUT_DIMENSION, VALUE_OUTSIDE_BOUNDS
 
Constructor Summary
VectorFunctionBuilder()
           
 
Method Summary
 Hypercube getBounds()
          Returns the bounds.
 int getInputDimension()
          Returns the inputDimension.
 int getOutputDimension()
          Returns the output dimension for this Computable.
 java.util.ArrayList<ScalarFunction> getScalarFunctions()
          Returns the scalarFunctions.
 java.util.ArrayList<VectorFunction> getVectorFunctions()
          Returns the vectorFunctions.
 void init()
          Initialization method.
 boolean isWithinBounds(double[] x)
          Returns true if the given point is within bounds.
 void quickCompute(double[] x, double[] y)
          Abstract method that all subclasses must implement.
 void setBounds(Hypercube bounds)
          Sets the bounds for this ScalarFunction.
 void setInputDimension(int inputDimension)
          Sets the dimensionality of this ScalarFunction.
 void setOutputDimension(int outputDimension)
          Sets the number of output dimensions.
 void setScalarFunctions(java.util.ArrayList<ScalarFunction> scalarFunctions)
          Sets the scalarFunctions.
 void setVectorFunctions(java.util.ArrayList<VectorFunction> vectorFunctions)
          Sets the vectorFunctions.
 
Methods inherited from class function.BasicVectorFunction
checkInputDimension, compute, compute, compute, compute, compute, makeBounds, quickCompute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorFunctionBuilder

public VectorFunctionBuilder()
Method Detail

getBounds

public Hypercube getBounds()
Returns the bounds.

Specified by:
getBounds in interface Computable
Overrides:
getBounds in class BasicVectorFunction
Returns:
the bounds.

getInputDimension

public int getInputDimension()
Returns the inputDimension.

Specified by:
getInputDimension in interface Computable
Overrides:
getInputDimension in class BasicVectorFunction
Returns:
the inputDimension.

getOutputDimension

public int getOutputDimension()
Description copied from interface: Computable
Returns the output dimension for this Computable.

Specified by:
getOutputDimension in interface Computable
Overrides:
getOutputDimension in class BasicVectorFunction
Returns:
the number of output dimensions.

getScalarFunctions

public java.util.ArrayList<ScalarFunction> getScalarFunctions()
Returns the scalarFunctions.

Returns:
the scalarFunctions.

getVectorFunctions

public java.util.ArrayList<VectorFunction> getVectorFunctions()
Returns the vectorFunctions.

Returns:
the vectorFunctions.

init

public void init()
Description copied from class: BasicVectorFunction
Initialization method.

Specified by:
init in interface VectorFunction
Overrides:
init in class BasicVectorFunction

isWithinBounds

public boolean isWithinBounds(double[] x)
Description copied from interface: Computable
Returns true if the given point is within bounds.

Specified by:
isWithinBounds in interface Computable
Overrides:
isWithinBounds in class BasicVectorFunction
Parameters:
x - the given point.
Returns:
true if within bounds.

quickCompute

public void quickCompute(double[] x,
                         double[] y)
Description copied from class: BasicVectorFunction
Abstract method that all subclasses must implement. This is the core compute method that takes an input double array and returns an output double array.

Specified by:
quickCompute in interface VectorFunction
Specified by:
quickCompute in class BasicVectorFunction
Parameters:
x - input array.
y - output array.

setBounds

public void setBounds(Hypercube bounds)
Description copied from interface: VariableBounds
Sets the bounds for this ScalarFunction.

Specified by:
setBounds in interface VariableBounds
Parameters:
bounds - the given bounds.

setInputDimension

public void setInputDimension(int inputDimension)
Description copied from interface: VariableInputDimension
Sets the dimensionality of this ScalarFunction.

Specified by:
setInputDimension in interface VariableInputDimension
Parameters:
inputDimension - the given number of dimensions.

setOutputDimension

public void setOutputDimension(int outputDimension)
Description copied from interface: VariableOutputDimension
Sets the number of output dimensions.

Specified by:
setOutputDimension in interface VariableOutputDimension
Parameters:
outputDimension - the number of output dimensions.

setScalarFunctions

public void setScalarFunctions(java.util.ArrayList<ScalarFunction> scalarFunctions)
Sets the scalarFunctions.

Parameters:
scalarFunctions - the given scalarFunctions.

setVectorFunctions

public void setVectorFunctions(java.util.ArrayList<VectorFunction> vectorFunctions)
Sets the vectorFunctions.

Parameters:
vectorFunctions - the given vectorFunctions.