Mercurial > octave
changeset 22657:a93887d7f0da
Use EmptyValue option correctly in all instances (bug #42023).
* dlmread.cc: Whenever calling resize on the data matrix, supply the fill value
of empty_value.
author | Rik <rik@octave.org> |
---|---|
date | Sun, 23 Oct 2016 13:57:00 -0700 |
parents | 471cc4268677 |
children | 9a939479308f |
files | libinterp/corefcn/dlmread.cc |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/dlmread.cc Sun Oct 23 12:10:19 2016 -0700 +++ b/libinterp/corefcn/dlmread.cc Sun Oct 23 13:57:00 2016 -0700 @@ -360,9 +360,9 @@ while (pos2 != std::string::npos); if (iscmplx) - cdata.resize (rmax, cmax); + cdata.resize (rmax, cmax, empty_value); else - rdata.resize (rmax, cmax); + rdata.resize (rmax, cmax, empty_value); } r = (r > i + 1 ? r : i + 1); @@ -398,9 +398,9 @@ rmax = 2*r; cmax = c; if (iscmplx) - cdata.resize (rmax, cmax); + cdata.resize (rmax, cmax, empty_value); else - rdata.resize (rmax, cmax); + rdata.resize (rmax, cmax, empty_value); } tmp_stream.str (str); @@ -504,7 +504,7 @@ %! fclose (fid); %! %! assert (dlmread (file), [1, 2, 3; 4 + 4i, 5, 6; 7, 8, 9; 10, 11, 12]); -%! assert (dlmread (file, ","), [1, 2, 3; 4 + 4i, 5, 6; 7, 8, 9; 10, 11, 12]); +%! assert (dlmread (file, ","), [1,2,3; 4 + 4i, 5, 6; 7, 8, 9; 10, 11, 12]); %! assert (dlmread (file, ",", [1, 0, 2, 1]), [4 + 4i, 5; 7, 8]); %! assert (dlmread (file, ",", "A2..B3"), [4 + 4i, 5; 7, 8]); %! assert (dlmread (file, ",", "A2:B3"), [4 + 4i, 5; 7, 8]); @@ -527,7 +527,7 @@ %! assert (dlmread (file, " "), [ 0, 0, 0, 0, 0, %! 0, 1, 2, 0, 0, %! 11, 22, 0, 0, 0, -%! 0, 0, 0, 0, 0]); +%! 0, 0, 0, 0, 0]); %! unwind_protect_cleanup %! unlink (file); %! end_unwind_protect