Exemplo n.º 1
0
 internal static void igraph_vector_fill(igraph_vector_t vector, double v)
 {
     if (X86)
     {
         igraph_vector_fill_x86(vector, v);
     }
     else
     {
         igraph_vector_fill_x64(vector, v);
     }
 }
Exemplo n.º 2
0
 internal static void igraph_vector_scale(igraph_vector_t vector, double by)
 {
     if (X86)
     {
         igraph_vector_scale_x86(vector, by);
     }
     else
     {
         igraph_vector_scale_x64(vector, by);
     }
 }
Exemplo n.º 3
0
 internal static void igraph_vector_destroy(igraph_vector_t vector)
 {
     if (X86)
     {
         igraph_vector_destroy_x86(vector);
     }
     else
     {
         igraph_vector_destroy_x64(vector);
     }
 }
Exemplo n.º 4
0
 internal static void igraph_vector_set(igraph_vector_t vector, int index, double value)
 {
     if (X86)
     {
         igraph_vector_set_x86(vector, index, value);
     }
     else
     {
         igraph_vector_set_x64(vector, index, value);
     }
 }
Exemplo n.º 5
0
        internal static double[] igraph_vector_to_array(igraph_vector_t from)
        {
            var len    = igraph_vector_size(from);
            var result = new double[len];

            if (X86)
            {
                igraph_vector_copy_to_x86(from, result);
            }
            else
            {
                igraph_vector_copy_to_x64(from, result);
            }
            return(result);
        }
Exemplo n.º 6
0
 private static extern double igraph_vector_e_x64(igraph_vector_t vector, int index);
Exemplo n.º 7
0
 private static extern int igraph_vector_size_x64(igraph_vector_t vector);
Exemplo n.º 8
0
 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);
Exemplo n.º 9
0
 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);
Exemplo n.º 10
0
 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));
 }
Exemplo n.º 11
0
 private static extern void igraph_vector_scale_x64([In, Out] igraph_vector_t vector, double by);
Exemplo n.º 12
0
 private static extern int igraph_vector_reverse_x64([In, Out] igraph_vector_t vector);
Exemplo n.º 13
0
 private static extern void igraph_vector_copy_to_x64(igraph_vector_t from, [In, Out] double[] to);
Exemplo n.º 14
0
 private static extern double igraph_vector_set_x64([In, Out] igraph_vector_t vector, int index, double value);
Exemplo n.º 15
0
 internal static double igraph_vector_e(igraph_vector_t vector, int index)
 {
     return(X86 ? igraph_vector_e_x86(vector, index) : igraph_vector_e_x64(vector, index));
 }
Exemplo n.º 16
0
 internal static int igraph_vector_copy(igraph_vector_t to, igraph_vector_t from)
 {
     return(X86 ? igraph_vector_copy_x86(to, from) : igraph_vector_copy_x64(to, from));
 }
Exemplo n.º 17
0
 internal static int igraph_vector_init_copy(igraph_vector_t vector, double[] vec)
 {
     return(X86 ? igraph_vector_init_copy_x86(vector, vec, vec.Length) : igraph_vector_init_copy_x64(vector, vec, vec.Length));
 }
Exemplo n.º 18
0
 internal static int igraph_vector_init(igraph_vector_t vector, int length)
 {
     return(X86 ? igraph_vector_init_x86(vector, length) : igraph_vector_init_x64(vector, length));
 }
Exemplo n.º 19
0
 private static extern int igraph_vector_copy_x64([In, Out] igraph_vector_t to, igraph_vector_t from);
Exemplo n.º 20
0
 internal static int igraph_vector_reverse(igraph_vector_t vector)
 {
     return(X86 ? igraph_vector_reverse_x86(vector) : igraph_vector_reverse_x64(vector));
 }
Exemplo n.º 21
0
 private static extern int igraph_vector_fill_x64([In, Out] igraph_vector_t vector, double v);
Exemplo n.º 22
0
 internal static int igraph_vector_shuffle(igraph_vector_t vector)
 {
     return(X86 ? igraph_vector_shuffle_x86(vector) : igraph_vector_shuffle_x64(vector));
 }
Exemplo n.º 23
0
 private static extern int igraph_vector_shuffle_x64([In, Out] igraph_vector_t vector);
Exemplo n.º 24
0
 private static extern int igraph_vector_init_x64([In, Out] igraph_vector_t vector, int length);
Exemplo n.º 25
0
 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));
 }
Exemplo n.º 26
0
 private static extern int igraph_vector_init_copy_x64([In, Out] igraph_vector_t vector, double[] vec, int length);
Exemplo n.º 27
0
 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);
Exemplo n.º 28
0
 private static extern void igraph_vector_destroy_x64([In, Out] igraph_vector_t vector);
Exemplo n.º 29
0
        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);
                }
            }
        }
Exemplo n.º 30
0
 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);