Public Types | Public Member Functions | Protected Attributes | List of all members
corbo::VectorVertex Class Reference

Vertex implementation that stores an Eigen::VectorXd (dynamic dimension) More...

#include <vector_vertex.h>

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

Public Types

using Ptr = std::shared_ptr< VectorVertex >
 
using UPtr = std::unique_ptr< VectorVertex >
 
- Public Types inherited from corbo::VertexInterface
using Ptr = std::shared_ptr< VertexInterface >
 
using UPtr = std::unique_ptr< VertexInterface >
 

Public Member Functions

void clear () override
 Clear complete backup container. More...
 
void discardTop () override
 Delete the previously made backup from the stack without restoring it. More...
 
const double * getData () const override
 Get read-only raw access to the values of the vertex. More...
 
double * getDataRaw () override
 Get write access to the values of the vertex. More...
 
int getDimension () const override
 Return number of elements/values/components stored in this vertex. More...
 
int getDimensionUnfixed () const override
 Return number of unfixed elements (unfixed elements are skipped as parameters in the Hessian and Jacobian. More...
 
const double * getLowerBounds () const override
 Read-only raw access to lower bounds [getDimension() x 1]. More...
 
int getNumBackups () const override
 Return the current size/number of backups of the backup stack. More...
 
int getNumberFiniteBounds (bool unfixed_only) const override
 Get number of finite upper bounds (either upper or lower must be finite) More...
 
int getNumberFiniteLowerBounds (bool unfixed_only) const override
 Get number of finite lower bounds. More...
 
int getNumberFiniteUpperBounds (bool unfixed_only) const override
 Get number of finite upper bounds. More...
 
const double * getUpperBounds () const override
 Read-only raw access to upper bounds [getDimension() x 1]. More...
 
bool hasFiniteBounds () const override
 Check if finite bounds (lower or upper) are provided. More...
 
bool hasFiniteLowerBound (int idx) const override
 Check if finite lower bound for a single component is provided. More...
 
bool hasFiniteLowerBounds () const override
 Check if finite lower bounds are provided. More...
 
bool hasFiniteUpperBound (int idx) const override
 Check if finite upper bound for a single component is provided. More...
 
bool hasFiniteUpperBounds () const override
 Check if finite upper bounds are provided. More...
 
bool hasFixedComponents () const override
 Check if the vertex has fixed components. More...
 
bool isFixedComponent (int) const override
 Check if individual components are fixed or unfixed. More...
 
const Eigen::VectorXd & lowerBound () const
 Read-access to the underlying lower bound vector. More...
 
void plus (int idx, double inc) override
 Add value to a specific component of the vertex: x[idx] += inc. More...
 
void plus (const double *inc) override
 Define the increment for the vertex: x += inc with dim(inc)=getDimension(). More...
 
void plusUnfixed (const double *inc) override
 Define the increment for the unfixed components of the vertex: x += inc with dim(inc)=getDimensionUnfixed(). More...
 
void pop () override
 Restore the previously stored values of the backup stack and remove them from the stack. More...
 
void push () override
 Store all values into a internal backup stack. More...
 
virtual void set (const Eigen::Ref< const Eigen::VectorXd > &values, const Eigen::Ref< const Eigen::VectorXd > &lb, const Eigen::Ref< const Eigen::VectorXd > &ub, bool fixed=false)
 Set values and bounds at once. More...
 
void setData (int idx, double data) override
 Write data to to a specific component. More...
 
virtual void setDimension (int dim)
 Change the dimension of the vertex (lower and upper bounds needs to be redefined) More...
 
virtual void setFixed (bool fixed)
 Set complete vertex to fixed (and hence skip during optimization) More...
 
void setLowerBound (int idx, double lb) override
 Define lower bound on a single component of the vertex (0 <= idx < getDimension()) More...
 
void setLowerBounds (const Eigen::Ref< const Eigen::VectorXd > &lb) override
 Define lower bounds on the vertex values [getDimension() x 1]. More...
 
void setUpperBound (int idx, double ub) override
 Define upper bound on a single component of the vertex (0 <= idx < getDimension()) More...
 
void setUpperBounds (const Eigen::Ref< const Eigen::VectorXd > &ub) override
 Define upper bounds on the vertex values [getDimension() x 1]. More...
 
void top () override
 Restore the previously stored values of the backup stack WITHOUT removing them from the stack. More...
 
const Eigen::VectorXd & upperBound () const
 Read-access to the underlying upper bound vector. More...
 
const Eigen::VectorXd & values () const
 Read-access to the underlying value vector. More...
 
Eigen::VectorXd & values ()
 Write-access to the underlying value vector. More...
 
 VectorVertex ()=default
 Default constructor. More...
 
 VectorVertex (bool fixed)
 
 VectorVertex (int dimension, bool fixed=false)
 Construct and allocate memory for a given dimension. More...
 
 VectorVertex (const Eigen::Ref< const Eigen::VectorXd > &values, bool fixed=false)
 Construct vertex with given values. More...
 
 VectorVertex (const Eigen::Ref< const Eigen::VectorXd > &values, const Eigen::Ref< const Eigen::VectorXd > &lb, const Eigen::Ref< const Eigen::VectorXd > &ub, bool fixed=false)
 Construct vertex with given values, lower and upper bounds. More...
 
- Public Member Functions inherited from corbo::VertexInterface
virtual void clearBackups ()
 
void clearConnectedEdges ()
 Clear all connected edges. More...
 
const std::set< BaseEdge * > & getConnectedEqualityEdgesRef () const
 Raw access for connected equality constraint edges. More...
 
const std::set< BaseEdge * > & getConnectedInequalityEdgesRef () const
 Raw access for connected inequality constraint edges. More...
 
const std::set< BaseEdge * > & getConnectedLsqObjectiveEdgesRef () const
 Raw access for connected least-squares objective edges. More...
 
const std::set< BaseMixedEdge * > & getConnectedMixedEdgesRef () const
 Raw access for connected mixed edges. More...
 
const std::set< BaseEdge * > & getConnectedObjectiveEdgesRef () const
 Raw access for connected objective edges. More...
 
Eigen::Map< const Eigen::VectorXd > getDataMap () const
 Get a read-only Eigen::Map to the values of the vertex. More...
 
Eigen::Map< Eigen::VectorXd > getDataRawMap ()
 Get a Eigen::Map to the values of the vertex. More...
 
Eigen::Map< const Eigen::VectorXd > getLowerBoundsMap () const
 Read-only Eigen::Map for lower bounds [getDimension() x 1]. More...
 
Eigen::Map< const Eigen::VectorXd > getUpperBoundsMap () const
 Read-only Eigen::Map for upper bounds [getDimension() x 1]. More...
 
int getVertexIdx () const
 Retrieve current edge index (warning, this value is determined within the related VertexSetInterface implementation) More...
 
virtual bool isFixed () const
 Check if all components are fixed. More...
 
void registerEqualityEdge (BaseEdge *edge)
 Register an adjacent equality constraint edge. More...
 
void registerInequalityEdge (BaseEdge *edge)
 Register an adjacent inequality constraint edge. More...
 
void registerLsqObjectiveEdge (BaseEdge *edge)
 Register an adjacent least-squares objective edge. More...
 
void registerMixedEdge (BaseMixedEdge *edge)
 Register an adjacent mixed edge. More...
 
void registerObjectiveEdge (BaseEdge *edge)
 Register an adjacent objective edge. More...
 
virtual ~VertexInterface ()
 Virtual destructor. More...
 

Protected Attributes

std::vector< Eigen::VectorXd > _backup
 
bool _finite_lb_bounds = false
 
bool _finite_ub_bounds = false
 
bool _fixed = false
 
Eigen::VectorXd _lb
 
Eigen::VectorXd _ub
 
Eigen::VectorXd _values
 

Detailed Description

Vertex implementation that stores an Eigen::VectorXd (dynamic dimension)

The vertex can be either completely fixed or unfixed. In order to partially fix components of the underlying vector refer to class PartiallyFixedVectorVertex.

See also
VertexInterface PartiallyFixedVectorVertex HyperGraph EdgeInterface ScalarVertex
Author
Christoph Rösmann (chris.nosp@m.toph.nosp@m..roes.nosp@m.mann.nosp@m.@tu-d.nosp@m.ortm.nosp@m.und.d.nosp@m.e)

Definition at line 51 of file vector_vertex.h.

Member Typedef Documentation

◆ Ptr

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

Definition at line 54 of file vector_vertex.h.

◆ UPtr

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

Definition at line 55 of file vector_vertex.h.

Constructor & Destructor Documentation

◆ VectorVertex() [1/5]

corbo::VectorVertex::VectorVertex ( )
default

Default constructor.

◆ VectorVertex() [2/5]

corbo::VectorVertex::VectorVertex ( bool  fixed)
inlineexplicit

Definition at line 60 of file vector_vertex.h.

◆ VectorVertex() [3/5]

corbo::VectorVertex::VectorVertex ( int  dimension,
bool  fixed = false 
)
inlineexplicit

Construct and allocate memory for a given dimension.

Definition at line 63 of file vector_vertex.h.

◆ VectorVertex() [4/5]

corbo::VectorVertex::VectorVertex ( const Eigen::Ref< const Eigen::VectorXd > &  values,
bool  fixed = false 
)
inlineexplicit

Construct vertex with given values.

Definition at line 74 of file vector_vertex.h.

◆ VectorVertex() [5/5]

corbo::VectorVertex::VectorVertex ( const Eigen::Ref< const Eigen::VectorXd > &  values,
const Eigen::Ref< const Eigen::VectorXd > &  lb,
const Eigen::Ref< const Eigen::VectorXd > &  ub,
bool  fixed = false 
)
inlineexplicit

Construct vertex with given values, lower and upper bounds.

Definition at line 85 of file vector_vertex.h.

Member Function Documentation

◆ clear()

void corbo::VectorVertex::clear ( )
inlineoverridevirtual

Clear complete backup container.

Implements corbo::VertexInterface.

Definition at line 235 of file vector_vertex.h.

◆ discardTop()

void corbo::VectorVertex::discardTop ( )
inlineoverridevirtual

Delete the previously made backup from the stack without restoring it.

Implements corbo::VertexInterface.

Definition at line 233 of file vector_vertex.h.

◆ getData()

const double* corbo::VectorVertex::getData ( ) const
inlineoverridevirtual

Get read-only raw access to the values of the vertex.

Implements corbo::VertexInterface.

Definition at line 117 of file vector_vertex.h.

◆ getDataRaw()

double* corbo::VectorVertex::getDataRaw ( )
inlineoverridevirtual

Get write access to the values of the vertex.

Implements corbo::VertexInterface.

Definition at line 120 of file vector_vertex.h.

◆ getDimension()

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

Return number of elements/values/components stored in this vertex.

Implements corbo::VertexInterface.

Definition at line 96 of file vector_vertex.h.

◆ getDimensionUnfixed()

int corbo::VectorVertex::getDimensionUnfixed ( ) const
inlineoverridevirtual

Return number of unfixed elements (unfixed elements are skipped as parameters in the Hessian and Jacobian.

Implements corbo::VertexInterface.

Reimplemented in corbo::PartiallyFixedVectorVertex.

Definition at line 98 of file vector_vertex.h.

◆ getLowerBounds()

const double* corbo::VectorVertex::getLowerBounds ( ) const
inlineoverridevirtual

Read-only raw access to lower bounds [getDimension() x 1].

Implements corbo::VertexInterface.

Definition at line 213 of file vector_vertex.h.

◆ getNumBackups()

int corbo::VectorVertex::getNumBackups ( ) const
inlineoverridevirtual

Return the current size/number of backups of the backup stack.

Implements corbo::VertexInterface.

Definition at line 237 of file vector_vertex.h.

◆ getNumberFiniteBounds()

int corbo::VectorVertex::getNumberFiniteBounds ( bool  unfixed_only) const
inlineoverridevirtual

Get number of finite upper bounds (either upper or lower must be finite)

Implements corbo::VertexInterface.

Reimplemented in corbo::PartiallyFixedVectorVertex.

Definition at line 201 of file vector_vertex.h.

◆ getNumberFiniteLowerBounds()

int corbo::VectorVertex::getNumberFiniteLowerBounds ( bool  unfixed_only) const
inlineoverridevirtual

Get number of finite lower bounds.

Implements corbo::VertexInterface.

Reimplemented in corbo::PartiallyFixedVectorVertex.

Definition at line 186 of file vector_vertex.h.

◆ getNumberFiniteUpperBounds()

int corbo::VectorVertex::getNumberFiniteUpperBounds ( bool  unfixed_only) const
inlineoverridevirtual

Get number of finite upper bounds.

Implements corbo::VertexInterface.

Reimplemented in corbo::PartiallyFixedVectorVertex.

Definition at line 194 of file vector_vertex.h.

◆ getUpperBounds()

const double* corbo::VectorVertex::getUpperBounds ( ) const
inlineoverridevirtual

Read-only raw access to upper bounds [getDimension() x 1].

Implements corbo::VertexInterface.

Definition at line 215 of file vector_vertex.h.

◆ hasFiniteBounds()

bool corbo::VectorVertex::hasFiniteBounds ( ) const
inlineoverridevirtual

Check if finite bounds (lower or upper) are provided.

Implements corbo::VertexInterface.

Definition at line 168 of file vector_vertex.h.

◆ hasFiniteLowerBound()

bool corbo::VectorVertex::hasFiniteLowerBound ( int  idx) const
inlineoverridevirtual

Check if finite lower bound for a single component is provided.

Implements corbo::VertexInterface.

Definition at line 174 of file vector_vertex.h.

◆ hasFiniteLowerBounds()

bool corbo::VectorVertex::hasFiniteLowerBounds ( ) const
inlineoverridevirtual

Check if finite lower bounds are provided.

Implements corbo::VertexInterface.

Definition at line 170 of file vector_vertex.h.

◆ hasFiniteUpperBound()

bool corbo::VectorVertex::hasFiniteUpperBound ( int  idx) const
inlineoverridevirtual

Check if finite upper bound for a single component is provided.

Implements corbo::VertexInterface.

Definition at line 180 of file vector_vertex.h.

◆ hasFiniteUpperBounds()

bool corbo::VectorVertex::hasFiniteUpperBounds ( ) const
inlineoverridevirtual

Check if finite upper bounds are provided.

Implements corbo::VertexInterface.

Definition at line 172 of file vector_vertex.h.

◆ hasFixedComponents()

bool corbo::VectorVertex::hasFixedComponents ( ) const
inlineoverridevirtual

Check if the vertex has fixed components.

Implements corbo::VertexInterface.

Reimplemented in corbo::PartiallyFixedVectorVertex.

Definition at line 139 of file vector_vertex.h.

◆ isFixedComponent()

bool corbo::VectorVertex::isFixedComponent ( int  idx) const
inlineoverridevirtual

Check if individual components are fixed or unfixed.

Implements corbo::VertexInterface.

Reimplemented in corbo::PartiallyFixedVectorVertex.

Definition at line 141 of file vector_vertex.h.

◆ lowerBound()

const Eigen::VectorXd& corbo::VectorVertex::lowerBound ( ) const
inline

Read-access to the underlying lower bound vector.

Definition at line 245 of file vector_vertex.h.

◆ plus() [1/2]

void corbo::VectorVertex::plus ( int  idx,
double  inc 
)
inlineoverridevirtual

Add value to a specific component of the vertex: x[idx] += inc.

Implements corbo::VertexInterface.

Definition at line 110 of file vector_vertex.h.

◆ plus() [2/2]

void corbo::VectorVertex::plus ( const double *  inc)
inlineoverridevirtual

Define the increment for the vertex: x += inc with dim(inc)=getDimension().

Implements corbo::VertexInterface.

Definition at line 112 of file vector_vertex.h.

◆ plusUnfixed()

void corbo::VectorVertex::plusUnfixed ( const double *  inc)
inlineoverridevirtual

Define the increment for the unfixed components of the vertex: x += inc with dim(inc)=getDimensionUnfixed().

Implements corbo::VertexInterface.

Reimplemented in corbo::PartiallyFixedVectorVertex.

Definition at line 114 of file vector_vertex.h.

◆ pop()

void corbo::VectorVertex::pop ( )
inlineoverridevirtual

Restore the previously stored values of the backup stack and remove them from the stack.

Implements corbo::VertexInterface.

Definition at line 221 of file vector_vertex.h.

◆ push()

void corbo::VectorVertex::push ( )
inlineoverridevirtual

Store all values into a internal backup stack.

Implements corbo::VertexInterface.

Definition at line 219 of file vector_vertex.h.

◆ set()

virtual void corbo::VectorVertex::set ( const Eigen::Ref< const Eigen::VectorXd > &  values,
const Eigen::Ref< const Eigen::VectorXd > &  lb,
const Eigen::Ref< const Eigen::VectorXd > &  ub,
bool  fixed = false 
)
inlinevirtual

Set values and bounds at once.

Reimplemented in corbo::PartiallyFixedVectorVertex.

Definition at line 126 of file vector_vertex.h.

◆ setData()

void corbo::VectorVertex::setData ( int  idx,
double  data 
)
inlineoverridevirtual

Write data to to a specific component.

Implements corbo::VertexInterface.

Definition at line 123 of file vector_vertex.h.

◆ setDimension()

virtual void corbo::VectorVertex::setDimension ( int  dim)
inlinevirtual

Change the dimension of the vertex (lower and upper bounds needs to be redefined)

Reimplemented in corbo::PartiallyFixedVectorVertex.

Definition at line 101 of file vector_vertex.h.

◆ setFixed()

virtual void corbo::VectorVertex::setFixed ( bool  fixed)
inlinevirtual

Set complete vertex to fixed (and hence skip during optimization)

Reimplemented in corbo::PartiallyFixedVectorVertex.

Definition at line 210 of file vector_vertex.h.

◆ setLowerBound()

void corbo::VectorVertex::setLowerBound ( int  idx,
double  lb 
)
inlineoverridevirtual

Define lower bound on a single component of the vertex (0 <= idx < getDimension())

Implements corbo::VertexInterface.

Definition at line 150 of file vector_vertex.h.

◆ setLowerBounds()

void corbo::VectorVertex::setLowerBounds ( const Eigen::Ref< const Eigen::VectorXd > &  lb)
inlineoverridevirtual

Define lower bounds on the vertex values [getDimension() x 1].

Implements corbo::VertexInterface.

Definition at line 144 of file vector_vertex.h.

◆ setUpperBound()

void corbo::VectorVertex::setUpperBound ( int  idx,
double  ub 
)
inlineoverridevirtual

Define upper bound on a single component of the vertex (0 <= idx < getDimension())

Implements corbo::VertexInterface.

Definition at line 162 of file vector_vertex.h.

◆ setUpperBounds()

void corbo::VectorVertex::setUpperBounds ( const Eigen::Ref< const Eigen::VectorXd > &  ub)
inlineoverridevirtual

Define upper bounds on the vertex values [getDimension() x 1].

Implements corbo::VertexInterface.

Definition at line 156 of file vector_vertex.h.

◆ top()

void corbo::VectorVertex::top ( )
inlineoverridevirtual

Restore the previously stored values of the backup stack WITHOUT removing them from the stack.

Implements corbo::VertexInterface.

Definition at line 227 of file vector_vertex.h.

◆ upperBound()

const Eigen::VectorXd& corbo::VectorVertex::upperBound ( ) const
inline

Read-access to the underlying upper bound vector.

Definition at line 247 of file vector_vertex.h.

◆ values() [1/2]

const Eigen::VectorXd& corbo::VectorVertex::values ( ) const
inline

Read-access to the underlying value vector.

Definition at line 240 of file vector_vertex.h.

◆ values() [2/2]

Eigen::VectorXd& corbo::VectorVertex::values ( )
inline

Write-access to the underlying value vector.

Definition at line 242 of file vector_vertex.h.

Member Data Documentation

◆ _backup

std::vector<Eigen::VectorXd> corbo::VectorVertex::_backup
protected

Definition at line 258 of file vector_vertex.h.

◆ _finite_lb_bounds

bool corbo::VectorVertex::_finite_lb_bounds = false
protected

Definition at line 253 of file vector_vertex.h.

◆ _finite_ub_bounds

bool corbo::VectorVertex::_finite_ub_bounds = false
protected

Definition at line 254 of file vector_vertex.h.

◆ _fixed

bool corbo::VectorVertex::_fixed = false
protected

Definition at line 256 of file vector_vertex.h.

◆ _lb

Eigen::VectorXd corbo::VectorVertex::_lb
protected

Definition at line 251 of file vector_vertex.h.

◆ _ub

Eigen::VectorXd corbo::VectorVertex::_ub
protected

Definition at line 252 of file vector_vertex.h.

◆ _values

Eigen::VectorXd corbo::VectorVertex::_values
protected

Definition at line 250 of file vector_vertex.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