Fix wrong allocated vector length in RowSlice

The length of the returned DVec should correspond to the
the number of elements in the slice and not the number of rows in the
matrix.
This commit is contained in:
Anders Kalør 2015-08-27 16:55:20 +02:00
parent 5e41fbfe2a
commit 043d7ab108

View File

@ -559,7 +559,7 @@ impl<N: Copy> RowSlice<DVec<N>> for DMat<N> {
assert!(col_start < col_end); assert!(col_start < col_end);
assert!(col_end <= self.ncols); assert!(col_end <= self.ncols);
let mut slice : DVec<N> = unsafe { let mut slice : DVec<N> = unsafe {
DVec::new_uninitialized(self.nrows) DVec::new_uninitialized(col_end - col_start)
}; };
let mut slice_idx = 0; let mut slice_idx = 0;
for col_id in col_start..col_end { for col_id in col_start..col_end {