# HG changeset patch # User jwe # Date 1176466932 0 # Node ID 03c89ade4070b23fb6dbd32689e0aaa0e800b03d # Parent 589c8dbba9162fb0346fb5d960f1ffa2fc1ce0dd [project @ 2007-04-13 12:19:30 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2007-04-13 Geordie McBain + + * spdiags.m: Fixed the four-argument case to work for columns of + length one. + 2007-04-12 John W. Eaton * optimization/qp.m: Avoid Octave indexing bug. diff --git a/scripts/sparse/spdiags.m b/scripts/sparse/spdiags.m --- a/scripts/sparse/spdiags.m +++ b/scripts/sparse/spdiags.m @@ -76,7 +76,7 @@ ## Create new matrix of size mxn using v,c [j, i, v] = find (v); offset = max (min (c(:), n-m), 0); - j += offset(i); + j = j(:) + offset(i); i = j-c(:)(i); idx = i > 0 & i <= m & j > 0 & j <= n; A = sparse (i(idx), j(idx), v(idx), m, n); diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2007-04-13 Geordie McBain + + * DLD-FUNCTIONS/find.cc (Ffind): Doc fix. + 2007-04-11 John W. Eaton * Makefile.in (DOCSTRINGS): Don't echo commands. diff --git a/src/DLD-FUNCTIONS/find.cc b/src/DLD-FUNCTIONS/find.cc --- a/src/DLD-FUNCTIONS/find.cc +++ b/src/DLD-FUNCTIONS/find.cc @@ -183,10 +183,10 @@ @deftypefn {Loadable Function} {} find (@var{x})\n\ @deftypefnx {Loadable Function} {} find (@var{x}, @var{n})\n\ @deftypefnx {Loadable Function} {} find (@var{x}, @var{n}, @var{direction})\n\ -Return a vector of indices of nonzero elements of a matrix. To obtain a\n\ -single index for each matrix element, Octave pretends that the columns\n\ -of a matrix form one long vector (like Fortran arrays are stored). For\n\ -example,\n\ +Return a vector of indices of nonzero elements of a matrix, as a row if\n\ +@var{x} is a row or as a column otherwise. To obtain a single index for\n\ +each matrix element, Octave pretends that the columns of a matrix form one\n\ +long vector (like Fortran arrays are stored). For example,\n\ \n\ @example\n\ @group\n\