28template <
typename Scalar>
struct LQRKnotTpl {
52 Scalar prec = std::numeric_limits<Scalar>::epsilon())
const;
55 return lhs.isApprox(rhs);
59template <
typename Scalar>
struct LQRProblemTpl {
85 stages[i].addParameterization(nth);
98 Scalar
evaluate(
const VectorOfVectors &xs,
const VectorOfVectors &us,
99 const std::optional<ConstVectorRef> &theta_)
const;
105 G0.resize(
nc0(), nx0);
109template <
typename Scalar>
112 oss << fmt::format(
"\n nx: {:d}", self.nx)
113 << fmt::format(
"\n nu: {:d}", self.nu)
114 << fmt::format(
"\n nc: {:d}", self.nc);
116 oss << fmt::format(
"\n nth: {:d}", self.nth);
147#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
148#include "lqr-problem.txx"
std::ostream & operator<<(std::ostream &oss, const LQRKnotTpl< Scalar > &self)
auto eigenPrintWithPreamble(const Eigen::EigenBase< D > &mat, const std::string &text)
Struct describing a stage of a constrained LQ problem.
LQRKnotTpl(uint nx, uint nu, uint nc)
friend bool operator==(const LQRKnotTpl &lhs, const LQRKnotTpl &rhs)
bool isApprox(const LQRKnotTpl &other, Scalar prec=std::numeric_limits< Scalar >::epsilon()) const
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
LQRKnotTpl(uint nx, uint nu, uint nc, uint nx2, uint nth=0)
void addParameterization(uint nth)
LQRProblemTpl(KnotVector &&knots, long nc0)
bool isInitialized() const
LQRProblemTpl(const KnotVector &knots, long nc0)
std::vector< KnotType > KnotVector
bool isParameterized() const
uint nc0() const noexcept
void addParameterization(uint nth)
Scalar evaluate(const VectorOfVectors &xs, const VectorOfVectors &us, const std::optional< ConstVectorRef > &theta_) const
Evaluate the quadratic objective.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
int horizon() const noexcept