comparison scripts/sparse/sprandsym.m @ 8506:bc982528de11

comment style fixes
author John W. Eaton <jwe@octave.org>
date Tue, 13 Jan 2009 11:56:00 -0500
parents f5005d9510f4
children eb63fbe60fab
comparison
equal deleted inserted replaced
8505:124dd27bedae 8506:bc982528de11
47 idx1 = unique (fix (rand (min (k1*1.01, k1+10), 1) * mn1)) + 1; 47 idx1 = unique (fix (rand (min (k1*1.01, k1+10), 1) * mn1)) + 1;
48 ## idx contains random numbers in [1,mn] generate 1% or 10 more 48 ## idx contains random numbers in [1,mn] generate 1% or 10 more
49 ## random values than necessary in order to reduce the probability 49 ## random values than necessary in order to reduce the probability
50 ## that there are less than k distinct values; maybe a better 50 ## that there are less than k distinct values; maybe a better
51 ## strategy could be used but I don't think it's worth the price. 51 ## strategy could be used but I don't think it's worth the price.
52 k1 = min (length (idx1), k1); # actual number of entries in S 52
53 ## Actual number of entries in S.
54 k1 = min (length (idx1), k1);
53 j1 = floor ((idx1(1:k1)-1)/m1); 55 j1 = floor ((idx1(1:k1)-1)/m1);
54 i1 = idx1(1:k1) - j1*m1; 56 i1 = idx1(1:k1) - j1*m1;
55 57
56 n2 = ceil (n/2); 58 n2 = ceil (n/2);
57 nn2 = n2*n2; 59 nn2 = n2*n2;