humoto
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
humoto::constraints::ContainerAB Class Reference

Detailed Description

Container for general equality constraints.

Definition at line 302 of file constraints_base.h.

#include <constraints_base.h>

Inheritance diagram for humoto::constraints::ContainerAB:
Inheritance graph

Public Member Functions

void copyBodyTo (Eigen::MatrixXd &A, const Location &location) const
 Copy body to the given matrix. More...
 
void copyBoundsTo (Eigen::VectorXd &lb, Eigen::VectorXd &ub, const Location &location) const
 Copy bounds to given vectors. More...
 
void copyNegativeBodyTo (Eigen::MatrixXd &A, const Location &location) const
 Copy body to the given matrix. More...
 
Eigen::MatrixXd & getA ()
 Get matrix A from general constraints: 'A*x = b', 'lb <= A*x <= ub'. More...
 
const Eigen::MatrixXd & getA () const
 Get matrix A from general constraints: 'A*x = b', 'lb <= A*x <= ub'. More...
 
Eigen::VectorXd & getB ()
 Get vector b from equalities: 'A*x = b' or 'x = b'. More...
 
const Eigen::VectorXd & getB () const
 Get vector b from equalities: 'A*x = b' or 'x = b'. More...
 
Location getCopyLocation (const std::size_t number_of_constraints, const std::size_t constraints_offset, const std::size_t number_of_variables) const
 Computes location of the copied constraints in a container and verifies their consistency. More...
 
std::size_t getNumberOfConstraints () const
 Returns number of constraints in the task. More...
 
std::size_t getNumberOfVariables () const
 Returns number of variables in the task. More...
 
double getProduct (const std::size_t i, const Eigen::VectorXd &vector) const
 Compute A(i,:) * vector. More...
 
void log (humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="constraints") const
 Log data. More...
 

Protected Member Functions

void addATA (Eigen::MatrixXd &H) const
 Compute 'A^T * A' for general equality constaints and save or add the result to H. More...
 
void copyEqualityBoundsTo (Eigen::VectorXd &b, const Location &location) const
 Copy b. More...
 
void getATA (Eigen::MatrixXd &H) const
 Compute 'A^T * A' for general equality constaints and save or add the result to H. More...
 
void logBody (humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="constraints") const
 Log body. More...
 
void logBounds (humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="constraints") const
 Log bounds. More...
 
void reset (const std::size_t number_of_constraints=0, const std::size_t number_of_variables=0, const bool initialize_matrices=false)
 Initialize constraints. More...
 
void resetBody (const std::size_t number_of_constraints, const bool initialize_matrices=false)
 Initialize A. More...
 
void resetBounds (const std::size_t number_of_constraints=0, const bool initialize_matrices=false)
 Reset bounds of constraints (b, lb, ub) More...
 
void setNumberOfVariables (const std::size_t number_of_variables)
 Set number of variables. More...
 

Protected Attributes

Eigen::MatrixXd A_
 
Eigen::VectorXd b_
 
std::size_t number_of_variables_
 

Member Function Documentation

◆ addATA()

void humoto::constraints::BodyAMixin< BoundsBMixin< ContainerBase > >::addATA ( Eigen::MatrixXd &  H) const
inlineprotectedinherited

Compute 'A^T * A' for general equality constaints and save or add the result to H.

Parameters
[in,out]Hleft lower triangular part of the result.
Attention
Only the left lower triangular part of H is formed. Apply appropriate conversion with etools::convertLLTtoSymmetric() before using H.

Definition at line 503 of file constraints_mixins.h.

◆ copyBodyTo()

void humoto::constraints::BodyAMixin< BoundsBMixin< ContainerBase > >::copyBodyTo ( Eigen::MatrixXd &  A,
const Location location 
) const
inlineinherited

Copy body to the given matrix.

Parameters
[in]A
[in]locationoffset and length

Definition at line 530 of file constraints_mixins.h.

◆ copyBoundsTo()

