changeset 12704:da6cbb752368

maint: Periodic merge of stable to default branch.
author Rik <octave@nomad.inbox5.com>
date Sat, 04 Jun 2011 16:05:37 -0700
parents c0d102ad9bba (current diff) d326be468b13 (diff)
children 4972eb61c6d6
files NEWS doc/faq/OctaveFAQ.texi doc/interpreter/plot.txi scripts/miscellaneous/unimplemented.m src/error.cc src/variables.cc
diffstat 27 files changed, 373 insertions(+), 174 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Thu Jun 02 11:57:08 2011 -0700
+++ b/NEWS	Sat Jun 04 16:05:37 2011 -0700
@@ -167,7 +167,7 @@
 
     Moreover, when unary operators occur in expressions, Octave will
     also try to do the operation in-place if it's argument is a
-    temporary expresssion.
+    temporary expression.
 
  ** The effect of comparison operators (<, >, <=, and >=) applied to
     complex numbers has changed to be consistent with the strict
@@ -355,15 +355,15 @@
     exponent where the exponent is a multiple of 3.
 
  ** The following functions are new in Octave 3.4:
-      accumdim   divergence   merge        ppjumps    textread
-      bitpack    erfcx        nfields      pqpnonneg  uigetdir
-      bitunpack  fileread     nth_element  quadcc     uigetfile
-      blkmm      fminbnd      onCleanup    randi      uiputfile
-      cbrt       fskipl       pbaspect     repelems   uimenu
-      curl       ifelse       pie3         reset      whitebg
-      chop       ishermitian  powerset     rsf2csf 
-      colstyle   isindex      ppder        saveas  
-      daspect    luupdate     ppint        strread 
+      accumdim   divergence   merge        ppjumps    strread 
+      bitpack    erfcx        nfields      pqpnonneg  textread
+      bitunpack  fileread     nth_element  quadcc     uigetdir
+      blkmm      fminbnd      onCleanup    randi      uigetfile
+      cbrt       fskipl       pbaspect     rectangle  uiputfile
+      curl       ifelse       pie3         repelems   uimenu
+      chop       ishermitian  powerset     reset      whitebg  
+      colstyle   isindex      ppder        rsf2csf  
+      daspect    luupdate     ppint        saveas  
 
  ** Using the image function to view images with external programs such
     as display, xv, and xloadimage is no longer supported.  The
@@ -691,7 +691,7 @@
     The performance of sort has been improved, especially when sorting
     indices are requested.  An efficient built-in issorted
     implementation was added.  The sortrows function now uses a more
-    efficient algorithm, especially in the homegeneous case.  The lookup
+    efficient algorithm, especially in the homogeneous case.  The lookup
     function is now a built-in function performing a binary search,
     optimized for long runs of close elements.  Lookup also works with
     cell arrays of strings.
--- a/NEWS.1	Thu Jun 02 11:57:08 2011 -0700
+++ b/NEWS.1	Sat Jun 04 16:05:37 2011 -0700
@@ -143,9 +143,9 @@
       <structure: s u v>
 
     This feature should be considered experimental, but it seems to
-    work ok.  Suggestions for ways to improve it are welcome.
+    work OK.  Suggestions for ways to improve it are welcome.
 
-  * Octave now supports a limited form of exception handling modelled
+  * Octave now supports a limited form of exception handling modeled
     after the unwind-protect form of Lisp:
 
       unwind_protect
@@ -198,7 +198,7 @@
 
   * Both `...{whitespace}\n' and `\{whitespace}\n' can be used to
     introduce continuation lines, where {whitespace} may include
-    spaces, tabs and comemnts.
+    spaces, tabs and comments.
 
   * The script directory has been split up by topic.
 
@@ -214,7 +214,7 @@
        make nonessential built-in functions dynamically loaded, but
        there also seem to be some problems.  For example, fsolve seems
        to always return info == 3.  This is difficult to debug since
-       gdb won't seem to allow breakpoints to be set inside
+       GDB doesn't appear to allow breakpoints to be set inside
        dynamically loaded functions.
 
     -- Octave uses a lot of memory if the dynamically linked functions
@@ -349,7 +349,7 @@
       rgb2ntsc  -- image format conversion
       saveimage -- save an image to a file
 
-  * New time and date funcitons:
+  * New time and date functions:
 
       tic          -- set wall-clock timer
       toc          -- get elapsed wall-clock time, since timer last set
@@ -452,7 +452,7 @@
     within functions that take a variable number of arguments.
 
   * If given a second argument, svd now returns an economy-sized
-    decomposition, eliminating the unecessary rows or columns of U or
+    decomposition, eliminating the unnecessary rows or columns of U or
     V.
 
   * The max and min functions correctly handle complex matrices in
@@ -935,7 +935,7 @@
 
   * Improved help.  The command `help -i topic' now uses the GNU Info
     browser to display help for the given topic directly from the
-    Texinfo documenation.
+    Texinfo documentation.
 
   * New function: chol -- Cholesky factorization.
 
@@ -1286,7 +1286,7 @@
     prefer_column_vectors.
 
   * Things like [[1,2][3,4]] no longer cause core dumps, and invalid
-    input like [1,2;3,4,[5,6]] now produces a diagnositic message.
+    input like [1,2;3,4,[5,6]] now produces a diagnostic message.
 
   * The cd, save, and load commands now do tilde expansion.
 
@@ -1380,7 +1380,7 @@
       a = [1,2,3,4];
       b = a([1,0,0,1])
 
-    sets b to the first and fourth elememnts of a.
+    sets b to the first and fourth elements of a.
 
     Zero-one style indexing also works for indexing the left hand side
     of an assignment.  For example,
@@ -1401,7 +1401,7 @@
     'false'.
 
   * Using the new global variable `propagate_empty_matrices', it is
