Mercurial > octave-nkf
comparison scripts/sparse/sprandsym.m @ 16036:dd583c258cf9
Fix trivial typo in run-octave.in comment
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Mon, 11 Feb 2013 11:30:14 -0500 |
parents | 86854d032a37 |
children | 095d8d22c87d |
comparison
equal
deleted
inserted
replaced
16035:999f8257313b | 16036:dd583c258cf9 |
---|---|
125 endif | 125 endif |
126 | 126 |
127 ## Compute the stuff described above | 127 ## Compute the stuff described above |
128 a = n*(n - 1)/2; | 128 a = n*(n - 1)/2; |
129 d = [mod(k,2):2:min(n,k)-2]; | 129 d = [mod(k,2):2:min(n,k)-2]; |
130 | |
131 ## Since we | |
132 if (isempty (d)) | |
133 keyboard | |
134 endif | |
135 | |
130 m = (k - d)/2; | 136 m = (k - d)/2; |
131 q = (n - d).*(n - d - 1).*m ./ (d + 2)./(d + 1)./(a - m + 1); | 137 q = (n - d).*(n - d - 1).*m ./ (d + 2)./(d + 1)./(a - m + 1); |
132 | 138 |
133 ## Slight modification from discussion above: pivot around the max in | 139 ## Slight modification from discussion above: pivot around the max in |
134 ## order to avoid overflow (underflow is fine, just means effectively | 140 ## order to avoid overflow (underflow is fine, just means effectively |