Public Types | Public Member Functions | Protected Attributes | List of all members
corbo::Edge<> Class Referenceabstract

#include <edge.h>

Inheritance diagram for corbo::Edge<>:
Inheritance graph
[legend]

Public Types

using ConstPtr = std::shared_ptr< const Edge >
 
using Ptr = std::shared_ptr< Edge >
 
using UPtr = std::unique_ptr< Edge >
 
using VertexContainer = std::vector< VertexInterface * >
 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=0
 Compute function values. More...
 
 Edge ()=delete
 
 Edge (int num_vertices)
 
int getDimension () const override=0
 Get dimension of the edge (dimension of the cost-function/constraint value vector) 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 isLinear () const override=0
 Return true if the edge is linear (and hence its Hessian is always zero) More...
 
bool providesJacobian () const override
 Return true if a custom Jacobian is provided (e.g. computeJacobian() is overwritten) More...
 
void resizeVertexContainer (int n)
 Set number n of vertices attached to this edge. More...
 
void setVertex (int idx, VertexInterface &vertex)
 
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...
 
virtual bool isLeastSquaresForm () const
 Defines if the edge is formulated as Least-Squares form. 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
 
int getEdgeIdx () const
 Retrieve current edge index (warning, this value is determined within the related HyperGraph) More...
 
- Public Member Functions inherited from corbo::EdgeInterface
virtual double computeSquaredNormOfValues ()
 
virtual double computeSumOfValues ()
 
int getNumFiniteVerticesLowerBounds () const
 
int getNumFiniteVerticesUpperBounds () const
 
virtual ~EdgeInterface ()
 Virtual destructor. More...
 

Protected Attributes

VertexContainer _vertices
 Vertex container. More...
 
- Protected Attributes inherited from corbo::BaseEdge
int _edge_idx = 0
 
EdgeCache _cache
 

Detailed Description

Definition at line 243 of file edge.h.

Member Typedef Documentation

◆ ConstPtr

using corbo::Edge<>::ConstPtr = std::shared_ptr<const Edge>

Definition at line 247 of file edge.h.

◆ Ptr

using corbo::Edge<>::Ptr = std::shared_ptr<Edge>

Definition at line 246 of file edge.h.

◆ UPtr

using corbo::Edge<>::UPtr = std::unique_ptr<Edge>

Definition at line 248 of file edge.h.

◆ VertexContainer

using corbo::Edge<>::VertexContainer = std::vector<VertexInterface*>

Typedef to represent the vertex container.

Definition at line 251 of file edge.h.

Constructor & Destructor Documentation

◆ Edge() [1/2]

corbo::Edge<>::Edge ( )
delete

◆ Edge() [2/2]

corbo::Edge<>::Edge ( int  num_vertices)
inlineexplicit

Definition at line 256 of file edge.h.

Member Function Documentation

◆ computeValues()

void corbo::Edge<>::computeValues ( Eigen::Ref< Eigen::VectorXd >  values)
overridepure virtual

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::BaseEdge.

Implemented in corbo::UncompressedCollocationEdge, corbo::MSDynamicsOnlyMultiControlsMultiDtsEdge, corbo::MSDynamicsOnlyMultiControlsEdge, corbo::CompressedCollocationMultipleControlsEdge, and corbo::QuadratureCollocationDynamicsOnly.

◆ getDimension()

int corbo::Edge<>::getDimension ( ) const
overridepure virtual

◆ getNumVertices()

int corbo::Edge<>::getNumVertices ( ) const
inlineoverridevirtual

Return number of attached vertices.

Implements corbo::EdgeInterface.

Definition at line 270 of file edge.h.

◆ getVertex()

const VertexInterface* corbo::Edge<>::getVertex ( int  idx) const
inlineoverridevirtual

Implements corbo::EdgeInterface.

Definition at line 296 of file edge.h.

◆ getVertexRaw()

VertexInterface* corbo::Edge<>::getVertexRaw ( int  idx)
inlineoverridevirtual

Get access to vertex with index idx (0 <= idx < numVertices)

Implements corbo::EdgeInterface.

Definition at line 289 of file edge.h.

◆ isLinear()

bool corbo::Edge<>::isLinear ( ) const
overridepure virtual

◆ providesJacobian()

bool corbo::Edge<>::providesJacobian ( ) const
inlineoverridevirtual

Return true if a custom Jacobian is provided (e.g. computeJacobian() is overwritten)

Reimplemented from corbo::BaseEdge.

Definition at line 283 of file edge.h.

◆ resizeVertexContainer()

void corbo::Edge<>::resizeVertexContainer ( int  n)
inline

Set number n of vertices attached to this edge.

Definition at line 259 of file edge.h.

◆ setVertex()

void corbo::Edge<>::setVertex ( int  idx,
VertexInterface vertex 
)
inline

Definition at line 261 of file edge.h.

◆ verticesDimension()

int corbo::Edge<>::verticesDimension ( ) const
inlineoverridevirtual

Return the combined dimension of all attached vertices (excluding fixed vertex components)

Implements corbo::EdgeInterface.

Definition at line 273 of file edge.h.

Member Data Documentation

◆ _vertices

VertexContainer corbo::Edge<>::_vertices
protected

Vertex container.

Definition at line 303 of file edge.h.


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


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:07:20