Interface ArraySliceMappable
-
- All Known Implementing Classes:
- MappableArray, MappableScalar
public interface ArraySliceMappableThis interface is used to map objects to and from simple arrays.Lots of mathematical algorithms are generic ones which can process the data from domain objects despite they ignore what this data represent. As an example, the same algorithm can integrate either the orbit evolution of a spacecraft under a specified force model or the electrical characteristics of a circuit after a switch is opened.
The approach of the Mantissa library is to define an interface for each such algorithm to represent the type of problem they can handle (
FirstOrderDifferentialEquationsfor an ODE integrators,EstimationProblemfor least squares estimators, ...). Furthermore, the state data that is handled by these algorithms is often a mixture of data coming from several domain objects (the orbit, plus the aerodynamical coefficients of the spacecraft, plus the characteristics of the thrusters, plus ...). Therefore, the user needs to gather and dispatch data between different objects representing different levels of abstraction.This interface is designed to copy data back and forth between existing objects during the iterative processing of these algorithms and avoid the cost of recreating the objects.
The nominal way to use this interface is to have the domain objects implement it (either directly or using inheritance to add this feature to already existing objects) and to create one class that implements the problem interface (for example
FirstOrderDifferentialEquations) and uses theArrayMapperclass to dispatch the data to and from the domain objects.- See Also:
ArrayMapper
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description intgetStateDimension()Get the dimension of the object.voidmapStateFromArray(int start, double[] array)Reinitialize internal state from the specified array slice data.voidmapStateToArray(int start, double[] array)Store internal state data into the specified array slice.
-
-
-
Method Detail
-
getStateDimension
int getStateDimension()
Get the dimension of the object.- Returns:
- dimension of the object
-
mapStateFromArray
void mapStateFromArray(int start, double[] array)Reinitialize internal state from the specified array slice data.- Parameters:
start- start index in the arrayarray- array holding the data to extract
-
mapStateToArray
void mapStateToArray(int start, double[] array)Store internal state data into the specified array slice.- Parameters:
start- start index in the arrayarray- array where data should be stored
-
-
DataMelt 3.0 © DataMelt by jWork.ORG