public class DSFactory extends Object implements Serializable
DerivativeStructure
.
This class is a factory for DerivativeStructure
instances.
Instances of this class are guaranteed to be immutable.
DerivativeStructure
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
DSFactory.DSField
Field for {link DerivativeStructure} instances.
|
Constructor and Description |
---|
DSFactory(int parameters,
int order)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
DerivativeStructure |
build(double... derivatives)
Build a
DerivativeStructure from all its derivatives. |
DerivativeStructure |
constant(double value)
Build a
DerivativeStructure representing a constant value. |
DSCompiler |
getCompiler()
Get the compiler for the current dimensions.
|
DSFactory.DSField |
getDerivativeField()
Get the
Field the DerivativeStructure instances belong to. |
DerivativeStructure |
variable(int index,
double value)
Build a
DerivativeStructure representing a variable. |
public DSFactory(int parameters, int order)
parameters
- number of free parametersorder
- derivation orderpublic DSFactory.DSField getDerivativeField()
Field
the DerivativeStructure
instances belong to.Field
the DerivativeStructure
instances belong topublic DerivativeStructure constant(double value)
DerivativeStructure
representing a constant value.value
- value of the constantDerivativeStructure
representing a constant valuepublic DerivativeStructure variable(int index, double value) throws MathIllegalArgumentException
DerivativeStructure
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.
index
- index of the variable (from 0 to
getCompiler()
.getFreeParameters()
- 1)value
- value of the variableDerivativeStructure
representing a variableMathIllegalArgumentException
- if index if greater or
equal to getCompiler()
.getFreeParameters()
.@SafeVarargs public final DerivativeStructure build(double... derivatives) throws MathIllegalArgumentException
DerivativeStructure
from all its derivatives.derivatives
- derivatives sorted according to
DSCompiler.getPartialDerivativeIndex(int...)
DerivativeStructure
with specified derivativesMathIllegalArgumentException
- if derivatives array does not match the
size
expected by the compilerMathIllegalArgumentException
- if order is too largeDerivativeStructure.getAllDerivatives()
public DSCompiler getCompiler()
Copyright © 2016-2022 CS GROUP. All rights reserved.