Mercurial > hg > octave-nkf
diff src/ov-intx.h @ 5898:da843f35775c
[project @ 2006-07-19 18:18:08 by jwe]
author | jwe |
---|---|
date | Wed, 19 Jul 2006 18:18:31 +0000 |
parents | b9c45e0cf685 |
children | c20eb7330d13 |
line wrap: on
line diff
--- a/src/ov-intx.h +++ b/src/ov-intx.h @@ -125,6 +125,19 @@ return retval; } + boolNDArray + bool_array_value (void) const + { + boolNDArray retval (dims ()); + + octave_idx_type nel = numel (); + + for (octave_idx_type i = 0; i < nel; i++) + retval(i) = static_cast<bool>(matrix(i)); + + return retval; + } + charNDArray char_array_value (bool = false) const { @@ -301,6 +314,14 @@ return retval; } + boolNDArray + bool_array_value (void) const + { + boolNDArray retval (dim_vector (1, 1)); + retval(0) = static_cast<bool>(scalar); + return retval; + } + charNDArray char_array_value (bool = false) const {