我想在DenseMatrix(下面的M+1
)中删除行N
到DM_a
,以生成另一个DenseMatrix(DM_b
)。像这样:
K
DM_a = 0 +-------------------+
| |
| |
| |
M | |
| |
| |
| |
N +-------------------+
K
DM_b = 0 +-------------------+
| |
| |
| |
M +-------------------+
最好(效率最高)通过这样切片来做到这一点:val DM_b = DM_a(0 to M, ::)
还是应该将padRight
映射到DM_a
的每一列?
答案 0 :(得分:1)
矩阵切片:
{{1}}