Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #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);
        }
Пример #6
0
 private static extern double igraph_vector_e_x64(igraph_vector_t vector, int index);
Пример #7
0
 private static extern int igraph_vector_size_x64(igraph_vector_t vector);
Пример #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);
Пример #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);
Пример #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));
 }
Пример #11
0
 private static extern void igraph_vector_scale_x64([In, Out] igraph_vector_t vector, double by);
Пример #12
0
 private static extern int igraph_vector_reverse_x64([In, Out] igraph_vector_t vector);
Пример #13
0
 private static extern void igraph_vector_copy_to_x64(igraph_vector_t from, [In, Out] double[] to);
Пример #14
0
 private static extern double igraph_vector_set_x64([In, Out] igraph_vector_t vector, int index, double value);
Пример #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));
 }
Пример #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));
 }
Пример #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));
 }
Пример #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));
 }
Пример #19
0
 private static extern int igraph_vector_copy_x64([In, Out] igraph_vector_t to, igraph_vector_t from);
Пример #20
0
 internal static int igraph_vector_reverse(igraph_vector_t vector)
 {
     return(X86 ? igraph_vector_reverse_x86(vector) : igraph_vector_reverse_x64(vector));
 }
Пример #21
0
 private static extern int igraph_vector_fill_x64([In, Out] igraph_vector_t vector, double v);
Пример #22
0
 internal static int igraph_vector_shuffle(igraph_vector_t vector)
 {
     return(X86 ? igraph_vector_shuffle_x86(vector) : igraph_vector_shuffle_x64(vector));
 }
Пример #23
0
 private static extern int igraph_vector_shuffle_x64([In, Out] igraph_vector_t vector);
Пример #24
0
 private static extern int igraph_vector_init_x64([In, Out] igraph_vector_t vector, int length);
Пример #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));
 }
Пример #26
0
 private static extern int igraph_vector_init_copy_x64([In, Out] igraph_vector_t vector, double[] vec, int length);
Пример #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);
Пример #28
0
 private static extern void igraph_vector_destroy_x64([In, Out] igraph_vector_t vector);
Пример #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);
                }
            }
        }
Пример #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);