Class PartitionedIntegrator#
Defined in File Integrator.h
Inheritance Relationships#
Base Type#
public Karana::Integrators::Integrator(Class Integrator)
Derived Type#
public Karana::Integrators::ExplicitVerletIntegrator(Class ExplicitVerletIntegrator)
Class Documentation#
-
class PartitionedIntegrator : public Karana::Integrators::Integrator#
Abstract integrator for states packed as [Q, U].
This class provides validation checks used by child classes.
Subclassed by Karana::Integrators::ExplicitVerletIntegrator
Public Functions
-
PartitionedIntegrator(const IntegratorType &integrator_type, size_t num_states, size_t num_q_states, DerivativeFunction deriv_fn, const IntegratorOptions *options = nullptr)#
Establish the Q/U layout and derivative callback.
- Parameters:
integrator_type – Concrete algorithm identifier.
num_states – Total number of Q and U states.
num_q_states – Number of leading Q states.
deriv_fn – Full-state derivative callback; required for nonempty systems.
options – Algorithm options, or nullptr for defaults.
-
virtual void hardReset(size_t num_states, size_t num_q_states) override#
Replace both dimensions after checking the new partition.
- Parameters:
num_states – New total number of states.
num_q_states – New number of leading Q states.
-
virtual void softReset(const km::Ktime &new_t, const km::Vec &new_x) override#
Replace time and values without changing the partition.
- Parameters:
new_t – New current time.
new_x – State vector with exactly nStates() entries.
-
virtual km::Ktime advanceTo(const km::Ktime &to_t) final#
Check the target time and take one algorithm step.
- Parameters:
to_t – Target time, at or after the current time.
- Returns:
The target time after a successful step.
Protected Functions
-
void _validatePartition(size_t num_states, size_t num_q_states) const#
Require nonempty Q and U blocks for a nonempty system.
- Parameters:
num_states – Proposed total number of states.
num_q_states – Proposed number of Q states; its upper bound is checked by Integrator.
-
virtual void _step(const km::Ktime &to_t) = 0#
Advance a nonempty system by one strictly positive step.
- Parameters:
to_t – Target time checked by advanceTo; the child commits time and state.
-
PartitionedIntegrator(const IntegratorType &integrator_type, size_t num_states, size_t num_q_states, DerivativeFunction deriv_fn, const IntegratorOptions *options = nullptr)#