11 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
15 : Base(problem, settings)
19 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
27 const size_t threadId)
29 this->
linearSystems_[threadId]->getAandB(x, u, x_next, n, subSteps, A, B);
32 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
38 const size_t threadId)
41 this->
systems_[threadId]->propagateControlledDynamics(state, n, control, stateNext);
44 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
46 const typename optConProblem_t::DynamicsPtr_t& dyn)
49 throw std::runtime_error(
"system dynamics are nullptr");
53 this->
systems_.at(
i) =
typename optConProblem_t::DynamicsPtr_t(dyn->clone());
58 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
60 const typename optConProblem_t::LinearPtr_t& lin)
63 throw std::runtime_error(
"linear system dynamics are nullptr");
67 this->
linearSystems_.at(
i) =
typename optConProblem_t::LinearPtr_t(lin->clone());
71 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
89 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
92 if (settings.nThreads != this->settings_.nThreads)
94 throw std::runtime_error(
"Number of threads cannot be changed after instance has been created.");
std::vector< ConstantControllerPtr, Eigen::aligned_allocator< ConstantControllerPtr > > controller_
Definition: OptconSystemInterface.h:123
std::vector< typename optConProblem_t::DynamicsPtr_t > systems_
Definition: OptconSystemInterface.h:111
std::vector< typename optConProblem_t::LinearPtr_t > linearSystems_
Definition: OptconSystemInterface.h:119
const LinearPtr_t getLinearSystem() const
Definition: OptConProblemBase-impl.h:151
ct::core::ControlVector< control_dim > u
Definition: LoadFromFileTest.cpp:21
settings_t settings_
instance of the optconProblem
Definition: OptconSystemInterface.h:127
const DynamicsPtr_t getNonlinearSystem() const
Definition: OptConProblemBase-impl.h:138
virtual void changeLinearSystem(const typename optConProblem_t::LinearPtr_t &lin) override
Definition: OptconDiscreteSystemInterface-impl.h:59
virtual void changeNonlinearSystem(const typename optConProblem_t::DynamicsPtr_t &dyn) override
Definition: OptconDiscreteSystemInterface-impl.h:45
virtual void propagateControlledDynamics(const state_vector_t &state, const time_t n, const control_vector_t &control, state_vector_t &stateNext, const size_t threadId) override
propagate discrete-time dynamics
Definition: OptconDiscreteSystemInterface-impl.h:33
Base::settings_t settings_t
Definition: OptconDiscreteSystemInterface.h:43
Base::state_matrix_t state_matrix_t
Definition: OptconDiscreteSystemInterface.h:34
Base::control_vector_t control_vector_t
Definition: OptconDiscreteSystemInterface.h:32
for i
Definition: mpc_unittest_plotting.m:14
Base::state_control_matrix_t state_control_matrix_t
Definition: OptconDiscreteSystemInterface.h:35
virtual void getAandB(const state_vector_t &x, const control_vector_t &u, const state_vector_t &x_next, const int n, size_t subSteps, state_matrix_t &A, state_control_matrix_t &B, const size_t threadId) override
retrieve discrete-time linear system matrices A and B.
Definition: OptconDiscreteSystemInterface-impl.h:20
optConProblem_t optConProblem_
the constant controller for forward-integration during one time-step
Definition: OptconSystemInterface.h:125
OptconDiscreteSystemInterface(const optConProblem_t &problem, const settings_t &settings)
constructor
Definition: OptconDiscreteSystemInterface-impl.h:12
ct::core::StateVector< state_dim > x
Definition: LoadFromFileTest.cpp:20
Base::state_vector_t state_vector_t
Definition: OptconDiscreteSystemInterface.h:33
virtual void initialize() override
perform necessary setup work
Definition: OptconDiscreteSystemInterface-impl.h:72
virtual void configure(const settings_t &settings) override
Definition: OptconDiscreteSystemInterface-impl.h:90
int nThreads
save the smallest eigenvalue of the Hessian
Definition: NLOptConSettings.hpp:272
Base::optConProblem_t optConProblem_t
Definition: OptconDiscreteSystemInterface.h:42