19 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR_EVAL =
double,
typename SCALAR = SCALAR_EVAL>
23 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
34 const SCALAR_EVAL c = 0.);
45 const Eigen::Matrix<SCALAR, CONTROL_DIM, 1>&
u,
51 ct::core::ADCGScalar
t)
override;
56 const SCALAR_EVAL&
t)
override;
60 const SCALAR_EVAL&
t)
override;
64 const SCALAR_EVAL&
t)
override;
68 const SCALAR_EVAL&
t)
override;
72 const SCALAR_EVAL&
t)
override;
75 const std::string& termName,
79 template <
typename SC>
80 SC
evalLocal(
const Eigen::Matrix<SC, STATE_DIM, 1>&
x,
const Eigen::Matrix<SC, CONTROL_DIM, 1>&
u,
const SC&
t);
88 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR_EVAL,
typename SCALAR>
89 template <
typename SC>
91 const Eigen::Matrix<SC, CONTROL_DIM, 1>&
u,
94 Eigen::Matrix<SC, 1, 1> y_eigen =
a_.template cast<SC>().transpose() * x +
b_.template cast<SC>().transpose() *
u;
95 SC y = y_eigen(0, 0) + SC(
c_);
A linear term of type .
Definition: TermLinear.hpp:20
SCALAR evaluate(const Eigen::Matrix< SCALAR, STATE_DIM, 1 > &x, const Eigen::Matrix< SCALAR, CONTROL_DIM, 1 > &u, const SCALAR &t) override
Evaluates the term at x, u, t.
Definition: TermLinear-impl.hpp:44
SC evalLocal(const Eigen::Matrix< SC, STATE_DIM, 1 > &x, const Eigen::Matrix< SC, CONTROL_DIM, 1 > &u, const SC &t)
Definition: TermLinear.hpp:90
Eigen::Matrix< SCALAR_EVAL, CONTROL_DIM, STATE_DIM > control_state_matrix_double_t
Definition: TermLinear.hpp:30
ct::core::ControlVector< control_dim > u
Definition: LoadFromFileTest.cpp:21
control_state_matrix_t stateControlDerivative(const core::StateVector< STATE_DIM, SCALAR_EVAL > &x, const core::ControlVector< CONTROL_DIM, SCALAR_EVAL > &u, const SCALAR_EVAL &t) override
compute the cross-term derivative (state-control) of this cost function term
Definition: TermLinear-impl.hpp:103
Eigen::Matrix< SCALAR_EVAL, CONTROL_DIM, CONTROL_DIM > control_matrix_t
Definition: TermLinear.hpp:26
An interface for a term, supporting both analytical and auto-diff terms.
Definition: TermBase.hpp:30
clear all close all load ct GNMSLog0 mat reformat t
Definition: gnmsPlot.m:6
TermLinear()
Definition: TermLinear-impl.hpp:33
CppAD::AD< CppAD::cg::CG< double > > SCALAR
ct::core::StateVector< state_dim > x
Definition: LoadFromFileTest.cpp:20
Eigen::Matrix< SCALAR_EVAL, STATE_DIM, STATE_DIM > state_matrix_double_t
Definition: TermLinear.hpp:28
control_matrix_t controlSecondDerivative(const core::StateVector< STATE_DIM, SCALAR_EVAL > &x, const core::ControlVector< CONTROL_DIM, SCALAR_EVAL > &u, const SCALAR_EVAL &t) override
compute second order derivative of this cost term w.r.t. the control input
Definition: TermLinear-impl.hpp:93
SCALAR_EVAL c_
Definition: TermLinear.hpp:84
core::StateVector< STATE_DIM, SCALAR_EVAL > a_
Definition: TermLinear.hpp:82
TermLinear< STATE_DIM, CONTROL_DIM, SCALAR_EVAL, SCALAR > * clone() const override
Deep-copy term.
Definition: TermLinear-impl.hpp:27
core::StateVector< STATE_DIM, SCALAR_EVAL > stateDerivative(const core::StateVector< STATE_DIM, SCALAR_EVAL > &x, const core::ControlVector< CONTROL_DIM, SCALAR_EVAL > &u, const SCALAR_EVAL &t) override
compute derivative of this cost term w.r.t. the state
Definition: TermLinear-impl.hpp:63
void loadConfigFile(const std::string &filename, const std::string &termName, bool verbose=false) override
load this term from a configuration file
Definition: TermLinear-impl.hpp:112
core::ControlVector< CONTROL_DIM, SCALAR_EVAL > b_
Definition: TermLinear.hpp:83
Eigen::Matrix< SCALAR_EVAL, CONTROL_DIM, STATE_DIM > control_state_matrix_t
Definition: TermLinear.hpp:27
const bool verbose
Definition: ConstraintComparison.h:18
Eigen::Matrix< SCALAR_EVAL, CONTROL_DIM, CONTROL_DIM > control_matrix_double_t
Definition: TermLinear.hpp:29
state_matrix_t stateSecondDerivative(const core::StateVector< STATE_DIM, SCALAR_EVAL > &x, const core::ControlVector< CONTROL_DIM, SCALAR_EVAL > &u, const SCALAR_EVAL &t) override
compute second order derivative of this cost term w.r.t. the state
Definition: TermLinear-impl.hpp:73
core::ControlVector< CONTROL_DIM, SCALAR_EVAL > controlDerivative(const core::StateVector< STATE_DIM, SCALAR_EVAL > &x, const core::ControlVector< CONTROL_DIM, SCALAR_EVAL > &u, const SCALAR_EVAL &t) override
compute derivative of this cost term w.r.t. the control input
Definition: TermLinear-impl.hpp:83
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef Eigen::Matrix< SCALAR_EVAL, STATE_DIM, STATE_DIM > state_matrix_t
Definition: TermLinear.hpp:25
virtual ~TermLinear()
Definition: TermLinear-impl.hpp:39