Esempio 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);
     }
 }
Esempio 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);
     }
 }
Esempio 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);
     }
 }
Esempio 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);
     }
 }
Esempio 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);
        }
Esempio n. 6
0
 private static extern double igraph_vector_e_x64(igraph_vector_t vector, int index);
Esempio n. 7
0
 private static extern int igraph_vector_size_x64(igraph_vector_t vector);
Esempio 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);
Esempio 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);
Esempio 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));
 }
Esempio n. 11
0
 private static extern void igraph_vector_scale_x64([In, Out] igraph_vector_t vector, double by);
Esempio n. 12
0
 private static extern int igraph_vector_reverse_x64([In, Out] igraph_vector_t vector);
Esempio n. 13
0
 private static extern void igraph_vector_copy_to_x64(igraph_vector_t from, [In, Out] double[] to);
Esempio n. 14
0
 private static extern double igraph_vector_set_x64([In, Out] igraph_vector_t vector, int index, double value);
Esempio 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));
 }
Esempio 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));
 }
Esempio 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));
 }
Esempio 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));
 }
Esempio n. 19
0
 private static extern int igraph_vector_copy_x64([In, Out] igraph_vector_t to, igraph_vector_t from);
Esempio 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));
 }
Esempio n. 21
0
 private static extern int igraph_vector_fill_x64([In, Out] igraph_vector_t vector, double v);
Esempio 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));
 }
Esempio n. 23
0
 private static extern int igraph_vector_shuffle_x64([In, Out] igraph_vector_t vector);
Esempio n. 24
0
 private static extern int igraph_vector_init_x64([In, Out] igraph_vector_t vector, int length);
Esempio 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));
 }
Esempio n. 26
0
 private static extern int igraph_vector_init_copy_x64([In, Out] igraph_vector_t vector, double[] vec, int length);
Esempio 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);
Esempio n. 28
0
 private static extern void igraph_vector_destroy_x64([In, Out] igraph_vector_t vector);
Esempio 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);
                }
            }
        }
Esempio 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);