internal static int igraph_pagerank(igraph_t graph, igraph_pagerank_algo_t algo, igraph_vector_t vector, out double value, igraph_vs_t vids, bool directed, double damping, igraph_vector_t weights) { value = 1; var options = IntPtr.Zero; if (algo == igraph_pagerank_algo_t.IGRAPH_PAGERANK_ALGO_ARPACK) { var arpackoptions = GetDefaultArpackOptions(); options = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(igraph_arpack_options_t))); Marshal.StructureToPtr(arpackoptions, options, false); } else if (algo == igraph_pagerank_algo_t.IGRAPH_PAGERANK_ALGO_POWER) { var poweroptions = GetDefaultPowerOptions(); options = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(igraph_pagerank_power_options_t))); Marshal.StructureToPtr(poweroptions, options, false); } try { return(X86 ? igraph_pagerank_x86(graph, algo, vector, ref value, vids, directed, damping, weights, options) : igraph_pagerank_x64(graph, algo, vector, ref value, vids, directed, damping, weights, options)); } finally { if (algo == igraph_pagerank_algo_t.IGRAPH_PAGERANK_ALGO_ARPACK) { Marshal.DestroyStructure(options, typeof(igraph_arpack_options_t)); Marshal.FreeHGlobal(options); } else if (algo == igraph_pagerank_algo_t.IGRAPH_PAGERANK_ALGO_POWER) { Marshal.DestroyStructure(options, typeof(igraph_pagerank_power_options_t)); Marshal.FreeHGlobal(options); } } }
internal static void igraph_empty(igraph_t graph, int n, bool directed) { if (X86) { igraph_empty_x86(graph, n, directed); } else { igraph_empty_x64(graph, n, directed); } }
private static extern int igraph_layout_fruchterman_reingold_x64(igraph_t graph, [In, Out] igraph_matrix_t res, bool use_seed, int niter, double start_temp, igraph_layout_grid_t grid, igraph_vector_t weights, igraph_vector_t minx, igraph_vector_t maxx, igraph_vector_t miny, igraph_vector_t maxy);
internal static int igraph_layout_davidson_harel(igraph_t graph, igraph_matrix_t res, bool use_seed, int maxiter, int fineiter, double cool_fact, double weight_node_dist, double weight_border, double weight_edge_lengths, double weight_edge_crossings, double weight_node_edge_dist) { return(X86 ? igraph_layout_davidson_harel_x86(graph, res, use_seed, maxiter, fineiter, cool_fact, weight_node_dist, weight_border, weight_edge_lengths, weight_edge_crossings, weight_node_edge_dist) : igraph_layout_davidson_harel_x64(graph, res, use_seed, maxiter, fineiter, cool_fact, weight_node_dist, weight_border, weight_edge_lengths, weight_edge_crossings, weight_node_edge_dist)); }
internal static int igraph_layout_mds(igraph_t graph, igraph_matrix_t res, igraph_matrix_t dist = null, int dim = 2) { return(MarshalIfExistsAndCall(GetDefaultArpackOptions(), ptr => X86 ? igraph_layout_mds_x86(graph, res, dist, dim, ptr) : igraph_layout_mds_x64(graph, res, dist, dim, ptr))); }
internal static int igraph_layout_fruchterman_reingold(igraph_t graph, igraph_matrix_t res, bool use_seed, int niter, double start_temp, igraph_layout_grid_t grid, igraph_vector_t weights, igraph_vector_t minx, igraph_vector_t maxx, igraph_vector_t miny, igraph_vector_t maxy) { return(X86 ? igraph_layout_fruchterman_reingold_x86(graph, res, use_seed, niter, start_temp, grid, weights, minx, maxx, miny, maxy) : igraph_layout_fruchterman_reingold_x64(graph, res, use_seed, niter, start_temp, grid, weights, minx, maxx, miny, maxy)); }
internal static int igraph_layout_kamada_kawai(igraph_t graph, igraph_matrix_t res, bool use_seed, int maxiter, double epsilon, double kkconst, igraph_vector_t weights, igraph_vector_t minx, igraph_vector_t maxx, igraph_vector_t miny, igraph_vector_t maxy) { return(X86 ? igraph_layout_kamada_kawai_x86(graph, res, use_seed, maxiter, epsilon, kkconst, weights, minx, maxx, miny, maxy) : igraph_layout_kamada_kawai_x64(graph, res, use_seed, maxiter, epsilon, kkconst, weights, minx, maxx, miny, maxy)); }
internal static int igraph_vcount(igraph_t graph) { return(X86 ? igraph_vcount_x86(graph) : igraph_vcount_x64(graph)); }
private static extern void igraph_empty_x64([In, Out] igraph_t graph, int n, bool directed);
private static extern int igraph_bfs_x64(igraph_t graph, int root, igraph_vector_t roots, igraph_neimode_t mode, bool unreachable, igraph_vector_t restricted, [In, Out] igraph_vector_t order, [In, Out] igraph_vector_t rank, [In, Out] igraph_vector_t father, [In, Out] igraph_vector_t pred, [In, Out] igraph_vector_t succ, [In, Out] igraph_vector_t dist, igraph_bfshandler_t callback, IntPtr extra);
private static extern int igraph_dfs_x64(igraph_t graph, int root, igraph_neimode_t mode, bool unreachable, [In, Out] igraph_vector_t order, [In, Out] igraph_vector_t order_out, [In, Out] igraph_vector_t father, [In, Out] igraph_vector_t dist, igraph_dfshandler_t in_callback, igraph_dfshandler_t out_callback, IntPtr extra);
private static extern int igraph_density_x64(igraph_t graph, ref double density, bool loops);
private static extern int igraph_pagerank_x64(igraph_t graph, igraph_pagerank_algo_t algo, [In, Out] igraph_vector_t vector, ref double value, igraph_vs_t vids, bool directed, double damping, igraph_vector_t weights, IntPtr options);
private static extern int igraph_add_edge_x64([In, Out] igraph_t graph, int from, int to);
private static extern int igraph_vcount_x64(igraph_t graph);
private static extern int igraph_destroy_x64([In, Out] igraph_t graph);
private static extern int igraph_layout_kamada_kawai_x64(igraph_t graph, [In, Out] igraph_matrix_t res, bool use_seed, int maxiter, double epsilon, double kkconst, igraph_vector_t weights, igraph_vector_t minx, igraph_vector_t maxx, igraph_vector_t miny, igraph_vector_t maxy);
internal static int igraph_density(igraph_t graph, out double density, bool loops) { density = double.NaN; return(X86 ? igraph_density_x86(graph, ref density, loops) : igraph_density_x64(graph, ref density, loops)); }
private static extern int igraph_layout_davidson_harel_x64(igraph_t graph, [In, Out] igraph_matrix_t res, bool use_seed, int maxiter, int fineiter, double cool_fact, double weight_node_dist, double weight_border, double weight_edge_lengths, double weight_edge_crossings, double weight_node_edge_dist);
internal static int igraph_bfs(igraph_t graph, int root, igraph_vector_t roots, igraph_neimode_t mode, bool unreachable, igraph_vector_t restricted, igraph_vector_t order, igraph_vector_t rank, igraph_vector_t father, igraph_vector_t pred, igraph_vector_t succ, igraph_vector_t dist, igraph_bfshandler_t callback, object tag) { return(MarshalIfExistsAndCall(tag, ptr => X86 ? igraph_bfs_x86(graph, root, roots, mode, unreachable, restricted, order, rank, father, pred, succ, dist, callback, ptr) : igraph_bfs_x64(graph, root, roots, mode, unreachable, restricted, order, rank, father, pred, succ, dist, callback, ptr))); }
private static extern int igraph_layout_mds_x64(igraph_t graph, [In, Out] igraph_matrix_t res, igraph_matrix_t dist, int dim, IntPtr options);
internal static int igraph_dfs(igraph_t graph, int root, igraph_neimode_t mode, bool unreachable, igraph_vector_t order, igraph_vector_t order_out, igraph_vector_t father, igraph_vector_t dist, igraph_dfshandler_t inWrapper, igraph_dfshandler_t outWrapper, object tag) { return(MarshalIfExistsAndCall(tag, ptr => X86 ? igraph_dfs_x86(graph, root, mode, unreachable, order, order_out, father, dist, inWrapper, outWrapper, ptr) : igraph_dfs_x64(graph, root, mode, unreachable, order, order_out, father, dist, inWrapper, outWrapper, ptr))); }
internal static int igraph_destroy(igraph_t graph) { return(X86 ? igraph_destroy_x86(graph) : igraph_destroy_x64(graph)); }
internal static int igraph_add_edge(igraph_t graph, int from, int to) { return(X86 ? igraph_add_edge_x86(graph, from, to) : igraph_add_edge_x64(graph, from, to)); }