@Override final public boolean hasNext() { return (rowIndex < matrix.getNumRows()); }
@Override final public boolean hasNext() { return (rowIndex < matrix.getNumRows()); }
@Override final public boolean hasNext() { return (rowIndex < matrix.getNumRows()); }
/** * Updates this to point to a new location in the matrix (if input is within * bounds). * * @param rowIndex The new row index * @throws IllegalArgumentException if the input rowIndex is out of bounds */ @Override final public void setRowIndex( final int rowIndex) { if ((rowIndex < 0) || (rowIndex >= this.matrix.getNumRows())) { throw new IllegalArgumentException("Unable to set row index " + "beyond bounds: " + rowIndex + " not within [0, " + matrix.getNumRows() + ")"); } this.rowIndex = rowIndex; }
/** * Updates this to point to a new location in the matrix (if input is within * bounds). * * @param rowIndex The new row index * @throws IllegalArgumentException if the input rowIndex is out of bounds */ @Override final public void setRowIndex( final int rowIndex) { if ((rowIndex < 0) || (rowIndex >= this.matrix.getNumRows())) { throw new IllegalArgumentException("Unable to set row index " + "beyond bounds: " + rowIndex + " not within [0, " + matrix.getNumRows() + ")"); } this.rowIndex = rowIndex; }
/** * Updates this to point to a new location in the matrix (if input is within * bounds). * * @param rowIndex The new row index * @throws IllegalArgumentException if the input rowIndex is out of bounds */ @Override final public void setRowIndex( final int rowIndex) { if ((rowIndex < 0) || (rowIndex >= this.matrix.getNumRows())) { throw new IllegalArgumentException("Unable to set row index " + "beyond bounds: " + rowIndex + " not within [0, " + matrix.getNumRows() + ")"); } this.rowIndex = rowIndex; }
/** * Helper method checks that the input submatrix range is acceptable for * this matrix, including that the max is greater than or equal to the min. * Note that the input mins and maxs are inclusive. * * @param minRow The minimum row to return (inclusive) * @param maxRow The maximum row to return (inclusive) * @param minCol The minimum column to return (inclusive) * @param maxCol The maximum column to return (inclusive) * @throws ArrayIndexOutOfBoundsException if the input range is illegal or * outside the bounds of this. */ final protected void checkSubmatrixRange( final int minRow, final int maxRow, final int minCol, final int maxCol) { if (maxRow < minRow || maxCol < minCol || minRow < 0 || minCol < 0 || maxRow > getNumRows() || maxCol > getNumColumns()) { throw new ArrayIndexOutOfBoundsException("Input range is invalid: [" + minRow + ", " + maxRow + "], [" + minCol + ", " + maxCol + "]"); } }
@Override final public String toString( final NumberFormat format) { StringBuilder sb = new StringBuilder(); int m = getNumRows(); int n = getNumColumns(); for (int i = 0; i < m; ++i) { for (int j = 0; j < n; ++j) { sb.append(format.format(get(i, j))).append(" "); } sb.append('\n'); } return sb.toString(); }
@Override final public String toString( final NumberFormat format) { StringBuilder sb = new StringBuilder(); int m = getNumRows(); int n = getNumColumns(); for (int i = 0; i < m; ++i) { for (int j = 0; j < n; ++j) { sb.append(format.format(get(i, j))).append(" "); } sb.append('\n'); } return sb.toString(); }
@Override final public String toString( final NumberFormat format) { StringBuilder sb = new StringBuilder(); int m = getNumRows(); int n = getNumColumns(); for (int i = 0; i < m; ++i) { for (int j = 0; j < n; ++j) { sb.append(format.format(get(i, j))).append(" "); } sb.append('\n'); } return sb.toString(); }
/** * Helper method checks that the input submatrix range is acceptable for * this matrix, including that the max is greater than or equal to the min. * Note that the input mins and maxs are inclusive. * * @param minRow The minimum row to return (inclusive) * @param maxRow The maximum row to return (inclusive) * @param minCol The minimum column to return (inclusive) * @param maxCol The maximum column to return (inclusive) * @throws ArrayIndexOutOfBoundsException if the input range is illegal or * outside the bounds of this. */ final protected void checkSubmatrixRange( final int minRow, final int maxRow, final int minCol, final int maxCol) { if (maxRow < minRow || maxCol < minCol || minRow < 0 || minCol < 0 || maxRow > getNumRows() || maxCol > getNumColumns()) { throw new ArrayIndexOutOfBoundsException("Input range is invalid: [" + minRow + ", " + maxRow + "], [" + minCol + ", " + maxCol + "]"); } }
/** * Helper method checks that the input submatrix range is acceptable for * this matrix, including that the max is greater than or equal to the min. * Note that the input mins and maxs are inclusive. * * @param minRow The minimum row to return (inclusive) * @param maxRow The maximum row to return (inclusive) * @param minCol The minimum column to return (inclusive) * @param maxCol The maximum column to return (inclusive) * @throws ArrayIndexOutOfBoundsException if the input range is illegal or * outside the bounds of this. */ final protected void checkSubmatrixRange( final int minRow, final int maxRow, final int minCol, final int maxCol) { if (maxRow < minRow || maxCol < minCol || minRow < 0 || minCol < 0 || maxRow > getNumRows() || maxCol > getNumColumns()) { throw new ArrayIndexOutOfBoundsException("Input range is invalid: [" + minRow + ", " + maxRow + "], [" + minCol + ", " + maxCol + "]"); } }
/** * Checks that the input matrix has the same numRows as this's numRows * (otherwise, there can be no soluation for Ax = b). * * @param b The RHS matrix * @throws IllegalArgumentException if the input's size doesn't match this's * numRows */ final protected void checkSolveDimensions( final Matrix b) { if (b.getNumRows() != this.getNumRows()) { throw new IllegalArgumentException("Input matrix (numRows = " + b.getNumRows() + ") can't be \"solved\" with by a matrix with dimensions " + getNumRows() + "x" + getNumColumns()); } }
/** * Checks that the input vector has the same dimensionality as this's * numRows (otherwise, there can be no solution for Ax = b). * * @param b The RHS vector * @throws IllegalArgumentException if the input's size doesn't match this's * numRows */ final protected void checkSolveDimensions( final Vector b) { if (b.getDimensionality() != this.getNumRows()) { throw new IllegalArgumentException("Input vector (length = " + b.getDimensionality() + ") can't be \"solved\" with by a matrix with dimensions " + getNumRows() + "x" + getNumColumns()); } }
/** * Checks that the input matrix has the same numRows as this's numRows * (otherwise, there can be no soluation for Ax = b). * * @param b The RHS matrix * @throws IllegalArgumentException if the input's size doesn't match this's * numRows */ final protected void checkSolveDimensions( final Matrix b) { if (b.getNumRows() != this.getNumRows()) { throw new IllegalArgumentException("Input matrix (numRows = " + b.getNumRows() + ") can't be \"solved\" with by a matrix with dimensions " + getNumRows() + "x" + getNumColumns()); } }
/** * Checks that the input vector has the same dimensionality as this's * numRows (otherwise, there can be no solution for Ax = b). * * @param b The RHS vector * @throws IllegalArgumentException if the input's size doesn't match this's * numRows */ final protected void checkSolveDimensions( final Vector b) { if (b.getDimensionality() != this.getNumRows()) { throw new IllegalArgumentException("Input vector (length = " + b.getDimensionality() + ") can't be \"solved\" with by a matrix with dimensions " + getNumRows() + "x" + getNumColumns()); } }
/** * Checks that the input vector has the same dimensionality as this's * numRows (otherwise, there can be no solution for Ax = b). * * @param b The RHS vector * @throws IllegalArgumentException if the input's size doesn't match this's * numRows */ final protected void checkSolveDimensions( final Vector b) { if (b.getDimensionality() != this.getNumRows()) { throw new IllegalArgumentException("Input vector (length = " + b.getDimensionality() + ") can't be \"solved\" with by a matrix with dimensions " + getNumRows() + "x" + getNumColumns()); } }
/** * Checks that the input matrix has the same numRows as this's numRows * (otherwise, there can be no soluation for Ax = b). * * @param b The RHS matrix * @throws IllegalArgumentException if the input's size doesn't match this's * numRows */ final protected void checkSolveDimensions( final Matrix b) { if (b.getNumRows() != this.getNumRows()) { throw new IllegalArgumentException("Input matrix (numRows = " + b.getNumRows() + ") can't be \"solved\" with by a matrix with dimensions " + getNumRows() + "x" + getNumColumns()); } }
vector.assertDimensionalityEquals(this.getNumRows()); final Vector result = vector.getVectorFactory().createVector( this.getNumColumns());
vector.assertDimensionalityEquals(this.getNumRows()); final Vector result = vector.getVectorFactory().createVector( this.getNumColumns());