Mercurial > hg > octave-nkf
changeset 18303:00539b673cd4
Sparse.cc: Fix C++ function ambiguity (bug #41145).
Sparse.cc (diag): Use octave_idx_type objects in Sparse constructor for
empty []0x1 object.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 14 Jan 2014 13:10:17 -0800 |
parents | 75d7cde2dda4 |
children | a0c9f5302eae |
files | liboctave/array/Sparse.cc |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/array/Sparse.cc +++ b/liboctave/array/Sparse.cc @@ -2490,8 +2490,16 @@ } } } - else // Matlab returns [] 0x1 for out-of-range diagonal - d = Sparse<T> (0, 1, 0); + else + { + // Matlab returns [] 0x1 for out-of-range diagonal + + octave_idx_type nr = 0; + octave_idx_type nc = 1; + octave_idx_type nz = 0; + + d = Sparse<T> (nr, nc, nz); + } } else if (nnr != 0 && nnc != 0) {