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

Detailed Description

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

Mixin representing matrix of indices 'I' and matrix of gains 'G' in a simple constraint.

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

Definition at line 890 of file constraints_mixins.h.

#include <constraints_mixins.h>

Inheritance diagram for humoto::constraints::BodyGIMixin< 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::VectorXd & getIGains ()
 Get gains for each element in simple objective. More...
 
const Eigen::VectorXd & getIGains () const
 Get gains for each element in simple objective. More...
 
humoto::IndexVectorgetIndices ()
 Get indices. More...
 
const humoto::IndexVectorgetIndices () const
 Get indices. 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

 BodyGIMixin ()
 
 ~BodyGIMixin ()
 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=0, const bool initialize_matrices=false)
 Initialize I and gains. More...
 

Protected Attributes

humoto::IndexVector I_
 
Eigen::VectorXd I_gains_
 

Constructor & Destructor Documentation

◆ ~BodyGIMixin()

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

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

Definition at line 902 of file constraints_mixins.h.

◆ BodyGIMixin()

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

Definition at line 903 of file constraints_mixins.h.

Member Function Documentation

◆ addATA()

template<class t_Base>
void humoto::constraints::BodyGIMixin< 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 945 of file constraints_mixins.h.

◆ copyBodyTo()

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

Copy body to the given matrix.

Parameters
[in]A
[in]locationoffset and length

Reimplemented from humoto::constraints::BodyIMixin< t_Base >.

Definition at line 976 of file constraints_mixins.h.

◆ copyNegativeBodyTo()

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

Copy body to the given matrix.

Parameters
[in]A
[in]locationoffset and length

Reimplemented from humoto::constraints::BodyIMixin< t_Base >.

Definition at line 993 of file constraints_mixins.h.

◆ getATA()

template<class t_Base>
void humoto::constraints::BodyGIMixin< 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 935 of file constraints_mixins.h.

◆ getIGains() [1/2]

template<class t_Base>
Eigen::VectorXd& humoto::constraints::BodyGIMixin< t_Base >::getIGains ( )
inline

Get gains for each element in simple objective.

Returns
gains

Definition at line 963 of file constraints_mixins.h.

◆ getIGains() [2/2]

template<class t_Base>
const Eigen::VectorXd& humoto::constraints::BodyGIMixin< t_Base >::getIGains ( ) const
inline

Get gains for each element in simple objective.

Returns
gains

Definition at line 969 of file constraints_mixins.h.

◆ getIndices() [1/2]

template<class t_Base>
humoto::IndexVector& humoto::constraints::BodyIMixin< t_Base >::getIndices ( )
inlineinherited

Get indices.

Returns
indices

Definition at line 852 of file constraints_mixins.h.

◆ getIndices() [2/2]

template<class t_Base>
const humoto::IndexVector& humoto::constraints::BodyIMixin< t_Base >::getIndices ( ) const
inlineinherited

Get indices.

Returns
indices

Definition at line 859 of file constraints_mixins.h.

◆ getNumberOfConstraints()

template<class t_Base>
std::size_t humoto::constraints::BodyIMixin< t_Base >::getNumberOfConstraints ( ) const
inlineinherited

Returns number of constraints in the task.

Returns
number of constraints

Definition at line 866 of file constraints_mixins.h.

◆ getProduct()

template<class t_Base>
double humoto::constraints::BodyGIMixin< 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 1010 of file constraints_mixins.h.

◆ logBody()

template<class t_Base>
void humoto::constraints::BodyGIMixin< 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 922 of file constraints_mixins.h.

◆ resetBody()

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

Initialize I and gains.

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

Reimplemented from humoto::constraints::BodyIMixin< t_Base >.

Definition at line 912 of file constraints_mixins.h.

Member Data Documentation

◆ I_

template<class t_Base>
humoto::IndexVector humoto::constraints::BodyIMixin< t_Base >::I_
protectedinherited

Definition at line 746 of file constraints_mixins.h.

◆ I_gains_

template<class t_Base>
Eigen::VectorXd humoto::constraints::BodyGIMixin< t_Base >::I_gains_
protected

Definition at line 894 of file constraints_mixins.h.


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