/** Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and columns of the given row. The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa. <p> To obtain a slice view on subranges, construct a sub-ranging view (<tt>view().part(...)</tt>), then apply this method to the sub-range view. To obtain 1-dimensional views, apply this method, then apply another slice view (methods <tt>viewColumn</tt>, <tt>viewRow</tt>) on the intermediate 2-dimensional view. To obtain 1-dimensional views on subranges, apply both steps. @param row the index of the row to fix. @return a new 2-dimensional slice view. @throws IndexOutOfBoundsException if <tt>row < 0 || row >= row()</tt>. @see #viewSlice(int) @see #viewColumn(int) */ public DoubleMatrix2D viewRow(int row) { checkRow(row); int sliceRows = this.slices; int sliceColumns = this.columns; //int sliceOffset = index(0,row,0); int sliceRowZero = sliceZero ; int sliceColumnZero = columnZero + _rowOffset(_rowRank(row)); int sliceRowStride = this.sliceStride; int sliceColumnStride = this.columnStride; return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride); } /**
/** Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and rows of the given column. The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa. <p> To obtain a slice view on subranges, construct a sub-ranging view (<tt>view().part(...)</tt>), then apply this method to the sub-range view. To obtain 1-dimensional views, apply this method, then apply another slice view (methods <tt>viewColumn</tt>, <tt>viewRow</tt>) on the intermediate 2-dimensional view. To obtain 1-dimensional views on subranges, apply both steps. @param column the index of the column to fix. @return a new 2-dimensional slice view. @throws IndexOutOfBoundsException if <tt>column < 0 || column >= columns()</tt>. @see #viewSlice(int) @see #viewRow(int) */ public DoubleMatrix2D viewColumn(int column) { checkColumn(column); int sliceRows = this.slices; int sliceColumns = this.rows; //int sliceOffset = index(0,0,column); int sliceRowZero = sliceZero; int sliceColumnZero = rowZero + _columnOffset(_columnRank(column)); int sliceRowStride = this.sliceStride; int sliceColumnStride = this.rowStride; return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride); } /**
/** Constructs and returns a new 2-dimensional <i>slice view</i> representing the rows and columns of the given slice. The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa. <p> To obtain a slice view on subranges, construct a sub-ranging view (<tt>view().part(...)</tt>), then apply this method to the sub-range view. To obtain 1-dimensional views, apply this method, then apply another slice view (methods <tt>viewColumn</tt>, <tt>viewRow</tt>) on the intermediate 2-dimensional view. To obtain 1-dimensional views on subranges, apply both steps. @param slice the index of the slice to fix. @return a new 2-dimensional slice view. @throws IndexOutOfBoundsException if <tt>slice < 0 || slice >= slices()</tt>. @see #viewRow(int) @see #viewColumn(int) */ public DoubleMatrix2D viewSlice(int slice) { checkSlice(slice); int sliceRows = this.rows; int sliceColumns = this.columns; //int sliceOffset = index(slice,0,0); int sliceRowZero = rowZero; int sliceColumnZero = columnZero + _sliceOffset(_sliceRank(slice)); int sliceRowStride = this.rowStride; int sliceColumnStride = this.columnStride; return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride); } /**
/** Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and rows of the given column. The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa. <p> To obtain a slice view on subranges, construct a sub-ranging view (<tt>view().part(...)</tt>), then apply this method to the sub-range view. To obtain 1-dimensional views, apply this method, then apply another slice view (methods <tt>viewColumn</tt>, <tt>viewRow</tt>) on the intermediate 2-dimensional view. To obtain 1-dimensional views on subranges, apply both steps. @param column the index of the column to fix. @return a new 2-dimensional slice view. @throws IndexOutOfBoundsException if <tt>column < 0 || column >= columns()</tt>. @see #viewSlice(int) @see #viewRow(int) */ public DoubleMatrix2D viewColumn(int column) { checkColumn(column); int sliceRows = this.slices; int sliceColumns = this.rows; //int sliceOffset = index(0,0,column); int sliceRowZero = sliceZero; int sliceColumnZero = rowZero + _columnOffset(_columnRank(column)); int sliceRowStride = this.sliceStride; int sliceColumnStride = this.rowStride; return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride); } /**
/** Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and columns of the given row. The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa. <p> To obtain a slice view on subranges, construct a sub-ranging view (<tt>view().part(...)</tt>), then apply this method to the sub-range view. To obtain 1-dimensional views, apply this method, then apply another slice view (methods <tt>viewColumn</tt>, <tt>viewRow</tt>) on the intermediate 2-dimensional view. To obtain 1-dimensional views on subranges, apply both steps. @param row the index of the row to fix. @return a new 2-dimensional slice view. @throws IndexOutOfBoundsException if <tt>row < 0 || row >= row()</tt>. @see #viewSlice(int) @see #viewColumn(int) */ public DoubleMatrix2D viewRow(int row) { checkRow(row); int sliceRows = this.slices; int sliceColumns = this.columns; //int sliceOffset = index(0,row,0); int sliceRowZero = sliceZero ; int sliceColumnZero = columnZero + _rowOffset(_rowRank(row)); int sliceRowStride = this.sliceStride; int sliceColumnStride = this.columnStride; return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride); } /**
/** Constructs and returns a new 2-dimensional <i>slice view</i> representing the rows and columns of the given slice. The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa. <p> To obtain a slice view on subranges, construct a sub-ranging view (<tt>view().part(...)</tt>), then apply this method to the sub-range view. To obtain 1-dimensional views, apply this method, then apply another slice view (methods <tt>viewColumn</tt>, <tt>viewRow</tt>) on the intermediate 2-dimensional view. To obtain 1-dimensional views on subranges, apply both steps. @param slice the index of the slice to fix. @return a new 2-dimensional slice view. @throws IndexOutOfBoundsException if <tt>slice < 0 || slice >= slices()</tt>. @see #viewRow(int) @see #viewColumn(int) */ public DoubleMatrix2D viewSlice(int slice) { checkSlice(slice); int sliceRows = this.rows; int sliceColumns = this.columns; //int sliceOffset = index(slice,0,0); int sliceRowZero = rowZero; int sliceColumnZero = columnZero + _sliceOffset(_sliceRank(slice)); int sliceRowStride = this.rowStride; int sliceColumnStride = this.columnStride; return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride); } /**