Go to the documentation of this file.
59 using Eigen::Vector2d;
90 bounds.at(0) =
Bounds(-1.0, 1.0);
111 Vector2d x =
GetVariables()->GetComponent(
"var_set1")->GetValues();
112 g(0) = std::pow(x(0), 2) + x(1);
122 b.at(0) =
Bounds(1.0, 1.0);
138 if (var_set ==
"var_set1") {
139 Vector2d x =
GetVariables()->GetComponent(
"var_set1")->GetValues();
141 jac_block.coeffRef(0, 0) =
143 jac_block.coeffRef(0, 1) =
156 Vector2d x =
GetVariables()->GetComponent(
"var_set1")->GetValues();
157 return -std::pow(x(1) - 2, 2);
162 if (var_set ==
"var_set1") {
163 Vector2d x =
GetVariables()->GetComponent(
"var_set1")->GetValues();
165 jac.coeffRef(0, 0) = 0.0;
166 jac.coeffRef(0, 1) = -2.0 * (x(1) - 2.0);
VectorXd GetValues() const override
Returns the "values" of whatever this component represents.
const VariablesPtr GetVariables() const
Read access to the value of the optimization variables.
double GetCost() const override
Returns the scalar cost term calculated from the variables.
VecBound GetBounds() const override
Returns the "bounds" of this component.
std::vector< Bounds > VecBound
void FillJacobianBlock(std::string var_set, Jacobian &jac) const override
Set individual Jacobians corresponding to each decision variable set.
Upper and lower bound for optimization variables and constraints.
ExVariables(const std::string &name)
void SetVariables(const VectorXd &x) override
Sets the optimization variables from an Eigen vector.
VecBound GetBounds() const override
Returns the "bounds" of this component.
common namespace for all elements in this library.
A container holding a set of related constraints.
VectorXd GetValues() const override
Returns the "values" of whatever this component represents.
A container holding a single cost term.
A container holding a set of related optimization variables.
static const Bounds NoBound
ExCost(const std::string &name)
int GetRows() const
Returns the number of rows of this component.
Eigen::SparseMatrix< double, Eigen::RowMajor > Jacobian
void FillJacobianBlock(std::string var_set, Jacobian &jac_block) const override
Set individual Jacobians corresponding to each decision variable set.
ExConstraint(const std::string &name)
ifopt
Author(s): Alexander W. Winkler
autogenerated on Mon Sep 18 2023 02:14:38