//[duplicated code from DoubleArrayExtension] public static IntArray GetCols(this IntArray x, IList <int> theseCols) { if (x.size0 == 1) { Slice[] s = new Slice[1]; s[0] = new Slice(theseCols); IntArray newX = x.GetSliceDeep(s); return(newX); } else { Slice[] s = new Slice[2]; s[0] = Slice.All; s[1] = new Slice(theseCols); IntArray newX = x.GetSliceDeep(s); return(newX); } }
//[duplicated code from DoubleArrayExtension] public static IntArray GetColSlice(this IntArray x, int firstCol, int colStep, int maxCol) { return(x.GetSliceDeep(0, x.size0 - 1, 1, firstCol, maxCol, colStep)); }
//[duplicated code from DoubleArrayExtension] public static IntArray GetRowSlice(this IntArray x, int firstRow, int rowStep, int maxRow) { return(x.GetSliceDeep(firstRow, maxRow, rowStep, 0, x.size1 - 1, 1)); }