Example #1
0
 public static XSlice Step(int step)
 {
     if (step < 0)
     {
         return(XSlice.Create(-1, int.MinValue, step));
     }
     return(XSlice.Create(0, int.MaxValue, step));
 }
Example #2
0
 public static XSlice From(Scalar <int> start, int step = 1)
 {
     if (step < 0)
     {
         return(XSlice.Create(start, int.MinValue, step));
     }
     else
     {
         return(XSlice.Create(start, int.MaxValue, step));
     }
 }
Example #3
0
 public static XSlice Until(Scalar <int> stop, int step = 1)
 {
     if (step < 0)
     {
         return(XSlice.Create(-1, stop, step));
     }
     else
     {
         return(XSlice.Create(0, stop, step));
     }
 }
Example #4
0
        //public static readonly Slice NewAxis = Range(0, 0, int.MaxValue);

        public static XSlice Range(Scalar <int> start, Scalar <int> stop, int step = 1)
        {
            if (stop == null)
            {
                return(From(start, step));
            }
            if (start == null)
            {
                return(Until(stop, step));
            }
            return(XSlice.Create(start, stop, step));
        }
Example #5
0
 public static XSlice Only(Scalar <int> i) => XSlice.Create(i, i + 1, 0);