view test/bug-38576.tst @ 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 730bc06134f9
children
line wrap: on
line source

%!function r = f1 ()
%!  ls = svd (1);
%!  r = eval ("ls -1;");
%!endfunction
%!function r = f2 ()
%!  [u,ls,v] = svd (1);
%!  r = eval ("ls -1;");
%!endfunction
%!function r = f3 (ls)
%!  r = eval ("ls -1;");
%!endfunction

%!test
%! ## Windows systems can't run "ls -1"
%! if (! ispc ())
%!   assert (f1 (), 0);
%!   assert (f2 (), 0);
%!   assert (ischar (f3 ()), true);
%!   assert (f3 (1), 0);
%! endif