void humoto::constraints::BoundsBMixin< ContainerBase >::copyBoundsTo ( Eigen::VectorXd &  lb,
Eigen::VectorXd &  ub,
const Location location 
) const
inlineinherited

Copy bounds to given vectors.

Parameters
[in]lb
[in]ub
[in]locationoffset and length

Definition at line 190 of file constraints_mixins.h.

◆ copyEqualityBoundsTo()

void humoto::constraints::BoundsBMixin< ContainerBase >::copyEqualityBoundsTo ( Eigen::VectorXd &  b,
const Location location 
) const
inlineprotectedinherited

Copy b.

Parameters
[in,out]b
[in]location

Definition at line 163 of file constraints_mixins.h.

◆ copyNegativeBodyTo()

void humoto::constraints::BodyAMixin< BoundsBMixin< ContainerBase > >::copyNegativeBodyTo ( Eigen::MatrixXd &  A,
const Location location 
) const
inlineinherited

Copy body to the given matrix.

Parameters
[in]A
[in]locationoffset and length

Definition at line 540 of file constraints_mixins.h.

◆ getA() [1/2]

Eigen::MatrixXd& humoto::constraints::BodyAMixin< BoundsBMixin< ContainerBase > >::getA ( )
inlineinherited

Get matrix A from general constraints: 'A*x = b', 'lb <= A*x <= ub'.

Returns
matrix A

Definition at line 517 of file constraints_mixins.h.

◆ getA() [2/2]

const Eigen::MatrixXd& humoto::constraints::BodyAMixin< BoundsBMixin< ContainerBase > >::getA ( ) const
inlineinherited

Get matrix A from general constraints: 'A*x = b', 'lb <= A*x <= ub'.

Returns
matrix A

Definition at line 523 of file constraints_mixins.h.

◆ getATA()

void humoto::constraints::BodyAMixin< BoundsBMixin< ContainerBase > >::getATA ( Eigen::MatrixXd &  H) const
inlineprotectedinherited

Compute 'A^T * A' for general equality constaints and save or add the result to H.

Parameters
[in,out]Hleft lower triangular part of the result.
Attention
Only the left lower triangular part of H is formed. Apply appropriate conversion with etools::convertLLTtoSymmetric() before using H.

Definition at line 495 of file constraints_mixins.h.

◆ getB() [1/2]

Eigen::VectorXd& humoto::constraints::BoundsBMixin< ContainerBase >::getB ( )
inlineinherited

Get vector b from equalities: 'A*x = b' or 'x = b'.

Returns
Vector b.

Definition at line 176 of file constraints_mixins.h.

◆ getB() [2/2]

const Eigen::VectorXd& humoto::constraints::BoundsBMixin< ContainerBase >::getB ( ) const
inlineinherited

Get vector b from equalities: 'A*x = b' or 'x = b'.

Returns
Vector b.

Definition at line 183 of file constraints_mixins.h.

◆ getCopyLocation()

Location humoto::constraints::ContainerBase::getCopyLocation ( const std::size_t  number_of_constraints,
const std::size_t  constraints_offset,
const std::size_t  number_of_variables 
) const
inlineinherited

Computes location of the copied constraints in a container and verifies their consistency.

Parameters
[in]number_of_constraintsnumber of added constraints
[in]constraints_offsetoffset in the container
[in]number_of_variablesnumber of variables in the container
Returns
Location

Definition at line 262 of file constraints_base.h.

◆ getNumberOfConstraints()

std::size_t humoto::constraints::BodyAMixin< BoundsBMixin< ContainerBase > >::getNumberOfConstraints ( ) const
inlinevirtualinherited

Returns number of constraints in the task.

Returns
number of constraints

Implements humoto::constraints::ContainerBase.

Definition at line 550 of file constraints_mixins.h.

◆ getNumberOfVariables()

std::size_t humoto::constraints::ContainerBase::getNumberOfVariables ( ) const
inlineinherited

Returns number of variables in the task.

Returns
number of variables

Definition at line 215 of file constraints_base.h.

◆ getProduct()

