25 #ifndef SRC_OPTIMIZATION_INCLUDE_CORBO_OPTIMIZATION_HYPER_GRAPH_VERTEX_INTERFACE_H_ 26 #define SRC_OPTIMIZATION_INCLUDE_CORBO_OPTIMIZATION_HYPER_GRAPH_VERTEX_INTERFACE_H_ 58 using Ptr = std::shared_ptr<VertexInterface>;
59 using UPtr = std::unique_ptr<VertexInterface>;
92 virtual void plus(
int idx,
double inc) = 0;
94 virtual void plus(
const double* inc) = 0;
99 virtual const double*
getData()
const = 0;
108 virtual void setData(
int idx,
double data) = 0;
162 virtual void push() = 0;
163 virtual void pop() = 0;
164 virtual void top() = 0;
166 virtual void clear() = 0;
193 #endif // SRC_OPTIMIZATION_INCLUDE_CORBO_OPTIMIZATION_HYPER_GRAPH_VERTEX_INTERFACE_H_ void registerMixedEdge(BaseMixedEdge *edge)
Register an adjacent mixed edge.
void registerObjectiveEdge(BaseEdge *edge)
Register an adjacent objective edge.
virtual void clearBackups()
virtual void top()=0
Restore the previously stored values of the backup stack WITHOUT removing them from the stack...
virtual void setLowerBound(int idx, double lb)=0
Define lower bound on a single component of the vertex (0 <= idx < getDimension()) ...
virtual ~VertexInterface()
Virtual destructor.
Abstract class representing a set of vertices.
virtual bool hasFiniteBounds() const =0
Check if finite bounds (lower or upper) are provided.
std::set< BaseMixedEdge * > _edges_mixed
connected mixed edges
virtual bool hasFiniteLowerBound(int idx) const =0
Check if finite lower bound for a single component is provided.
virtual int getNumberFiniteLowerBounds(bool unfixed_only) const =0
Get number of finite lower bounds.
std::shared_ptr< VertexInterface > Ptr
void registerInequalityEdge(BaseEdge *edge)
Register an adjacent inequality constraint edge.
A matrix or vector expression mapping an existing array of data.
virtual void pop()=0
Restore the previously stored values of the backup stack and remove them from the stack...
virtual bool isFixed() const
Check if all components are fixed.
virtual int getDimension() const =0
Return number of elements/values/components stored in this vertex.
Generic interface class for vertices.
int getVertexIdx() const
Retrieve current edge index (warning, this value is determined within the related VertexSetInterface ...
std::unique_ptr< VertexInterface > UPtr
const std::set< BaseMixedEdge * > & getConnectedMixedEdgesRef() const
Raw access for connected mixed edges.
virtual int getNumBackups() const =0
Return the current size/number of backups of the backup stack.
Eigen::Map< const Eigen::VectorXd > getDataMap() const
Get a read-only Eigen::Map to the values of the vertex.
virtual const double * getLowerBounds() const =0
Read-only raw access to lower bounds [getDimension() x 1].
const std::set< BaseEdge * > & getConnectedLsqObjectiveEdgesRef() const
Raw access for connected least-squares objective edges.
std::set< BaseEdge * > _edges_objective
Retrieve number of connected objective edges with custom Jacobian.
virtual void discardTop()=0
Delete the previously made backup from the stack without restoring it.
virtual void plusUnfixed(const double *inc)=0
Define the increment for the unfixed components of the vertex: x += inc with dim(inc)=getDimensionUnf...
Eigen::Map< const Eigen::VectorXd > getUpperBoundsMap() const
Read-only Eigen::Map for upper bounds [getDimension() x 1].
virtual int getDimensionUnfixed() const =0
Return number of unfixed elements (unfixed elements are skipped as parameters in the Hessian and Jaco...
virtual bool hasFiniteUpperBounds() const =0
Check if finite upper bounds are provided.
std::set< BaseEdge * > _edges_lsq_objective
connected least-squares objective edges
virtual void setUpperBounds(const Eigen::Ref< const Eigen::VectorXd > &ub)=0
Define upper bounds on the vertex values [getDimension() x 1].
virtual void setUpperBound(int idx, double ub)=0
Define upper bound on a single component of the vertex (0 <= idx < getDimension()) ...
virtual const double * getUpperBounds() const =0
Read-only raw access to upper bounds [getDimension() x 1].
Eigen::Map< Eigen::VectorXd > getDataRawMap()
Get a Eigen::Map to the values of the vertex.
virtual bool hasFiniteLowerBounds() const =0
Check if finite lower bounds are provided.
void clearConnectedEdges()
Clear all connected edges.
virtual bool hasFiniteUpperBound(int idx) const =0
Check if finite upper bound for a single component is provided.
int _vertex_idx
vertex index in jacobian or hessian (determined by friend class HyperGraph).
A matrix or vector expression mapping an existing expression.
virtual void setLowerBounds(const Eigen::Ref< const Eigen::VectorXd > &lb)=0
Define lower bounds on the vertex values [getDimension() x 1].
virtual double * getDataRaw()=0
Get write access to the values of the vertex.
virtual void plus(int idx, double inc)=0
Add value to a specific component of the vertex: x[idx] += inc.
const std::set< BaseEdge * > & getConnectedObjectiveEdgesRef() const
Raw access for connected objective edges.
virtual const double * getData() const =0
Get read-only raw access to the values of the vertex.
std::set< BaseEdge * > _edges_inequalities
connected inequality constraint edges
virtual int getNumberFiniteUpperBounds(bool unfixed_only) const =0
Get number of finite upper bounds.
const std::set< BaseEdge * > & getConnectedEqualityEdgesRef() const
Raw access for connected equality constraint edges.
std::set< BaseEdge * > _edges_equalities
connected equality constraint edges
virtual bool hasFixedComponents() const =0
Check if the vertex has fixed components.
void registerEqualityEdge(BaseEdge *edge)
Register an adjacent equality constraint edge.
virtual void setData(int idx, double data)=0
Write data to to a specific component.
const std::set< BaseEdge * > & getConnectedInequalityEdgesRef() const
Raw access for connected inequality constraint edges.
Eigen::Map< const Eigen::VectorXd > getLowerBoundsMap() const
Read-only Eigen::Map for lower bounds [getDimension() x 1].
virtual void push()=0
Store all values into a internal backup stack.
virtual int getNumberFiniteBounds(bool unfixed_only) const =0
Get number of finite upper bounds (either upper or lower must be finite)
void registerLsqObjectiveEdge(BaseEdge *edge)
Register an adjacent least-squares objective edge.
virtual void clear()=0
Clear complete backup container.
virtual bool isFixedComponent(int idx) const =0
Check if individual components are fixed or unfixed.