robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
robotoc::constraintsimpl Namespace Reference

Functions

template<typename ConstraintComponentBaseTypePtr >
void clear (std::vector< ConstraintComponentBaseTypePtr > &constraints)
 Clears the vector of the constraints. More...
 
template<typename ConstraintComponentBaseTypePtr >
void createConstraintsData (const std::vector< ConstraintComponentBaseTypePtr > &constraints, std::vector< ConstraintComponentData > &data)
 Creates constraints data. More...
 
template<typename ConstraintComponentBaseTypePtr , typename ContactStatusType >
bool isFeasible (const std::vector< ConstraintComponentBaseTypePtr > &constraints, Robot &robot, const ContactStatusType &contact_status, std::vector< ConstraintComponentData > &data, const SplitSolution &s)
 Checks whether the current solution s is feasible or not. More...
 
template<typename ConstraintComponentBaseTypePtr , typename ContactStatusType >
void setSlackAndDual (const std::vector< ConstraintComponentBaseTypePtr > &constraints, Robot &robot, const ContactStatusType &contact_status, std::vector< ConstraintComponentData > &data, const SplitSolution &s)
 Sets the slack and dual variables of each constraint components. More...
 
template<typename ConstraintComponentBaseTypePtr , typename ContactStatusType >
void evalConstraint (const std::vector< ConstraintComponentBaseTypePtr > &constraints, Robot &robot, const ContactStatusType &contact_status, std::vector< ConstraintComponentData > &data, const SplitSolution &s)
 Computes the primal residual, residual in the complementary slackness, and the log-barrier_param function of the slack varible. More...
 
template<typename ConstraintComponentBaseTypePtr , typename ContactStatusType >
void linearizeConstraints (const std::vector< ConstraintComponentBaseTypePtr > &constraints, Robot &robot, const ContactStatusType &contact_status, std::vector< ConstraintComponentData > &data, const SplitSolution &s, SplitKKTResidual &kkt_residual)
 Evaluates the constraints (i.e., calls evalConstraint()) and adds the products of the Jacobian of the constraints and Lagrange multipliers. More...
 
template<typename ConstraintComponentBaseTypePtr , typename ContactStatusType >
void condenseSlackAndDual (const std::vector< ConstraintComponentBaseTypePtr > &constraints, const ContactStatusType &contact_status, std::vector< ConstraintComponentData > &data, SplitKKTMatrix &kkt_matrix, SplitKKTResidual &kkt_residual)
 Condenses the slack and dual variables. linearizeConstraints() must be called before this function. More...
 
template<typename ConstraintComponentBaseTypePtr , typename ContactStatusType , typename SplitDirectionType >
void expandSlackAndDual (const std::vector< ConstraintComponentBaseTypePtr > &constraints, const ContactStatusType &contact_status, std::vector< ConstraintComponentData > &data, const SplitDirectionType &d)
 Expands the slack and dual, i.e., computes the directions of the slack and dual variables from the directions of the primal variables. More...
 
template<typename ConstraintComponentBaseTypePtr >
double maxSlackStepSize (const std::vector< ConstraintComponentBaseTypePtr > &constraints, const std::vector< ConstraintComponentData > &data)
 Computes and returns the maximum step size by applying fraction-to-boundary-rule to the direction of the slack variable. More...
 
template<typename ConstraintComponentBaseTypePtr >
double maxDualStepSize (const std::vector< ConstraintComponentBaseTypePtr > &constraints, const std::vector< ConstraintComponentData > &data)
 Computes and returns the maximum step size by applying fraction-to-boundary-rule to the direction of the dual variable. More...
 
void updateSlack (std::vector< ConstraintComponentData > &data, const double step_size)
 Updates the slack variables according to the step size. More...
 
void updateDual (std::vector< ConstraintComponentData > &data, const double step_size)
 Updates the dual variables according to the step size. More...
 
