Beispiel #1
0
        public static NativeMatrix <T> AllocateMatrix <T>(int nx, int ny) where T : struct
        {
            var size = NativeMatrix <T> .ElementSize;

            IntPtr ptr = Fftw.Malloc((IntPtr)(nx * ny * size));

            _allPointers.Add(ptr);

            return(new NativeMatrix <T>(ptr, nx, ny));
        }
Beispiel #2
0
        public static NativeArray <T> AllocateArray <T>(int length) where T : struct
        {
            var size = NativeArray <T> .ElementSize;

            IntPtr ptr = Fftw.Malloc((IntPtr)(length * size));

            _allPointers.Add(ptr);

            return(new NativeArray <T>(ptr, length));
        }