Exemple #1
0
            public unsafe override void  ToBuffer(byte[] buf, DType buftype, int iheight, int icol)
            {
                var bytesPerRow = buftype.FieldOffset(buftype.Fields.Count);
                var fieldOffset = buftype.FieldOffset(icol);
                var dtype       = buftype.Fields[icol];

                long[] data   = (this.Values as Int64.NdArray).DataAccessor.AsArray();
                int    elsize = sizeof(long);

                fixed(void *dst = &buf[0])
                fixed(void *src = &data[0])
                ColumnCopy(dst, fieldOffset, bytesPerRow, src, 0, elsize, iheight, elsize);
            }
Exemple #2
0
            public unsafe static Series FromBuffer(byte[] buf, DType buftype, int iheight, int icol)
            {
                var bytesPerRow = buftype.FieldOffset(buftype.Fields.Count);
                var fieldOffset = buftype.FieldOffset(icol);
                var dtype       = buftype.Fields[icol];
                var data        = new long[iheight];
                int elsize      = sizeof(long);

                fixed(void *src = &buf[0])
                fixed(void *dst = &data[0])
                ColumnCopy(dst, 0, elsize, src, fieldOffset, bytesPerRow, iheight, elsize);

                return(data.ToLongSeries());
            }