vkostyukov / la4j

Linear Algebra for Java
http://la4j.org
Apache License 2.0
373 stars 107 forks source link

New API methods: remove row/column #177

Closed vkostyukov closed 9 years ago

vkostyukov commented 10 years ago

For now, users can still use select method in order to remove n rows/columns from matrix. Like this:

Matrix a = Matrices.asMatrix3x3(...);
Matrix b = a.select(new int[] {0, 1}, new int[] {0, 1, 2}); // removes the last row
Matrix c = a.select(new int[] {0, 1, 2}, new int[] {0, 2}); // removes the second column

Users are also asking me about a particular methods for this: removeRow(int i) and removeColumn(int j).

We also should probably think about opposite methods, like insertRow/insertColumn. This might be done in a next release.

SamoylovMD commented 10 years ago

Do we need to optimize methods for sparse matrices, or we can stay (for now) on this version?

vkostyukov commented 10 years ago

Lets start within a simple version. How about also having a couple of additional methods like removeFirstRow(), removeFirstColumn(), removeLastRow() and removeLastColumn()?

SamoylovMD commented 10 years ago

Accepted. Will be done in few minutes.

vkostyukov commented 9 years ago

Looks like this is done.