In the java library ojAlgo
, how can I slice a matrix or extract a sub-matrix from an existing one?
For example,
matrix A = [[1,2,3],[4,5,6],[7,8,9]]
.
I am looking for a method which looks like slice(a,b,c,d)
where a, b are the start and end indexes of the rows and c,d are the start and end indexes of the columns.
For example, if I call A.slice(1,3,1,3)
, it should return [[5,6],[8,9]]
.
I tried the slice
method in SparseStore
, but it does not work as I expected.