std::auto_ptr<Graph> grg_game(integer_t nodes, real_t radius, bool torus, Vector* x, Vector* y) { std::auto_ptr<igraph_t> result(new igraph_t); IGRAPH_TRY(igraph_grg_game(result.get(), nodes, radius, torus, x ? x->c_vector() : 0, y ? y->c_vector() : 0)); return std::auto_ptr<Graph>(new Graph(result)); }
void bfs(const Graph& graph, integer_t root, Vector* roots, NeighborMode mode, bool unreachable, Vector* restricted, Vector* order, Vector* rank, Vector* father, Vector* pred, Vector* succ, Vector* dist, BFSHandler callback, void* extra) { igraph_vector_t* c_roots; igraph_vector_t* c_restricted; igraph_vector_t* c_order; igraph_vector_t* c_rank; igraph_vector_t* c_father; igraph_vector_t* c_pred; igraph_vector_t* c_succ; igraph_vector_t* c_dist; c_roots = (roots == 0) ? 0 : roots->c_vector(); c_restricted = (restricted == 0) ? 0 : restricted->c_vector(); c_order = (order == 0) ? 0 : order->c_vector(); c_rank = (rank == 0) ? 0 : rank->c_vector(); c_father = (father == 0) ? 0 : father->c_vector(); c_pred = (pred == 0) ? 0 : pred->c_vector(); c_succ = (succ == 0) ? 0 : succ->c_vector(); c_dist = (dist == 0) ? 0 : dist->c_vector(); IGRAPH_TRY(igraph_bfs(graph.c_graph(), root, c_roots, mode, unreachable, c_restricted, c_order, c_rank, c_father, c_pred, c_succ, c_dist, callback, extra)); }
bool Graph::areConnected(long int u, long int v) const { igraph_bool_t result; assert(m_pGraph); IGRAPH_TRY(igraph_are_connected(m_pGraph, u, v, &result)); return result; }
void write_leda(FILE* outstream, const Graph& graph, const std::string& vertex_attr_name, const std::string& edge_attr_name) { const char *vattr, *eattr; vattr = vertex_attr_name.length() ? vertex_attr_name.c_str() : 0; eattr = edge_attr_name.length() ? edge_attr_name.c_str() : 0; IGRAPH_TRY(igraph_write_graph_leda(graph.c_graph(), outstream, vattr, eattr)); }
void Graph::deleteEdges(const EdgeSelector& es) { assert(m_pGraph); IGRAPH_TRY(igraph_delete_edges(m_pGraph, *es.c_es())); }
void Graph::degree(Vector* result, const VertexSelector& vids, NeighborMode mode, bool loops) const { assert(m_pGraph); IGRAPH_TRY(igraph_degree(m_pGraph, result->c_vector(), *vids.c_vs(), mode, loops)); }
void Graph::addVertices(long int numVertices) { assert(m_pGraph); IGRAPH_TRY(igraph_add_vertices(m_pGraph, numVertices, 0)); }
void Graph::addEdges(const Vector& edges) { assert(m_pGraph); IGRAPH_TRY(igraph_add_edges(m_pGraph, edges.c_vector(), 0)); }
Graph Graph::operator+(const Graph& other) const { std::auto_ptr<igraph_t> result(new igraph_t); IGRAPH_TRY(igraph_disjoint_union(result.get(), m_pGraph, other.m_pGraph)); return Graph(result.release()); }
void Graph::neighbors(Vector* result, long int vertex, NeighborMode mode) const { assert(m_pGraph); IGRAPH_TRY(igraph_neighbors(m_pGraph, result->c_vector(), vertex, mode)); }
bool Graph::isSimple() const { bool_t result; IGRAPH_TRY(igraph_is_simple(m_pGraph, &result)); return result; }
integer_t Graph::getEid(integer_t source, integer_t target, bool directed, bool error) const { integer_t eid; IGRAPH_TRY(igraph_get_eid(m_pGraph, &eid, source, target, directed, error)); return eid; }
std::auto_ptr<Graph> erdos_renyi_game_gnm(integer_t n, integer_t m, bool directed, bool loops) { std::auto_ptr<igraph_t> result(new igraph_t); IGRAPH_TRY(igraph_erdos_renyi_game_gnm(result.get(), n, m, directed, loops)); return std::auto_ptr<Graph>(new Graph(result)); }
Graph read_edgelist(FILE* instream, integer_t n, bool directed) { std::auto_ptr<igraph_t> result(new igraph_t); IGRAPH_TRY(igraph_read_graph_edgelist(result.get(), instream, n, directed)); return Graph(result.release()); }
void write_edgelist(FILE* outstream, const Graph& graph) { IGRAPH_TRY(igraph_write_graph_edgelist(graph.c_graph(), outstream)); }
void Graph::edge(integer_t eid, integer_t* from, integer_t* to) const { assert(m_pGraph); IGRAPH_TRY(igraph_edge(m_pGraph, eid, from, to)); }
void Graph::getEdgelist(Vector* result, bool bycol) const { assert(m_pGraph); IGRAPH_TRY(igraph_get_edgelist(m_pGraph, result->c_vector(), bycol)); }
void Graph::simplify(bool multiple, bool loops) { // TODO: last argument (attribute combination) assert(m_pGraph); IGRAPH_TRY(igraph_simplify(m_pGraph, multiple, loops, 0)); }