-    possible to have unary andy binary operations on empty matrices
+    possible to have unary and binary operations on empty matrices
     return an empty matrix.  The default value of this variable is
     'warn', so that empty matrices are propagated but you get a
     warning.  Some functions, like eig and svd have also been changed
@@ -1594,7 +1594,7 @@
 
   * New files:
 
-      THANKS -- A list of people and organazations who have supported
+      THANKS -- A list of people and organizations who have supported
                 the development of Octave.
 
       NEWS   -- This file, listing recent changes.
--- a/NEWS.2	Thu Jun 02 11:57:08 2011 -0700
+++ b/NEWS.2	Sat Jun 04 16:05:37 2011 -0700
@@ -173,7 +173,7 @@
 
       chisquare_cdf      -- CDF of the chi-square distribution
       chisquare_inv      -- Quantile function of the chi-square distribution
-      chisquare_pdf      -- PDF of the chi-sqaure distribution
+      chisquare_pdf      -- PDF of the chi-square distribution
       chisquare_rnd      -- Random deviates from the chi-square distribution
 
       discrete_cdf       -- CDF of a discrete distribution
@@ -549,7 +549,7 @@
   * It is now possible to use commands like ls, save, and cd as simple
     variable names.  They still cannot be used as formal parameters
     for functions, or as the names of structure variables.  Failed
-    assignments leave them undefined (you can recover the orginal
+    assignments leave them undefined (you can recover the original
     function definition using clear).
 
   * Is is now possible to invoke commands like ls, save, and cd as
@@ -982,7 +982,7 @@
       getgrent  -- read entry from group-file stream, opening if necessary
       getgrgid  -- search for group entry with matching group ID
       getgrnam  -- search for group entry with matching group name
-      setgrent  -- rewind the pgroup-file stream
+      setgrent  -- rewind the group-file stream
       endgrent  -- close the group-file stream
 
   * The New function octave_config_info returns a structure containing
--- a/NEWS.3	Thu Jun 02 11:57:08 2011 -0700
+++ b/NEWS.3	Sat Jun 04 16:05:37 2011 -0700
@@ -60,7 +60,7 @@
       semilogx, etc.).
 
     + Plot property values are not extensively checked.  Specifying
-      invalid property values may produce unpredictible results.
+      invalid property values may produce unpredictable results.
 
     + Octave now sends data over the same pipe that is used to send
       commands to gnuplot.  While this avoids the problem of
--- a/README.MacOS	Thu Jun 02 11:57:08 2011 -0700
+++ b/README.MacOS	Sat Jun 04 16:05:37 2011 -0700
@@ -269,7 +269,7 @@
 
 After installing each of the dependencies, the sources are compiled by
 setting the proper environment variables and then following the standard build
-sequence.  The following is an example set of variables to for a 32-bit build
+sequence.  The following is an example set of variables for a 32-bit build
 using gcc-4.2.  When building from the sources obtained from the mercurial
 archive, ./autogen.sh must be run prior to ./configure.
 
--- a/README.Windows	Thu Jun 02 11:57:08 2011 -0700
+++ b/README.Windows	Sat Jun 04 16:05:37 2011 -0700
@@ -2,7 +2,7 @@
 package of Octave for Cygwin.
 
 See the file README.MinGW for information about Octave on the MinGW platform
-including installation of binaries or compiling Octave frome source.
+including installation of binaries or compiling Octave from source.
 
 
 John W. Eaton
--- a/doc/faq/OctaveFAQ.texi	Thu Jun 02 11:57:08 2011 -0700
+++ b/doc/faq/OctaveFAQ.texi	Sat Jun 04 16:05:37 2011 -0700
@@ -242,7 +242,7 @@
 No.  Instead of asking us to change the licensing terms for Octave, we
 recommend that you release your program under terms that are compatible
 with the GPL so that the free software community can benefit from your
-work the same as you have benefitted from the work of all the people who
+work the same as you have benefited from the work of all the people who
 have contributed to Octave.
 
 @node How can I cite Octave?
@@ -384,7 +384,7 @@
 @menu
 * Functions defined on the command-line::
 * Comments with #::
-* Strings delimitted by double quotes "::
+* Strings delimited by double quotes "::
 * Line continuation by backslash::
 * Informative block closing::
 * Coherent syntax::
@@ -424,8 +424,8 @@
 files, any file that starts with a string like @samp{#! /usr/bin/octave
 -q} will be treated as an octave script and be executed by octave.
 