double humoto::constraints::BodyAMixin< BoundsBMixin< ContainerBase > >::getProduct ( const std::size_t  i,
const Eigen::VectorXd &  vector 
) const
inlineinherited

Compute A(i,:) * vector.

Parameters
[in]irow index
[in]vectorvector
Returns
result of multiplication

Definition at line 564 of file constraints_mixins.h.

◆ log()

void humoto::constraints::ContainerBase::log ( humoto::Logger logger,
const LogEntryName parent = LogEntryName(),
const std::string &  name = "constraints" 
) const
inlineinherited

Log data.

Parameters
[in,out]loggerlogger
[in]parentparent
[in]namename

Definition at line 238 of file constraints_base.h.

◆ logBody()

void humoto::constraints::BodyAMixin< BoundsBMixin< ContainerBase > >::logBody ( humoto::Logger logger,
const LogEntryName parent = LogEntryName(),
const std::string &  name = "constraints" 
) const
inlineprotectedvirtualinherited

Log body.

Parameters
[in,out]loggerlogger
[in]parentparent
[in]namename

Implements humoto::constraints::ContainerBase.

Definition at line 476 of file constraints_mixins.h.

◆ logBounds()

void humoto::constraints::BoundsBMixin< ContainerBase >::logBounds ( humoto::Logger logger,
const LogEntryName parent = LogEntryName(),
const std::string &  name = "constraints" 
) const
inlineprotectedvirtualinherited

Log bounds.

Parameters
[in,out]loggerlogger
[in]parentparent
[in]namename

Implements humoto::constraints::ContainerBase.

Definition at line 149 of file constraints_mixins.h.

◆ reset()

void humoto::constraints::ContainerBase::reset ( const std::size_t  number_of_constraints = 0,
const std::size_t  number_of_variables = 0,
const bool  initialize_matrices = false 
)
inlineprotectedinherited

Initialize constraints.

Parameters
[in]number_of_constraintsnumber of constraints
[in]number_of_variablesnumber of variables
[in]initialize_matricesinitialize matrices using defaults

Definition at line 175 of file constraints_base.h.

◆ resetBody()

void humoto::constraints::BodyAMixin< BoundsBMixin< ContainerBase > >::resetBody ( const std::size_t  number_of_constraints,
const bool  initialize_matrices = false 
)
inlineprotectedvirtualinherited

Initialize A.

Parameters
[in]number_of_constraintsnumber of constraints
[in]initialize_matricesinitialize matrices using defaults

Initialization:

  • A is filled with zeros

Implements humoto::constraints::ContainerBase.

Definition at line 462 of file constraints_mixins.h.

◆ resetBounds()

void humoto::constraints::BoundsBMixin< ContainerBase >::resetBounds ( const std::size_t  number_of_constraints = 0,
const bool  initialize_matrices = false 
)
inlineprotectedvirtualinherited

Reset bounds of constraints (b, lb, ub)

Parameters
[in]number_of_constraintsnumber of constraints
[in]initialize_matricesinitialize matrices using defaults
Note
Initialization: b is filled with zeros

Implements humoto::constraints::ContainerBase.

Definition at line 134 of file constraints_mixins.h.

◆ setNumberOfVariables()

void humoto::constraints::ContainerBase::setNumberOfVariables ( const std::size_t  number_of_variables)
inlineprotectedinherited

Set number of variables.

Parameters
[in]number_of_variablesnumber of variables

Definition at line 142 of file constraints_base.h.

Member Data Documentation

◆ A_

Eigen::MatrixXd humoto::constraints::BodyAMixin< BoundsBMixin< ContainerBase > >::A_
protectedinherited

Definition at line 441 of file constraints_mixins.h.

◆ b_

Eigen::VectorXd humoto::constraints::BoundsBMixin< ContainerBase >::b_
protectedinherited

Definition at line 118 of file constraints_mixins.h.

◆ number_of_variables_

std::size_t humoto::constraints::ContainerBase::number_of_variables_
protectedinherited

Definition at line 120 of file constraints_base.h.


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