Class DSFactory
java.lang.Object
org.hipparchus.analysis.differentiation.DSFactory
- All Implemented Interfaces:
Serializable
Factory for
DerivativeStructure
.
This class is a factory for DerivativeStructure
instances.
Instances of this class are guaranteed to be immutable.
- Since:
- 1.1
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Field for {link DerivativeStructure} instances. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal DerivativeStructure
build
(double... derivatives) Build aDerivativeStructure
from all its derivatives.constant
(double value) Build aDerivativeStructure
representing a constant value.Get the compiler for the current dimensions.Get theField
theDerivativeStructure
instances belong to.variable
(int index, double value) Build aDerivativeStructure
representing a variable.
-
Constructor Details
-
DSFactory
public DSFactory(int parameters, int order) Simple constructor.- Parameters:
parameters
- number of free parametersorder
- derivation order
-
-
Method Details
-
getDerivativeField
Get theField
theDerivativeStructure
instances belong to.- Returns:
Field
theDerivativeStructure
instances belong to
-
constant
Build aDerivativeStructure
representing a constant value.- Parameters:
value
- value of the constant- Returns:
- a
DerivativeStructure
representing a constant value
-
variable
Build aDerivativeStructure
representing a variable.Instances built using this method are considered to be the free variables with respect to which differentials are computed. As such, their differential with respect to themselves is +1.
- Parameters:
index
- index of the variable (from 0 togetCompiler()
.getFreeParameters()
- 1)value
- value of the variable- Returns:
- a
DerivativeStructure
representing a variable - Throws:
MathIllegalArgumentException
- if index if greater or equal togetCompiler()
.getFreeParameters()
.
-
build
@SafeVarargs public final DerivativeStructure build(double... derivatives) throws MathIllegalArgumentException Build aDerivativeStructure
from all its derivatives.- Parameters:
derivatives
- derivatives sorted according toDSCompiler.getPartialDerivativeIndex(int...)
- Returns:
- a
DerivativeStructure
with specified derivatives - Throws:
MathIllegalArgumentException
- if derivatives array does not match thesize
expected by the compilerMathIllegalArgumentException
- if order is too large- See Also:
-
getCompiler
Get the compiler for the current dimensions.- Returns:
- compiler for the current dimensions
-