Mercurial > hg > octave-nkf
comparison scripts/sparse/sprandsym.m @ 7017:a1dbe9d80eee
[project @ 2007-10-12 21:27:11 by jwe]
author | jwe |
---|---|
date | Fri, 12 Oct 2007 21:27:37 +0000 |
parents | 93c65f2a5668 |
children | f5005d9510f4 |
comparison
equal
deleted
inserted
replaced
7016:93c65f2a5668 | 7017:a1dbe9d80eee |
---|---|
1 ## Copyright (C) 2004 David Bateman & Andy Adler | 1 ## Copyright (C) 2004, 2006, 2007 David Bateman & Andy Adler |
2 ## | 2 ## |
3 ## This file is part of Octave. | 3 ## This file is part of Octave. |
4 ## | 4 ## |
5 ## Octave is free software; you can redistribute it and/or modify it | 5 ## Octave is free software; you can redistribute it and/or modify it |
6 ## under the terms of the GNU General Public License as published by | 6 ## under the terms of the GNU General Public License as published by |
62 | 62 |
63 if (isempty (i1) && isempty (i2)) | 63 if (isempty (i1) && isempty (i2)) |
64 S = sparse (n, n); | 64 S = sparse (n, n); |
65 else | 65 else |
66 S1 = sparse (i1, j1+1, randn (k1, 1), m1, n1); | 66 S1 = sparse (i1, j1+1, randn (k1, 1), m1, n1); |
67 S = [tril(S1), sparse (m1, m1); ... | 67 S = [tril(S1), sparse(m1,m1); ... |
68 sparse(i2,j2+1,randn(k2,1),n2,n2), triu(S1,1)']; | 68 sparse(i2,j2+1,randn(k2,1),n2,n2), triu(S1,1)']; |
69 S = S + tril (S, -1)'; | 69 S = S + tril (S, -1)'; |
70 endif | 70 endif |
71 else | 71 else |
72 print_usage (); | 72 print_usage (); |