Mercurial > hg > octave-nkf
changeset 4026:8cb8eff3f44c
[project @ 2002-08-09 06:54:46 by jwe]
author | jwe |
---|---|
date | Fri, 09 Aug 2002 06:56:43 +0000 |
parents | cfb762dc9259 |
children | af3a0264eefc |
files | scripts/ChangeLog scripts/deprecated/is_scalar.m scripts/deprecated/is_square.m scripts/deprecated/is_symmetric.m scripts/deprecated/is_vector.m scripts/general/is_scalar.m scripts/general/is_square.m scripts/general/is_symmetric.m scripts/general/is_vector.m scripts/general/isscalar.m scripts/general/issquare.m scripts/general/issymmetric.m scripts/general/isvector.m |
diffstat | 13 files changed, 308 insertions(+), 177 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,10 @@ +2002-08-09 John W. Eaton <jwe@bevo.che.wisc.edu> + + * general/isscalar.m: Rename from is_scalar.m. + * general/issquare.m: Rename from is_square.m. + * general/issymmetric.m: Rename from is_symmetric.m. + * general/isvector.m: Rename from is_vector.m. + 2002-08-05 John W. Eaton <jwe@bevo.che.wisc.edu> * statistics/base/mean.m: Allow empty matrices.
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/is_scalar.m @@ -0,0 +1,31 @@ +## 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. + +## -*- texinfo -*- +## @deftypefn {Function File} {} is_scalar (@var{a}) +## This function has been deprecated. Use isscalar instead. +## @end deftypefn + +## Author: jwe + +function retval = is_scalar (varargin) + + retval = isscalar (varargin{:}); + +endfunction
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/is_square.m @@ -0,0 +1,31 @@ +## 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. + +## -*- texinfo -*- +## @deftypefn {Function File} {} is_square (@var{x}) +## This function has been deprecated. Use issquare instead. +## @end deftypefn + +## Author: jwe + +function retval = is_square (varargin) + + retval = issquare (varargin{:}); + +endfunction
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/is_symmetric.m @@ -0,0 +1,31 @@ +## 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. + +## -*- texinfo -*- +## @deftypefn {Function File} {} issymmetric (@var{x}, @var{tol}) +## This function has been deprecated. Use issymmetric instead. +## @end deftypefn + +## Author: jwe + +function retval = is_symmetric (varargin) + + retval = issymmetric (varargin{:}); + +endfunction
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/is_vector.m @@ -0,0 +1,31 @@ +## 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. + +## -*- texinfo -*- +## @deftypefn {Function File} {} is_vector (@var{a}) +## This function has been deprecated. Use isvector instead. +## @end deftypefn + +## Author: jwe + +function retval = is_vector (varargin) + + retval = isvector (varargin{:}); + +endfunction
deleted file mode 100644 --- a/scripts/general/is_scalar.m +++ /dev/null @@ -1,41 +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. - -## -*- texinfo -*- -## @deftypefn {Function File} {} is_scalar (@var{a}) -## Return 1 if @var{a} is a scalar. Otherwise, return 0. -## @end deftypefn -## @seealso{size, rows, columns, length, is_scalar, and is_matrix} - -## Author: jwe - -function retval = is_scalar (x) - - retval = 0; - - if (nargin == 1) - if (is_matrix (x)) - [nr, nc] = size (x); - retval = (nr == 1 && nc == 1); - endif - else - usage ("is_scalar (x)"); - endif - -endfunction
deleted file mode 100644 --- a/scripts/general/is_square.m +++ /dev/null @@ -1,46 +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. - -## -*- texinfo -*- -## @deftypefn {Function File} {} is_square (@var{x}) -## If @var{x} is a square matrix, then return the dimension of @var{x}. -## Otherwise, return 0. -## @end deftypefn -## @seealso{size, rows, columns, length, is_matrix, is_scalar, and is_vector} - -## Author: A. S. Hodel <scotte@eng.auburn.edu> -## Created: August 1993 -## Adapted-By: jwe - -function retval = is_square (x) - - retval = 0; - - if (nargin == 1) - if (is_matrix (x)) - [nr, nc] = size (x); - if (nr == nc && nr > 0) - retval = nr; - endif - endif - else - usage ("is_square (x)"); - endif - -endfunction
deleted file mode 100644 --- a/scripts/general/is_symmetric.m +++ /dev/null @@ -1,49 +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. - -## -*- texinfo -*- -## @deftypefn {Function File} {} is_symmetric (@var{x}, @var{tol}) -## If @var{x} is symmetric within the tolerance specified by @var{tol}, -## then return the dimension of @var{x}. Otherwise, return 0. If -## @var{tol} is omitted, use a tolerance equal to the machine precision. -## @end deftypefn -## @seealso{size, rows, columns, length, is_matrix, is_scalar, -## is_square, and is_vector} - -## Author: A. S. Hodel <scotte@eng.auburn.edu> -## Created: August 1993 -## Adapted-By: jwe - -function retval = is_symmetric (x,tol) - - if (nargin == 1 || nargin == 2) - retval = is_square (x); - if (retval != 0) - if (nargin == 1) - tol = eps; - endif - if (norm (x - x') / norm(x) > tol) - retval = 0; - endif - endif - else - usage ("is_symmetric (x {,tol})"); - endif - -endfunction
deleted file mode 100644 --- a/scripts/general/is_vector.m +++ /dev/null @@ -1,41 +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. - -## -*- texinfo -*- -## @deftypefn {Function File} {} is_vector (@var{a}) -## Return 1 if @var{a} is a vector. Otherwise, return 0. -## @end deftypefn -## @seealso{size, rows, columns, length, is_scalar, and is_matrix} - -## Author: jwe - -function retval = is_vector (x) - - retval = 0; - - if (nargin == 1) - if (is_matrix (x)) - [nr, nc] = size (x); - retval = ((nr == 1 && nc >= 1) || (nc == 1 && nr >= 1)); - endif - else - usage ("is_vector (x)"); - endif - -endfunction
new file mode 100644 --- /dev/null +++ b/scripts/general/isscalar.m @@ -0,0 +1,41 @@ +## 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. + +## -*- texinfo -*- +## @deftypefn {Function File} {} isscalar (@var{a}) +## Return 1 if @var{a} is a scalar. Otherwise, return 0. +## @end deftypefn +## @seealso{size, rows, columns, length, isscalar, and ismatrix} + +## Author: jwe + +function retval = isscalar (x) + + retval = 0; + + if (nargin == 1) + if (ismatrix (x)) + [nr, nc] = size (x); + retval = (nr == 1 && nc == 1); + endif + else + usage ("isscalar (x)"); + endif + +endfunction
new file mode 100644 --- /dev/null +++ b/scripts/general/issquare.m @@ -0,0 +1,46 @@ +## 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. + +## -*- texinfo -*- +## @deftypefn {Function File} {} issquare (@var{x}) +## If @var{x} is a square matrix, then return the dimension of @var{x}. +## Otherwise, return 0. +## @end deftypefn +## @seealso{size, rows, columns, length, ismatrix, isscalar, and isvector} + +## Author: A. S. Hodel <scotte@eng.auburn.edu> +## Created: August 1993 +## Adapted-By: jwe + +function retval = issquare (x) + + retval = 0; + + if (nargin == 1) + if (ismatrix (x)) + [nr, nc] = size (x); + if (nr == nc && nr > 0) + retval = nr; + endif + endif + else + usage ("issquare (x)"); + endif + +endfunction
new file mode 100644 --- /dev/null +++ b/scripts/general/issymmetric.m @@ -0,0 +1,49 @@ +## 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. + +## -*- texinfo -*- +## @deftypefn {Function File} {} issymmetric (@var{x}, @var{tol}) +## If @var{x} is symmetric within the tolerance specified by @var{tol}, +## then return the dimension of @var{x}. Otherwise, return 0. If +## @var{tol} is omitted, use a tolerance equal to the machine precision. +## @end deftypefn +## @seealso{size, rows, columns, length, ismatrix, isscalar, +## issquare, and isvector} + +## Author: A. S. Hodel <scotte@eng.auburn.edu> +## Created: August 1993 +## Adapted-By: jwe + +function retval = issymmetric (x,tol) + + if (nargin == 1 || nargin == 2) + retval = issquare (x); + if (retval != 0) + if (nargin == 1) + tol = eps; + endif + if (norm (x - x') / norm(x) > tol) + retval = 0; + endif + endif + else + usage ("issymmetric (x {,tol})"); + endif + +endfunction
new file mode 100644 --- /dev/null +++ b/scripts/general/isvector.m @@ -0,0 +1,41 @@ +## 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. + +## -*- texinfo -*- +## @deftypefn {Function File} {} isvector (@var{a}) +## Return 1 if @var{a} is a vector. Otherwise, return 0. +## @end deftypefn +## @seealso{size, rows, columns, length, isscalar, and ismatrix} + +## Author: jwe + +function retval = isvector (x) + + retval = 0; + + if (nargin == 1) + if (ismatrix (x)) + [nr, nc] = size (x); + retval = ((nr == 1 && nc >= 1) || (nc == 1 && nr >= 1)); + endif + else + usage ("isvector (x)"); + endif + +endfunction