comparison liboctave/array/boolMatrix.h @ 19354: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
comparison
equal deleted inserted replaced
19353:3746b92739f7 19354:50922b1c74df
42 : boolNDArray (dim_vector (r, c)) { } 42 : boolNDArray (dim_vector (r, c)) { }
43 43
44 boolMatrix (octave_idx_type r, octave_idx_type c, bool val) 44 boolMatrix (octave_idx_type r, octave_idx_type c, bool val)
45 : boolNDArray (dim_vector (r, c), val) { } 45 : boolNDArray (dim_vector (r, c), val) { }
46 46
47 boolMatrix (const dim_vector& dv) : boolNDArray (dv) { } 47 boolMatrix (const dim_vector& dv) : boolNDArray (dv.redim (2)) { }
48 48
49 boolMatrix (const dim_vector& dv, bool val) : boolNDArray (dv, val) { } 49 boolMatrix (const dim_vector& dv, bool val)
50 : boolNDArray (dv.redim (2), val) { }
50 51
51 boolMatrix (const Array<bool>& a) : boolNDArray (a.as_matrix ()) { } 52 boolMatrix (const Array<bool>& a) : boolNDArray (a.as_matrix ()) { }
52 53
53 boolMatrix (const boolMatrix& a) : boolNDArray (a) { } 54 boolMatrix (const boolMatrix& a) : boolNDArray (a) { }
54 55