Package dev.nm.analysis.function.rn2r1
Class AbstractRealScalarFunction
- java.lang.Object
-
- dev.nm.analysis.function.rn2r1.AbstractRealScalarFunction
-
- All Implemented Interfaces:
Function<Vector,Double>
,RealScalarFunction
- Direct Known Subclasses:
AbstractBivariateRealFunction
,AbstractTrivariateRealFunction
,AbstractUnivariateRealFunction
,MultinomialBetaFunction
,MultivariateFiniteDifference
,QuadraticFunction
,R1Projection
,Rastrigin
,Ridders
public abstract class AbstractRealScalarFunction extends Object implements RealScalarFunction
This abstract implementation implementsFunction.dimensionOfRange()
by always returning 1, andFunction.dimensionOfDomain()
by returning the input argument for the dimension of domain.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface dev.nm.analysis.function.Function
Function.EvaluationException
-
-
Constructor Summary
Constructors Constructor Description AbstractRealScalarFunction(int domainDimension)
Construct an instance with the dimension of the domain.
-
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.
-
-
-
Method Detail
-
dimensionOfDomain
public final 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,Double>
- Returns:
- the number of variables
-
dimensionOfRange
public final 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,Double>
- Returns:
- the dimension of the range
-
-