Mercurial > hg > octave-nkf
diff liboctave/array/boolMatrix.h @ 19507:25f535b90e52
Change boolMatrix to subclass boolNDArray rather than be another Array<bool>.
* boolMatrix.h: both boolMatrix and boolNDArray are Array<bool>, the first
being simply 2 dimensional. We change this so that boolMatrix inherits from
boolNDArray instead.
* boolNDArray.cc, boolNDArray.h (boolNDArray::matrix_value): remove method
since boolMatrix can be constructed from its parent.
(boolNDArray::boolNDArray): remove constructor from boolMatrix
* pr-output.cc, octave-value/ov-bool-mat.cc, octave-value/ov-bool-mat.h:
replace calls to boolNDArray::matrix_value () with the boolMatrix constructor.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Mon, 20 Oct 2014 01:34:52 +0100 |
parents | ebb3ef964372 |
children | 8b4a24081e47 |
line wrap: on
line diff
--- a/liboctave/array/boolMatrix.h +++ b/liboctave/array/boolMatrix.h @@ -25,31 +25,32 @@ #define octave_boolMatrix_h 1 #include "Array.h" +#include "boolNDArray.h" #include "mx-defs.h" #include "mx-op-decl.h" class OCTAVE_API -boolMatrix : public Array<bool> +boolMatrix : public boolNDArray { public: - boolMatrix (void) : Array<bool> () { } + boolMatrix (void) : boolNDArray () { } boolMatrix (octave_idx_type r, octave_idx_type c) - : Array<bool> (dim_vector (r, c)) { } + : boolNDArray (dim_vector (r, c)) { } boolMatrix (octave_idx_type r, octave_idx_type c, bool val) - : Array<bool> (dim_vector (r, c), val) { } + : boolNDArray (dim_vector (r, c), val) { } - boolMatrix (const dim_vector& dv) : Array<bool> (dv) { } + boolMatrix (const dim_vector& dv) : boolNDArray (dv) { } - boolMatrix (const dim_vector& dv, bool val) : Array<bool> (dv, val) { } + boolMatrix (const dim_vector& dv, bool val) : boolNDArray (dv, val) { } - boolMatrix (const Array<bool>& a) : Array<bool> (a.as_matrix ()) { } + boolMatrix (const Array<bool>& a) : boolNDArray (a.as_matrix ()) { } - boolMatrix (const boolMatrix& a) : Array<bool> (a) { } + boolMatrix (const boolMatrix& a) : boolNDArray (a) { } boolMatrix& operator = (const boolMatrix& a) {