Package org.apache.commons.math3.ode
Class EquationsMapper
- java.lang.Object
-
- org.apache.commons.math3.ode.EquationsMapper
-
- All Implemented Interfaces:
java.io.Serializable
public class EquationsMapper extends java.lang.Object implements java.io.SerializableClass mapping the part of a complete state or derivative that pertains to a specific differential equation.Instances of this class are guaranteed to be immutable.
- Since:
- 3.0
- See Also:
SecondaryEquations, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private intdimensionDimension of the secondary state parameters.private intfirstIndexIndex of the first equation element in complete state arrays.private static longserialVersionUIDSerializable UID.
-
Constructor Summary
Constructors Constructor Description EquationsMapper(int firstIndex, int dimension)simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidextractEquationData(double[] complete, double[] equationData)Extract equation data from a complete state or derivative array.intgetDimension()Get the dimension of the secondary state parameters.intgetFirstIndex()Get the index of the first equation element in complete state arrays.voidinsertEquationData(double[] equationData, double[] complete)Insert equation data into a complete state or derivative array.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serializable UID.- See Also:
- Constant Field Values
-
firstIndex
private final int firstIndex
Index of the first equation element in complete state arrays.
-
dimension
private final int dimension
Dimension of the secondary state parameters.
-
-
Method Detail
-
getFirstIndex
public int getFirstIndex()
Get the index of the first equation element in complete state arrays.- Returns:
- index of the first equation element in complete state arrays
-
getDimension
public int getDimension()
Get the dimension of the secondary state parameters.- Returns:
- dimension of the secondary state parameters
-
extractEquationData
public void extractEquationData(double[] complete, double[] equationData) throws DimensionMismatchExceptionExtract equation data from a complete state or derivative array.- Parameters:
complete- complete state or derivative array from which equation data should be retrievedequationData- placeholder where to put equation data- Throws:
DimensionMismatchException- if the dimension of the equation data does not match the mapper dimension
-
insertEquationData
public void insertEquationData(double[] equationData, double[] complete) throws DimensionMismatchExceptionInsert equation data into a complete state or derivative array.- Parameters:
equationData- equation data to be inserted into the complete arraycomplete- placeholder where to put equation data (only the part corresponding to the equation will be overwritten)- Throws:
DimensionMismatchException- if the dimension of the equation data does not match the mapper dimension
-
-