Public Types | Public Member Functions | Private Attributes | List of all members
corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge Class Reference

#include <trapezoidal_collocation_edges.h>

Inheritance diagram for corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge:
Inheritance graph
[legend]

Public Types

using Ptr = std::shared_ptr< TrapezoidalCollocationIntegralEqualityDynamicsEdge >
 
using UPtr = std::unique_ptr< TrapezoidalCollocationIntegralEqualityDynamicsEdge >
 
- Public Types inherited from corbo::Edge< VectorVertex, VectorVertex, VectorVertex, VectorVertex, ScalarVertex >
using ConstPtr = std::shared_ptr< const Edge >
 
using Ptr = std::shared_ptr< Edge >
 
using UPtr = std::unique_ptr< Edge >
 
using VertexContainer = std::array< VertexInterface *, numVerticesCompileTime >
 Typedef to represent the vertex container. More...
 
- Public Types inherited from corbo::BaseEdge
using Ptr = std::shared_ptr< BaseEdge >
 
using UPtr = std::unique_ptr< BaseEdge >
 
- Public Types inherited from corbo::EdgeInterface
using Ptr = std::shared_ptr< EdgeInterface >
 
using UPtr = std::unique_ptr< EdgeInterface >
 

Public Member Functions

void computeValues (Eigen::Ref< Eigen::VectorXd > values) override
 Compute function values. More...
 
int getDimension () const override
 Get dimension of the edge (dimension of the cost-function/constraint value vector) More...
 
bool isLeastSquaresForm () const override
 Defines if the edge is formulated as Least-Squares form. More...
 
bool isLinear () const override
 Return true if the edge is linear (and hence its Hessian is always zero) More...
 
 TrapezoidalCollocationIntegralEqualityDynamicsEdge (SystemDynamicsInterface::Ptr dynamics, VectorVertex &x1, VectorVertex &u1, VectorVertex &u2, VectorVertex &x2, ScalarVertex &dt, StageEqualityConstraint::Ptr stage_eq, int k)
 
virtual ~TrapezoidalCollocationIntegralEqualityDynamicsEdge ()=default
 
- Public Member Functions inherited from corbo::Edge< VectorVertex, VectorVertex, VectorVertex, VectorVertex, ScalarVertex >
 Edge ()=delete
 
 Edge (VerticesT &... args)
 Construct edge by providing connected vertices. More...
 
int getNumVertices () const override
 Return number of attached vertices. More...
 
const VertexInterfacegetVertex (int idx) const override
 
VertexInterfacegetVertexRaw (int idx) override
 Get access to vertex with index idx (0 <= idx < numVertices) More...
 
bool providesJacobian () const override
 Return true if a custom Jacobian is provided (e.g. computeJacobian() is overwritten) More...
 
int verticesDimension () const override
 Return the combined dimension of all attached vertices (excluding fixed vertex components) More...
 
- Public Member Functions inherited from corbo::BaseEdge
virtual void computeHessian (int vtx_idx_i, int vtx_idx_j, const Eigen::Ref< const Eigen::MatrixXd > &block_jacobian_i, Eigen::Ref< Eigen::MatrixXd > block_hessian_ij, const double *multipliers=nullptr, double weight=1.0)
 
virtual void computeHessianInc (int vtx_idx_i, int vtx_idx_j, const Eigen::Ref< const Eigen::MatrixXd > &block_jacobian_i, Eigen::Ref< Eigen::MatrixXd > block_hessian_ij, const double *multipliers=nullptr, double weight=1.0)
 Compute edge block Hessian for a given vertex pair. More...
 
virtual void computeHessianInc (int vtx_idx_i, int vtx_idx_j, Eigen::Ref< Eigen::MatrixXd > block_hessian_ij, const double *multipliers=nullptr, double weight=1.0)
 
virtual void computeJacobian (int vtx_idx, Eigen::Ref< Eigen::MatrixXd > block_jacobian, const double *multipliers=nullptr)
 Compute edge block jacobian for a given vertex. More...
 
int getEdgeIdx () const
 Retrieve current edge index (warning, this value is determined within the related HyperGraph) More...
 
virtual bool providesHessian () const
 Return true if a custom Hessian is provided (e.g. computeHessian() is overwritten) More...
 
void reserveCacheMemory (int num_value_vectors, int num_jacobians)
 
void reserveValuesCacheMemory (int num_value_vectors)
 
void reserveJacobiansCacheMemory (int num_jacobians)
 
void computeValuesCached ()
 Call computeValues() and store result to previously allocated internal cache (call allocateInteralValuesCache() first once) More...
 
void computeSquaredNormOfValuesCached ()
 compute the specialied squared-norm method for computing the values (note only the first element in the values cache is used) More...
 
EdgeCachegetCache ()
 Retreive values computed previously via computeValuesCached() More...
 
const EdgeCachegetCache () const
 
- Public Member Functions inherited from corbo::EdgeInterface
virtual double computeSquaredNormOfValues ()
 
virtual double computeSumOfValues ()
 
int getNumFiniteVerticesLowerBounds () const
 
int getNumFiniteVerticesUpperBounds () const
 
virtual ~EdgeInterface ()
 Virtual destructor. More...
 

Private Attributes

int _dim_dyn = 0
 
int _dim_eq = 0
 
int _dim_int_eq = 0
 
SystemDynamicsInterface::Ptr _dynamics
 
Eigen::VectorXd _eq1
 
Eigen::VectorXd _eq2
 
Eigen::VectorXd _f1
 
Eigen::VectorXd _f2
 
