Esempio n. 1
0
	public static MVPRetCode query_mvptree(ref MVPFile m, ref DP query, int knearest,
					float radius, float thresh, ref DP[] results, ref int count)
	{

		IntPtr[] points = new IntPtr[results.Length];
		MVPRetCode ret = ph_query_mvptree(ref m, ref query, knearest, radius, thresh, points,
							ref count);
		int i = 0;
		foreach(IntPtr ptr in points)
		{
			DP dp = (DP)Marshal.PtrToStructure(ptr, typeof(DP));
			results[i++] = dp;
			free(ptr);
		}
		return ret;
	}
Esempio n. 2
0
    public static MVPRetCode query_mvptree(ref MVPFile m, ref DP query, int knearest,
                                           float radius, float thresh, ref DP[] results, ref int count)
    {
        IntPtr[]   points = new IntPtr[results.Length];
        MVPRetCode ret    = ph_query_mvptree(ref m, ref query, knearest, radius, thresh, points,
                                             ref count);
        int i = 0;

        foreach (IntPtr ptr in points)
        {
            DP dp = (DP)Marshal.PtrToStructure(ptr, typeof(DP));
            results[i++] = dp;
            free(ptr);
        }
        return(ret);
    }
Esempio n. 3
0
    public static MVPRetCode save_mvptree(ref MVPFile m, DP[] points)
    {
        IntPtr[] datapoints = new IntPtr[points.Length];
        int      size       = Marshal.SizeOf(typeof(DP));
        int      i          = 0;

        foreach (DP dp in points)
        {
            IntPtr ptr = Marshal.AllocHGlobal(size);
            Marshal.StructureToPtr(dp, ptr, false);
            datapoints[i++] = ptr;
        }
        MVPRetCode ret = ph_save_mvptree(ref m, datapoints, datapoints.Length);

        for (i = 0; i < datapoints.Length; ++i)
        {
            Marshal.FreeHGlobal(datapoints[i]);
        }

        return(ret);
    }
Esempio n. 4
0
 public static extern void ph_mvp_init(ref MVPFile f);
Esempio n. 5
0
 private static extern MVPRetCode ph_query_mvptree(ref MVPFile m, ref DP query, int knearest,
                                                   float radius, float threshold, IntPtr[] results,
                                                   ref int count);
Esempio n. 6
0
 private static extern MVPRetCode ph_save_mvptree(ref MVPFile m, IntPtr[] points, int num);
Esempio n. 7
0
 private static extern MVPRetCode ph_add_mvptree(ref MVPFile f, IntPtr[] points, int num,
                                                 ref int saved);
Esempio n. 8
0
	private static extern MVPRetCode ph_add_mvptree(ref MVPFile f, IntPtr[] points, int num, 
							ref int saved);
Esempio n. 9
0
	public static extern void ph_mvp_init(ref MVPFile f);
Esempio n. 10
0
	private static extern MVPRetCode ph_query_mvptree(ref MVPFile m, ref DP query, int knearest,
						float radius, float threshold, IntPtr[] results,
						ref int count);
Esempio n. 11
0
	public static MVPRetCode save_mvptree(ref MVPFile m, DP[] points)
	{
		IntPtr[] datapoints = new IntPtr[points.Length];
		int size = Marshal.SizeOf(typeof(DP));
		int i = 0;
		foreach(DP dp in points)
		{
			IntPtr ptr = Marshal.AllocHGlobal(size);
			Marshal.StructureToPtr(dp, ptr, false);
			datapoints[i++] = ptr;
			
		}
		MVPRetCode ret = ph_save_mvptree(ref m, datapoints, datapoints.Length);
		for(i = 0; i < datapoints.Length; ++i)
			Marshal.FreeHGlobal(datapoints[i]);

		return ret;
	}
Esempio n. 12
0
	private static extern MVPRetCode ph_save_mvptree(ref MVPFile m, IntPtr[] points, int num);