Mercurial > hg > octave-nkf
diff src/OPERATORS/op-cs-sm.cc @ 8835:1685c61542f8
Don't perform narrowing to full matrices in mixed spare scalar operators
author | David Bateman <dbateman@free.fr> |
---|---|
date | Sat, 21 Feb 2009 01:27:23 +0100 (2009-02-21) |
parents | e5055ed23f52 |
children | eb63fbe60fab |
line wrap: on
line diff
--- a/src/OPERATORS/op-cs-sm.cc +++ b/src/OPERATORS/op-cs-sm.cc @@ -57,7 +57,7 @@ if (d == 0.0) gripe_divide_by_zero (); - return octave_value (v1.complex_value () / d); + return octave_value (SparseComplexMatrix (1, 1, v1.complex_value () / d)); } else { @@ -84,13 +84,9 @@ octave_value retval; if (d == 0.0) - { - gripe_divide_by_zero (); + gripe_divide_by_zero (); - retval = octave_value (v2.matrix_value () / d); - } - else - retval = octave_value (v2.sparse_matrix_value () / d); + retval = octave_value (v2.sparse_matrix_value () / d); return retval; } @@ -114,13 +110,9 @@ octave_value retval; if (d == 0.0) - { - gripe_divide_by_zero (); + gripe_divide_by_zero (); - retval = octave_value (v2.matrix_value () / d); - } - else - retval = octave_value (v2.sparse_matrix_value () / d); + retval = octave_value (v2.sparse_matrix_value () / d); return retval; }