Mercurial > hg > octave-terminal
changeset 4371:c14ec945fabb
[project @ 2003-03-26 16:05:59 by jwe]
author | jwe |
---|---|
date | Wed, 26 Mar 2003 16:05:59 +0000 |
parents | 790d6e486e22 |
children | fa80721998d6 |
files | scripts/ChangeLog scripts/linear-algebra/null.m src/ChangeLog src/syscalls.cc |
diffstat | 4 files changed, 34 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2003-03-24 Quentin Spencer <qspencer@ieee.org> + + * linear-algebra/null.m: Handle empty matrix arg. + 2003-03-18 John W. Eaton <jwe@bevo.che.wisc.edu> * general/shift.m: Force empty_list_elements_ok to 1.
--- a/scripts/linear-algebra/null.m +++ b/scripts/linear-algebra/null.m @@ -36,30 +36,34 @@ function retval = null (A, tol) - [U, S, V] = svd (A); - - [rows, cols] = size (A); - - [S_nr, S_nc] = size (S); + if (isempty (A)) + retval = []; + else + [U, S, V] = svd (A); - if (S_nr == 1 || S_nc == 1) - s = S(1); - else - s = diag (S); - endif + [rows, cols] = size (A); + + [S_nr, S_nc] = size (S); - if (nargin == 1) - tol = max (size (A)) * s (1) * eps; - elseif (nargin != 2) - usage ("null (A, tol)"); - endif + if (S_nr == 1 || S_nc == 1) + s = S(1); + else + s = diag (S); + endif - rank = sum (s > tol); + if (nargin == 1) + tol = max (size (A)) * s (1) * eps; + elseif (nargin != 2) + usage ("null (A, tol)"); + endif - if (rank < cols) - retval = V (:, rank+1:cols); - else - retval = zeros (cols, 0); + rank = sum (s > tol); + + if (rank < cols) + retval = V (:, rank+1:cols); + else + retval = zeros (cols, 0); + endif endif endfunction
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-03-24 Mats Jansson <mats.e.jansson@home.se> + + * syscalls.cc (Fkill): Fixed docstring typo. + 2003-03-18 John W. Eaton <jwe@bevo.che.wisc.edu> * ov-cell.h (octave_cell::is_matrix_type): New function.
--- a/src/syscalls.cc +++ b/src/syscalls.cc @@ -495,7 +495,7 @@ } DEFUN (kill, args, , - "-*- textinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} kill (@var{pid}, @var{sig})\n\ Send signal @var{sig} to process @var{pid}.\n\ \n\ @@ -510,7 +510,7 @@ If @var{pid} is less than -1, then signal @var{sig} is sent to every\n\ process in the process group @var{-pid}.\n\ \n\ -If @var{sig} is 0, then no signal is sent, but error checing is still\n\ +If @var{sig} is 0, then no signal is sent, but error checking is still\n\ performed.\n\ \n\ Return 0 if sucessful, otherwise return -1.\n\