Free-form topology#
New in version 2.15.
#include <pagmo/topologies/free_form.hpp>
-
class free_form : public base_bgl_topology#
This user-defined topology (UDT) represents a graph in which vertices and edges can be manipulated freely. It is implemented as a simple extension of
base_bgl_topologyin which thepush_back()function adds a vertex without connections.-
free_form()#
Default constructor.
The default constructor initialises an empty topology.
-
explicit free_form(bgl_graph_t g)#
Constructor from a
bgl_graph_t.The internal graph of the topology will be set to g.
- Parameters
g – the graph that will be used to initialise
this.- Throws
std::invalid_argument – if any edge in the graph has a weight outside the \(\left[ 0, 1 \right]\) range.
-
template<typename T>
explicit free_form(const T &t)# Note
The constructor from
Tdoes not participate in overload resolution ifTisfree_formor ifTdoes not satisfyis_udt.Constructors from a
topologyor a UDT.These constructors will first invoke the
pagmo::topology::to_bgl()function to extract a graph representation of the inputtopologyor UDT, and will then use that graph object to initialise thisfree_formobject via the constructor frombgl_graph_t.In other words, these constructors allow to copy the graph of a
topologyor a UDT intothis.- Parameters
t – the input
topologyor UDT.- Throws
unspecified – any exception raised by the construction of a
topologyobject, the invocation of thepagmo::topology::to_bgl()function or by the constructor frombgl_graph_t.
-
void push_back()#
Add a new vertex.
The newly-added vertex will not be connected to any other vertex.
- Throws
unspecified – any exception thrown by the public API of
base_bgl_topology.
-
std::string get_name() const#
Get the name of the topology.
- Returns
"Free form".
-
free_form()#