int _k = 0
 
StageEqualityConstraint::Ptr _stage_eq
 

Additional Inherited Members

- Static Public Attributes inherited from corbo::Edge< VectorVertex, VectorVertex, VectorVertex, VectorVertex, ScalarVertex >
static constexpr const int numVerticesCompileTime
 Return number of vertices at compile-time. More...
 
- Protected Attributes inherited from corbo::Edge< VectorVertex, VectorVertex, VectorVertex, VectorVertex, ScalarVertex >
const VertexContainer _vertices
 Vertex container. More...
 
- Protected Attributes inherited from corbo::BaseEdge
EdgeCache _cache
 
int _edge_idx = 0
 

Detailed Description

Definition at line 148 of file trapezoidal_collocation_edges.h.

Member Typedef Documentation

◆ Ptr

Definition at line 151 of file trapezoidal_collocation_edges.h.

◆ UPtr

Definition at line 152 of file trapezoidal_collocation_edges.h.

Constructor & Destructor Documentation

◆ TrapezoidalCollocationIntegralEqualityDynamicsEdge()

corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::TrapezoidalCollocationIntegralEqualityDynamicsEdge ( SystemDynamicsInterface::Ptr  dynamics,
VectorVertex x1,
VectorVertex u1,
VectorVertex u2,
VectorVertex x2,
ScalarVertex dt,
StageEqualityConstraint::Ptr  stage_eq,
int  k 
)
inlineexplicit

Definition at line 154 of file trapezoidal_collocation_edges.h.

◆ ~TrapezoidalCollocationIntegralEqualityDynamicsEdge()

virtual corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::~TrapezoidalCollocationIntegralEqualityDynamicsEdge ( )
virtualdefault

Member Function Documentation

◆ computeValues()

void corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::computeValues ( Eigen::Ref< Eigen::VectorXd >  values)
inlineoverridevirtual

Compute function values.

Here, the actual cost/constraint function values are computed:

  • objective in non-least-squares form: e(x) (hereby, the actual cost is f(x) = e(x)^T e(x))
  • objective in least-squares form: f(x)
  • equality constraints: ceq(x) (in case constraints are satisfied: ceq(x) = 0)
  • inequality constraints: c(x) (in case constraints are satisfied: c(x) < 0)
    Parameters
    [in]valuesvalues should be stored here according to getDimension().

Implements corbo::Edge< VectorVertex, VectorVertex, VectorVertex, VectorVertex, ScalarVertex >.

Definition at line 184 of file trapezoidal_collocation_edges.h.

◆ getDimension()

int corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::getDimension ( ) const
inlineoverridevirtual

Get dimension of the edge (dimension of the cost-function/constraint value vector)

Implements corbo::Edge< VectorVertex, VectorVertex, VectorVertex, VectorVertex, ScalarVertex >.

Definition at line 176 of file trapezoidal_collocation_edges.h.

◆ isLeastSquaresForm()

bool corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::isLeastSquaresForm ( ) const
inlineoverridevirtual

Defines if the edge is formulated as Least-Squares form.

Least-squares cost terms are defined as $ f(x) = e(x)^T e(x) $ and the function values and Jacobian are computed for $ e(x) $ rather than for $ f(x) $. Specialiezed least-squares solvers require the optimization problem to be defined in this particular form. Other solvers can automatically compute the square of least-squares edges if required. However, the other way round is more restrictive: general solvers might not cope with non-least-squares forms.

Note, in the LS-form case computeValues() computes e(x) and otherwise f(x).

Returns
true if the edge is given in LS-form

Reimplemented from corbo::BaseEdge.

Definition at line 182 of file trapezoidal_collocation_edges.h.

◆ isLinear()

bool corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::isLinear ( ) const
inlineoverridevirtual

Return true if the edge is linear (and hence its Hessian is always zero)

Implements corbo::Edge< VectorVertex, VectorVertex, VectorVertex, VectorVertex, ScalarVertex >.

Definition at line 179 of file trapezoidal_collocation_edges.h.

Member Data Documentation

◆ _dim_dyn

int corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::_dim_dyn = 0
private

Definition at line 212 of file trapezoidal_collocation_edges.h.

◆ _dim_eq

int corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::_dim_eq = 0
private

Definition at line 210 of file trapezoidal_collocation_edges.h.

◆ _dim_int_eq

int corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::_dim_int_eq = 0
private

Definition at line 211 of file trapezoidal_collocation_edges.h.

◆ _dynamics

SystemDynamicsInterface::Ptr corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::_dynamics
private

Definition at line 206 of file trapezoidal_collocation_edges.h.

◆ _eq1

Eigen::VectorXd corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::_eq1
private

Definition at line 214 of file trapezoidal_collocation_edges.h.

◆ _eq2

Eigen::VectorXd corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::_eq2
private

Definition at line 215 of file trapezoidal_collocation_edges.h.

◆ _f1

Eigen::VectorXd corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::_f1
private

Definition at line 219 of file trapezoidal_collocation_edges.h.

◆ _f2

Eigen::VectorXd corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::_f2
private

Definition at line 220 of file trapezoidal_collocation_edges.h.

◆ _k

int corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::_k = 0
private

Definition at line 217 of file trapezoidal_collocation_edges.h.

◆ _stage_eq

StageEqualityConstraint::Ptr corbo::TrapezoidalCollocationIntegralEqualityDynamicsEdge::_stage_eq
private

Definition at line 208 of file trapezoidal_collocation_edges.h.


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


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Mon Feb 28 2022 22:08:03