-@node Strings delimitted by double quotes "
-@section Strings delimitted by double quotes "
+@node Strings delimited by double quotes "
+@section Strings delimited by double quotes "
 The double quote, @samp{"}, may be used to delimit strings, in addition
 to the single quote @samp{'}. See the previous example. Also,
 double-quoted strings include backslash interpretation (like C++, C, and
@@ -513,7 +513,7 @@
 
 @cindex Unwind-protect
 
-Octave supports a limited form of exception handling modelled after the
+Octave supports a limited form of exception handling modeled after the
 unwind-protect form of Lisp.  The general form of an
 @code{unwind_protect} block looks like this:
 
@@ -644,7 +644,7 @@
 @item @url{ftp://ftp.octave.org/pub/octave/}
 @end itemize
 
-Since Octave is distrubted under the terms of the GPL, you can get
+Since Octave is distributed under the terms of the GPL, you can get
 Octave from a friend who has a copy, or from the Octave website.
 
 @node Pre-compiled binary packages
@@ -899,7 +899,7 @@
 
 The authors of Octave consider the nested function scoping rules of
 @sc{Matlab} to be more problems than they are worth as they introduce
-diffiult to find bugs as inadvertantly modifying a variable in a
+difficult to find bugs as inadvertently modifying a variable in a
 nested function that is also used in the parent is particularly easy.
 
 @item Differences in core syntax
@@ -1033,7 +1033,7 @@
 
 @item Short-circuit & and | operators
 The @code{&} and @code{|} operators in @sc{Matlab} short-circuit when
-included in an if statemant and not otherwise.  In Octave only the
+included in an if statement and not otherwise.  In Octave only the
 @code{&&} and @code{||} short circuit.  Note that this means that
 
 @example
@@ -1299,7 +1299,7 @@
 difference is important on Windows platforms where the "\" character is
 used in path names, and so single quoted strings should be used in
 paths. @sc{Matlab} doesn't have double quoted strings and so they should
-be avoided if the code will be transfered to a @sc{Matlab} user.
+be avoided if the code will be transferred to a @sc{Matlab} user.
 @end itemize
 
 @end itemize
--- a/doc/interpreter/basics.txi	Thu Jun 02 11:57:08 2011 -0700
+++ b/doc/interpreter/basics.txi	Sat Jun 04 16:05:37 2011 -0700
@@ -1059,7 +1059,7 @@
 lines "@code{disp(2);}" and "@code{disp(1);}" won't be executed.
 
 The block comment markers must appear alone as the only characters on a line
-(excepting whitepsace) in order to to be parsed correctly.
+(excepting whitespace) in order to to be parsed correctly.
 
 @node Comments and the Help System
 @subsection Comments and the Help System
--- a/doc/interpreter/doccheck/aspell-octave.en.pws	Thu Jun 02 11:57:08 2011 -0700
+++ b/doc/interpreter/doccheck/aspell-octave.en.pws	Sat Jun 04 16:05:37 2011 -0700
@@ -50,6 +50,7 @@
 bdf
 betacdf
 betainv
+betaln
 betapdf
 betarnd
 BFGS
@@ -233,6 +234,7 @@
 equidistributed
 equispaced
 erf
+erfc
 errno
 Errorbar
 errorbar
--- a/doc/interpreter/install.txi	Thu Jun 02 11:57:08 2011 -0700
+++ b/doc/interpreter/install.txi	Sat Jun 04 16:05:37 2011 -0700
@@ -223,7 +223,7 @@
 FLTK@.  Gnuplot is a command-driven interactive function plotting
 program.  Gnuplot is copyrighted, but freely distributable.  As of
 Octave release 3.4, gnuplot is the default option for plotting.  But,
-the internal graphics engine is nearly 100% compatibile, certainly for
+the internal graphics engine is nearly 100% compatible, certainly for
 most ordinary plots, and users are encouraged to test it.  It is
 anticipated that the internal engine will become the default option at
 the next major release of Octave.
--- a/doc/interpreter/plot.txi	Thu Jun 02 11:57:08 2011 -0700
+++ b/doc/interpreter/plot.txi	Sat Jun 04 16:05:37 2011 -0700
@@ -2512,16 +2512,19 @@
 May be one of
 @table @code
 @item "-"
-Solid lines.
+Solid line.  [default]
 
 @item "--"
-Dashed lines.
+Dashed line.
 
 @item ":"
-Points.
+Dotted line.
 
 @item "-."
 A dash-dot line.
+
+@item "none"
+No line.  Points will still be marked using the current Marker Style.
 @end table
 
 @item linewidth
--- a/doc/interpreter/sparseimages.m	Thu Jun 02 11:57:08 2011 -0700
+++ b/doc/interpreter/sparseimages.m	Sat Jun 04 16:05:37 2011 -0700
@@ -200,7 +200,7 @@
 
     E = size(elems,1);  #No. of elements
     N = size(nodes,1);  #No. of elements
-    D = size(elems,2);  #dimentions+1
+    D = size(elems,2);  #dimensions+1
 
     ## Plot FEM Geometry
     elemx = elems(:,[1,2,3,1])';
--- a/doc/liboctave/array.texi	Thu Jun 02 11:57:08 2011 -0700
+++ b/doc/liboctave/array.texi	Sat Jun 04 16:05:37 2011 -0700
@@ -177,7 +177,7 @@
 @deftypefnx Constructor {} DiagArray<T> (const DiagArray<T> &@var{a})
 @end deftypefn
 
-@deftypeop Assginment DiagArray<T>& {} {operator =} (const DiagArray<T> &@var{a})
+@deftypeop Assignment DiagArray<T>& {} {operator =} (const DiagArray<T> &@var{a})
 @end deftypeop
 
 @deftypemethod DiagArray<T> int dim1 (void) const
--- a/examples/COPYING	Thu Jun 02 11:57:08 2011 -0700
+++ b/examples/COPYING	Sat Jun 04 16:05:37 2011 -0700
@@ -1,3 +1,3 @@
-Copyright notices are intentionlly omitted from the files in the
+Copyright notices are intentionally omitted from the files in the
 examples directory.  We don't want copyright notices cluttering the
 manual.
--- a/scripts/audio/wavread.m	Thu Jun 02 11:57:08 2011 -0700
+++ b/scripts/audio/wavread.m	Sat Jun 04 16:05:37 2011 -0700
@@ -22,9 +22,9 @@
 ## in vector @var{y}.  If the file contains multichannel data, then
 ## @var{y} is a matrix with the channels represented as columns.
 ##
-## @deftypefnx {Function File} {[@var{y}, @var{Fs}, @var{bits}] =} wavread (@var{filename})
+## @deftypefnx {Function File} {[@var{y}, @var{Fs}, @var{bps}] =} wavread (@var{filename})
 ## Additionally return the sample rate (@var{fs}) in Hz and the number of bits
-## per sample (@var{bits}).
+## per sample (@var{bps}).
 ##
 ## @deftypefnx {Function File} {[@dots{}] =} wavread (@var{filename}, @var{n})
 ## Read only the first @var{n} samples from each channel.
@@ -75,7 +75,7 @@
   endif
 
   riff_type = char (fread (fid, 4))';
-  if(! strcmp (riff_type, "WAVE"))
+  if (! strcmp (riff_type, "WAVE"))
     fclose (fid);
     error ("wavread: file contains no WAVE signature");
   endif
@@ -157,7 +157,7 @@
   if (nargin == 1)
     length = 8 * data_size / bits_per_sample;
   else
-    nparams = size (param, 2);
+    nparams = numel (param);
     if (nparams == 1)
       ## Number of samples is given.
       length = param * channels;
@@ -174,7 +174,7 @@
       return;
     else
       fclose (fid);
-      error ("wavread: invalid argument 2");
+      error ("wavread: invalid PARAM argument");
     endif
   endif
 
@@ -201,13 +201,13 @@
     ## Normalize samples.
     switch (bits_per_sample)
       case 8
-        yi = (yi - 128)/127;
+        yi = (yi - 128)/128;
       case 16
-        yi /= 32767;
+        yi /= 32768;
       case 24
-        yi /= 8388607;
+        yi /= 8388608;
       case 32
-        yi /= 2147483647;
+        yi /= 2147483648;
     endswitch
   endif
 
@@ -239,3 +239,8 @@
     chunk_size = -1;
   endif
 endfunction
+
+
+%% Tests for wavread/wavwrite pair are in wavrite.m
+%!assert(1)  # stop fntests.m from reporting no tests for wavread
+
--- a/scripts/audio/wavwrite.m	Thu Jun 02 11:57:08 2011 -0700
+++ b/scripts/audio/wavwrite.m	Sat Jun 04 16:05:37 2011 -0700
@@ -18,10 +18,10 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} wavwrite (@var{y}, @var{filename})
-## @deftypefnx {Function File} {} wavwrite (@var{y}, @var{fs}, @var{filename})
-## @deftypefnx {Function File} {} wavwrite (@var{y}, @var{fs}, @var{bits}, @var{filename})
+## @deftypefnx {Function File} {} wavwrite (@var{y}, @var{Fs}, @var{filename})
+## @deftypefnx {Function File} {} wavwrite (@var{y}, @var{Fs}, @var{bps}, @var{filename})
 ## Write @var{y} to the canonical RIFF/WAVE sound file @var{filename}
-## with sample rate @var{fs} and bits per sample @var{bits}.  The
+## with sample rate @var{Fs} and bits per sample @var{bps}.  The
 ## default sample rate is 8000 Hz with 16-bits per sample.  Each column
 ## of the data represents a separate channel.
 ## @seealso{wavread}
@@ -34,13 +34,6 @@
 
   BYTEORDER = "ieee-le";
 
-  ## For backward compatibility with previous versions of Octave, also
-  ## accept the inputs
-  ##
-  ##   wavwrite (filename, y)
-  ##   wavwrite (filename, y, fs)
-  ##   wavwrite (filename, y, fs, bits)
-
   if (nargin < 2 || nargin > 4)
     print_usage ();
   endif
@@ -49,22 +42,11 @@
   samples_per_sec = 8000;
   bits_per_sample = 16;
 
-  if (ischar (y))
-    filename = y;
-    y = varargin{1};
-    if (nargin > 2)
-      samples_per_sec = varargin{2};
-      if (nargin > 3)
-        bits_per_sample = varargin{3};
-      endif
-    endif
-  else
-    filename = varargin{end};
-    if (nargin > 2)
-      samples_per_sec = varargin{1};
-      if (nargin > 3)
-        bits_per_sample = varargin{2};
-      endif
+  filename = varargin{end};
+  if (nargin > 2)
+    samples_per_sec = varargin{1};
+    if (nargin > 3)
+      bits_per_sample = varargin{2};
     endif
   endif
 
@@ -72,7 +54,7 @@
   if (columns (y) < 1)
     error ("wavwrite: Y must have at least one column");
   endif
-  if (columns (y) > 2^15-1)
+  if (columns (y) > 0x7FFF)
     error ("wavwrite: Y has more than 32767 columns (too many for a WAV-file)");
   endif
 
@@ -89,17 +71,16 @@
   endswitch
 
   ## calculate filesize
-  [n, channels] = size(y);
+  [n, channels] = size (y);
 
   ## size of data chunk
   ck_size = n*channels*(bits_per_sample/8);
 
-  ## open file for writing binary
-
   if (! ischar (filename))
     error ("wavwrite: expecting FILENAME to be a character string");
   endif
 
+  ## open file for writing binary
   [fid, msg] = fopen (filename, "wb");
   if (fid < 0)
     error ("wavwrite: %s", msg);
@@ -126,8 +107,8 @@
   c += fwrite (fid, samples_per_sec, "uint32", 0, BYTEORDER);
 
   ## bytes per second
-  bps = samples_per_sec*channels*bits_per_sample/8;
-  c += fwrite (fid, bps, "uint32", 0, BYTEORDER);
+  byteps = samples_per_sec*channels*bits_per_sample/8;
+  c += fwrite (fid, byteps, "uint32", 0, BYTEORDER);
 
   ## block align
   c += fwrite (fid, channels*bits_per_sample/8, "uint16", 0, BYTEORDER);
@@ -147,11 +128,11 @@
   ## scale samples
   switch (bits_per_sample)
     case 8
-      yi = round (yi*127 + 128);
+      yi = round (yi*128 + 128);
     case 16
-      yi = round (yi*32767);
+      yi = round (yi*32768);
     case 32
-      yi = round (yi*2147483647);
+      yi = round (yi*2147483648);
   endswitch
 
   ## write to file
@@ -161,29 +142,39 @@
 
 endfunction
 
+
 %!test
-%! A = [1:10; 1:10]/10;
-%! wavwrite("a.wav", A);
-%! [B, samples_per_sec, bits_per_sample] = wavread("a.wav");
-%! assert(A,B, 10^(-4));
+%! A = [-1:0.1:1; -1:0.1:1];
+%! wavwrite (A, "a.wav");
+%! [B, samples_per_sec, bits_per_sample] = wavread ("a.wav");
+%! assert(A,B, 1/2^15);
 %! assert(samples_per_sec, 8000);
 %! assert(bits_per_sample, 16);
 %! delete ("a.wav");
 %
 %!test
-%! A=[1:10; 1:10] / 10;
-%! wavwrite("a.wav", A, 4000);
-%! [B, samples_per_sec, bits_per_sample] = wavread("a.wav");
-%! assert(A,B, 10^(-4));
+%! A = [-1:0.1:1; -1:0.1:1];
+%! wavwrite (A, 4000, "a.wav");
+%! [B, samples_per_sec, bits_per_sample] = wavread ("a.wav");
+%! assert(A,B, 1/2^15);
 %! assert(samples_per_sec, 4000);
 %! assert(bits_per_sample, 16);
 %! delete ("a.wav");
 %
 %!test
-%! A=[1:10; 1:10] / 10;
-%! wavwrite("a.wav", A, 4000, 8);
-%! [B, samples_per_sec, bits_per_sample] = wavread("a.wav");
-%! assert(A,B, 10^(-2));
+%! A = [-1:0.1:1; -1:0.1:1];
+%! wavwrite (A, 4000, 8, "a.wav");
+%! [B, samples_per_sec, bits_per_sample] = wavread ("a.wav");
+%! assert(A,B, 1/128);
 %! assert(samples_per_sec, 4000);
 %! assert(bits_per_sample, 8);
 %! delete ("a.wav");
+%
+%!test
+%! A = [-2:2];
+%! wavwrite (A, "a.wav");
+%! B = wavread ("a.wav");
+%! B *= 32768;
+%! assert(B, [-32768 -32768 0 32767 32767]);
+%! delete ("a.wav");
+
--- a/scripts/miscellaneous/unimplemented.m	Thu Jun 02 11:57:08 2011 -0700
+++ b/scripts/miscellaneous/unimplemented.m	Sat Jun 04 16:05:37 2011 -0700
@@ -329,7 +329,6 @@
   "quad2d",
   "questdlg",
   "rbbox",
-  "rectangle",
   "recycle",
   "reducepatch",
   "reducevolume",
--- a/scripts/plot/module.mk	Thu Jun 02 11:57:08 2011 -0700
+++ b/scripts/plot/module.mk	Sat Jun 04 16:05:37 2011 -0700
@@ -141,6 +141,7 @@
   plot/print.m \
   plot/quiver.m \
   plot/quiver3.m \
+  plot/rectangle.m \
   plot/refresh.m \
   plot/refreshdata.m \
   plot/ribbon.m \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/plot/rectangle.m	Sat Jun 04 16:05:37 2011 -0700
@@ -0,0 +1,221 @@
+## Copyright (C) 2011 David Bateman
+##
+## 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 3 of the License, 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, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn  {Function File} {} rectangle ()
+## @deftypefnx {Function File} {} rectangle (@dots{}, "Position", @var{pos})
+## @deftypefnx {Function File} {} rectangle (@dots{}, "Curvature", @var{curv})
+## @deftypefnx {Function File} {} rectangle (@dots{}, "EdgeColor", @var{ec})
+## @deftypefnx {Function File} {} rectangle (@dots{}, "FaceColor", @var{fc})
+## @deftypefnx {Function File} {@var{h} =} rectangle (@dots{})
+##
+## Draw rectangular patch defined by @var{pos} and @var{curv}.  The variable
+## @code{@var{pos}(1 : 2)} defines the lower left-hand corner of the patch
+## and @code{@var{pos}(3 : 4)} its width and height.  By default the value of
+## @var{pos} is @var{[0, 0, 1, 1]}.
+##
+## The variable @var{curv} defines the curvature of the sides of the rectangle
+## and it can be a scalar or two-element vector with values between 0 and 1.
+## A value of 0 represents no curvature of the side, where as a value of 1
+## means that the rectangular side is entirely curved into an arc of a circle.
+## If curvature is a two-element vector, then the first element is the 
+## curvature along the x-axis of the patch and the second along y-axis.
+##
+## If @var{curv} is a scalar, it represents the curvature of the shorter of the
+## two sides of the rectangle and the curvature of the other side is defined
+## by
+##
+## @example
+## min (pos (1: 2)) / max (pos (1:2)) * curv
+## @end example
+##
+## Other properties are passed to the underlying patch command.  If called 
+## with an output argument, @code{rectangle} returns the handle to the 
+## rectangle.
+## @end deftypefn
+## @seealso{patch}
+
+function h = rectangle (varargin)
+
+  [hax, varargin] = __plt_get_axis_arg__ ("rectangle", varargin{:});
+
+  tmp =  __rectangle__ (hax, varargin{:});
+
+  if (nargout > 0)
+    h = tmp;
+  endif
+endfunction
+
+function hg = __rectangle__ (hax, varargin)
+
+  iarg = 1;
+  pos = [0, 0, 1, 1];
+  curv2 = [0, 0];
+  ec = [0, 0, 0];
+  fc = "none";
+
+  while (iarg < length (varargin))
+    arg = varargin{iarg};
+    if (ischar(arg))
+      if (strcmpi (arg, "position"))
+        pos = varargin{iarg+1};
+        varargin(iarg:iarg+1) = [];
+        if (!isvector (pos) || numel (pos) != 4)
+          error ("rectangle: position must be a 4 element vector");
+        endif
+      elseif (strcmpi (arg, "curvature"))
+        curv2 = varargin{iarg+1};
+        varargin(iarg:iarg+1) = [];
+        if (!isnumeric (curv2) || (numel (curv2) != 1 && numel (curv2) != 2))
+          error ("rectangle: curvature must be a 2 element vector or a scalar");
+        endif
+        if (any (curv2 < 0) || any (curv2 > 1))
+          error ("rectangle: curvature values must be between 0 and 1");
+        endif
+      elseif (strcmpi (arg, "edgecolor"))
+        ec = varargin{iarg+1};
+        varargin(iarg:iarg+1) = [];
+      elseif (strcmpi (arg, "facecolor"))
+        fc = varargin{iarg+1};
+        varargin(iarg:iarg+1) = [];
+      else
+        iarg ++;
+      endif
+    else
+      iarg ++;
+    endif
+  endwhile
+
+  if (numel (curv2) == 1)
+    [a, ai] = min (pos (3 : 4));
+    [b, bi] = max (pos (3 : 4));
+    if (ai < bi)
+      curv = [curv2, curv2 .* a ./ b];
+    else
+      curv = [curv2 .* a ./ b, curv2];
+    endif
+  else
+    curv = curv2;
+  endif
+
+  if (all (curv) < 0.01)
+    ## Special case : no curvature
+    x = [pos(1), pos(1) + pos(3), pos(1) + pos(3), pos(1), pos(1)];
+    y = [pos(2), pos(2), pos(2) + pos(4), pos(2) + pos(4), pos(2)];
+  else
+    p = pi / 2 * [0 : 15] / 15;
+    c = curv .* pos(3 : 4) / 2;
+    cx = c(1) * sin (p) - c(1);
+    cy = c(2) * cos (p) - c(2);
+    x = [pos(1) - fliplr(cx), pos(1) + pos(3) + cx, ...
+         pos(1) + pos(3) + fliplr(cx), pos(1) - cx, pos(1)];
+    y = [pos(2) - fliplr(cy), pos(2) - cy, pos(2) + pos(4) + fliplr(cy), ...
+         pos(2) + pos(4) + cy, pos(2) + c(2)];
+  endif
+
+  hg = hggroup ();
+
+  h = patch ("xdata", x(:), "ydata", y(:), "facecolor", fc, "edgecolor", ec, ...
+             "parent", hg, varargin{:});
+
+  addproperty ("curvature", hg, "data", curv2);
+  addproperty ("position",  hg, "data", pos);
+  addproperty ("edgecolor", hg, "patchedgecolor", get (h, "edgecolor"));
+  addproperty ("linewidth", hg, "patchlinewidth", get (h, "linewidth"));
+  addproperty ("linestyle", hg, "patchlinestyle", get (h, "linestyle"));
+  addproperty ("facecolor", hg, "patchfacecolor", get (h, "facecolor"));
+
+  addlistener (hg, "curvature", @update_data);
+  addlistener (hg, "position",  @update_data);
+  addlistener (hg, "edgecolor", @update_props);
+  addlistener (hg, "linewidth", @update_props);
+  addlistener (hg, "linestyle", @update_props);
+  addlistener (hg, "facecolor", @update_props);
+endfunction
+
+function update_data (h, d)
+  persistent recursion = false;
+
+  ## Don't allow recursion
+  if (!recursion)
+    unwind_protect
+      recursion = true;
+
+      kids = get (h, "children");
+      pos = get (h, "position");
+      curv2 = get (h, "curvature");
+
+      if (numel (curv2) == 1)
+        [a, ai] = min (pos (3 : 4));
+        [b, bi] = max (pos (3 : 4));
+        if (ai < bi)
+          curv = [curv2, curv2 .* a ./ b];
+        else
+          curv = [curv2 .* a ./ b, curv2];
+        endif
+      else
+        curv = curv2;
+      endif
+
+      if (all (curv) < 0.01)
+        ## Special case : no curvature
+        x = [pos(1), pos(1) + pos(3), pos(1) + pos(3), pos(1), pos(1)];
+        y = [pos(2), pos(2), pos(2) + pos(4), pos(2) + pos(4), pos(2)];
+      else
+        p = pi / 2 * [0 : 15] / 15;
+        c = curv .* pos(3 : 4) / 2;
+        cx = c(1) * sin (p) - c(1);
+        cy = c(2) * cos (p) - c(2);
+        x = [pos(1) - fliplr(cx), pos(1) + pos(3) + cx, ...
+             pos(1) + pos(3) + fliplr(cx), pos(1) - cx, pos(1)];
+        y = [pos(2) - fliplr(cy), pos(2) - cy, pos(2) + pos(4) + fliplr(cy), ...
+             pos(2) + pos(4) + cy, pos(2) + c(2)];
+      endif
+
+      set (kids, "xdata", x, "ydata", y);
+    unwind_protect_cleanup
+      recursion = false;
+    end_unwind_protect
+  endif
+endfunction
+
+function update_props (h, d)
+  kids = get (h, "children");
+  set (kids, "edgecolor", get (h, "edgecolor"),
+       "linewidth", get (h, "linewidth"),
+       "linestyle", get (h, "linestyle"),
+       "facecolor", get (h, "facecolor"));
+endfunction
+
+
+%!demo
+%! close all
+%! axis equal
+%! rectangle ("Position", [0.05, 0.05, 0.9, 0.9], "Curvature", [0.5, 0.5]);
+
+%!demo
+%! close all
+%! axis equal
+%! rectangle ("Position", [0.05, 0.05, 0.9, 0.4], "Curvature", 1.0);
+
+%!demo
+%! close all
+%! axis equal
+%! h = rectangle ("Position", [0.05, 0.05, 0.9, 0.4], "Curvature",  1.0);
+%! set (h, "FaceColor", [0, 1, 0]);
+
--- a/scripts/statistics/distributions/geornd.m	Thu Jun 02 11:57:08 2011 -0700
+++ b/scripts/statistics/distributions/geornd.m	Sat Jun 04 16:05:37 2011 -0700
@@ -60,7 +60,7 @@
       error ("geornd: n must be scalar or of size SZ");
     endif
   elseif (nargin == 1)
-    sz = size(n);
+    sz = size(p);
   elseif (nargin != 1)
     print_usage ();
   endif
--- a/scripts/statistics/distributions/unifpdf.m	Thu Jun 02 11:57:08 2011 -0700
+++ b/scripts/statistics/distributions/unifpdf.m	Sat Jun 04 16:05:37 2011 -0700
@@ -53,7 +53,7 @@
     pdf(k) = NaN;
   endif
 
-  k = find ((x > a) & (x < b));
+  k = find ((x >= a) & (x <= b));
   if (any (k))
     if (isscalar (a) && isscalar(b))
       pdf(k) = 1 ./ (b - a);
--- a/scripts/statistics/distributions/wblinv.m	Thu Jun 02 11:57:08 2011 -0700
+++ b/scripts/statistics/distributions/wblinv.m	Sat Jun 04 16:05:37 2011 -0700
@@ -53,7 +53,7 @@
 
   k = find ((x == 0) & ok);
   if (any (k))
-    inv(k) = -Inf;
+    inv(k) = 0;
   endif
 
   k = find ((x > 0) & (x < 1) & ok);
--- a/scripts/statistics/distributions/wblpdf.m	Thu Jun 02 11:57:08 2011 -0700
+++ b/scripts/statistics/distributions/wblpdf.m	Sat Jun 04 16:05:37 2011 -0700
@@ -62,12 +62,12 @@
   pdf = NaN (size (x));
   ok = ((scale > 0) & (scale < Inf) & (shape > 0) & (shape < Inf));
 
-  k = find ((x > -Inf) & (x <= 0) & ok);
+  k = find ((x > -Inf) & (x < 0) & ok);
   if (any (k))
     pdf(k) = 0;
   endif
 
-  k = find ((x > 0) & (x < Inf) & ok);
+  k = find ((x >= 0) & (x < Inf) & ok);
   if (any (k))
     if (isscalar (scale) && isscalar (shape))
       pdf(k) = (shape .* (scale .^ -shape)
--- a/src/DLD-FUNCTIONS/filter.cc	Thu Jun 02 11:57:08 2011 -0700
+++ b/src/DLD-FUNCTIONS/filter.cc	Sat Jun 04 16:05:37 2011 -0700
@@ -456,19 +456,10 @@
                 }
               else
                 {
-                  dim_vector si_dims = args (3).dims ();
-                  bool si_is_vector = true;
-                  for (int i = 0; i < si_dims.length (); i++)
-                    if (si_dims(i) != 1 && si_dims(i) < si_dims.numel ())
-                      {
-                        si_is_vector = false;
-                        break;
-                      }
-
                   si = args(3).float_complex_array_value ();
 
-                  if (si_is_vector)
-                    si = si.reshape (dim_vector (1, si.numel ()));
+                  if (si.is_vector () && x.is_vector ())
+                    si = si.reshape (dim_vector (si.numel (), 1));
                 }
 
               if (! error_state)
@@ -513,19 +504,10 @@
                 }
               else
                 {
-                  dim_vector si_dims = args (3).dims ();
-                  bool si_is_vector = true;
-                  for (int i = 0; i < si_dims.length (); i++)
-                    if (si_dims(i) != 1 && si_dims(i) < si_dims.numel ())
-                      {
-                        si_is_vector = false;
-                        break;
-                      }
-
                   si = args(3).complex_array_value ();
 
-                  if (si_is_vector)
-                    si = si.reshape (dim_vector (1, si.numel ()));
+                  if (si.is_vector () && x.is_vector ())
+                    si = si.reshape (dim_vector (si.numel (), 1));
                 }
 
               if (! error_state)
@@ -573,19 +555,10 @@
                 }
               else
                 {
-                  dim_vector si_dims = args (3).dims ();
-                  bool si_is_vector = true;
-                  for (int i = 0; i < si_dims.length (); i++)
-                    if (si_dims(i) != 1 && si_dims(i) < si_dims.numel ())
-                      {
-                        si_is_vector = false;
-                        break;
-                      }
-
                   si = args(3).float_array_value ();
 
-                  if (si_is_vector)
-                    si = si.reshape (dim_vector (1, si.numel ()));
+                  if (si.is_vector () && x.is_vector ())
+                    si = si.reshape (dim_vector (si.numel (), 1));
                 }
 
               if (! error_state)
@@ -630,19 +603,10 @@
                 }
               else
                 {
-                  dim_vector si_dims = args (3).dims ();
-                  bool si_is_vector = true;
-                  for (int i = 0; i < si_dims.length (); i++)
-                    if (si_dims(i) != 1 && si_dims(i) < si_dims.numel ())
-                      {
-                        si_is_vector = false;
-                        break;
-                      }
-
                   si = args(3).array_value ();
 
-                  if (si_is_vector)
-                    si = si.reshape (dim_vector (1, si.numel ()));
+                  if (si.is_vector () && x.is_vector ())
+                    si = si.reshape (dim_vector (si.numel (), 1));
                 }
 
               if (! error_state)
