Example #1
0
        public PosIter(
            FastAccess fl,
            int[] startPos = null,
            int fromDim    = 0,
            int toDim      = int.MinValue)
        {
            if (startPos == null)
            {
                startPos = new int[fl.NumDiensions];
            }

            if (toDim == int.MinValue)
            {
                toDim = fl.NumDiensions - 1;
            }

            Pos = new int[startPos.Length];
            startPos.CopyTo(Pos, 0);

            Shape  = fl.Shape;
            Stride = fl.Stride;

            Addr    = fl.UnCheckedArray(startPos);
            Active  = Enumerable.Range(0, fl.NumDiensions + 1).All(d => !(fromDim <= d && d <= toDim) || (startPos[d] >= 0 && startPos[d] < Shape[d]));
            FromDim = fromDim;
            ToDim   = toDim;
        }
 public HostBackend(Layout layout, IHostStorage <T> storage)
 {
     FastAccess = new FastAccess(layout);
     data       = storage.Data;
 }