template<typename ConstraintComponentBaseTypePtr >
void setBarrierParam (std::vector< ConstraintComponentBaseTypePtr > &constraints, const double barrier_param)
 Sets the barrier parameter. More...
 
template<typename ConstraintComponentBaseTypePtr >
void setFractionToBoundaryRule (std::vector< ConstraintComponentBaseTypePtr > &constraints, const double fraction_to_boundary_rule)
 Sets the parameter of the fraction-to-boundary-rule. More...
 

Function Documentation

◆ clear()

template<typename ConstraintComponentBaseTypePtr >
void robotoc::constraintsimpl::clear ( std::vector< ConstraintComponentBaseTypePtr > &  constraints)
inline

Clears the vector of the constraints.

Parameters
[in,out]constraintsVector of the constraints.

◆ condenseSlackAndDual()

template<typename ConstraintComponentBaseTypePtr , typename ContactStatusType >
void robotoc::constraintsimpl::condenseSlackAndDual ( const std::vector< ConstraintComponentBaseTypePtr > &  constraints,
const ContactStatusType &  contact_status,
std::vector< ConstraintComponentData > &  data,
SplitKKTMatrix kkt_matrix,
SplitKKTResidual kkt_residual 
)
inline

Condenses the slack and dual variables. linearizeConstraints() must be called before this function.

Parameters
[in]constraintsVector of the constraints.
[in]contact_statusContact status.
[in,out]dataVector of the constraints data.
[in,out]kkt_matrixSplit KKT matrix. The condensed Hessians are added
to this object.
[in,out]kkt_residualSplit KKT residual. The condensed residuals are added to this object.

◆ createConstraintsData()

template<typename ConstraintComponentBaseTypePtr >
void robotoc::constraintsimpl::createConstraintsData ( const std::vector< ConstraintComponentBaseTypePtr > &  constraints,
std::vector< ConstraintComponentData > &  data 
)
inline

Creates constraints data.

Parameters
[in]constraintsVector of the constraints.
[out]dataVector of the constraints data.

◆ evalConstraint()

template<typename ConstraintComponentBaseTypePtr , typename ContactStatusType >
void robotoc::constraintsimpl::evalConstraint ( const std::vector< ConstraintComponentBaseTypePtr > &  constraints,
Robot robot,
const ContactStatusType &  contact_status,
std::vector< ConstraintComponentData > &  data,
const SplitSolution s 
)
inline

Computes the primal residual, residual in the complementary slackness, and the log-barrier_param function of the slack varible.

Parameters
[in]constraintsVector of the constraint components.
[in]robotRobot model.
[in]contact_statusContact status.
[in,out]dataVector of the constraints data.
[in]sSplit solution.

◆ expandSlackAndDual()

template<typename ConstraintComponentBaseTypePtr , typename ContactStatusType , typename SplitDirectionType >
void robotoc::constraintsimpl::expandSlackAndDual ( const std::vector< ConstraintComponentBaseTypePtr > &  constraints,
const ContactStatusType &  contact_status,
std::vector< ConstraintComponentData > &  data,
const SplitDirectionType &  d 
)
inline

Expands the slack and dual, i.e., computes the directions of the slack and dual variables from the directions of the primal variables.

Parameters
[in]constraintsVector of the constraint components.
[in]contact_statusContact status.
[in,out]dataVector of the constraints data.
[in]dSplit direction.

◆ isFeasible()

template<typename ConstraintComponentBaseTypePtr , typename ContactStatusType >
bool robotoc::constraintsimpl::isFeasible ( const std::vector< ConstraintComponentBaseTypePtr > &  constraints,
Robot robot,
const ContactStatusType &  contact_status,
std::vector< ConstraintComponentData > &  data,
const SplitSolution s 
)
inline

Checks whether the current solution s is feasible or not.

Parameters
[in]constraintsVector of the constraints.
[in]robotRobot model.
[in]contact_statusContact status.
[in,out]dataVector of the constraints data.
[in]sSplit solution.
Returns
true if s is feasible. false if not.