@@ -749,8 +713,13 @@
 %!
 %!assert(filter (1, ones(10,1)/10, []), []);
 %!assert(filter (1, ones(10,1)/10, zeros(0,10)), zeros(0,10));
+%!assert(filter (1, ones(10,1)/10, single (1:5)), repmat (single (10), 1, 5));
+%% Test using initial conditions
+%!assert(filter([1, 1, 1], [1, 1], [1 2], [1, 1]), [2 2]);
+%!assert(filter([1, 1, 1], [1, 1], [1 2], [1, 1]'), [2 2]);
 %!assert(filter([1, 3], [1], [1 2; 3 4; 5 6], [4, 5]), [5 7; 6 10; 14 18]);
-%!assert(filter (1, ones(10,1)/10, single (1:5)), repmat (single (10), 1, 5));
+%!error (filter([1, 3], [1], [1 2; 3 4; 5 6], [4, 5]'));
+%!assert(filter([1, 3, 2], [1], [1 2; 3 4; 5 6], [1 0 0; 1 0 0], 2), [2 6; 3 13; 5 21]);
 %%  Should put some tests of the "DIM" parameter in here.
 
 */
--- a/src/DLD-FUNCTIONS/str2double.cc	Thu Jun 02 11:57:08 2011 -0700
+++ b/src/DLD-FUNCTIONS/str2double.cc	Sat Jun 04 16:05:37 2011 -0700
@@ -244,8 +244,11 @@
 case each element is converted and an array of the same dimensions is\n\
 returned.\n\
 \n\
-@code{str2double} can replace @code{str2num}, and it avoids the use of\n\
-@code{eval} on unknown data.\n\
+@code{str2double} returns NaN for elements of @var{s} which cannot be\n\
+converted.\n\
+\n\
+@code{str2double} can replace @code{str2num}, and it avoids the security\n\
+risk of using @code{eval} on unknown data.\n\
 @seealso{str2num}\n\
 @end deftypefn")
 {
--- a/src/error.cc	Thu Jun 02 11:57:08 2011 -0700
+++ b/src/error.cc	Sat Jun 04 16:05:37 2011 -0700
@@ -1480,9 +1480,9 @@
 @deftypefn  {Built-in Function} {@var{lasterr} =} lasterror ()\n\
 @deftypefnx {Built-in Function} {} lasterror (@var{err})\n\
 @deftypefnx {Built-in Function} {} lasterror ('reset')\n\
-Query or set the last error message.  Called without any arguments\n\
-returns a structure containing the last error message, as well as other\n\
-information related to this error.  The elements of this structure are:\n\
+Query or set the last error message structure.  When called without arguments\n\
+, return a structure containing the last error message and other\n\
+information related to this error.  The elements of the structure are:\n\
 \n\
 @table @asis\n\
 @item 'message'\n\
@@ -1492,9 +1492,9 @@
 The message identifier of this error message\n\
 \n\
 @item 'stack'\n\
-A structure containing information on where the message occurred.  This might\n\
-be an empty structure if this in the case where this information cannot\n\
-be obtained.  The fields of this structure are:\n\
+A structure containing information on where the message occurred.  This may\n\
+be an empty structure if the information cannot\n\
+be obtained.  The fields of the structure are:\n\
 \n\
 @table @asis\n\
 @item 'file'\n\
@@ -1511,14 +1511,13 @@
 @end table\n\
 @end table\n\
 \n\
-The @var{err} structure may also be passed to @code{lasterror} to set the\n\
-information about the last error.  The only constraint on @var{err} in that\n\
-case is that it is a scalar structure.  Any fields of @var{err} that match\n\
-the above are set to the value passed in @var{err}, while other fields are\n\
+The last error structure may be set by passing a scalar structure, @var{err},\n\
+as input.  Any fields of @var{err} that match those above are set while any\n\
+unspecified fields are initialized with default values.\n\
+\n\
+If @code{lasterror} is called with the argument 'reset', all fields are\n\
 set to their default values.\n\
-\n\
-If @code{lasterror} is called with the argument 'reset', all values take\n\
-their default values.\n\
+@seealso{lasterr}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -1636,10 +1635,14 @@
 
 DEFUN (lasterr, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {[@var{msg}, @var{msgid}] =} lasterr (@var{msg}, @var{msgid})\n\
-Without any arguments, return the last error message.  With one\n\
+@deftypefn  {Built-in Function} {[@var{msg}, @var{msgid}] =} lasterr ()\n\
+@deftypefnx {Built-in Function} {} lasterr (@var{msg})\n\
+@deftypefnx {Built-in Function} {} lasterr (@var{msg}, @var{msgid})\n\
+Query or set the last error message.  When called without input arguments,\n\
+return the last error message and message identifier.  With one\n\
 argument, set the last error message to @var{msg}.  With two arguments,\n\
 also set the last message identifier.\n\
+@seealso{lasterror}\n\
 @end deftypefn")
 {
   octave_value_list retval;
--- a/src/variables.cc	Thu Jun 02 11:57:08 2011 -0700
+++ b/src/variables.cc	Sat Jun 04 16:05:37 2011 -0700
@@ -1964,8 +1964,9 @@
 
 DEFUN (munlock, args, ,
   "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {} munlock (@var{fcn})\n\
-Unlock the named function.  If no function is named\n\
+@deftypefn  {Built-in Function} {} munlock ()\n\
+@deftypefnx {Built-in Function} {} munlock (@var{fcn})\n\
+Unlock the named function @var{fcn}.  If no function is named\n\
 then unlock the current function.\n\
 @seealso{mlock, mislocked, persistent}\n\
 @end deftypefn")
@@ -1999,9 +2000,10 @@
 
 DEFUN (mislocked, args, ,
   "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {} mislocked (@var{fcn})\n\
-Return true if the named function is locked.  If no function is named\n\
-then return true if the current function is locked.\n\
+@deftypefn  {Built-in Function} {} mislocked ()\n\
+@deftypefnx {Built-in Function} {} mislocked (@var{fcn})\n\
+Return true if the named function @var{fcn} is locked.  If no function is\n\
+named then return true if the current function is locked.\n\
 @seealso{mlock, munlock, persistent}\n\
 @end deftypefn")
 {