Class GradientFunction
- java.lang.Object
-
- dev.nm.analysis.differentiation.multivariate.GradientFunction
-
- All Implemented Interfaces:
Function<Vector,Vector>
,RealVectorFunction
public class GradientFunction extends Object implements RealVectorFunction
The gradient function, g(x), evaluates the gradient of a real scalar function f at a point x. g(x) has the same domain as f(x). Its range dimension is the same as the domain dimension.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface dev.nm.analysis.function.Function
Function.EvaluationException
-
-
Constructor Summary
Constructors Constructor Description GradientFunction(RealScalarFunction f)
Construct the gradient function of a real scalar function f.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
dimensionOfDomain()
Get the number of variables the function has.int
dimensionOfRange()
Get the dimension of the range space of the function.Vector
evaluate(Vector x)
Evaluate the function f at x, where x is from the domain.
-
-
-
Constructor Detail
-
GradientFunction
public GradientFunction(RealScalarFunction f)
Construct the gradient function of a real scalar function f.- Parameters:
f
- a real scalar function
-
-
Method Detail
-
evaluate
public Vector evaluate(Vector x)
Description copied from interface:Function
Evaluate the function f at x, where x is from the domain.
-
dimensionOfDomain
public int dimensionOfDomain()
Description copied from interface:Function
Get the number of variables the function has. For example, for a univariate function, the domain dimension is 1; for a bivariate function, the domain dimension is 2.- Specified by:
dimensionOfDomain
in interfaceFunction<Vector,Vector>
- Returns:
- the number of variables
-
dimensionOfRange
public int dimensionOfRange()
Description copied from interface:Function
Get the dimension of the range space of the function. For example, for a Rn->Rm function, the dimension of the range is m.- Specified by:
dimensionOfRange
in interfaceFunction<Vector,Vector>
- Returns:
- the dimension of the range
-
-