|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfunction.BasicVectorFunction
public abstract class BasicVectorFunction
Provides methods for functions with vector-valued outputs. As before, the
inputs and outputs must be double-valued.
| Field Summary | |
|---|---|
protected static Hypercube |
DEFAULT_BOUNDS
|
protected static int |
DEFAULT_INPUT_DIMENSION
|
protected static int |
DEFAULT_OUTPUT_DIMENSION
|
protected static double |
VALUE_OUTSIDE_BOUNDS
|
| Constructor Summary | |
|---|---|
BasicVectorFunction()
|
|
| Method Summary | |
|---|---|
protected void |
checkInputDimension(double[] x)
Checks the input dimensions of the provided input. |
double[] |
compute(double[] x)
Computes the outputs corresponding to the given input. |
void |
compute(double[][] x,
double[][] y)
Computes the outputs corresponding to the given set of inputs and stores the results in the given array, which cannot be null. |
void |
compute(double[] x,
double[] y)
Computes the outputs corresponding to the given input, and stores the result in the supplied array. |
cern.colt.matrix.DoubleMatrix1D |
compute(cern.colt.matrix.DoubleMatrix1D x,
cern.colt.matrix.DoubleMatrix1D y)
Computes the outputs corresponding to the given input, and stores the result in the supplied vector, which cannot be null. |
cern.colt.matrix.DoubleMatrix2D |
compute(cern.colt.matrix.DoubleMatrix2D X,
cern.colt.matrix.DoubleMatrix2D Y)
Computes the outputs corresponding to the given set of inputs and stores the result in the given array, which cannot be null. |
Hypercube |
getBounds()
Returns a Hypercube specifying the domain of this
Computable. |
int |
getInputDimension()
Returns the number of dimensions accepted by this Computable. |
int |
getOutputDimension()
Returns the output dimension for this Computable. |
void |
init()
Initialization method. |
boolean |
isWithinBounds(double[] x)
Returns true if the given point is within bounds. |
protected static void |
makeBounds()
|
abstract void |
quickCompute(double[] x,
double[] y)
Abstract method that all subclasses must implement. |
void |
quickCompute(cern.colt.matrix.DoubleMatrix2D X,
cern.colt.matrix.DoubleMatrix2D Y)
Applies compute(double[]) on a set of inputs, supplied row-wise in
a matrix. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static int DEFAULT_INPUT_DIMENSION
protected static int DEFAULT_OUTPUT_DIMENSION
protected static double VALUE_OUTSIDE_BOUNDS
protected static Hypercube DEFAULT_BOUNDS
| Constructor Detail |
|---|
public BasicVectorFunction()
| Method Detail |
|---|
protected static void makeBounds()
public double[] compute(double[] x)
VectorFunction
compute in interface VectorFunctionx - the given input.
public void compute(double[] x,
double[] y)
Computable
compute in interface Computablex - the given input.y - array to hold the result.
public void compute(double[][] x,
double[][] y)
Computablenull.
compute in interface Computablecompute in interface VectorFunctionx - the given inputs.y - array to hold the result.
public cern.colt.matrix.DoubleMatrix1D compute(cern.colt.matrix.DoubleMatrix1D x,
cern.colt.matrix.DoubleMatrix1D y)
VectorFunctionnull.
compute in interface VectorFunctionx - the given input.y - matrix
public cern.colt.matrix.DoubleMatrix2D compute(cern.colt.matrix.DoubleMatrix2D X,
cern.colt.matrix.DoubleMatrix2D Y)
VectorFunctionnull.
compute in interface VectorFunctionX - given matrix of inputs.Y - matrix to hold results.public Hypercube getBounds()
ComputableHypercube specifying the domain of this
Computable.
getBounds in interface ComputableScalarFunction.public int getInputDimension()
ComputableComputable.
getInputDimension in interface Computablepublic int getOutputDimension()
ComputableComputable.
getOutputDimension in interface Computablepublic void init()
init in interface VectorFunction
public abstract void quickCompute(double[] x,
double[] y)
double array and returns an
output double array.
quickCompute in interface VectorFunctionx - input array.y - output array.
public void quickCompute(cern.colt.matrix.DoubleMatrix2D X,
cern.colt.matrix.DoubleMatrix2D Y)
compute(double[]) on a set of inputs, supplied row-wise in
a matrix. Stores the result in the supplied output array. No size-checking
is performed.
quickCompute in interface VectorFunctionX - input matrix.Y - output matrix.public boolean isWithinBounds(double[] x)
Computabletrue if the given point is within bounds.
isWithinBounds in interface Computablex - the given point.
true if within bounds.protected void checkInputDimension(double[] x)
x - the given input.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||