Go to the documentation of this file.
25 #ifndef SRC_OPTIMIZATION_INCLUDE_CORBO_OPTIMIZATION_HYPER_GRAPH_EDGE_H_
26 #define SRC_OPTIMIZATION_INCLUDE_CORBO_OPTIMIZATION_HYPER_GRAPH_EDGE_H_
147 template <
class... Vertices>
148 class Edge :
public BaseEdge
151 using Ptr = std::shared_ptr<Edge>;
152 using ConstPtr = std::shared_ptr<const Edge>;
153 using UPtr = std::unique_ptr<Edge>;
159 using VertexContainer = std::array<VertexInterface*, numVerticesCompileTime>;
170 template <
class... VerticesT>
174 static_assert(util::variadic_temp_equal<std::tuple<Vertices...>, std::tuple<VerticesT...>>::value,
175 "Edge(): Number and types of vertices passed via the constructor does not match number of class template parameters");
187 for (VertexInterface* vertex :
_vertices)
n += vertex->getDimension();
221 class Edge<> :
public BaseEdge
224 using Ptr = std::shared_ptr<Edge>;
226 using UPtr = std::unique_ptr<Edge>;
234 explicit Edge(
int num_vertices) { resizeVertexContainer(num_vertices); }
237 void resizeVertexContainer(
int n) {
_vertices.resize(
n); }
287 template <
class... Vertices>
291 using Ptr = std::shared_ptr<MixedEdge>;
292 using ConstPtr = std::shared_ptr<const MixedEdge>;
293 using UPtr = std::unique_ptr<MixedEdge>;
299 using VertexContainer = std::array<VertexInterface*, numVerticesCompileTime>;
310 template <
class... VerticesT>
314 static_assert(util::variadic_temp_equal<std::tuple<Vertices...>, std::tuple<VerticesT...>>::value,
315 "MixedEdge(): Number and types of vertices passed via the constructor does not match number of class template parameters");
368 class MixedEdge<> :
public BaseMixedEdge
371 using Ptr = std::shared_ptr<MixedEdge>;
372 using ConstPtr = std::shared_ptr<const MixedEdge>;
373 using UPtr = std::unique_ptr<MixedEdge>;
384 void resizeVertexContainer(
int n) {
_vertices.resize(
n); }
386 void setVertex(
int idx, VertexInterface& vertex)
443 #endif // SRC_OPTIMIZATION_INCLUDE_CORBO_OPTIMIZATION_HYPER_GRAPH_EDGE_H_
std::shared_ptr< EdgeInterface > Ptr
std::array< VertexInterface *, numVerticesCompileTime > VertexContainer
Typedef to represent the vertex container.
std::shared_ptr< const Edge > ConstPtr
std::array< VertexInterface *, numVerticesCompileTime > VertexContainer
Typedef to represent the vertex container.
bool isLinear() const override=0
Return true if the edge is linear (and hence its Hessian is always zero)
static constexpr const int numVerticesCompileTime
Return number of vertices at compile-time.
const VertexContainer _vertices
Vertex container.
Generic interface class for vertices.
std::shared_ptr< const MixedEdge > ConstPtr
const VertexInterface * getVertex(int idx) const override
bool providesJacobian() const override
Return true if a custom Jacobian is provided (e.g. computeJacobian() is overwritten)
int getNumVertices() const override
Return number of attached vertices.
int getObjectiveDimension() const override=0
void computeObjectiveValues(Eigen::Ref< Eigen::VectorXd > obj_values) override=0
const VertexInterface * getVertex(int idx) const override
int getNumVertices() const override
Return number of attached vertices.
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW
std::vector< VertexInterface * > VertexContainer
Typedef to represent the vertex container.
void computeInequalityValues(Eigen::Ref< Eigen::VectorXd > ineq_values) override=0
std::shared_ptr< Edge > Ptr
std::unique_ptr< EdgeInterface > UPtr
int getInequalityDimension() const override=0
A matrix or vector expression mapping an existing expression.
std::unique_ptr< Edge > UPtr
VertexInterface * getVertexRaw(int idx) override
Get access to vertex with index idx (0 <= idx < numVertices)
int getDimension() const override=0
Get dimension of the edge (dimension of the cost-function/constraint value vector)
void precompute() override=0
void computeValues(Eigen::Ref< Eigen::VectorXd > values) override=0
Compute function values.
int getEqualityDimension() const override=0
int verticesDimension() const override
Return the combined dimension of all attached vertices (excluding fixed vertex components)
std::shared_ptr< Edge > Ptr
void computeEqualityValues(Eigen::Ref< Eigen::VectorXd > eq_values) override=0
VertexInterface * getVertexRaw(int idx) override
Get access to vertex with index idx (0 <= idx < numVertices)
int verticesDimension() const override
Return the combined dimension of all attached vertices (excluding fixed vertex components)
static constexpr const int numVerticesCompileTime
Return number of vertices at compile-time.
std::unique_ptr< Edge > UPtr
std::shared_ptr< const Edge > ConstPtr
const VertexContainer _vertices
Vertex container.
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:05:45