◆ linearizeConstraints()

template<typename ConstraintComponentBaseTypePtr , typename ContactStatusType >
void robotoc::constraintsimpl::linearizeConstraints ( const std::vector< ConstraintComponentBaseTypePtr > &  constraints,
Robot robot,
const ContactStatusType &  contact_status,
std::vector< ConstraintComponentData > &  data,
const SplitSolution s,
SplitKKTResidual kkt_residual 
)
inline

Evaluates the constraints (i.e., calls evalConstraint()) and adds the products of the Jacobian of the constraints and Lagrange multipliers.

Parameters
[in]constraintsVector of the constraint components.
[in]robotRobot model.
[in]contact_statusContact status.
[in,out]dataVector of the constraints data.
[in]sSplit solution.
[in,out]kkt_residualSplit KKT residual.

◆ maxDualStepSize()

template<typename ConstraintComponentBaseTypePtr >
double robotoc::constraintsimpl::maxDualStepSize ( const std::vector< ConstraintComponentBaseTypePtr > &  constraints,
const std::vector< ConstraintComponentData > &  data 
)
inline

Computes and returns the maximum step size by applying fraction-to-boundary-rule to the direction of the dual variable.

Parameters
[in]constraintsVector of the constraint components.
[in]dataVector of the constraints data.

◆ maxSlackStepSize()

template<typename ConstraintComponentBaseTypePtr >
double robotoc::constraintsimpl::maxSlackStepSize ( const std::vector< ConstraintComponentBaseTypePtr > &  constraints,
const std::vector< ConstraintComponentData > &  data 
)
inline

Computes and returns the maximum step size by applying fraction-to-boundary-rule to the direction of the slack variable.

Parameters
[in]constraintsVector of the constraint components.
[in]dataVector of the constraints data.

◆ setBarrierParam()

template<typename ConstraintComponentBaseTypePtr >
void robotoc::constraintsimpl::setBarrierParam ( std::vector< ConstraintComponentBaseTypePtr > &  constraints,
const double  barrier_param 
)
inline

Sets the barrier parameter.

Parameters
[in,out]constraintsVector of the constraint components.
[in]barrier_paramBarrier parameter. Must be positive. Should be small.

◆ setFractionToBoundaryRule()

template<typename ConstraintComponentBaseTypePtr >
void robotoc::constraintsimpl::setFractionToBoundaryRule ( std::vector< ConstraintComponentBaseTypePtr > &  constraints,
const double  fraction_to_boundary_rule 
)
inline

Sets the parameter of the fraction-to-boundary-rule.

Parameters
[in,out]constraintsVector of the constraint components.
[in]fraction_to_boundary_ruleMust be larger than 0 and smaller than 1. Should be between 0.9 and 0.995.

◆ setSlackAndDual()

template<typename ConstraintComponentBaseTypePtr , typename ContactStatusType >
void robotoc::constraintsimpl::setSlackAndDual ( const std::vector< ConstraintComponentBaseTypePtr > &  constraints,
Robot robot,
const ContactStatusType &  contact_status,
std::vector< ConstraintComponentData > &  data,
const SplitSolution s 
)
inline

Sets the slack and dual variables of each constraint components.

Parameters
[in]constraintsVector of the constraints.
[in]robotRobot model.
[in]contact_statusContact status.
[in,out]dataVector of the constraints data.
[in]sSplit solution.

◆ updateDual()

void robotoc::constraintsimpl::updateDual ( std::vector< ConstraintComponentData > &  data,
const double  step_size 
)
inline

Updates the dual variables according to the step size.

Parameters
[in,out]dataVector of the constraints data.
[in]step_sizeStep size.

◆ updateSlack()

void robotoc::constraintsimpl::updateSlack ( std::vector< ConstraintComponentData > &  data,
const double  step_size 
)
inline

Updates the slack variables according to the step size.

Parameters
[in,out]dataVector of the constraints data.
[in]step_sizeStep size.