Go to the documentation of this file.
40 : Component(n_var, name)
44 : Component(row_count, name)
53 std::vector<Eigen::Triplet<double>> triplet_list;
55 for (
const auto& vars :
variables_->GetComponents()) {
56 int n = vars->GetRows();
61 triplet_list.reserve(triplet_list.size() + jac.nonZeros());
64 for (
int k = 0; k < jac.outerSize(); ++k)
65 for (Jacobian::InnerIterator it(jac, k); it; ++it)
66 triplet_list.push_back(
67 Eigen::Triplet<double>(it.row(), col + it.col(), it.value()));
72 jacobian.setFromTriplets(triplet_list.begin(), triplet_list.end());
101 std::cout.precision(2);
102 std::cout << std::fixed << std::left << std::setw(30) <<
GetName()
103 << std::right << std::setw(4) <<
GetRows() << std::setw(9) << index
104 << std::setfill(
'.') << std::setw(7) << index +
GetRows() - 1
105 << std::setfill(
' ') << std::setw(12) << cost << std::endl;
std::vector< Bounds > VecBound
virtual void FillJacobianBlock(std::string var_set, Jacobian &jac_block) const =0
Set individual Jacobians corresponding to each decision variable set.
VecBound GetBounds() const final
Returns infinite bounds (e.g. no bounds).
void LinkWithVariables(const VariablesPtr &x)
Connects the constraint with the optimization variables.
void Print(double tol, int &index) const final
Jacobian GetJacobian() const final
The matrix of derivatives for these constraints and variables.
virtual void InitVariableDependedQuantities(const VariablesPtr &)
Initialize quantities that depend on the optimization variables.
ConstraintSet(int n_constraints, const std::string &name)
Creates constraints on the variables x.
std::string GetName() const
Returns the name (id) of this component.
common namespace for all elements in this library.
VectorXd GetValues() const final
Wrapper function that converts double to Eigen::VectorXd.
CostTerm(const std::string &name)
static const Bounds NoBound
int GetRows() const
Returns the number of rows of this component.
Eigen::SparseMatrix< double, Eigen::RowMajor > Jacobian
VariableSet(int n_var, const std::string &name)
Creates a set of variables representing a single concept.
virtual double GetCost() const =0
Returns the scalar cost term calculated from the variables.
ifopt
Author(s): Alexander W. Winkler
autogenerated on Mon Sep 18 2023 02:14:38