1#ifndef ROBOTOC_STO_COST_FUNCTION_COMPONENT_BASE_HPP_
2#define ROBOTOC_STO_COST_FUNCTION_COMPONENT_BASE_HPP_
70 Eigen::VectorXd& lt) const = 0;
81 Eigen::MatrixXd& Qtt) const = 0;
89 template <typename Derived>
91 auto ptr = shared_from_this();
92 auto derived_ptr = std::dynamic_pointer_cast<Derived>(ptr);
93 if (derived_ptr ==
nullptr) {
94 throw std::runtime_error(
"[STOCostFunctionComponentBase] runtime error: failed in down-casting!");
Base class of components of the cost function of the switching time optimization (STO) problem.
Definition: sto_cost_function_component_base.hpp:19
STOCostFunctionComponentBase()
Default constructor.
Definition: sto_cost_function_component_base.hpp:24
STOCostFunctionComponentBase & operator=(const STOCostFunctionComponentBase &)=default
Default copy operator.
virtual ~STOCostFunctionComponentBase()
Destructor.
Definition: sto_cost_function_component_base.hpp:29
STOCostFunctionComponentBase(const STOCostFunctionComponentBase &)=default
Default copy constructor.
std::shared_ptr< Derived > as_shared_ptr()
Gets the shared ptr of this object as the specified type. If this fails in dynamic casting,...
Definition: sto_cost_function_component_base.hpp:90
virtual void evalCostHessian(const TimeDiscretization &time_discretization, Eigen::MatrixXd &Qtt) const =0
Computes the twice-time derivative (Hessian) of the cost on the switching times.
virtual void evalCostDerivatives(const TimeDiscretization &time_discretization, Eigen::VectorXd <) const =0
Computes the derivative of the cost on the switching times.
virtual double evalCost(const TimeDiscretization &time_discretization) const =0
Computes the cost on the switching times.
STOCostFunctionComponentBase(STOCostFunctionComponentBase &&) noexcept=default
Default move constructor.
Time discretization of the optimal control problem.
Definition: time_discretization.hpp:20
Definition: constraint_component_base.hpp:17