Mercurial > hg > octave-nkf
diff liboctave/array/dSparse.cc @ 17688:8031fc73f291
Remove zeros from sparse matrices after use of real/imag (bug # 40305)
* dSparse.CC (SparseMatrix real (const SparseComplexMatrix&),
SparseMatrix imag (const SparseComplexMatrix&)) : Use maybe_compress to
remove zeros from the return matrix.
author | David Bateman <dbateman@free.fr> |
---|---|
date | Fri, 18 Oct 2013 23:13:45 +0200 |
parents | 93e272018df2 |
children | 8a54a481ecb5 |
line wrap: on
line diff
--- a/liboctave/array/dSparse.cc +++ b/liboctave/array/dSparse.cc @@ -653,6 +653,7 @@ r.ridx (i) = a.ridx (i); } + r.maybe_compress (true); return r; } @@ -673,9 +674,17 @@ r.ridx (i) = a.ridx (i); } + r.maybe_compress (true); return r; } +/* + +%!assert(nnz(real(sparse([1i,1]))),1) +%!assert(nnz(real(sparse([1i,1]))),1) + +*/ + SparseMatrix atan2 (const double& x, const SparseMatrix& y) {