diff scripts/sparse/sprandn.m @ 16779:8fce0ed4894a

Specialize is_empty and numel methods for sparse matrices (debian bug #706376) * ov-base.h (virtual bool is_empty (void) const) : Make method virtual * ov-base-sparse.h (bool is_empty (void) const)) : Declare new method (octave_idx_type numel (void) const): New method. * ov-base-sparse.cc (template <class T> bool octave_base_sparse<T>:is_empty (void) const)) : Define new method * ov-bool-sparse.h (idx_vector index_vector (void) const): Start specialization for sparse matrices * lo-array-gripes.cc (void gripe_index_value (void)): Clarify error message * data.cc : Add test to isempty * idx-vector.cc (idx_vector::idx_vector_rep::idx_vector_rep (const Sparse<bool>&) : Fix sparse indexing bug * __sprand_impl__.m : Don't use randparm when there are more than sizemax() elements. * sprand.m, sprandn.m : Add a test for large, low density matrices
author David Bateman <dbateman@free.fr>
date Thu, 20 Jun 2013 02:17:25 +0200
parents 5d3a684236b0
children 1c89599167a6
line wrap: on
line diff
--- a/scripts/sparse/sprandn.m
+++ b/scripts/sparse/sprandn.m
@@ -72,3 +72,6 @@
 %!error sprandn (3, 3, -1)
 %!error sprandn (3, 3, 2)
 
+%% Test very large, very low density matrix doesn't fail 
+%!test
+%! s = sprandn(1e6,1e6,1e-7);