humoto
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
humoto::constraints::BodyAMixin< t_Base > Class Template Reference

Detailed Description

template<class t_Base>
class humoto::constraints::BodyAMixin< t_Base >

Mixin representing matrix 'A' in a general constraint.

Template Parameters
t_BaseBase class: humoto::constraints::ConstraintsBase or humoto::TaskBase wrapped with other mixins.

Definition at line 438 of file constraints_mixins.h.

#include <constraints_mixins.h>

Inheritance diagram for humoto::constraints::BodyAMixin< t_Base >:
Inheritance graph

Public Member Functions

void copyBodyTo (Eigen::MatrixXd &A, const Location &location) const
 Copy body to the given matrix. 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...
 
std::size_t getNumberOfConstraints () const
 Returns number of constraints in the task. More...
 
double getProduct (const std::size_t i, const Eigen::VectorXd &vector) const
 Compute A(i,:) * vector. More...
 

Protected Member Functions

 BodyAMixin ()
 
 ~BodyAMixin ()
 Protected destructor: prevent destruction of the child classes through a base pointer. More...
 
void addATA (Eigen::MatrixXd &H) const
 Compute 'A^T * A' for general equality constaints and save or add the result to H. 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 resetBody (const std::size_t number_of_constraints, const bool initialize_matrices=false)
 Initialize A. More...
 

Protected Attributes

Eigen::MatrixXd A_
 

Constructor & Destructor Documentation

◆ ~BodyAMixin()

template<class t_Base>
humoto::constraints::BodyAMixin< t_Base >::~BodyAMixin ( )
inlineprotected

Protected destructor: prevent destruction of the child classes through a base pointer.

Definition at line 449 of file constraints_mixins.h.

◆ BodyAMixin()

template<class t_Base>
humoto::constraints::BodyAMixin< t_Base >::BodyAMixin ( )
inlineprotected

Definition at line 450 of file constraints_mixins.h.

Member Function Documentation

◆ addATA()

template<class t_Base>
void humoto::constraints::BodyAMixin< t_Base >::addATA ( Eigen::MatrixXd &  H) const
inlineprotected

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()

template<class t_Base>
void humoto::constraints::BodyAMixin< t_Base >::copyBodyTo ( Eigen::MatrixXd &  A,
const Location location 
) const
inline

Copy body to the given matrix.

Parameters
[in]A
[in]locationoffset and length

Definition at line 530 of file constraints_mixins.h.

◆ copyNegativeBodyTo()

template<class t_Base>
void humoto::constraints::BodyAMixin< t_Base >::copyNegativeBodyTo ( Eigen::MatrixXd &  A,
const Location location 
) const
inline

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]

template<class t_Base>
Eigen::MatrixXd& humoto::constraints::BodyAMixin< t_Base >::getA ( )
inline

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]

template<class t_Base>
const Eigen::MatrixXd& humoto::constraints::BodyAMixin< t_Base >::getA ( ) const
inline

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()

template<class t_Base>
void humoto::constraints::BodyAMixin< t_Base >::getATA ( Eigen::MatrixXd &  H) const
inlineprotected

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.

◆ getNumberOfConstraints()

template<class t_Base>
std::size_t humoto::constraints::BodyAMixin< t_Base >::getNumberOfConstraints ( ) const
inline

Returns number of constraints in the task.

Returns
number of constraints

Definition at line 550 of file constraints_mixins.h.

◆ getProduct()

template<class t_Base>
double humoto::constraints::BodyAMixin< t_Base >::getProduct ( const std::size_t  i,
const Eigen::VectorXd &  vector 
) const
inline

Compute A(i,:) * vector.

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

Definition at line 564 of file constraints_mixins.h.

◆ logBody()

template<class t_Base>
void humoto::constraints::BodyAMixin< t_Base >::logBody ( humoto::Logger logger,
const LogEntryName parent = LogEntryName(),
const std::string &  name = "constraints" 
) const
inlineprotected

Log body.

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

Definition at line 476 of file constraints_mixins.h.

◆ resetBody()

template<class t_Base>
void humoto::constraints::BodyAMixin< t_Base >::resetBody ( const std::size_t  number_of_constraints,
const bool  initialize_matrices = false 
)
inlineprotected

Initialize A.

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

Initialization:

  • A is filled with zeros

Definition at line 462 of file constraints_mixins.h.

Member Data Documentation

◆ A_

template<class t_Base>
Eigen::MatrixXd humoto::constraints::BodyAMixin< t_Base >::A_
protected

Definition at line 441 of file constraints_mixins.h.


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