public static XSlice Step(int step) { if (step < 0) { return(XSlice.Create(-1, int.MinValue, step)); } return(XSlice.Create(0, int.MaxValue, step)); }
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)); } }
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)); } }
//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)); }
public static XSlice Only(Scalar <int> i) => XSlice.Create(i, i + 1, 0);