Vertex implementation for scalar values. More...
#include <scalar_vertex.h>
Public Types | |
using | Ptr = std::shared_ptr< ScalarVertex > |
using | UPtr = std::unique_ptr< ScalarVertex > |
![]() | |
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) 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) 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... | |
void | plus (int, 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... | |
ScalarVertex () | |
Default constructor. More... | |
ScalarVertex (double value) | |
Construct vertex with given value. More... | |
ScalarVertex (double value, bool fixed) | |
Construct vertex with given value and fixed flag. More... | |
ScalarVertex (double value, double lb, double ub) | |
Construct vertex with given value, lower and upper bound. More... | |
ScalarVertex (double value, double lb, double ub, bool fixed) | |
Construct vertex with given value, lower and upper bound and fixed flag. More... | |
void | set (double value, double lb, double ub, bool fixed) |
void | setData (int, double data) override |
Write data to to a specific component. More... | |
void | setFixed (bool fixed) |
Set vertex (un)fixed. More... | |
void | setLowerBound (double lb) |
Set lower bound. More... | |
void | setLowerBound (int, 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 (double ub) |
Set upper bound. More... | |
void | setUpperBound (int, 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 double & | value () const |
Get underlying value. More... | |
double & | value () |
Raw access to the underlying value. More... | |
const double & | values () const |
Get underlying value (this method is for compatibility purposes) More... | |
double & | values () |
Raw access to the underlying value (this method is for compatibility purposes) More... | |
![]() | |
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< double > | _backup |
bool | _fixed = false |
double | _lb |
double | _ub |
double | _value |
Vertex implementation for scalar values.
This vertex is optimized for scalar (1D) values in contrast to VectorVertex which stores multi-dimensional vector.
Definition at line 50 of file scalar_vertex.h.
using corbo::ScalarVertex::Ptr = std::shared_ptr<ScalarVertex> |
Definition at line 53 of file scalar_vertex.h.
using corbo::ScalarVertex::UPtr = std::unique_ptr<ScalarVertex> |
Definition at line 54 of file scalar_vertex.h.
|
inline |
Default constructor.
Definition at line 57 of file scalar_vertex.h.
|
inlineexplicit |
Construct vertex with given value.
Definition at line 59 of file scalar_vertex.h.
|
inlineexplicit |
Construct vertex with given value and fixed flag.
Definition at line 62 of file scalar_vertex.h.
|
inlineexplicit |
Construct vertex with given value, lower and upper bound.
Definition at line 65 of file scalar_vertex.h.
|
inlineexplicit |
Construct vertex with given value, lower and upper bound and fixed flag.
Definition at line 68 of file scalar_vertex.h.
|
inlineoverridevirtual |
Clear complete backup container.
Implements corbo::VertexInterface.
Definition at line 176 of file scalar_vertex.h.
|
inlineoverridevirtual |
Delete the previously made backup from the stack without restoring it.
Implements corbo::VertexInterface.
Definition at line 174 of file scalar_vertex.h.
|
inlineoverridevirtual |
Get read-only raw access to the values of the vertex.
Implements corbo::VertexInterface.
Definition at line 83 of file scalar_vertex.h.
|
inlineoverridevirtual |
Get write access to the values of the vertex.
Implements corbo::VertexInterface.
Definition at line 84 of file scalar_vertex.h.
|
inlineoverridevirtual |
Return number of elements/values/components stored in this vertex.
Implements corbo::VertexInterface.
Definition at line 71 of file scalar_vertex.h.
|
inlineoverridevirtual |
Return number of unfixed elements (unfixed elements are skipped as parameters in the Hessian and Jacobian.
Implements corbo::VertexInterface.
Definition at line 73 of file scalar_vertex.h.
|
inlineoverridevirtual |
Read-only raw access to lower bounds [getDimension() x 1].
Implements corbo::VertexInterface.
Definition at line 154 of file scalar_vertex.h.
|
inlineoverridevirtual |
Return the current size/number of backups of the backup stack.
Implements corbo::VertexInterface.
Definition at line 178 of file scalar_vertex.h.
|
inlineoverridevirtual |
Get number of finite upper bounds (either upper or lower must be finite)
Implements corbo::VertexInterface.
Definition at line 142 of file scalar_vertex.h.
|
inlineoverridevirtual |
Get number of finite lower bounds.
Implements corbo::VertexInterface.
Definition at line 126 of file scalar_vertex.h.
|
inlineoverridevirtual |
Get number of finite upper bounds.
Implements corbo::VertexInterface.
Definition at line 134 of file scalar_vertex.h.
|
inlineoverridevirtual |
Read-only raw access to upper bounds [getDimension() x 1].
Implements corbo::VertexInterface.
Definition at line 156 of file scalar_vertex.h.
|
inlineoverridevirtual |
Check if finite bounds (lower or upper) are provided.
Implements corbo::VertexInterface.
Definition at line 116 of file scalar_vertex.h.
|
inlineoverridevirtual |
Check if finite lower bound for a single component is provided.
Implements corbo::VertexInterface.
Definition at line 122 of file scalar_vertex.h.
|
inlineoverridevirtual |
Check if finite lower bounds are provided.
Implements corbo::VertexInterface.
Definition at line 118 of file scalar_vertex.h.
|
inlineoverridevirtual |
Check if finite upper bound for a single component is provided.
Implements corbo::VertexInterface.
Definition at line 124 of file scalar_vertex.h.
|
inlineoverridevirtual |
Check if finite upper bounds are provided.
Implements corbo::VertexInterface.
Definition at line 120 of file scalar_vertex.h.
|
inlineoverridevirtual |
Check if the vertex has fixed components.
Implements corbo::VertexInterface.
Definition at line 99 of file scalar_vertex.h.
|
inlineoverridevirtual |
Check if individual components are fixed or unfixed.
Implements corbo::VertexInterface.
Definition at line 101 of file scalar_vertex.h.
|
inlineoverridevirtual |
Add value to a specific component of the vertex: x[idx] += inc.
Implements corbo::VertexInterface.
Definition at line 76 of file scalar_vertex.h.
|
inlineoverridevirtual |
Define the increment for the vertex: x += inc with dim(inc)=getDimension().
Implements corbo::VertexInterface.
Definition at line 78 of file scalar_vertex.h.
|
inlineoverridevirtual |
Define the increment for the unfixed components of the vertex: x += inc with dim(inc)=getDimensionUnfixed().
Implements corbo::VertexInterface.
Definition at line 80 of file scalar_vertex.h.
|
inlineoverridevirtual |
Restore the previously stored values of the backup stack and remove them from the stack.
Implements corbo::VertexInterface.
Definition at line 162 of file scalar_vertex.h.
|
inlineoverridevirtual |
Store all values into a internal backup stack.
Implements corbo::VertexInterface.
Definition at line 160 of file scalar_vertex.h.
|
inline |
Definition at line 90 of file scalar_vertex.h.
|
inlineoverridevirtual |
Write data to to a specific component.
Implements corbo::VertexInterface.
Definition at line 87 of file scalar_vertex.h.
|
inline |
Set vertex (un)fixed.
Definition at line 151 of file scalar_vertex.h.
|
inline |
Set lower bound.
Definition at line 104 of file scalar_vertex.h.
|
inlineoverridevirtual |
Define lower bound on a single component of the vertex (0 <= idx < getDimension())
Implements corbo::VertexInterface.
Definition at line 112 of file scalar_vertex.h.
|
inlineoverridevirtual |
Define lower bounds on the vertex values [getDimension() x 1].
Implements corbo::VertexInterface.
Definition at line 108 of file scalar_vertex.h.
|
inline |
Set upper bound.
Definition at line 106 of file scalar_vertex.h.
|
inlineoverridevirtual |
Define upper bound on a single component of the vertex (0 <= idx < getDimension())
Implements corbo::VertexInterface.
Definition at line 114 of file scalar_vertex.h.
|
inlineoverridevirtual |
Define upper bounds on the vertex values [getDimension() x 1].
Implements corbo::VertexInterface.
Definition at line 110 of file scalar_vertex.h.
|
inlineoverridevirtual |
Restore the previously stored values of the backup stack WITHOUT removing them from the stack.
Implements corbo::VertexInterface.
Definition at line 168 of file scalar_vertex.h.
|
inline |
Get underlying value.
Definition at line 181 of file scalar_vertex.h.
|
inline |
Raw access to the underlying value.
Definition at line 183 of file scalar_vertex.h.
|
inline |
Get underlying value (this method is for compatibility purposes)
Definition at line 186 of file scalar_vertex.h.
|
inline |
Raw access to the underlying value (this method is for compatibility purposes)
Definition at line 188 of file scalar_vertex.h.
|
protected |
Definition at line 197 of file scalar_vertex.h.
|
protected |
Definition at line 195 of file scalar_vertex.h.
|
protected |
Definition at line 192 of file scalar_vertex.h.
|
protected |
Definition at line 193 of file scalar_vertex.h.
|
protected |
Definition at line 191 of file scalar_vertex.h.