These checks assume sizes of ranges to have exactly the same size as the matrix has. This way it is impossible to fill some part of the matrix with the other one (say a vector), you can only fill the whole matrix with the other one of the same size.
public DoubleMatrix put(Range rs, Range cs, DoubleMatrix x) {
rs.init(0, rows);
cs.init(0, columns);
x.checkRows(rs.length());
x.checkColumns(cs.length());
for (; rs.hasMore(); rs.next()) {
cs.init(0, columns);
for (; cs.hasMore(); cs.next()) {
put(rs.value(), cs.value(), x.get(rs.index(), cs.index()));
}
}
return this;
}
These checks assume sizes of ranges to have exactly the same size as the matrix has. This way it is impossible to fill some part of the matrix with the other one (say a vector), you can only fill the whole matrix with the other one of the same size.