Mercurial > hg > octave-lyh
changeset 12820:efd924e19ff7
codesprint: Add tests for sparse_auto_mutate()
* ov-base.cc (sparse_auto_mutate): Add functional test.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 16 Jul 2011 12:56:58 -0700 |
parents | 66af8b914607 |
children | 8f58f087df7f |
files | src/ov-base.cc |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ov-base.cc +++ b/src/ov-base.cc @@ -1548,3 +1548,16 @@ { return SET_INTERNAL_VARIABLE (sparse_auto_mutate); } + +/* + +%!test + s = speye(3); + sparse_auto_mutate (false); + s(:, 1) = 1; + assert (typeinfo (s), "sparse matrix"); + sparse_auto_mutate (true); + s(1, :) = 1; + assert (typeinfo (s), "matrix"); + +*/