|
SSJ V. 2.0. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface MultivariateFunction
Represents a function of multiple variables.
This interface specifies a method evaluate that computes
a
g(
x) function, where
[tex2html_wrap_inline116]x = (x0,…, xd-1)∈Rd. It also specifies
a method evaluateGradient for computing
its gradient
∇g([tex2html_wrap_inline118]x).
The dimension d can be fixed or variable. When d is fixed, the methods specified by this interface always take the same number of arguments. This is the case, for example, with a ratio of two variables. When d is variable, the implementation can compute the function for a vector [tex2html_wrap_inline123]x of any length. This can happen for a product or sum of variables.
The methods of this interface take a variable number of arguments to accomodate the common case of fixed dimension with more convenience; the programmer can call the method without creating an array. For the generic case, however, one can replace the arguments with an array.
| Method Summary | |
|---|---|
double |
evaluate(double... x)
Computes the function g(boldx) for the vector x. |
double |
evaluateGradient(int i,
double... x)
Computes ∂g(boldx)/∂xi, the derivative of g(boldx) with respect to xi. |
int |
getDimension()
Returns d, the dimension of the function computed by this implementation. |
| Method Detail |
|---|
int getDimension()
double evaluate(double... x)
x - a vector boldx.
NullPointerException - if x is null.
IllegalArgumentException - if x.length
does not correspond to the dimension of this function.
double evaluateGradient(int i,
double... x)
i - the variable to derive with respect to.x - a vector boldx.
NullPointerException - if x is null.
IllegalArgumentException - if x.length
does not correspond to the dimension of this function.
IndexOutOfBoundsException - if i is negative
or greater than or equal to the dimension of this function.
|
SSJ V. 2.0. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||