Go to the documentation of this file.
36 #ifndef IFOPT_INCLUDE_OPT_COMPOSITE_H_
37 #define IFOPT_INCLUDE_OPT_COMPOSITE_H_
43 #include <Eigen/Dense>
44 #include <Eigen/Sparse>
65 using Ptr = std::shared_ptr<Component>;
67 using Jacobian = Eigen::SparseMatrix<double, Eigen::RowMajor>;
81 Component(
int num_rows,
const std::string& name);
134 virtual void Print(
double tolerance,
int& index_start)
const;
162 using Ptr = std::shared_ptr<Composite>;
173 Composite(
const std::string& name,
bool is_cost);
196 template <
typename T>
197 std::shared_ptr<T>
GetComponent(
const std::string& name)
const;
223 template <
typename T>
227 return std::dynamic_pointer_cast<T>(c);
Composite(const std::string &name, bool is_cost)
Creates a Composite holding either variables, costs or constraints.
Interface representing either Variable, Cost or Constraint.
void SetRows(int num_rows)
Sets the number of rows of this component.
static const int kSpecifyLater
void AddComponent(const Component::Ptr &)
Adds a component to this composite.
std::vector< Bounds > VecBound
const ComponentVec GetComponents() const
Returns read access to the components.
VecBound GetBounds() const override
Returns the "bounds" of this component.
virtual void Print(double tolerance, int &index_start) const
Prints the relevant information (name, rows, values) of this component.
virtual ~Composite()=default
virtual Jacobian GetJacobian() const =0
Returns derivatives of each row w.r.t. the variables.
Jacobian GetJacobian() const override
Returns derivatives of each row w.r.t. the variables.
std::shared_ptr< Component > Ptr
std::string GetName() const
Returns the name (id) of this component.
virtual void SetVariables(const VectorXd &x)=0
Sets the optimization variables from an Eigen vector.
void SetVariables(const VectorXd &x) override
Sets the optimization variables from an Eigen vector.
common namespace for all elements in this library.
virtual VecBound GetBounds() const =0
Returns the "bounds" of this component.
Component(int num_rows, const std::string &name)
Creates a component.
A collection of components which is treated as another Component.
std::vector< Component::Ptr > ComponentVec
virtual ~Component()=default
const Component::Ptr GetComponent(std::string name) const
Access generic component with the specified name.
int GetRows() const
Returns the number of rows of this component.
Eigen::SparseMatrix< double, Eigen::RowMajor > Jacobian
VectorXd GetValues() const override
Returns the "values" of whatever this component represents.
void ClearComponents()
Removes all component from this composite.
virtual VectorXd GetValues() const =0
Returns the "values" of whatever this component represents.
ifopt
Author(s): Alexander W. Winkler
autogenerated on Mon Sep 18 2023 02:14:38