changeset 20214:cc5ffacb15ab stable

normest.m: Fix function to run with sparse complex inputs (bug #45080). * normest.m: Convert trace value to full (non-sparse) before using it to set the rand seed.
author Rik <rik@octave.org>
date Tue, 12 May 2015 08:01:42 -0700
parents 2ae4a7ef4378
children aa36fb998a4d
files scripts/linear-algebra/normest.m
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/linear-algebra/normest.m	Mon May 11 22:13:08 2015 -0700
+++ b/scripts/linear-algebra/normest.m	Tue May 12 08:01:42 2015 -0700
@@ -55,7 +55,7 @@
   tol = max (tol, eps (class (A)));
   ## Set random number generator to depend on target matrix
   v = rand ("state");
-  rand ("state", trace (A));
+  rand ("state", full (trace (A)));
   ncols = columns (A);
   ## Randomize y to avoid bad guesses for important matrices.
   y = rand (ncols, 1);