function
Interface ScalarFunction

All Superinterfaces:
Computable
All Known Subinterfaces:
ApproxModel, BoundConstrainedDiviner, DataFit, InequalityConstrainedDiviner, ScalarDifferentiableFunction, TwoFidelityApproxModel
All Known Implementing Classes:
BasicApproxModel, BasicBoundConstrainedDiviner, BasicDifferentiableScalarFunction, BasicInequalityConstrainedDiviner, BasicScalarFunction, BasicTwoFidelityModel, CaffeToScalarFunction, ConstrainedEIDiviner, ConstrainedImprovementDiviner, ConstrainedMultiMetricDiviner, EIDiviner, GPRegression, Hartman3, Hartman3LoFi, Hartman6, Hartman6LoFi, ImprovementDiviner, MultiMetricDiviner, PenaltyFunctionModel, PIDiviner, RiskDiviner, RiskPerfTradeDiviner, Rosenbrock, RosenbrockLoFi, Shekel10, Shekel5, Shekel7, TestFunction1D, VariableDomainScalarFunction, WaveDragAxisymmetric.AreaRule, WaveDragAxisymmetric.CART3D, WaveDragAxisymmetric.MaxRadiusConstraint, WaveDragAxisymmetric.MaxRadiusLoFi, WaveDragAxisymmetric.MaxVolumeConstraint, WaveDragAxisymmetric.MaxVolumeLoFi, WaveDragAxisymmetric.Panair, WaveDragAxisymmetric.PanairShevell, Woods, WoodsLoFi

public interface ScalarFunction
extends Computable

This is the basic interface that all objectives, constraints, approximate models, and so on, must implement.

Author:
dgorur

Method Summary
 double compute(double[] x)
          Computes the output corresponding to the given input.
 void compute(double[][] xArr, double[] outputs)
          Computes the outputs for the given inputs, and stores the result in the supplied array.
 double compute(cern.colt.matrix.DoubleMatrix1D xVec)
          Computes the output corresponding to the given input.
 cern.colt.matrix.DoubleMatrix1D compute(cern.colt.matrix.DoubleMatrix2D xMat, cern.colt.matrix.DoubleMatrix1D outputs)
          Computes the outputs for the given inputs, and stores the result in the given vector.
 void init()
          Init method.
 double quickCompute(double[] x)
          Compute method without dimension checking.
 void quickCompute(cern.colt.matrix.DoubleMatrix2D xMat, cern.colt.matrix.DoubleMatrix1D outputs)
          Compute method without dimension checking, operating on DoubleMatrix2D and exploiting optimized operations therein.
 
Methods inherited from interface function.Computable
compute, compute, getBounds, getInputDimension, getOutputDimension, isWithinBounds
 

Method Detail

compute

double compute(double[] x)
Computes the output corresponding to the given input.

Parameters:
x - the given input.
Returns:
the output corresponding to x.

compute

void compute(double[][] xArr,
             double[] outputs)
Computes the outputs for the given inputs, and stores the result in the supplied array.

Parameters:
xArr - array of inputs, row-wise.
outputs - array to hold the result, cannot be null.

compute

double compute(cern.colt.matrix.DoubleMatrix1D xVec)
Computes the output corresponding to the given input.

Parameters:
xVec - the given input.
Returns:
the output corresponding to the given input.

compute

cern.colt.matrix.DoubleMatrix1D compute(cern.colt.matrix.DoubleMatrix2D xMat,
                                        cern.colt.matrix.DoubleMatrix1D outputs)
Computes the outputs for the given inputs, and stores the result in the given vector.

Parameters:
xMat - a matrix of inputs, specified row-wise.
outputs - vector to hold the result, cannot be null.
Returns:
the output vector, for convenience.

quickCompute

double quickCompute(double[] x)
Compute method without dimension checking. All subclasses must implement this method: it is the core method that defines the function.

Parameters:
x - the given input.
Returns:
the output corresponding to the given input.

quickCompute

void quickCompute(cern.colt.matrix.DoubleMatrix2D xMat,
                  cern.colt.matrix.DoubleMatrix1D outputs)
Compute method without dimension checking, operating on DoubleMatrix2D and exploiting optimized operations therein.

Parameters:
xMat - given matrix of inputs.
outputs - vector to store the result.

init

void init()
Init method.