raiigraph
C++ RAII for igraph data structures
|
Wrapper around igraph_t
objects with RAII behavior.
More...
#include <Graph.hpp>
Public Member Functions | |
Graph (igraph_integer_t num_vertices=0, igraph_bool_t directed=false) | |
Graph (const IntVector &edges, igraph_integer_t num_vertices, igraph_bool_t directed) | |
Graph (const igraph_vector_int_t *edges, igraph_integer_t num_vertices, igraph_bool_t directed) | |
Graph (igraph_t &&graph) | |
Graph (const Graph &other) | |
Graph & | operator= (const Graph &other) |
Graph (Graph &&other) | |
Graph & | operator= (Graph &&other) |
~Graph () | |
igraph_integer_t | vcount () const |
igraph_integer_t | ecount () const |
IntVector | get_edgelist (igraph_bool_t by_col=false) const |
igraph_bool_t | is_directed () const |
igraph_bool_t | is_connected (igraph_connectedness_t mode=IGRAPH_WEAK) const |
igraph_bool_t | is_simple () const |
igraph_bool_t | has_loop () const |
igraph_bool_t | has_multiple () const |
igraph_bool_t | has_mutual (igraph_bool_t loops=false) const |
bool | is_tree (igraph_neimode_t mode=IGRAPH_ALL) const |
bool | is_forest (igraph_neimode_t mode=IGRAPH_ALL) const |
bool | is_dag () const |
bool | is_acyclic () const |
operator igraph_t * () | |
operator const igraph_t * () const | |
igraph_t * | get () |
const igraph_t * | get () const |
Wrapper around igraph_t
objects with RAII behavior.
This class has ownership of the underlying igraph_t
object, handling both its initialization and destruction. Users should only pass instances of this class to igraph functions that accept an already-initialized graph. Users should not attempt to destroy the graph manually as this is done automatically when the Graph
goes out of scope.
|
inline |
Create an empty graph, i.e., with no edges.
num_vertices | Number of vertices. |
directed | Whether the graph is directed. |
|
inline |
edges | Edges between vertices, stored as row-major matrix with two columns. Each row corresponds to an edge and contains its connected vertices. For example, the i -th edge is defined from the first vertex at edges[2 * i] to the second vertex at edges[2 * i + 1] . |
num_vertices | Number of vertices in the graph. This should be greater than the largest index in edges . |
directed | Whether the graph is directed. |
|
inline |
edges | Edges between vertices, stored as a vector of non-negative vertex indices of length equal to twice the number of edges. The i -th edge is defined from the first vertex at edges[2 * i] to the second vertex at edges[2 * i + 1] . |
num_vertices | Number of vertices in the graph. This should be greater than the largest index in edges . |
directed | Whether the graph is directed. |
|
inline |
graph | An initialized graph to take ownership of. |
|
inline |
other | Graph to be copy-constructed from. |
|
inline |
other | Graph to be move-constructed from. This constructor will leave other in a valid but unspecified state. |
|
inline |
Destructor.
|
inline |
|
inline |
|
inline |
|
inline |
by_col | Whether to return the edges in a column-major array. |
by_col = false
, this is the same as the sequence of edges used in the constructor.
|
inline |
|
inline |
|
inline |
loops | Whether to consider directed self-loops to be mutual. |
|
inline |
|
inline |
mode | The connectedness mode, for directed graphs. This can be either IGRAPH_WEAK or IGRAPH_STRONG . Ignored for undirected graphs. |
|
inline |
|
inline |
|
inline |
mode | Whether to test for an out-tree, an in-tree or to ignore edge directions, for directed graphs; see is_tree() . |
|
inline |
|
inline |
mode | Whether to test for an out-tree, an in-tree or to ignore edge directions, for directed graphs. The respective possible values are IGRAPH_OUT , IGRAPH_IN and IGRAPH_ALL . Ignored for undirected graphs. |
|
inline |
|
inline |
other | Graph to be copy-assigned from. |
other | Graph to be move-assigned from. This constructor will leave other in a valid but unspecified state. |
|
inline |