# HG changeset patch # User jwe # Date 1048694759 0 # Node ID c14ec945fabb1d99ec740570fd2a53955c8b52b7 # Parent 790d6e486e22351b2c571924fa81f19debf4853b [project @ 2003-03-26 16:05:59 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2003-03-24 Quentin Spencer + + * linear-algebra/null.m: Handle empty matrix arg. + 2003-03-18 John W. Eaton * general/shift.m: Force empty_list_elements_ok to 1. diff --git a/scripts/linear-algebra/null.m b/scripts/linear-algebra/null.m --- 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 diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-03-24 Mats Jansson + + * syscalls.cc (Fkill): Fixed docstring typo. + 2003-03-18 John W. Eaton * ov-cell.h (octave_cell::is_matrix_type): New function. diff --git a/src/syscalls.cc b/src/syscalls.cc --- 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\