Mercurial > hg > octave-nkf
diff liboctave/array/chMatrix.h @ 19512:50922b1c74df
liboctave: confirm that matrices constructors are limited to 2 dimensions.
* liboctave/array/boolMatrix.h, liboctave/array/chMatrix.h
(boolMatrix::boolMatrix(dim_vector),boolMatrix::boolMatrix(dim_vector,bool),
charMatrix::charMatrix(dim_vector),charMatrix::charMatrix(dim_vector,char)):
call redim(2) on the dim_vector argument to the constructor, the same that
happens in the other typeMatrix classes.
* liboctave/array/fCMatrix.h: simplify code to reshape NDArray input into
matrix form (should have no effect).
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Mon, 10 Nov 2014 23:11:20 +0000 |
parents | 8b4a24081e47 |
children | 4197fc428c7d |
line wrap: on
line diff
--- a/liboctave/array/chMatrix.h +++ b/liboctave/array/chMatrix.h @@ -49,9 +49,10 @@ charMatrix (octave_idx_type r, octave_idx_type c, char val) : charNDArray (dim_vector (r, c), val) { } - charMatrix (const dim_vector& dv) : charNDArray (dv) { } + charMatrix (const dim_vector& dv) : charNDArray (dv.redim (2)) { } - charMatrix (const dim_vector& dv, char val) : charNDArray (dv, val) { } + charMatrix (const dim_vector& dv, char val) + : charNDArray (dv.redim (2), val) { } charMatrix (const Array<char>& a) : charNDArray (a.as_matrix ()) { }