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
public class FDSFactory<T extends CalculusFieldElement<T>> extends Object
Factory forFieldDerivativeStructure
.This class is a factory for
FieldDerivativeStructure
instances.Instances of this class are guaranteed to be immutable.
- See Also:
FieldDerivativeStructure
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FDSFactory.DerivativeField<T extends CalculusFieldElement<T>>
Field for {link FieldDerivativeStructure} instances.
-
Constructor Summary
Constructors Constructor Description FDSFactory(Field<T> valueField, int parameters, int order)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldDerivativeStructure<T>
build(double... derivatives)
Build aFieldDerivativeStructure
from all its derivatives.FieldDerivativeStructure<T>
build(T... derivatives)
Build aFieldDerivativeStructure
from all its derivatives.FieldDerivativeStructure<T>
constant(double value)
Build aFieldDerivativeStructure
representing a constant value.FieldDerivativeStructure<T>
constant(T value)
Build aFieldDerivativeStructure
representing a constant value.DSCompiler
getCompiler()
Get the compiler for the current dimensions.FDSFactory.DerivativeField<T>
getDerivativeField()
Get theField
theFieldDerivativeStructure
instances belong to.Field<T>
getValueField()
Get theField
the value and parameters of the function belongs to.FieldDerivativeStructure<T>
variable(int index, double value)
Build aFieldDerivativeStructure
representing a variable.FieldDerivativeStructure<T>
variable(int index, T value)
Build aFieldDerivativeStructure
representing a variable.
-
-
-
Method Detail
-
getValueField
public Field<T> getValueField()
Get theField
the value and parameters of the function belongs to.- Returns:
Field
the value and parameters of the function belongs to
-
getDerivativeField
public FDSFactory.DerivativeField<T> getDerivativeField()
Get theField
theFieldDerivativeStructure
instances belong to.- Returns:
Field
theFieldDerivativeStructure
instances belong to
-
constant
public FieldDerivativeStructure<T> constant(double value)
Build aFieldDerivativeStructure
representing a constant value.- Parameters:
value
- value of the constant- Returns:
- a
FieldDerivativeStructure
representing a constant value
-
constant
public FieldDerivativeStructure<T> constant(T value)
Build aFieldDerivativeStructure
representing a constant value.- Parameters:
value
- value of the constant- Returns:
- a
FieldDerivativeStructure
representing a constant value
-
variable
public FieldDerivativeStructure<T> variable(int index, T 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()
.
-
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:
FieldDerivativeStructure.getAllDerivatives()
-
build
public FieldDerivativeStructure<T> build(double... 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:
FieldDerivativeStructure.getAllDerivatives()
-
getCompiler
public DSCompiler getCompiler()
Get the compiler for the current dimensions.- Returns:
- compiler for the current dimensions
-
-