# HG changeset patch # User jwe # Date 886493271 0 # Node ID 990ea337e950d147fbe2b01951c26b23ce0fce8e # Parent d0384ceed762915cf2154b824a421ee47b95bb5b [project @ 1998-02-03 08:07:51 by jwe] diff -r d0384ceed762 -r 990ea337e950 scripts/special-matrix/hadamard.m --- a/scripts/special-matrix/hadamard.m Tue Feb 03 08:07:19 1998 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -## Copyright (C) 1996, 1997 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, write to the Free -## Software Foundation, 59 Temple Place - Suite 330, Boston, MA -## 02111-1307, USA. - -## usage: hadamard (k) -## -## Return the Hadamard matrix of order n = 2^k. -## -## See also: hankel, vander, hilb, invhilb, toeplitz - -## Author: jwe - -function retval = hadamard (k) - - if (nargin != 1) - usage ("hadamard (n)"); - endif - - if (is_scalar (k)) - if (k < 1) - retval = 1; - else - tmp = hadamard (k-1); - retval = [tmp, tmp; tmp, -tmp]; - endif - else - error ("hadamard: expecting scalar argument"); - endif - -endfunction diff -r d0384ceed762 -r 990ea337e950 scripts/special-matrix/hankel.m --- a/scripts/special-matrix/hankel.m Tue Feb 03 08:07:19 1998 +0000 +++ b/scripts/special-matrix/hankel.m Tue Feb 03 08:07:51 1998 +0000 @@ -26,7 +26,7 @@ ## anti-diagonal. If the last element of c is not the same as the first ## element of r, the last element of c is used. ## -## See also: vander, hadamard, hilb, invhilb, toeplitz +## See also: vander, sylvester_matrix, hilb, invhilb, toeplitz ## Author: jwe diff -r d0384ceed762 -r 990ea337e950 scripts/special-matrix/hilb.m --- a/scripts/special-matrix/hilb.m Tue Feb 03 08:07:19 1998 +0000 +++ b/scripts/special-matrix/hilb.m Tue Feb 03 08:07:51 1998 +0000 @@ -24,7 +24,7 @@ ## ## H (i, j) = 1 / (i + j - 1); ## -## See also: hankel, vander, hadamard, invhilb, toeplitz +## See also: hankel, vander, sylvester_matrix, invhilb, toeplitz ## Author: jwe diff -r d0384ceed762 -r 990ea337e950 scripts/special-matrix/invhilb.m --- a/scripts/special-matrix/invhilb.m Tue Feb 03 08:07:19 1998 +0000 +++ b/scripts/special-matrix/invhilb.m Tue Feb 03 08:07:51 1998 +0000 @@ -22,7 +22,7 @@ ## Return the inverse of a Hilbert matrix of order n. This is slow but ## exact. Compare with inv (hilb (n)). ## -## See also: hankel, vander, hadamard, hilb, toeplitz +## See also: hankel, vander, sylvester_matrix, hilb, toeplitz ## Author: jwe diff -r d0384ceed762 -r 990ea337e950 scripts/special-matrix/sylvester_matrix.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/special-matrix/sylvester_matrix.m Tue Feb 03 08:07:51 1998 +0000 @@ -0,0 +1,45 @@ +## Copyright (C) 1996, 1997 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2, or (at your option) +## any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, write to the Free +## Software Foundation, 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +## usage: sylvester_matrix (k) +## +## Return the Sylvester matrix of order n = 2^k. +## +## See also: hankel, vander, hilb, invhilb, toeplitz + +## Author: jwe + +function retval = sylvester_matrix (k) + + if (nargin != 1) + usage ("sylvester_matrix (n)"); + endif + + if (is_scalar (k)) + if (k < 1) + retval = 1; + else + tmp = sylvester_matrix (k-1); + retval = [tmp, tmp; tmp, -tmp]; + endif + else + error ("sylvester_matrix: expecting scalar argument"); + endif + +endfunction diff -r d0384ceed762 -r 990ea337e950 scripts/special-matrix/toeplitz.m --- a/scripts/special-matrix/toeplitz.m Tue Feb 03 08:07:19 1998 +0000 +++ b/scripts/special-matrix/toeplitz.m Tue Feb 03 08:07:51 1998 +0000 @@ -26,7 +26,7 @@ ## same as the first column. If the first element of c is not the same ## as the first element of r, the first element of c is used. ## -## See also: hankel, vander, hadamard, hilb, invhib +## See also: hankel, vander, sylvester_matrix, hilb, invhib ## Author: jwe diff -r d0384ceed762 -r 990ea337e950 scripts/special-matrix/vander.m --- a/scripts/special-matrix/vander.m Tue Feb 03 08:07:19 1998 +0000 +++ b/scripts/special-matrix/vander.m Tue Feb 03 08:07:51 1998 +0000 @@ -21,7 +21,7 @@ ## ## Return the Vandermonde matrix whose next to last column is c. ## -## See also: hankel, hadamard, hilb, invhilb, toeplitz +## See also: hankel, sylvester_matrix, hilb, invhilb, toeplitz ## Author: jwe