FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
JacobianStates.h
1#ifndef JACOBIAN_STATES_H
2#define JACOBIAN_STATES_H
3
28{
29public:
33 StateFrame(const double* localStates, int firstStateIndex)
34 : m_localStates(localStates)
35 , m_firstStateIndex(firstStateIndex)
36 {
37 }
38
42 explicit StateFrame(int firstStateIndex)
43 : StateFrame(nullptr, firstStateIndex)
44 {
45 }
46
48 int Local(int globalIndex) const { return globalIndex - m_firstStateIndex; }
49
51 const double* State(int globalIndex) const { return m_localStates + Local(globalIndex); }
52
54 const double* Global() const { return m_localStates - m_firstStateIndex; }
55
56private:
57 const double* m_localStates;
58 int m_firstStateIndex;
59};
60
61#endif
Definition JacobianStates.h:28
const double * Global() const
The global state vector, as OdeFcn is handed it.
Definition JacobianStates.h:54
int Local(int globalIndex) const
Index within the slice of the state with global index globalIndex.
Definition JacobianStates.h:48
StateFrame(const double *localStates, int firstStateIndex)
Definition JacobianStates.h:33
const double * State(int globalIndex) const
The state with global index globalIndex, in the slice.
Definition JacobianStates.h:51
StateFrame(int firstStateIndex)
Definition JacobianStates.h:42