Class FDSFactory<T extends CalculusFieldElement<T>>
java.lang.Object
org.hipparchus.analysis.differentiation.FDSFactory<T>
- Type Parameters:
T
- the type of the function parameters and value
Factory for
FieldDerivativeStructure
.
This class is a factory for FieldDerivativeStructure
instances.
Instances of this class are guaranteed to be immutable.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
FDSFactory.DerivativeField<T extends CalculusFieldElement<T>>
Field for {link FieldDerivativeStructure} instances. -
Constructor Summary
ConstructorDescriptionFDSFactory
(Field<T> valueField, int parameters, int order) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptionbuild
(double... derivatives) Build aFieldDerivativeStructure
from all its derivatives.final FieldDerivativeStructure<T>
Build aFieldDerivativeStructure
from all its derivatives.constant
(double value) Build aFieldDerivativeStructure
representing a constant value.Build aFieldDerivativeStructure
representing a constant value.Get the compiler for the current dimensions.Get theField
theFieldDerivativeStructure
instances belong to.Get theField
the value and parameters of the function belongs to.variable
(int index, double value) Build aFieldDerivativeStructure
representing a variable.Build aFieldDerivativeStructure
representing a variable.
-
Constructor Details
-
FDSFactory
Simple constructor.- Parameters:
valueField
- field for the function parameters and valueparameters
- number of free parametersorder
- derivation order
-
-
Method Details
-
getValueField
Get theField
the value and parameters of the function belongs to.- Returns:
Field
the value and parameters of the function belongs to
-
getDerivativeField
Get theField
theFieldDerivativeStructure
instances belong to.- Returns:
Field
theFieldDerivativeStructure
instances belong to
-
constant
Build aFieldDerivativeStructure
representing a constant value.- Parameters:
value
- value of the constant- Returns:
- a
FieldDerivativeStructure
representing a constant value
-
constant
Build aFieldDerivativeStructure
representing a constant value.- Parameters:
value
- value of the constant- Returns:
- a
FieldDerivativeStructure
representing a constant value
-
variable
Build aFieldDerivativeStructure
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
FieldDerivativeStructure
representing a variable - Throws:
MathIllegalArgumentException
- if index if greater or equal togetCompiler()
.getFreeParameters()
.
-
variable
public FieldDerivativeStructure<T> variable(int index, double value) throws MathIllegalArgumentException Build aFieldDerivativeStructure
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
FieldDerivativeStructure
representing a variable - Throws:
MathIllegalArgumentException
- if index if greater or equal togetCompiler()
.getFreeParameters()
.
-
build
@SafeVarargs public final FieldDerivativeStructure<T> build(T... derivatives) throws MathIllegalArgumentException Build aFieldDerivativeStructure
from all its derivatives.- Parameters:
derivatives
- derivatives sorted according toDSCompiler.getPartialDerivativeIndex(int...)
- Returns:
FieldDerivativeStructure
with specified derivatives- Throws:
MathIllegalArgumentException
- if derivatives array does not match thesize
expected by the compilerMathIllegalArgumentException
- if order is too large- See Also:
-
build
Build aFieldDerivativeStructure
from all its derivatives.- Parameters:
derivatives
- derivatives sorted according toDSCompiler.getPartialDerivativeIndex(int...)
- Returns:
FieldDerivativeStructure
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
-