Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
ifopt::ConstraintSet Class Reference

A container holding a set of related constraints. More...

#include <constraint_set.h>

Inheritance diagram for ifopt::ConstraintSet:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ConstraintSet (int n_constraints, const std::string &name)
 Creates constraints on the variables x.
Jacobian GetJacobian () const override final
 The matrix of derivatives for these constraints and variables.
virtual void LinkWithVariables (const VariablesPtr &x) final
 Connects the constraint with the optimization variables.
virtual ~ConstraintSet ()

Protected Member Functions

const VariablesPtr GetVariables () const
 Read access to the value of the optimization variables.

Private Member Functions

virtual void FillJacobianBlock (std::string var_set, Jacobian &jac_block) const =0
 Set individual Jacobians corresponding to each decision variable set.
virtual void InitVariableDependedQuantities (const VariablesPtr &x_init)
 Initialize quantities that depend on the optimization variables.
virtual void SetVariables (const VectorXd &x) override final
 Sets the optimization variables from an Eigen vector.

Private Attributes

VariablesPtr variables_

Detailed Description

A container holding a set of related constraints.

This container holds constraints representing a single concept, e.g. n constraints keeping a foot inside its range of motion. Each of the n rows is given by: lower_bound < g(x) < upper_bound

See also:
Component

Definition at line 47 of file constraint_set.h.


Constructor & Destructor Documentation

ifopt::ConstraintSet::ConstraintSet ( int  n_constraints,
const std::string &  name 
)

Creates constraints on the variables x.

Parameters:
n_constraintsThe number of constraints.
nameWhat these constraints represent.

Definition at line 42 of file leaves.cc.

virtual ifopt::ConstraintSet::~ConstraintSet ( ) [virtual]

Member Function Documentation

virtual void ifopt::ConstraintSet::FillJacobianBlock ( std::string  var_set,
Jacobian &  jac_block 
) const [private, pure virtual]

Set individual Jacobians corresponding to each decision variable set.

Parameters:
var_setSet of variables the current Jacobian block belongs to.
jac_blockColumns of the overall Jacobian affected by var_set.

A convenience function so the user does not have to worry about the ordering of variable sets. All that is required is that the user knows the internal ordering of variables in each individual set and provides the Jacobian of the constraints w.r.t. this set (starting at column 0). GetJacobian() then inserts these columns at the correct position in the overall Jacobian.

If the constraint doen't depend on a var_set, this function should simply do nothing.

Implemented in ifopt::ExCost, and ifopt::ExConstraint.

ConstraintSet::Jacobian ifopt::ConstraintSet::GetJacobian ( ) const [override, virtual]

The matrix of derivatives for these constraints and variables.

Assuming n constraints and m variables, the returned Jacobian has dimensions n x m. Every row represents the derivatives of a single constraint, whereas every column refers to a single optimization variable.

This function only combines the user-defined jacobians from FillJacobianBlock().

Implements ifopt::Component.

Definition at line 48 of file leaves.cc.

const VariablesPtr ifopt::ConstraintSet::GetVariables ( ) const [inline, protected]

Read access to the value of the optimization variables.

This must be used to formulate the constraint violation and Jacobian.

Definition at line 87 of file constraint_set.h.

virtual void ifopt::ConstraintSet::InitVariableDependedQuantities ( const VariablesPtr &  x_init) [inline, private, virtual]

Initialize quantities that depend on the optimization variables.

Parameters:
xA pointer to the initial values of the optimization variables.

Sometimes the number of constraints depends on the variable representation, or shorthands to specific variable sets want to be saved for quicker access later. This function can be overwritten for that.

Definition at line 116 of file constraint_set.h.

void ifopt::ConstraintSet::LinkWithVariables ( const VariablesPtr &  x) [virtual]

Connects the constraint with the optimization variables.

Parameters:
xA pointer to the current values of the optimization variables.

The optimization variable values are necessary for calculating constraint violations and Jacobians.

Definition at line 72 of file leaves.cc.

virtual void ifopt::ConstraintSet::SetVariables ( const VectorXd &  x) [inline, override, private, virtual]

Sets the optimization variables from an Eigen vector.

This is only done for Variable, where these are set from the current values of the NLP solvers.

Implements ifopt::Component.

Definition at line 119 of file constraint_set.h.


Member Data Documentation

VariablesPtr ifopt::ConstraintSet::variables_ [private]

Definition at line 106 of file constraint_set.h.


The documentation for this class was generated from the following files:


ifopt_core
Author(s): Alexander W. Winkler
autogenerated on Sat Apr 21 2018 03:01:48