#! /bin/sh # # To apply this patch, cd to the top level Octave source directory and # run this file through /bin/sh. It will first remove any files that # have been deleted from the source distribution since the last # release and then update the sources with patch(1). # # Diffs for updating *.ps, *.dvi, *.info*, and *.html files are not # included because they can be recreated from the Texinfo files using # TeX, makeinfo, or texi2html. # # Diffs for updating parse.cc and y.tab.h are not included because # they can be recreated from the file parse.y using bison. # # Diffs for updating lex.cc are not included because it can be # recreated from lex.l using flex. # # John W. Eaton # jwe@bevo.che.wisc.edu # University of Wisconsin-Madison # Department of Chemical Engineering if test -f src/octave.cc ; then true else echo '***********************************************************' 1>&2 echo 'You must run this script in the top-level octave directory!' 1>&2 echo '***********************************************************' 1>&2 exit 1 fi ### ### Special commands should go here. ### echo 'patching existing files' patch -p1 << \PATCH_EOF diff -cNr octave-3.2.0/BUGS octave-3.2.2/BUGS *** octave-3.2.0/BUGS 2009-06-03 14:36:32.000000000 +0200 --- octave-3.2.2/BUGS 2009-07-21 07:11:08.000000000 +0200 *************** *** 113,126 **** not want to receive bug reports. Those that do have asked to be on the mailing list. - As a last resort, send bug reports on paper to: - - Octave Bugs c/o John W. Eaton - University of Wisconsin-Madison - Department of Chemical Engineering - 1415 Engineering Drive - Madison, Wisconsin 53706 USA - 1.5 How to Report Bugs ====================== --- 113,118 ---- diff -cNr octave-3.2.0/ChangeLog octave-3.2.2/ChangeLog *** octave-3.2.0/ChangeLog 2009-06-03 14:32:51.000000000 +0200 --- octave-3.2.2/ChangeLog 2009-07-21 06:52:31.000000000 +0200 *************** *** 1,3 **** --- 1,16 ---- + 2009-07-21 Jaroslav Hajek + + Version 3.2.2 released. + + 2009-06-02 Jaroslav Hajek + + * examples/@polynomial/subsref.m: Handle ':' correctly. + * examples/@polynomial/subsasgn.m: Ditto. + + 2009-05-22 Benjamin Lindner + + * mkoctfile.cc.in: mask MSVC specific linker flags for mex output + 2009-05-25 Jaroslav Hajek Version 3.2.0 released. diff -cNr octave-3.2.0/doc/ChangeLog octave-3.2.2/doc/ChangeLog *** octave-3.2.0/doc/ChangeLog 2009-06-03 14:32:51.000000000 +0200 --- octave-3.2.2/doc/ChangeLog 2009-07-21 06:52:30.000000000 +0200 *************** *** 1,3 **** --- 1,31 ---- + 2009-07-21 Jaroslav Hajek + + Version 3.2.2 released. + + 2009-06-24 Rafael Laboissiere + + * Makefile.in (dist): Drop conf.texi as prerequisite. + + 2009-06-16 Jaroslav Hajek + + * interpreter/tips.txi: Update. + + 2009-06-07 Rik + + * interpreter/plot.txi: Update some of Advanced Plotting documentation. + Updated functions delete, allchild, backend, clf, hold, and refreshdata. + + 2009-06-07 Thorsten Meyer + + * interpreter/container.txi: Udate documentation of container types + + 2009-06-03 Rik + + * interpreter/plotimages.m: Correct errorbar plot for docs. Make hist plot + reprodroducible for docs. + * interpreter/interpimages.m: Correct typo in legend of interpft plot for + docs + 2009-05-25 Jaroslav Hajek Version 3.2.0 released. *************** *** 11,21 **** * interpreter/oop.txi: Update docs of polynomial class, mention chained indexing. ! 2009-05-27 Søren Hauberg * interpreter/errors.txi: fix 'print_usage' output. ! 2009-05-27 Søren Hauberg * interpreter/bugs.txi: fix call to 'page_screen_output'. --- 39,49 ---- * interpreter/oop.txi: Update docs of polynomial class, mention chained indexing. ! 2009-05-27 S�ren Hauberg * interpreter/errors.txi: fix 'print_usage' output. ! 2009-05-27 S�ren Hauberg * interpreter/bugs.txi: fix call to 'page_screen_output'. *************** *** 155,161 **** * interpreter/Makefile.in (DISTFILES): Use doc-cache instead of DOC for doc cache file. ! 2009-03-08 Søren Hauberg * interpreter/stats.txi (Basic Statistical Functions): Add the 'histc' function. --- 183,189 ---- * interpreter/Makefile.in (DISTFILES): Use doc-cache instead of DOC for doc cache file. ! 2009-03-08 S�ren Hauberg * interpreter/stats.txi (Basic Statistical Functions): Add the 'histc' function. *************** *** 241,251 **** (DISTFILES): Add DOC nad mk_doc_cache.m to the list. * mk_doc_cache.m: New file. ! 2009-02-01 Soren Hauberg * interpreter/nonlin.txi: Remove reference to 'fsolve_options'. ! 2009-02-01 Soren Hauberg * interpreter/system.txi: Remove reference to 'eomdate'. --- 269,279 ---- (DISTFILES): Add DOC nad mk_doc_cache.m to the list. * mk_doc_cache.m: New file. ! 2009-02-01 S�ren Hauberg * interpreter/nonlin.txi: Remove reference to 'fsolve_options'. ! 2009-02-01 S�ren Hauberg * interpreter/system.txi: Remove reference to 'eomdate'. *************** *** 261,267 **** * vr-idx.txi: Delete. * interpreter/Makefile.in (SUB_SOURCE): Remove it from the list. ! 2009-01-22 Søren Hauberg * interpreter/func.txi: Put varargin and varargout in concept index. * interpreter/var.txi: Put ans in concept index. --- 289,295 ---- * vr-idx.txi: Delete. * interpreter/Makefile.in (SUB_SOURCE): Remove it from the list. ! 2009-01-22 S�ren Hauberg * interpreter/func.txi: Put varargin and varargout in concept index. * interpreter/var.txi: Put ans in concept index. *************** *** 382,393 **** * interpreter/contrib.txi: correction of the mercurial example * interpreter/container.txi: minor correction of the text ! 2008-09-25 Søren Hauberg * interpreter/image.txi: Update for imread and imwrite instead of loadimge and saveimage. ! 2008-09-24 Søren Hauberg * interpreter/image.txi: Document imfinfo. --- 410,421 ---- * interpreter/contrib.txi: correction of the mercurial example * interpreter/container.txi: minor correction of the text ! 2008-09-25 S�ren Hauberg * interpreter/image.txi: Update for imread and imwrite instead of loadimge and saveimage. ! 2008-09-24 S�ren Hauberg * interpreter/image.txi: Document imfinfo. *************** *** 436,442 **** * interpreter/numbers.txi: Document intwarning. ! 2008-08-06 Søren Hauberg * interpreter/basics.txi, interpreter/errors.txi, interpreter/expr.txi, interpreter/func.txi, --- 464,470 ---- * interpreter/numbers.txi: Document intwarning. ! 2008-08-06 S�ren Hauberg * interpreter/basics.txi, interpreter/errors.txi, interpreter/expr.txi, interpreter/func.txi, *************** *** 653,659 **** * refcard/refcard.tex: Update for 3.0. ! 2007-10-15 Søren Hauberg * interpreter/preface.txi, interpreter/basics.txi, interpreter/strings.txi, interpreter/container.txi, --- 681,687 ---- * refcard/refcard.tex: Update for 3.0. ! 2007-10-15 S�ren Hauberg * interpreter/preface.txi, interpreter/basics.txi, interpreter/strings.txi, interpreter/container.txi, *************** *** 685,691 **** 2007-10-06 John W. Eaton ! * interpreter/octave.texi: Add David Bateman and Søren Hauberg as authors. 2006-09-28 Henry Mollet mollet@pacbell.net --- 713,719 ---- 2007-10-06 John W. Eaton ! * interpreter/octave.texi: Add David Bateman and S�ren Hauberg as authors. 2006-09-28 Henry Mollet mollet@pacbell.net *************** *** 717,723 **** * interpreter/geometry.txi: Check whether TEXINFO_QHULL is set before including certain figures. ! 2007-08-31 Søren Hauberg * interpreter/nonlin.txi: Extended the example. --- 745,751 ---- * interpreter/geometry.txi: Check whether TEXINFO_QHULL is set before including certain figures. ! 2007-08-31 S�ren Hauberg * interpreter/nonlin.txi: Extended the example. *************** *** 800,806 **** * interpreter/interp.txi: Also change figures here. * interpreter/Makefile.in: and here. ! 2007-06-18 Søren Hauberg * interpreter/optim.txi: Added some introductory text to each section. --- 828,834 ---- * interpreter/interp.txi: Also change figures here. * interpreter/Makefile.in: and here. ! 2007-06-18 S�ren Hauberg * interpreter/optim.txi: Added some introductory text to each section. *************** *** 847,853 **** and subsections for hashing to system utilities chapter. ! 2007-06-12 2007-06-10 Søren Hauberg * interpreter/diffeq.txi: Note that x-dot is the derivative of x. --- 875,881 ---- and subsections for hashing to system utilities chapter. ! 2007-06-12 2007-06-10 S�ren Hauberg * interpreter/diffeq.txi: Note that x-dot is the derivative of x. *************** *** 875,881 **** * interpreter/Makefile.in ($(HTML_IMAGES_PNG)): Use cp instead of INSTALL_DATA to copy files to the HTML directory. ! 2007-05-28 Søren Hauberg * interpreter/errors.txi: Add new sections and some more detailed descriptions on errors and warnings. --- 903,909 ---- * interpreter/Makefile.in ($(HTML_IMAGES_PNG)): Use cp instead of INSTALL_DATA to copy files to the HTML directory. ! 2007-05-28 S�ren Hauberg * interpreter/errors.txi: Add new sections and some more detailed descriptions on errors and warnings. *************** *** 883,889 **** interpreter/var.txi: Add references to the new sections in errors.txi. ! 2007-05-28 Søren Hauberg * interpreter/io.txi: Rearrange some sections, and add a few examples. --- 911,917 ---- interpreter/var.txi: Add references to the new sections in errors.txi. ! 2007-05-28 S�ren Hauberg * interpreter/io.txi: Rearrange some sections, and add a few examples. *************** *** 917,923 **** * interpreter/debug.txi, io.txi, octave.txi: Doc fixes. ! 2007-05-21 Søren Hauberg * interpreter/expr.txi: Describe +=, -=, *=, and /= operators. Add new example. --- 945,951 ---- * interpreter/debug.txi, io.txi, octave.txi: Doc fixes. ! 2007-05-21 S�ren Hauberg * interpreter/expr.txi: Describe +=, -=, *=, and /= operators. Add new example. *************** *** 939,945 **** * interpreter/func.txi: Additional documentation for function locking, dispatch and autoloading. ! 2007-05-16 Søren Hauberg * interpreter/expr.txi: Improve docs. --- 967,973 ---- * interpreter/func.txi: Additional documentation for function locking, dispatch and autoloading. ! 2007-05-16 S�ren Hauberg * interpreter/expr.txi: Improve docs. *************** *** 949,955 **** interpreter/intro.txi, interpreter/numbers.txi, interpreter/octave.texi, interpreter/preface.txi: Doc fixes. ! 2007-04-18 Søren Hauberg * interpreter/package.texi: Document "*" flag for loaded packages. --- 977,983 ---- interpreter/intro.txi, interpreter/numbers.txi, interpreter/octave.texi, interpreter/preface.txi: Doc fixes. ! 2007-04-18 S�ren Hauberg * interpreter/package.texi: Document "*" flag for loaded packages. *************** *** 1032,1038 **** * Makefile.in (SUB_SOURCE): Include dynamic.txi in the list. ! 2007-04-18 Søren Hauberg * interpreter/package.texi: New file. * octave/texi: @include it, add it to the menus. --- 1060,1066 ---- * Makefile.in (SUB_SOURCE): Include dynamic.txi in the list. ! 2007-04-18 S�ren Hauberg * interpreter/package.texi: New file. * octave/texi: @include it, add it to the menus. *************** *** 1057,1063 **** * interpreter/stream.txi: Delete. * interpreter/Makefile.in (SUB_SOURCE): Remove it from the list. ! 2007-04-16 Søren Hauberg * intrepreter/stmt.txi: Improve documentation of switch statement. --- 1085,1091 ---- * interpreter/stream.txi: Delete. * interpreter/Makefile.in (SUB_SOURCE): Remove it from the list. ! 2007-04-16 S�ren Hauberg * intrepreter/stmt.txi: Improve documentation of switch statement. *************** *** 1069,1083 **** * interpreter/image.txi: Update docs. ! 2007-04-11 Søren Hauberg * interpreter/container.txi: Document indexing with (). ! 2007-04-11 Søren Hauberg * interpreter/container.txi: Improve cell array documentation. ! 2007-04-09 Søren Hauberg * interpreter/func.txi: Document varargin, varargout, and default argument values. --- 1097,1111 ---- * interpreter/image.txi: Update docs. ! 2007-04-11 S�ren Hauberg * interpreter/container.txi: Document indexing with (). ! 2007-04-11 S�ren Hauberg * interpreter/container.txi: Improve cell array documentation. ! 2007-04-09 S�ren Hauberg * interpreter/func.txi: Document varargin, varargout, and default argument values. diff -cNr octave-3.2.0/doc/interpreter/arith.texi octave-3.2.2/doc/interpreter/arith.texi *** octave-3.2.0/doc/interpreter/arith.texi 2009-06-03 14:36:33.000000000 +0200 --- octave-3.2.2/doc/interpreter/arith.texi 2009-07-21 07:11:08.000000000 +0200 *************** *** 2062,2067 **** --- 2062,2068 ---- arguments specify additional matrix dimensions. The optional argument @var{class} specifies the return type and may be either "double" or "single". + @seealso{@ref{doc-isinf,,isinf}} @end deftypefn diff -cNr octave-3.2.0/doc/interpreter/bugs.texi octave-3.2.2/doc/interpreter/bugs.texi *** octave-3.2.0/doc/interpreter/bugs.texi 2009-06-03 14:36:33.000000000 +0200 --- octave-3.2.2/doc/interpreter/bugs.texi 2009-07-21 07:11:08.000000000 +0200 *************** *** 210,227 **** Octave do not want to receive bug reports. Those that do have asked to be on the mailing list. - As a last resort, send bug reports on paper to: - - @example - @group - Octave Bugs c/o John W. Eaton - University of Wisconsin-Madison - Department of Chemical Engineering - 1415 Engineering Drive - Madison, Wisconsin 53706 USA - @end group - @end example - @node Bug Reporting @appendixsec How to Report Bugs @cindex bugs, reporting --- 210,215 ---- diff -cNr octave-3.2.0/doc/interpreter/bugs.txi octave-3.2.2/doc/interpreter/bugs.txi *** octave-3.2.0/doc/interpreter/bugs.txi 2009-06-03 13:55:40.000000000 +0200 --- octave-3.2.2/doc/interpreter/bugs.txi 2009-06-11 07:13:21.000000000 +0200 *************** *** 201,218 **** Octave do not want to receive bug reports. Those that do have asked to be on the mailing list. - As a last resort, send bug reports on paper to: - - @example - @group - Octave Bugs c/o John W. Eaton - University of Wisconsin-Madison - Department of Chemical Engineering - 1415 Engineering Drive - Madison, Wisconsin 53706 USA - @end group - @end example - @node Bug Reporting @appendixsec How to Report Bugs @cindex bugs, reporting --- 201,206 ---- diff -cNr octave-3.2.0/doc/interpreter/container.texi octave-3.2.2/doc/interpreter/container.texi *** octave-3.2.0/doc/interpreter/container.texi 2009-06-03 14:36:33.000000000 +0200 --- octave-3.2.2/doc/interpreter/container.texi 2009-07-21 07:11:08.000000000 +0200 *************** *** 25,31 **** Octave includes support for two different mechanisms to contain arbitrary data types in the same variable. Structures, which are C-like, and are indexed with named fields, and cell arrays, where each element ! of the array can have a different data type and or shape. @menu * Data Structures:: --- 25,33 ---- Octave includes support for two different mechanisms to contain arbitrary data types in the same variable. Structures, which are C-like, and are indexed with named fields, and cell arrays, where each element ! of the array can have a different data type and or shape. Multiple ! input arguments and return values of functions are organized as ! another data container, the comma separated list. @menu * Data Structures:: *************** *** 40,56 **** Octave includes support for organizing data in structures. The current implementation uses an associative array with indices limited to ! strings, but the syntax is more like C-style structures. Here are some ! examples of using data structures in Octave. Elements of structures can be of any value type. For example, the three expressions @example @group ! x.a = 1 ! x.b = [1, 2; 3, 4] ! x.c = "string" @end group @end example --- 42,70 ---- Octave includes support for organizing data in structures. The current implementation uses an associative array with indices limited to ! strings, but the syntax is more like C-style structures. ! ! @menu ! * Basic Usage and Examples:: ! * Structure Arrays:: ! * Creating Structures:: ! * Manipulating Structures:: ! * Processing Data in Structures:: ! @end menu ! ! @node Basic Usage and Examples ! @subsection Basic Usage and Examples ! ! Here are some examples of using data structures in Octave. Elements of structures can be of any value type. For example, the three expressions @example @group ! x.a = 1; ! x.b = [1, 2; 3, 4]; ! x.c = "string"; @end group @end example *************** *** 60,97 **** @example @group ! octave:2> x ! x = ! @{ ! a = 1 ! b = ! 1 2 ! 3 4 ! c = string ! @} @end group @end example @noindent Note that Octave may print the elements in any order. ! Structures may be copied. @example @group ! octave:1> y = x ! y = ! @{ ! a = 1 ! b = ! 1 2 ! 3 4 ! c = string ! @} @end group @end example --- 74,111 ---- @example @group ! x ! @result{} x = ! @{ ! a = 1 ! b = ! 1 2 ! 3 4 ! c = string ! @} @end group @end example @noindent Note that Octave may print the elements in any order. ! Structures may be copied just like any other variable: @example @group ! y = x ! @result{} y = ! @{ ! a = 1 ! b = ! 1 2 ! 3 4 ! c = string ! @} @end group @end example *************** *** 102,125 **** @example @group ! octave:1> x.b.d = 3 ! x.b.d = 3 ! octave:2> x.b ! ans = ! @{ ! d = 3 ! @} ! octave:3> x ! x = ! @{ ! a = 1 ! b = ! @{ ! d = 3 ! @} ! c = string ! @} @end group @end example --- 116,139 ---- @example @group ! x.b.d = 3; ! x.b ! @result{} ans = ! @{ ! d = 3 ! @} ! ! x ! @result{} x = ! @{ ! a = 1 ! b = ! @{ ! d = 3 ! @} ! c = string ! @} @end group @end example *************** *** 128,151 **** @example @group ! octave:1> a.b.c.d.e = 1; ! octave:2> a ! a = ! @{ ! b = ! @{ ! c = ! @{ ! d: 1x1 struct ! @} ! @} ! @} @end group @end example @noindent This prevents long and confusing output from large deeply nested ! structures. @c pr-output.cc @anchor{doc-struct_levels_to_print} --- 142,168 ---- @example @group ! a.b.c.d.e = 1; ! a ! @result{} a = ! @{ ! b = ! @{ ! c = ! @{ ! 1x1 struct array containing the fields: ! ! d: 1x1 struct ! @} ! @} ! @} @end group @end example @noindent This prevents long and confusing output from large deeply nested ! structures. The number of levels to print for nested structures can be ! set with the function @code{struct_levels_to_print}: @c pr-output.cc @anchor{doc-struct_levels_to_print} *************** *** 162,171 **** @example @group ! octave:1> function y = f (x) ! > y.re = real (x); ! > y.im = imag (x); ! > endfunction @end group @end example --- 179,188 ---- @example @group ! function y = f (x) ! y.re = real (x); ! y.im = imag (x); ! endfunction @end group @end example *************** *** 175,193 **** @example @group ! octave:2> f (rand (2) + rand (2) * I) ! ans = ! @{ ! im = ! 0.26475 0.14828 ! 0.18436 0.83669 ! re = ! 0.040239 0.242160 ! 0.238081 0.402523 ! @} @end group @end example --- 192,211 ---- @example @group ! f (rand (2) + rand (2) * I) ! @result{} ans = ! @{ ! im = ! 0.26475 0.14828 ! 0.18436 0.83669 ! re = ! 0.040239 0.242160 ! 0.238081 0.402523 ! ! @} @end group @end example *************** *** 196,289 **** @example @group ! octave:1> [ x.u, x.s(2:3,2:3), x.v ] = svd ([1, 2; 3, 4]) ! x.u = ! -0.40455 -0.91451 ! -0.91451 0.40455 ! x.s = ! 0.00000 0.00000 0.00000 ! 0.00000 5.46499 0.00000 ! 0.00000 0.00000 0.36597 ! x.v = ! -0.57605 0.81742 ! -0.81742 -0.57605 @end group @end example It is also possible to cycle through all the elements of a structure in a loop, using a special form of the @code{for} statement ! (@pxref{Looping Over Structure Elements}) ! ! @menu ! * Structure Arrays:: ! * Creating Structures:: ! * Manipulating Structures:: ! * Processing Data in Structures:: ! @end menu @node Structure Arrays @subsection Structure Arrays A structure array is a particular instance of a structure, where each of the fields of the structure is represented by a cell array. Each of ! these cell arrays has the same dimensions. An example of the creation of ! a structure array is @example @group ! x(1).a = "string1" ! x(2).a = "string2" ! x(1).b = 1 ! x(2).b = 2 @end group @end example @noindent ! which creates a 2-by-1 structure array with two fields. As previously, ! to print the value of the structure array, you can type its name: @example @group ! octave:1> x ! x = ! @{ ! 1x2 struct array containing the fields: ! a ! b ! @} @end group @end example Individual elements of the structure array can be returned by indexing ! the variable like @code{@var{x} (1)}, which returns a structure with the ! two fields like @example @group ! octave:2> x(1) ! ans = ! @{ ! a = string1 ! b = 1 ! @} @end group @end example ! Furthermore, the structure array can return a comma separated list ! (@pxref{Comma Separated Lists}), if indexed by one of its own field ! names. For example @example @group ! octave:3> x.a ! ans = string1 ! ans = string2 @end group @end example --- 214,309 ---- @example @group ! [ x.u, x.s(2:3,2:3), x.v ] = svd ([1, 2; 3, 4]); ! x ! @result{} x = ! @{ ! u = ! -0.40455 -0.91451 ! -0.91451 0.40455 ! s = ! 0.00000 0.00000 0.00000 ! 0.00000 5.46499 0.00000 ! 0.00000 0.00000 0.36597 ! v = ! -0.57605 0.81742 ! -0.81742 -0.57605 ! ! @} @end group @end example It is also possible to cycle through all the elements of a structure in a loop, using a special form of the @code{for} statement ! (@pxref{Looping Over Structure Elements}). @node Structure Arrays @subsection Structure Arrays A structure array is a particular instance of a structure, where each of the fields of the structure is represented by a cell array. Each of ! these cell arrays has the same dimensions. Conceptually, a structure ! array can also be seen as an array of structures with identical ! fields. An example of the creation of a structure array is @example @group ! x(1).a = "string1"; ! x(2).a = "string2"; ! x(1).b = 1; ! x(2).b = 2; @end group @end example @noindent ! which creates a 2-by-1 structure array with two fields. Another way ! to create a structure array is with the @code{struct} function ! (@pxref{Creating Structures}). As previously, to print the value of ! the structure array, you can type its name: @example @group ! x ! @result{} x = ! @{ ! 1x2 struct array containing the fields: ! a ! b ! @} @end group @end example Individual elements of the structure array can be returned by indexing ! the variable like @code{@var{x}(1)}, which returns a structure with ! two fields: @example @group ! x(1) ! @result{} ans = ! @{ ! a = string1 ! b = 1 ! @} @end group @end example ! Furthermore, the structure array can return a comma separated list of ! field values (@pxref{Comma Separated Lists}), if indexed by one of its ! own field names. For example @example @group ! x.a ! @result{} ! ans = string1 ! ans = string2 @end group @end example *************** *** 292,302 **** @example @group ! octave:4> [x.a] = deal("new string1", "new string2"); ! octave:5> x(1).a ! ans = new string1 ! octave:6> x(2).a ! ans = new string2 @end group @end example --- 312,322 ---- @example @group ! [x.a] = deal("new string1", "new string2"); ! x(1).a ! @result{} ans = new string1 ! x(2).a ! @result{} ans = new string2 @end group @end example *************** *** 304,316 **** @example @group ! octave:7> x(3:4) = x(1:2); ! octave:8> [x([1,3]).a] = deal("other string1", "other string2"); ! octave:9> x.a ! ans = other string1 ! ans = new string2 ! ans = other string2 ! ans = new string2 @end group @end example --- 324,337 ---- @example @group ! x(3:4) = x(1:2); ! [x([1,3]).a] = deal("other string1", "other string2"); ! x.a ! @result{} ! ans = other string1 ! ans = new string2 ! ans = other string2 ! ans = new string2 @end group @end example *************** *** 319,328 **** @example @group ! octave:10> size(x) ! ans = ! 1 4 @end group @end example --- 340,349 ---- @example @group ! size(x) ! @result{} ans = ! 1 4 @end group @end example *************** *** 332,356 **** @example in = struct ("call1", @{x, Inf, "last"@}, ! "call2", @{x, Inf, "first"@}); ! in (1, :) = [] ! @result{} in = ! @{ ! call1 = ! ! (, ! [1] = Inf ! [2] = last ! ,) ! ! call2 = ! ! (, ! [1] = Inf ! [2] = first ! ,) ! ! @} @end example @node Creating Structures --- 353,372 ---- @example in = struct ("call1", @{x, Inf, "last"@}, ! "call2", @{x, Inf, "first"@}) ! @result{} in = ! @{ ! 1x3 struct array containing the fields: ! ! call1 ! call2 ! @} ! ! in(1) = []; ! in.call1 ! @result{} ! ans = Inf ! ans = last @end example @node Creating Structures *************** *** 378,410 **** structure array with a consistent dimension. For example @example ! struct ("field1", @{1, "one"@}, "field2", @{2, "two"@}, ! "field3", 3) ! @result{} ans = ! @{ ! field1 = ! ! (, ! [1] = 1 ! [2] = one ! ,) ! ! field2 = ! ! (, ! [1] = 2 ! [2] = two ! ,) ! ! field3 = ! ! (, ! [1] = 3 ! [2] = 3 ! ,) ! ! @} ! @end example @c ov-struct.cc @anchor{doc-struct} --- 394,435 ---- structure array with a consistent dimension. For example @example ! s = struct ("field1", @{1, "one"@}, "field2", @{2, "two"@}, ! "field3", 3); ! s.field1 ! @result{} ! ans = 1 ! ans = one ! ! s.field2 ! @result{} ! ans = 2 ! ans = two ! ! s.field3 ! @result{} ! ans = 3 ! ans = 3 ! @end example ! ! If you want to create a struct which contains a cell array as an ! individual field, you have to put it into another cell array like in ! the following example: ! ! @example ! struct ("field1", @{@{1, "one"@}@}, "field2", 2) ! @result{} ans = ! @{ ! field1 = ! ! @{ ! [1,1] = 1 ! [1,2] = one ! @} ! ! field2 = 2 ! @} ! @end example @c ov-struct.cc @anchor{doc-struct} *************** *** 422,427 **** --- 447,455 ---- @end deftypefn + The function @code{isstruct} can be used to test if an object is a + structure or a structure array. + @c ov-struct.cc @anchor{doc-isstruct} @deftypefn {Built-in Function} {} isstruct (@var{expr}) *************** *** 429,436 **** @end deftypefn ! Additional functions that can manipulate the fields of a structure are ! listed below. @c ov-struct.cc @anchor{doc-rmfield} --- 457,466 ---- @end deftypefn ! @node Manipulating Structures ! @subsection Manipulating Structures ! ! Other functions that can manipulate the fields of a structure are given below. @c ov-struct.cc @anchor{doc-rmfield} *************** *** 484,494 **** @end deftypefn - @node Manipulating Structures - @subsection Manipulating Structures - - Other functions that can manipulate the fields of a structure are given below. - @c ov-struct.cc @anchor{doc-fieldnames} @deftypefn {Built-in Function} {} fieldnames (@var{struct}) --- 514,519 ---- *************** *** 619,627 **** It can be both necessary and convenient to store several variables of different size or type in one variable. A cell array is a container class able to do just that. In general cell arrays work just like ! @math{N}-dimensional arrays, with the exception of the use of @samp{@{} and @samp{@}} as allocation and indexing operators. As an example, the following code creates a cell array containing a string and a 2-by-2 random matrix --- 644,663 ---- It can be both necessary and convenient to store several variables of different size or type in one variable. A cell array is a container class able to do just that. In general cell arrays work just like ! @math{N}-dimensional arrays with the exception of the use of @samp{@{} and @samp{@}} as allocation and indexing operators. + @menu + * Basic Usage of Cell Arrays:: + * Creating Cell Arrays:: + * Indexing Cell Arrays:: + * Cell Arrays of Strings:: + * Processing Data in Cell Arrays:: + @end menu + + @node Basic Usage of Cell Arrays + @subsection Basic Usage of Cell Arrays + As an example, the following code creates a cell array containing a string and a 2-by-2 random matrix *************** *** 630,637 **** @end example @noindent ! And a cell array can be indexed with the @{ and @} operators, so the ! variable created in the previous example can be indexed like this @example @group --- 666,674 ---- @end example @noindent ! To access the elements of a cell array, it can be indexed with the @{ ! and @} operators. Thus, the variable created in the previous example ! can be indexed like this: @example @group *************** *** 681,689 **** @end group @end example ! In general nested cell arrays are displayed hierarchically as above. In ! some circumstances it makes sense to reference them by their index, and ! this can be performed by the @code{celldisp} function. @c ./general/celldisp.m @anchor{doc-celldisp} --- 718,729 ---- @end group @end example ! Details on indexing cell arrays are explained in @ref{Indexing Cell Arrays}. ! ! In general nested cell arrays are displayed hierarchically as in the ! previous example. In some circumstances it makes sense to reference ! them by their index, and this can be performed by the @code{celldisp} ! function. @c ./general/celldisp.m @anchor{doc-celldisp} *************** *** 695,713 **** @end deftypefn ! @menu ! * Creating Cell Arrays:: ! * Indexing Cell Arrays:: ! * Cell Arrays of Strings:: ! * Processing Data in Cell Arrays:: ! @end menu @node Creating Cell Arrays @subsection Creating Cell Array ! The introductory example showed how to create a cell array containing ! currently available variables. In many situations, however, it is useful ! to create a cell array and then fill it with data. The @code{cell} function returns a cell array of a given size, containing empty matrices. This function is similar to the @code{zeros} --- 735,769 ---- @end deftypefn ! To test if an object is a cell array, use the @code{iscell} ! function. For example: ! ! @example ! @group ! iscell(c) ! @result{} ans = 1 ! ! iscell(3) ! @result{} ans = 0 ! ! @end group ! @end example ! ! @c ov-cell.cc ! @anchor{doc-iscell} ! @deftypefn {Built-in Function} {} iscell (@var{x}) ! Return true if @var{x} is a cell array object. Otherwise, return ! false. ! @end deftypefn ! @node Creating Cell Arrays @subsection Creating Cell Array ! The introductory example (@pxref{Basic Usage of Cell Arrays}) showed ! how to create a cell array containing currently available variables. ! In many situations, however, it is useful to create a cell array and ! then fill it with data. The @code{cell} function returns a cell array of a given size, containing empty matrices. This function is similar to the @code{zeros} *************** *** 746,758 **** @end example @noindent ! As can be seen, the @code{size} function also works for cell arrays. As ! do the other functions describing the size of an object, such as ! @code{length}, @code{numel}, @code{rows}, and @code{columns}. ! ! As an alternative to creating empty cell arrays, and then filling them, it ! is possible to convert numerical arrays into cell arrays using the ! @code{num2cell} and @code{mat2cell} functions. @c ov-cell.cc @anchor{doc-cell} --- 802,812 ---- @end example @noindent ! As can be seen, the @ref{doc-size, @code{size}} function also works ! for cell arrays. As do other functions describing the size of an ! object, such as @ref{doc-length, @code{length}}, @ref{doc-numel, ! @code{numel}}, @ref{doc-rows, @code{rows}}, and @ref{doc-columns, ! @code{columns}}. @c ov-cell.cc @anchor{doc-cell} *************** *** 767,785 **** @end deftypefn ! @c ov-cell.cc ! @anchor{doc-iscell} ! @deftypefn {Built-in Function} {} iscell (@var{x}) ! Return true if @var{x} is a cell array object. Otherwise, return ! false. ! @end deftypefn ! @c ./DLD-FUNCTIONS/cellfun.cc @anchor{doc-num2cell} ! @deftypefn {Loadable Function} {@var{c} =} num2cell (@var{m}) @deftypefnx {Loadable Function} {@var{c} =} num2cell (@var{m}, @var{dim}) ! Convert the matrix @var{m} into a cell array. If @var{dim} is defined, the value @var{c} is of dimension 1 in this dimension and the elements of @var{m} are placed in slices in @var{c}. @seealso{@ref{doc-mat2cell,,mat2cell}} --- 821,835 ---- @end deftypefn ! As an alternative to creating empty cell arrays, and then filling them, it ! is possible to convert numerical arrays into cell arrays using the ! @code{num2cell} and @code{mat2cell} functions. @c ./DLD-FUNCTIONS/cellfun.cc @anchor{doc-num2cell} ! @deftypefn {Loadable Function} {@var{c} =} num2cell (@var{m}) @deftypefnx {Loadable Function} {@var{c} =} num2cell (@var{m}, @var{dim}) ! Convert the matrix @var{m} to a cell array. If @var{dim} is defined, the value @var{c} is of dimension 1 in this dimension and the elements of @var{m} are placed in slices in @var{c}. @seealso{@ref{doc-mat2cell,,mat2cell}} *************** *** 832,869 **** @node Indexing Cell Arrays @subsection Indexing Cell Arrays ! As shown in the introductory example elements can be inserted from cell ! arrays using the @samp{@{} and @samp{@}} operators. Besides the change ! of operators, indexing works for cell arrays like for multidimensional ! arrays. As an example, all the rows of the first and third column of a ! cell array can be set to @code{0} with the following code @example ! c@{:, [1, 3]@} = 0; @end example ! Accessing values in a cell array is, however, different from the same ! operation for numerical arrays. Accessing a single element of a cell ! array is very similar to numerical arrays, for example @example ! element = c@{1, 2@}; @end example ! @noindent ! This will, however, @emph{not} work when accessing multiple elements of ! a cell array, because it might not be possible to represent all elements ! with a single variable as is the case with numerical arrays. Accessing multiple elements of a cell array with the @samp{@{} and ! @samp{@}} operators will result in a comma-separated list (@pxref{Comma ! Separated Lists}) of all the requested elements as discussed later. ! One distinction between @samp{@{} and @samp{(} to index cell arrays is ! in the deletion of elements from the cell array. In a similar manner to ! a numerical array the @samp{()} operator can be used to delete elements ! from the cell array. The @samp{@{@}} operator however will remove the ! elements of the cell array, but not delete the space for them. For example @example @group --- 882,1001 ---- @node Indexing Cell Arrays @subsection Indexing Cell Arrays ! As shown in @pxref{Basic Usage of Cell Arrays} elements can be ! extracted from cell arrays using the @samp{@{} and @samp{@}} ! operators. If you want to extract or access subarrays which are still ! cell arrays, you need to use the @samp{(} and @samp{)} operators. The ! following example illustrates the difference: @example ! @group ! c = @{"1", "2", "3"; "a", "b", "c"; "4", "5", "6"@}; ! c@{2,3@} ! @result{} ans = c ! ! c(2,3) ! @result{} ans = ! @{ ! [1,1] = c ! @} ! @end group @end example ! @noindent So with @samp{@{@}} you access elements of a cell ! array, while with @samp{()} you access a sub array of a cell ! array. ! ! Using the @samp{(} and @samp{)} operators, indexing works for cell ! arrays like for multidimensional arrays. As an example, all the rows ! of the first and third column of a cell array can be set to @code{0} ! with the following command: @example ! @group ! c(:, [1, 3]) = @{0@} ! @result{} = ! @{ ! [1,1] = 0 ! [2,1] = 0 ! [3,1] = 0 ! [1,2] = 2 ! [2,2] = 10 ! [3,2] = 20 ! [1,3] = 0 ! [2,3] = 0 ! [3,3] = 0 ! @} ! @end group @end example ! Note, that the above can also be achieved like this: ! ! @example ! c(:, [1, 3]) = 0; ! @end example ! ! @noindent Here, the scalar @samp{0} is automatically promoted to ! cell array @samp{@{0@}} and then assigned to the subarray of @code{c}. ! ! To give another example for indexing cell arrays with @samp{()}, you ! can exchange the first and the second row of a cell array as in the ! following command: ! ! @example ! @group ! c = @{1, 2, 3; 4, 5, 6@}; ! c([1, 2], :) = c([2, 1], :) ! @result{} = ! @{ ! [1,1] = 4 ! [2,1] = 1 ! [1,2] = 5 ! [2,2] = 2 ! [1,3] = 6 ! [2,3] = 3 ! @} ! @end group ! @end example Accessing multiple elements of a cell array with the @samp{@{} and ! @samp{@}} operators will result in a comma-separated list of all the ! requested elements (@pxref{Comma Separated Lists}). Using the ! @samp{@{} and @samp{@}} operators the first two rows in the above ! example can be swapped back like this: ! ! @example ! @group ! [c@{[1,2], :@}] = deal(c@{[2, 1], :@}) ! @result{} = ! @{ ! [1,1] = 1 ! [2,1] = 4 ! [1,2] = 2 ! [2,2] = 5 ! [1,3] = 3 ! [2,3] = 6 ! @} ! @end group ! @end example ! As for struct arrays and numerical arrays, the empty matrix @samp{[]} ! can be used to delete elements from a cell array: ! ! @example ! @group ! x = @{"1", "2"; "3", "4"@}; ! x(1, :) = [] ! @result{} x = ! @{ ! [1,1] = 3 ! [1,2] = 4 ! @} ! @end group ! @end example ! ! The following example shows how to just remove the contents of cell ! array elements but not delete the space for them: @example @group *************** *** 876,888 **** [1,2] = [](0x0) [2,2] = 4 @} - - x(1, :) = [] - @result{} x = - @{ - [1,1] = 3 - [1,2] = 4 - @} @end group @end example --- 1008,1013 ---- *************** *** 890,901 **** @subsection Cell Arrays of Strings One common use of cell arrays is to store multiple strings in the same ! variable. It is possible to store multiple strings in a character matrix ! by letting each row be a string. This, however, introduces the problem ! that all strings must be of equal length. Therefore it is recommended to ! use cell arrays to store multiple strings. If, however, the character ! matrix representation is required for an operation, it can be converted ! to a cell array of strings using the @code{cellstr} function @example @group --- 1015,1030 ---- @subsection Cell Arrays of Strings One common use of cell arrays is to store multiple strings in the same ! variable. It is also possible to store multiple strings in a ! character matrix by letting each row be a string. This, however, ! introduces the problem that all strings must be of equal length. ! Therefore, it is recommended to use cell arrays to store multiple ! strings. For cases, where the character matrix representation is required ! for an operation, there are several functions that convert a cell ! array of strings to a character array and back. @code{char} and ! @code{strvcat} convert cell arrays to a character array ! (@pxref{Concatenating Strings}), while the function @code{cellstr} ! converts a character array to a cell array of strings: @example @group *************** *** 909,921 **** @end group @end example One further advantage of using cell arrays to store multiple strings is that most functions for string manipulations included with Octave support this representation. As an example, it is possible to compare one string with many others using the @code{strcmp} function. If one of the arguments to this function is a string and the other is a cell array ! of strings, each element of the cell array will be compared the string ! argument, @example @group --- 1038,1058 ---- @end group @end example + @c ov-cell.cc + @anchor{doc-cellstr} + @deftypefn {Built-in Function} {} cellstr (@var{string}) + Create a new cell array object from the elements of the string + array @var{string}. + @end deftypefn + + One further advantage of using cell arrays to store multiple strings is that most functions for string manipulations included with Octave support this representation. As an example, it is possible to compare one string with many others using the @code{strcmp} function. If one of the arguments to this function is a string and the other is a cell array ! of strings, each element of the cell array will be compared to the string ! argument: @example @group *************** *** 927,944 **** @end example @noindent ! The following functions for string manipulation support cell arrays of ! strings, @code{strcmp}, @code{strcmpi}, @code{strncmp}, @code{strncmpi}, ! @code{str2double}, @code{char}, @code{strappend}, @code{strtrunc}, ! @code{strvcat}, @code{strfind}, and @code{strmatch}. ! ! @c ov-cell.cc ! @anchor{doc-cellstr} ! @deftypefn {Built-in Function} {} cellstr (@var{string}) ! Create a new cell array object from the elements of the string ! array @var{string}. ! @end deftypefn @c ov-cell.cc @anchor{doc-iscellstr} --- 1064,1079 ---- @end example @noindent ! The following string functions support cell arrays of strings: ! @code{char}, @code{strvcat}, @code{strcat} (@pxref{Concatenating ! Strings}), @code{strcmp}, @code{strncmp}, @code{strcmpi}, ! @code{strncmpi} (@pxref{Comparing Strings}), @code{str2double}, ! @code{deblank}, @code{strtrim}, @code{strtrunc}, @code{strfind}, ! @code{strmatch}, , @code{regexp}, @code{regexpi} (@pxref{Manipulating ! Strings}) and @code{str2double} (@pxref{String Conversions}). + The function @code{iscellstr} can be used to test if an object is a + cell array of strings. @c ov-cell.cc @anchor{doc-iscellstr} *************** *** 1111,1175 **** @cindex comma separated lists @cindex cs-lists ! Comma separated lists@footnote{Comma-separated lists are also sometimes informally referred to as @dfn{cs-lists}.} are the basic argument type ! to all Octave functions. In the example @example max (@var{a}, @var{b}) @end example @noindent ! @code{@var{a}, @var{b}} is a comma separated list. Comma separated lists ! can appear on both the right and left hand side of an equation. For example @example ! [@var{i}, @var{j}] = ceil (find (@var{x}, [], "last")); @end example @noindent ! where @code{@var{i}, @var{j}} is equally a comma separated list. Comma ! separated lists cannot be directly manipulated by the user. However, ! both structures and cell arrays can be converted into comma ! separated lists, which makes them useful to keep the input arguments and ! return values of functions organized. Another example of where a comma ! separated list can be used is in the creation of a new array. If all the ! accessed elements of a cell array are scalars or column vectors, they ! can be concatenated into a new column vector containing the elements, by ! surrounding the list with @code{[} and @code{]} as in the following ! example @example ! @group ! a = @{1, [2, 3], 4@}; ! b = [a@{:@}] ! @result{} b = ! 1 2 3 4 ! @end group @end example ! It is also possible to pass the accessed elements directly to a ! function. The list of elements from the cell array will be passed as an ! argument list to a given function as if it is called with the elements as ! arguments. The two calls to @code{printf} in the following example are ! identical but the latter is simpler and handles more situations @example @group ! c = @{"GNU", "Octave", "is", "Free", "Software"@}; ! printf ("%s ", c@{1@}, c@{2@}, c@{3@}, c@{4@}, c@{5@}); ! @print{} GNU Octave is Free Software ! printf ("%s ", c@{:@}); ! @print{} GNU Octave is Free Software @end group @end example ! Just like it is possible to create a numerical array from selected ! elements of a cell array, it is possible to create a new cell array ! containing the selected elements. By surrounding the list with @samp{@{} and @samp{@}} a new cell array will be created, as the ! following example illustrates @example @group --- 1246,1323 ---- @cindex comma separated lists @cindex cs-lists ! Comma separated lists @footnote{Comma-separated lists are also sometimes informally referred to as @dfn{cs-lists}.} are the basic argument type ! to all Octave functions - both for input and return arguments. In the ! example @example max (@var{a}, @var{b}) @end example @noindent ! @samp{@var{a}, @var{b}} is a comma separated list. Comma separated lists ! can appear on both the right and left hand side of an assignment. For example @example ! @group ! x = [1 0 1 0 0 1 1; 0 0 0 0 0 0 7]; ! [@var{i}, @var{j}] = find (@var{x}, 2, "last"); ! @end group @end example @noindent ! Here, @samp{@var{x}, 2, "last"} is a comma separated list constituting ! the input arguments of @code{find}. @code{find} returns a comma ! separated list of output arguments which is assigned element by ! element to the comma separated list @samp{@var{i}, @var{j}}. ! ! Another example of where comma separated lists are used is in the ! creation of a new array with @code{[]} (@pxref{Matrices}) or the ! creation of a cell array with @code{@{@}} (@pxref{Basic Usage of Cell ! Arrays}). In the expressions @example ! a = [1, 2, 3, 4]; ! c = @{4, 5, 6, 7@}; @end example ! @noindent ! both @samp{1, 2, 3, 4} and @samp{4, 5, 6, 7} are comma separated lists. ! ! Comma separated lists cannot be directly manipulated by the ! user. However, both structure arrays and cell arrays can be converted ! into comma separated lists, and thus used in place of explicitly ! written comma separated lists. This feature is useful in many ways, ! as will be shown in the following subsections. ! ! @menu ! * Comma Separated Lists Generated from Cell Arrays:: ! * Comma Separated Lists Generated from Structure Arrays:: ! @end menu ! ! @node Comma Separated Lists Generated from Cell Arrays ! @subsection Comma Separated Lists Generated from Cell Arrays ! ! As has been mentioned above (@pxref{Indexing Cell Arrays}), elements ! of a cell array can be extracted into a comma separated list with the ! @code{@{} and @code{@}} operators. By surrounding this list with ! @code{[} and @code{]}, it can be concatenated into an array. For example: @example @group ! a = @{1, [2, 3], 4, 5, 6@}; ! b = [a@{1:4@}] ! @result{} b = ! 1 2 3 4 @end group @end example ! Similarly, it is possible to create a new cell array containing cell ! elements selected with @code{@{@}}. By surrounding the list with @samp{@{} and @samp{@}} a new cell array will be created, as the ! following example illustrates: @example @group *************** *** 1183,1223 **** @end group @end example ! @noindent ! This syntax is however a bit cumbersome, and since this is a common ! operation, it is possible to achieve the same using the @samp{(} ! and @samp{)} operators for indexing. When a cell array is indexed ! using the @samp{(} and @samp{)} operators a new cell array containing ! the selected elements will be created. Using this syntax, the previous ! example can be simplified into the following @example @group ! a = @{1, rand(2, 2), "three"@}; ! b = a( [1, 3] ) ! @result{} b = ! @{ ! [1,1] = 1 ! [1,2] = three ! @} @end group @end example ! A comma separated list can equally appear on the left-hand side of an ! assignment. An example is @example @group ! in @{1@} = ceil (rand (10, 1)); ! in @{2@} = []; ! in @{3@} = "last"; ! in @{4@} = "first"; out = cell (4, 1); ! [out@{1:2@}] = find (in@{1 : 3@}); ! [out@{3:4@}] = find (in@{[1, 2, 4]@}); @end group @end example Structure arrays can equally be used to create comma separated lists. This is done by addressing one of the fields of a structure array. For example --- 1331,1380 ---- @end group @end example ! Furthermore, cell elements (accessed by @code{@{@}}) can be passed ! directly to a function. The list of elements from the cell array will ! be passed as an argument list to a given function as if it is called ! with the elements as individual arguments. The two calls to ! @code{printf} in the following example are identical but the latter is ! simpler and can handle cell arrays of an arbitrary size: @example @group ! c = @{"GNU", "Octave", "is", "Free", "Software"@}; ! printf ("%s ", c@{1@}, c@{2@}, c@{3@}, c@{4@}, c@{5@}); ! @print{} GNU Octave is Free Software ! printf ("%s ", c@{:@}); ! @print{} GNU Octave is Free Software @end group @end example ! If used on the left-hand side of an assignment, a comma separated list ! generated with @code{@{@}} can be assigned to. An example is @example @group ! in@{1@} = [10, 20, 30, 40, 50, 60, 70, 80, 90]; ! in@{2@} = inf; ! in@{3@} = "last"; ! in@{4@} = "first"; out = cell (4, 1); ! [out@{1:3@}] = find (in@{1 : 3@}); ! [out@{4:6@}] = find (in@{[1, 2, 4]@}) ! @result{} out = ! @{ ! [1,1] = 1 ! [2,1] = 9 ! [3,1] = 90 ! [4,1] = 1 ! [3,1] = 1 ! [4,1] = 10 ! @} @end group @end example + + @node Comma Separated Lists Generated from Structure Arrays + @subsection Comma Separated Lists Generated from Structure Arrays Structure arrays can equally be used to create comma separated lists. This is done by addressing one of the fields of a structure array. For example *************** *** 1225,1232 **** @example @group x = ceil (randn (10, 1)); ! in = struct ("call1", @{x, Inf, "last"@}, ! "call2", @{x, Inf, "first"@}); out = struct ("call1", cell (2, 1), "call2", cell (2, 1)); [out.call1] = find (in.call1); [out.call2] = find (in.call2); --- 1382,1389 ---- @example @group x = ceil (randn (10, 1)); ! in = struct ("call1", @{x, 3, "last"@}, ! "call2", @{x, inf, "first"@}); out = struct ("call1", cell (2, 1), "call2", cell (2, 1)); [out.call1] = find (in.call1); [out.call2] = find (in.call2); diff -cNr octave-3.2.0/doc/interpreter/container.txi octave-3.2.2/doc/interpreter/container.txi *** octave-3.2.0/doc/interpreter/container.txi 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/container.txi 2009-06-08 07:34:33.000000000 +0200 *************** *** 23,29 **** Octave includes support for two different mechanisms to contain arbitrary data types in the same variable. Structures, which are C-like, and are indexed with named fields, and cell arrays, where each element ! of the array can have a different data type and or shape. @menu * Data Structures:: --- 23,31 ---- Octave includes support for two different mechanisms to contain arbitrary data types in the same variable. Structures, which are C-like, and are indexed with named fields, and cell arrays, where each element ! of the array can have a different data type and or shape. Multiple ! input arguments and return values of functions are organized as ! another data container, the comma separated list. @menu * Data Structures:: *************** *** 38,54 **** Octave includes support for organizing data in structures. The current implementation uses an associative array with indices limited to ! strings, but the syntax is more like C-style structures. Here are some ! examples of using data structures in Octave. Elements of structures can be of any value type. For example, the three expressions @example @group ! x.a = 1 ! x.b = [1, 2; 3, 4] ! x.c = "string" @end group @end example --- 40,68 ---- Octave includes support for organizing data in structures. The current implementation uses an associative array with indices limited to ! strings, but the syntax is more like C-style structures. ! ! @menu ! * Basic Usage and Examples:: ! * Structure Arrays:: ! * Creating Structures:: ! * Manipulating Structures:: ! * Processing Data in Structures:: ! @end menu ! ! @node Basic Usage and Examples ! @subsection Basic Usage and Examples ! ! Here are some examples of using data structures in Octave. Elements of structures can be of any value type. For example, the three expressions @example @group ! x.a = 1; ! x.b = [1, 2; 3, 4]; ! x.c = "string"; @end group @end example *************** *** 58,95 **** @example @group ! octave:2> x ! x = ! @{ ! a = 1 ! b = ! 1 2 ! 3 4 ! c = string ! @} @end group @end example @noindent Note that Octave may print the elements in any order. ! Structures may be copied. @example @group ! octave:1> y = x ! y = ! @{ ! a = 1 ! b = ! 1 2 ! 3 4 ! c = string ! @} @end group @end example --- 72,109 ---- @example @group ! x ! @result{} x = ! @{ ! a = 1 ! b = ! 1 2 ! 3 4 ! c = string ! @} @end group @end example @noindent Note that Octave may print the elements in any order. ! Structures may be copied just like any other variable: @example @group ! y = x ! @result{} y = ! @{ ! a = 1 ! b = ! 1 2 ! 3 4 ! c = string ! @} @end group @end example *************** *** 100,123 **** @example @group ! octave:1> x.b.d = 3 ! x.b.d = 3 ! octave:2> x.b ! ans = ! @{ ! d = 3 ! @} ! octave:3> x ! x = ! @{ ! a = 1 ! b = ! @{ ! d = 3 ! @} ! c = string ! @} @end group @end example --- 114,137 ---- @example @group ! x.b.d = 3; ! x.b ! @result{} ans = ! @{ ! d = 3 ! @} ! ! x ! @result{} x = ! @{ ! a = 1 ! b = ! @{ ! d = 3 ! @} ! c = string ! @} @end group @end example *************** *** 126,149 **** @example @group ! octave:1> a.b.c.d.e = 1; ! octave:2> a ! a = ! @{ ! b = ! @{ ! c = ! @{ ! d: 1x1 struct ! @} ! @} ! @} @end group @end example @noindent This prevents long and confusing output from large deeply nested ! structures. @DOCSTRING(struct_levels_to_print) --- 140,166 ---- @example @group ! a.b.c.d.e = 1; ! a ! @result{} a = ! @{ ! b = ! @{ ! c = ! @{ ! 1x1 struct array containing the fields: ! ! d: 1x1 struct ! @} ! @} ! @} @end group @end example @noindent This prevents long and confusing output from large deeply nested ! structures. The number of levels to print for nested structures can be ! set with the function @code{struct_levels_to_print}: @DOCSTRING(struct_levels_to_print) *************** *** 153,162 **** @example @group ! octave:1> function y = f (x) ! > y.re = real (x); ! > y.im = imag (x); ! > endfunction @end group @end example --- 170,179 ---- @example @group ! function y = f (x) ! y.re = real (x); ! y.im = imag (x); ! endfunction @end group @end example *************** *** 166,184 **** @example @group ! octave:2> f (rand (2) + rand (2) * I) ! ans = ! @{ ! im = ! ! 0.26475 0.14828 ! 0.18436 0.83669 ! ! re = ! ! 0.040239 0.242160 ! 0.238081 0.402523 ! @} @end group @end example --- 183,202 ---- @example @group ! f (rand (2) + rand (2) * I) ! @result{} ans = ! @{ ! im = ! ! 0.26475 0.14828 ! 0.18436 0.83669 ! ! re = ! ! 0.040239 0.242160 ! 0.238081 0.402523 ! ! @} @end group @end example *************** *** 187,280 **** @example @group ! octave:1> [ x.u, x.s(2:3,2:3), x.v ] = svd ([1, 2; 3, 4]) ! x.u = ! -0.40455 -0.91451 ! -0.91451 0.40455 ! x.s = ! 0.00000 0.00000 0.00000 ! 0.00000 5.46499 0.00000 ! 0.00000 0.00000 0.36597 ! x.v = ! -0.57605 0.81742 ! -0.81742 -0.57605 @end group @end example It is also possible to cycle through all the elements of a structure in a loop, using a special form of the @code{for} statement ! (@pxref{Looping Over Structure Elements}) ! ! @menu ! * Structure Arrays:: ! * Creating Structures:: ! * Manipulating Structures:: ! * Processing Data in Structures:: ! @end menu @node Structure Arrays @subsection Structure Arrays A structure array is a particular instance of a structure, where each of the fields of the structure is represented by a cell array. Each of ! these cell arrays has the same dimensions. An example of the creation of ! a structure array is @example @group ! x(1).a = "string1" ! x(2).a = "string2" ! x(1).b = 1 ! x(2).b = 2 @end group @end example @noindent ! which creates a 2-by-1 structure array with two fields. As previously, ! to print the value of the structure array, you can type its name: @example @group ! octave:1> x ! x = ! @{ ! 1x2 struct array containing the fields: ! a ! b ! @} @end group @end example Individual elements of the structure array can be returned by indexing ! the variable like @code{@var{x} (1)}, which returns a structure with the ! two fields like @example @group ! octave:2> x(1) ! ans = ! @{ ! a = string1 ! b = 1 ! @} @end group @end example ! Furthermore, the structure array can return a comma separated list ! (@pxref{Comma Separated Lists}), if indexed by one of its own field ! names. For example @example @group ! octave:3> x.a ! ans = string1 ! ans = string2 @end group @end example --- 205,300 ---- @example @group ! [ x.u, x.s(2:3,2:3), x.v ] = svd ([1, 2; 3, 4]); ! x ! @result{} x = ! @{ ! u = ! -0.40455 -0.91451 ! -0.91451 0.40455 ! s = ! 0.00000 0.00000 0.00000 ! 0.00000 5.46499 0.00000 ! 0.00000 0.00000 0.36597 ! v = ! -0.57605 0.81742 ! -0.81742 -0.57605 ! ! @} @end group @end example It is also possible to cycle through all the elements of a structure in a loop, using a special form of the @code{for} statement ! (@pxref{Looping Over Structure Elements}). @node Structure Arrays @subsection Structure Arrays A structure array is a particular instance of a structure, where each of the fields of the structure is represented by a cell array. Each of ! these cell arrays has the same dimensions. Conceptually, a structure ! array can also be seen as an array of structures with identical ! fields. An example of the creation of a structure array is @example @group ! x(1).a = "string1"; ! x(2).a = "string2"; ! x(1).b = 1; ! x(2).b = 2; @end group @end example @noindent ! which creates a 2-by-1 structure array with two fields. Another way ! to create a structure array is with the @code{struct} function ! (@pxref{Creating Structures}). As previously, to print the value of ! the structure array, you can type its name: @example @group ! x ! @result{} x = ! @{ ! 1x2 struct array containing the fields: ! a ! b ! @} @end group @end example Individual elements of the structure array can be returned by indexing ! the variable like @code{@var{x}(1)}, which returns a structure with ! two fields: @example @group ! x(1) ! @result{} ans = ! @{ ! a = string1 ! b = 1 ! @} @end group @end example ! Furthermore, the structure array can return a comma separated list of ! field values (@pxref{Comma Separated Lists}), if indexed by one of its ! own field names. For example @example @group ! x.a ! @result{} ! ans = string1 ! ans = string2 @end group @end example *************** *** 283,293 **** @example @group ! octave:4> [x.a] = deal("new string1", "new string2"); ! octave:5> x(1).a ! ans = new string1 ! octave:6> x(2).a ! ans = new string2 @end group @end example --- 303,313 ---- @example @group ! [x.a] = deal("new string1", "new string2"); ! x(1).a ! @result{} ans = new string1 ! x(2).a ! @result{} ans = new string2 @end group @end example *************** *** 295,307 **** @example @group ! octave:7> x(3:4) = x(1:2); ! octave:8> [x([1,3]).a] = deal("other string1", "other string2"); ! octave:9> x.a ! ans = other string1 ! ans = new string2 ! ans = other string2 ! ans = new string2 @end group @end example --- 315,328 ---- @example @group ! x(3:4) = x(1:2); ! [x([1,3]).a] = deal("other string1", "other string2"); ! x.a ! @result{} ! ans = other string1 ! ans = new string2 ! ans = other string2 ! ans = new string2 @end group @end example *************** *** 310,319 **** @example @group ! octave:10> size(x) ! ans = ! 1 4 @end group @end example --- 331,340 ---- @example @group ! size(x) ! @result{} ans = ! 1 4 @end group @end example *************** *** 323,347 **** @example in = struct ("call1", @{x, Inf, "last"@}, ! "call2", @{x, Inf, "first"@}); ! in (1, :) = [] ! @result{} in = ! @{ ! call1 = ! ! (, ! [1] = Inf ! [2] = last ! ,) ! ! call2 = ! ! (, ! [1] = Inf ! [2] = first ! ,) ! ! @} @end example @node Creating Structures --- 344,363 ---- @example in = struct ("call1", @{x, Inf, "last"@}, ! "call2", @{x, Inf, "first"@}) ! @result{} in = ! @{ ! 1x3 struct array containing the fields: ! ! call1 ! call2 ! @} ! ! in(1) = []; ! in.call1 ! @result{} ! ans = Inf ! ans = last @end example @node Creating Structures *************** *** 369,408 **** structure array with a consistent dimension. For example @example ! struct ("field1", @{1, "one"@}, "field2", @{2, "two"@}, ! "field3", 3) ! @result{} ans = ! @{ ! field1 = ! ! (, ! [1] = 1 ! [2] = one ! ,) ! ! field2 = ! ! (, ! [1] = 2 ! [2] = two ! ,) ! ! field3 = ! ! (, ! [1] = 3 ! [2] = 3 ! ,) ! ! @} ! @end example @DOCSTRING(struct) @DOCSTRING(isstruct) ! Additional functions that can manipulate the fields of a structure are ! listed below. @DOCSTRING(rmfield) --- 385,438 ---- structure array with a consistent dimension. For example @example ! s = struct ("field1", @{1, "one"@}, "field2", @{2, "two"@}, ! "field3", 3); ! s.field1 ! @result{} ! ans = 1 ! ans = one ! ! s.field2 ! @result{} ! ans = 2 ! ans = two ! ! s.field3 ! @result{} ! ans = 3 ! ans = 3 ! @end example ! ! If you want to create a struct which contains a cell array as an ! individual field, you have to put it into another cell array like in ! the following example: ! ! @example ! struct ("field1", @{@{1, "one"@}@}, "field2", 2) ! @result{} ans = ! @{ ! field1 = ! ! @{ ! [1,1] = 1 ! [1,2] = one ! @} ! ! field2 = 2 ! @} ! @end example @DOCSTRING(struct) + The function @code{isstruct} can be used to test if an object is a + structure or a structure array. + @DOCSTRING(isstruct) ! @node Manipulating Structures ! @subsection Manipulating Structures ! ! Other functions that can manipulate the fields of a structure are given below. @DOCSTRING(rmfield) *************** *** 410,420 **** @DOCSTRING(orderfields) - @node Manipulating Structures - @subsection Manipulating Structures - - Other functions that can manipulate the fields of a structure are given below. - @DOCSTRING(fieldnames) @DOCSTRING(isfield) --- 440,445 ---- *************** *** 445,453 **** It can be both necessary and convenient to store several variables of different size or type in one variable. A cell array is a container class able to do just that. In general cell arrays work just like ! @math{N}-dimensional arrays, with the exception of the use of @samp{@{} and @samp{@}} as allocation and indexing operators. As an example, the following code creates a cell array containing a string and a 2-by-2 random matrix --- 470,489 ---- It can be both necessary and convenient to store several variables of different size or type in one variable. A cell array is a container class able to do just that. In general cell arrays work just like ! @math{N}-dimensional arrays with the exception of the use of @samp{@{} and @samp{@}} as allocation and indexing operators. + @menu + * Basic Usage of Cell Arrays:: + * Creating Cell Arrays:: + * Indexing Cell Arrays:: + * Cell Arrays of Strings:: + * Processing Data in Cell Arrays:: + @end menu + + @node Basic Usage of Cell Arrays + @subsection Basic Usage of Cell Arrays + As an example, the following code creates a cell array containing a string and a 2-by-2 random matrix *************** *** 456,463 **** @end example @noindent ! And a cell array can be indexed with the @{ and @} operators, so the ! variable created in the previous example can be indexed like this @example @group --- 492,500 ---- @end example @noindent ! To access the elements of a cell array, it can be indexed with the @{ ! and @} operators. Thus, the variable created in the previous example ! can be indexed like this: @example @group *************** *** 507,531 **** @end group @end example ! In general nested cell arrays are displayed hierarchically as above. In ! some circumstances it makes sense to reference them by their index, and ! this can be performed by the @code{celldisp} function. @DOCSTRING(celldisp) ! @menu ! * Creating Cell Arrays:: ! * Indexing Cell Arrays:: ! * Cell Arrays of Strings:: ! * Processing Data in Cell Arrays:: ! @end menu @node Creating Cell Arrays @subsection Creating Cell Array ! The introductory example showed how to create a cell array containing ! currently available variables. In many situations, however, it is useful ! to create a cell array and then fill it with data. The @code{cell} function returns a cell array of a given size, containing empty matrices. This function is similar to the @code{zeros} --- 544,581 ---- @end group @end example ! Details on indexing cell arrays are explained in @ref{Indexing Cell Arrays}. ! ! In general nested cell arrays are displayed hierarchically as in the ! previous example. In some circumstances it makes sense to reference ! them by their index, and this can be performed by the @code{celldisp} ! function. @DOCSTRING(celldisp) ! To test if an object is a cell array, use the @code{iscell} ! function. For example: ! ! @example ! @group ! iscell(c) ! @result{} ans = 1 ! ! iscell(3) ! @result{} ans = 0 ! ! @end group ! @end example ! ! @DOCSTRING(iscell) @node Creating Cell Arrays @subsection Creating Cell Array ! The introductory example (@pxref{Basic Usage of Cell Arrays}) showed ! how to create a cell array containing currently available variables. ! In many situations, however, it is useful to create a cell array and ! then fill it with data. The @code{cell} function returns a cell array of a given size, containing empty matrices. This function is similar to the @code{zeros} *************** *** 564,581 **** @end example @noindent ! As can be seen, the @code{size} function also works for cell arrays. As ! do the other functions describing the size of an object, such as ! @code{length}, @code{numel}, @code{rows}, and @code{columns}. As an alternative to creating empty cell arrays, and then filling them, it is possible to convert numerical arrays into cell arrays using the @code{num2cell} and @code{mat2cell} functions. - @DOCSTRING(cell) - - @DOCSTRING(iscell) - @DOCSTRING(num2cell) @DOCSTRING(mat2cell) --- 614,631 ---- @end example @noindent ! As can be seen, the @ref{doc-size, @code{size}} function also works ! for cell arrays. As do other functions describing the size of an ! object, such as @ref{doc-length, @code{length}}, @ref{doc-numel, ! @code{numel}}, @ref{doc-rows, @code{rows}}, and @ref{doc-columns, ! @code{columns}}. ! ! @DOCSTRING(cell) As an alternative to creating empty cell arrays, and then filling them, it is possible to convert numerical arrays into cell arrays using the @code{num2cell} and @code{mat2cell} functions. @DOCSTRING(num2cell) @DOCSTRING(mat2cell) *************** *** 583,620 **** @node Indexing Cell Arrays @subsection Indexing Cell Arrays ! As shown in the introductory example elements can be inserted from cell ! arrays using the @samp{@{} and @samp{@}} operators. Besides the change ! of operators, indexing works for cell arrays like for multidimensional ! arrays. As an example, all the rows of the first and third column of a ! cell array can be set to @code{0} with the following code @example ! c@{:, [1, 3]@} = 0; @end example ! Accessing values in a cell array is, however, different from the same ! operation for numerical arrays. Accessing a single element of a cell ! array is very similar to numerical arrays, for example @example ! element = c@{1, 2@}; @end example ! @noindent ! This will, however, @emph{not} work when accessing multiple elements of ! a cell array, because it might not be possible to represent all elements ! with a single variable as is the case with numerical arrays. Accessing multiple elements of a cell array with the @samp{@{} and ! @samp{@}} operators will result in a comma-separated list (@pxref{Comma ! Separated Lists}) of all the requested elements as discussed later. ! One distinction between @samp{@{} and @samp{(} to index cell arrays is ! in the deletion of elements from the cell array. In a similar manner to ! a numerical array the @samp{()} operator can be used to delete elements ! from the cell array. The @samp{@{@}} operator however will remove the ! elements of the cell array, but not delete the space for them. For example @example @group --- 633,752 ---- @node Indexing Cell Arrays @subsection Indexing Cell Arrays ! As shown in @pxref{Basic Usage of Cell Arrays} elements can be ! extracted from cell arrays using the @samp{@{} and @samp{@}} ! operators. If you want to extract or access subarrays which are still ! cell arrays, you need to use the @samp{(} and @samp{)} operators. The ! following example illustrates the difference: ! ! @example ! @group ! c = @{"1", "2", "3"; "a", "b", "c"; "4", "5", "6"@}; ! c@{2,3@} ! @result{} ans = c ! ! c(2,3) ! @result{} ans = ! @{ ! [1,1] = c ! @} ! @end group ! @end example ! ! @noindent So with @samp{@{@}} you access elements of a cell ! array, while with @samp{()} you access a sub array of a cell ! array. ! ! Using the @samp{(} and @samp{)} operators, indexing works for cell ! arrays like for multidimensional arrays. As an example, all the rows ! of the first and third column of a cell array can be set to @code{0} ! with the following command: @example ! @group ! c(:, [1, 3]) = @{0@} ! @result{} = ! @{ ! [1,1] = 0 ! [2,1] = 0 ! [3,1] = 0 ! [1,2] = 2 ! [2,2] = 10 ! [3,2] = 20 ! [1,3] = 0 ! [2,3] = 0 ! [3,3] = 0 ! @} ! @end group @end example ! Note, that the above can also be achieved like this: @example ! c(:, [1, 3]) = 0; @end example ! @noindent Here, the scalar @samp{0} is automatically promoted to ! cell array @samp{@{0@}} and then assigned to the subarray of @code{c}. ! ! To give another example for indexing cell arrays with @samp{()}, you ! can exchange the first and the second row of a cell array as in the ! following command: ! ! @example ! @group ! c = @{1, 2, 3; 4, 5, 6@}; ! c([1, 2], :) = c([2, 1], :) ! @result{} = ! @{ ! [1,1] = 4 ! [2,1] = 1 ! [1,2] = 5 ! [2,2] = 2 ! [1,3] = 6 ! [2,3] = 3 ! @} ! @end group ! @end example Accessing multiple elements of a cell array with the @samp{@{} and ! @samp{@}} operators will result in a comma-separated list of all the ! requested elements (@pxref{Comma Separated Lists}). Using the ! @samp{@{} and @samp{@}} operators the first two rows in the above ! example can be swapped back like this: ! @example ! @group ! [c@{[1,2], :@}] = deal(c@{[2, 1], :@}) ! @result{} = ! @{ ! [1,1] = 1 ! [2,1] = 4 ! [1,2] = 2 ! [2,2] = 5 ! [1,3] = 3 ! [2,3] = 6 ! @} ! @end group ! @end example ! ! As for struct arrays and numerical arrays, the empty matrix @samp{[]} ! can be used to delete elements from a cell array: ! ! @example ! @group ! x = @{"1", "2"; "3", "4"@}; ! x(1, :) = [] ! @result{} x = ! @{ ! [1,1] = 3 ! [1,2] = 4 ! @} ! @end group ! @end example ! ! The following example shows how to just remove the contents of cell ! array elements but not delete the space for them: @example @group *************** *** 627,639 **** [1,2] = [](0x0) [2,2] = 4 @} - - x(1, :) = [] - @result{} x = - @{ - [1,1] = 3 - [1,2] = 4 - @} @end group @end example --- 759,764 ---- *************** *** 641,652 **** @subsection Cell Arrays of Strings One common use of cell arrays is to store multiple strings in the same ! variable. It is possible to store multiple strings in a character matrix ! by letting each row be a string. This, however, introduces the problem ! that all strings must be of equal length. Therefore it is recommended to ! use cell arrays to store multiple strings. If, however, the character ! matrix representation is required for an operation, it can be converted ! to a cell array of strings using the @code{cellstr} function @example @group --- 766,781 ---- @subsection Cell Arrays of Strings One common use of cell arrays is to store multiple strings in the same ! variable. It is also possible to store multiple strings in a ! character matrix by letting each row be a string. This, however, ! introduces the problem that all strings must be of equal length. ! Therefore, it is recommended to use cell arrays to store multiple ! strings. For cases, where the character matrix representation is required ! for an operation, there are several functions that convert a cell ! array of strings to a character array and back. @code{char} and ! @code{strvcat} convert cell arrays to a character array ! (@pxref{Concatenating Strings}), while the function @code{cellstr} ! converts a character array to a cell array of strings: @example @group *************** *** 660,672 **** @end group @end example One further advantage of using cell arrays to store multiple strings is that most functions for string manipulations included with Octave support this representation. As an example, it is possible to compare one string with many others using the @code{strcmp} function. If one of the arguments to this function is a string and the other is a cell array ! of strings, each element of the cell array will be compared the string ! argument, @example @group --- 789,803 ---- @end group @end example + @DOCSTRING(cellstr) + One further advantage of using cell arrays to store multiple strings is that most functions for string manipulations included with Octave support this representation. As an example, it is possible to compare one string with many others using the @code{strcmp} function. If one of the arguments to this function is a string and the other is a cell array ! of strings, each element of the cell array will be compared to the string ! argument: @example @group *************** *** 678,689 **** @end example @noindent ! The following functions for string manipulation support cell arrays of ! strings, @code{strcmp}, @code{strcmpi}, @code{strncmp}, @code{strncmpi}, ! @code{str2double}, @code{char}, @code{strappend}, @code{strtrunc}, ! @code{strvcat}, @code{strfind}, and @code{strmatch}. ! @DOCSTRING(cellstr) @DOCSTRING(iscellstr) --- 809,824 ---- @end example @noindent ! The following string functions support cell arrays of strings: ! @code{char}, @code{strvcat}, @code{strcat} (@pxref{Concatenating ! Strings}), @code{strcmp}, @code{strncmp}, @code{strcmpi}, ! @code{strncmpi} (@pxref{Comparing Strings}), @code{str2double}, ! @code{deblank}, @code{strtrim}, @code{strtrunc}, @code{strfind}, ! @code{strmatch}, , @code{regexp}, @code{regexpi} (@pxref{Manipulating ! Strings}) and @code{str2double} (@pxref{String Conversions}). ! The function @code{iscellstr} can be used to test if an object is a ! cell array of strings. @DOCSTRING(iscellstr) *************** *** 714,778 **** @cindex comma separated lists @cindex cs-lists ! Comma separated lists@footnote{Comma-separated lists are also sometimes informally referred to as @dfn{cs-lists}.} are the basic argument type ! to all Octave functions. In the example @example max (@var{a}, @var{b}) @end example @noindent ! @code{@var{a}, @var{b}} is a comma separated list. Comma separated lists ! can appear on both the right and left hand side of an equation. For example @example ! [@var{i}, @var{j}] = ceil (find (@var{x}, [], "last")); @end example @noindent ! where @code{@var{i}, @var{j}} is equally a comma separated list. Comma ! separated lists cannot be directly manipulated by the user. However, ! both structures and cell arrays can be converted into comma ! separated lists, which makes them useful to keep the input arguments and ! return values of functions organized. Another example of where a comma ! separated list can be used is in the creation of a new array. If all the ! accessed elements of a cell array are scalars or column vectors, they ! can be concatenated into a new column vector containing the elements, by ! surrounding the list with @code{[} and @code{]} as in the following ! example @example ! @group ! a = @{1, [2, 3], 4@}; ! b = [a@{:@}] ! @result{} b = ! 1 2 3 4 ! @end group @end example ! It is also possible to pass the accessed elements directly to a ! function. The list of elements from the cell array will be passed as an ! argument list to a given function as if it is called with the elements as ! arguments. The two calls to @code{printf} in the following example are ! identical but the latter is simpler and handles more situations @example @group ! c = @{"GNU", "Octave", "is", "Free", "Software"@}; ! printf ("%s ", c@{1@}, c@{2@}, c@{3@}, c@{4@}, c@{5@}); ! @print{} GNU Octave is Free Software ! printf ("%s ", c@{:@}); ! @print{} GNU Octave is Free Software @end group @end example ! Just like it is possible to create a numerical array from selected ! elements of a cell array, it is possible to create a new cell array ! containing the selected elements. By surrounding the list with @samp{@{} and @samp{@}} a new cell array will be created, as the ! following example illustrates @example @group --- 849,926 ---- @cindex comma separated lists @cindex cs-lists ! Comma separated lists @footnote{Comma-separated lists are also sometimes informally referred to as @dfn{cs-lists}.} are the basic argument type ! to all Octave functions - both for input and return arguments. In the ! example @example max (@var{a}, @var{b}) @end example @noindent ! @samp{@var{a}, @var{b}} is a comma separated list. Comma separated lists ! can appear on both the right and left hand side of an assignment. For example @example ! @group ! x = [1 0 1 0 0 1 1; 0 0 0 0 0 0 7]; ! [@var{i}, @var{j}] = find (@var{x}, 2, "last"); ! @end group @end example @noindent ! Here, @samp{@var{x}, 2, "last"} is a comma separated list constituting ! the input arguments of @code{find}. @code{find} returns a comma ! separated list of output arguments which is assigned element by ! element to the comma separated list @samp{@var{i}, @var{j}}. ! ! Another example of where comma separated lists are used is in the ! creation of a new array with @code{[]} (@pxref{Matrices}) or the ! creation of a cell array with @code{@{@}} (@pxref{Basic Usage of Cell ! Arrays}). In the expressions @example ! a = [1, 2, 3, 4]; ! c = @{4, 5, 6, 7@}; @end example ! @noindent ! both @samp{1, 2, 3, 4} and @samp{4, 5, 6, 7} are comma separated lists. ! ! Comma separated lists cannot be directly manipulated by the ! user. However, both structure arrays and cell arrays can be converted ! into comma separated lists, and thus used in place of explicitly ! written comma separated lists. This feature is useful in many ways, ! as will be shown in the following subsections. ! ! @menu ! * Comma Separated Lists Generated from Cell Arrays:: ! * Comma Separated Lists Generated from Structure Arrays:: ! @end menu ! ! @node Comma Separated Lists Generated from Cell Arrays ! @subsection Comma Separated Lists Generated from Cell Arrays ! ! As has been mentioned above (@pxref{Indexing Cell Arrays}), elements ! of a cell array can be extracted into a comma separated list with the ! @code{@{} and @code{@}} operators. By surrounding this list with ! @code{[} and @code{]}, it can be concatenated into an array. For example: @example @group ! a = @{1, [2, 3], 4, 5, 6@}; ! b = [a@{1:4@}] ! @result{} b = ! 1 2 3 4 @end group @end example ! Similarly, it is possible to create a new cell array containing cell ! elements selected with @code{@{@}}. By surrounding the list with @samp{@{} and @samp{@}} a new cell array will be created, as the ! following example illustrates: @example @group *************** *** 786,826 **** @end group @end example ! @noindent ! This syntax is however a bit cumbersome, and since this is a common ! operation, it is possible to achieve the same using the @samp{(} ! and @samp{)} operators for indexing. When a cell array is indexed ! using the @samp{(} and @samp{)} operators a new cell array containing ! the selected elements will be created. Using this syntax, the previous ! example can be simplified into the following @example @group ! a = @{1, rand(2, 2), "three"@}; ! b = a( [1, 3] ) ! @result{} b = ! @{ ! [1,1] = 1 ! [1,2] = three ! @} @end group @end example ! A comma separated list can equally appear on the left-hand side of an ! assignment. An example is @example @group ! in @{1@} = ceil (rand (10, 1)); ! in @{2@} = []; ! in @{3@} = "last"; ! in @{4@} = "first"; out = cell (4, 1); ! [out@{1:2@}] = find (in@{1 : 3@}); ! [out@{3:4@}] = find (in@{[1, 2, 4]@}); @end group @end example Structure arrays can equally be used to create comma separated lists. This is done by addressing one of the fields of a structure array. For example --- 934,983 ---- @end group @end example ! Furthermore, cell elements (accessed by @code{@{@}}) can be passed ! directly to a function. The list of elements from the cell array will ! be passed as an argument list to a given function as if it is called ! with the elements as individual arguments. The two calls to ! @code{printf} in the following example are identical but the latter is ! simpler and can handle cell arrays of an arbitrary size: @example @group ! c = @{"GNU", "Octave", "is", "Free", "Software"@}; ! printf ("%s ", c@{1@}, c@{2@}, c@{3@}, c@{4@}, c@{5@}); ! @print{} GNU Octave is Free Software ! printf ("%s ", c@{:@}); ! @print{} GNU Octave is Free Software @end group @end example ! If used on the left-hand side of an assignment, a comma separated list ! generated with @code{@{@}} can be assigned to. An example is @example @group ! in@{1@} = [10, 20, 30, 40, 50, 60, 70, 80, 90]; ! in@{2@} = inf; ! in@{3@} = "last"; ! in@{4@} = "first"; out = cell (4, 1); ! [out@{1:3@}] = find (in@{1 : 3@}); ! [out@{4:6@}] = find (in@{[1, 2, 4]@}) ! @result{} out = ! @{ ! [1,1] = 1 ! [2,1] = 9 ! [3,1] = 90 ! [4,1] = 1 ! [3,1] = 1 ! [4,1] = 10 ! @} @end group @end example + + @node Comma Separated Lists Generated from Structure Arrays + @subsection Comma Separated Lists Generated from Structure Arrays Structure arrays can equally be used to create comma separated lists. This is done by addressing one of the fields of a structure array. For example *************** *** 828,835 **** @example @group x = ceil (randn (10, 1)); ! in = struct ("call1", @{x, Inf, "last"@}, ! "call2", @{x, Inf, "first"@}); out = struct ("call1", cell (2, 1), "call2", cell (2, 1)); [out.call1] = find (in.call1); [out.call2] = find (in.call2); --- 985,992 ---- @example @group x = ceil (randn (10, 1)); ! in = struct ("call1", @{x, 3, "last"@}, ! "call2", @{x, inf, "first"@}); out = struct ("call1", cell (2, 1), "call2", cell (2, 1)); [out.call1] = find (in.call1); [out.call2] = find (in.call2); diff -cNr octave-3.2.0/doc/interpreter/contrib.texi octave-3.2.2/doc/interpreter/contrib.texi *** octave-3.2.0/doc/interpreter/contrib.texi 2009-06-03 14:36:33.000000000 +0200 --- octave-3.2.2/doc/interpreter/contrib.texi 2009-07-21 07:11:08.000000000 +0200 *************** *** 112,118 **** year, name and comment marks): @example ! ## Copyright (C) 1996, 1997, 2007 John W. Eaton ## ## This file is part of Octave. ## --- 112,118 ---- year, name and comment marks): @example ! ## Copyright (C) 1996, 1997, 2007 John W. Eaton ## ## This file is part of Octave. ## diff -cNr octave-3.2.0/doc/interpreter/contrib.txi octave-3.2.2/doc/interpreter/contrib.txi *** octave-3.2.0/doc/interpreter/contrib.txi 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/contrib.txi 2009-06-11 07:13:21.000000000 +0200 *************** *** 110,116 **** year, name and comment marks): @example ! ## Copyright (C) 1996, 1997, 2007 John W. Eaton ## ## This file is part of Octave. ## --- 110,116 ---- year, name and comment marks): @example ! ## Copyright (C) 1996, 1997, 2007 John W. Eaton ## ## This file is part of Octave. ## diff -cNr octave-3.2.0/doc/interpreter/contributors.in octave-3.2.2/doc/interpreter/contributors.in *** octave-3.2.0/doc/interpreter/contributors.in 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/contributors.in 2009-06-25 06:35:23.000000000 +0200 *************** *** 131,136 **** --- 131,137 ---- Tatsuro Matsuoka Laurent Mazet G. D. McBain + Alexander Mamonov Christoph Mayer Thorsten Meyer Petr Mikulik *************** *** 143,148 **** --- 144,150 ---- Al Niessner Rick Niles Takuji Nishimura + Kai Noda Eric Norum Krzesimir Nowak Michael O'Brien diff -cNr octave-3.2.0/doc/interpreter/contributors.texi octave-3.2.2/doc/interpreter/contributors.texi *** octave-3.2.0/doc/interpreter/contributors.texi 2009-06-03 14:36:35.000000000 +0200 --- octave-3.2.2/doc/interpreter/contributors.texi 2009-07-21 07:11:11.000000000 +0200 *************** *** 43,79 **** @item Emil Lucretiu @tab Hoxide Ma @tab James Macnicol @item Jens-Uwe Mager @tab Ricardo Marranita @tab Orestes Mas @item Makoto Matsumoto @tab Tatsuro Matsuoka @tab Laurent Mazet ! @item G. D. McBain @tab Christoph Mayer @tab Thorsten Meyer ! @item Petr Mikulik @tab Stefan Monnier @tab Antoine Moreau ! @item Kai P. Mueller @tab Victor Munoz @tab Carmen Navarrete ! @item Todd Neal @tab Al Niessner @tab Rick Niles ! @item Takuji Nishimura @tab Eric Norum @tab Krzesimir Nowak ! @item Michael O'Brien @tab Peter O'Gorman @tab Thorsten Ohl ! @item Arno Onken @tab Luis F. Ortiz @tab Scott Pakin ! @item Gabriele Pannocchia @tab Sylvain Pelissier @tab Per Persson ! @item Primozz Peterlin @tab Jim Peterson @tab Danilo Piazzalunga ! @item Nicholas Piper @tab Robert Platt @tab Hans Ekkehard Plesser ! @item Tom Poage @tab Orion Poplawski @tab Ondrej Popp ! @item Jef Poskanzer @tab Francesco Potorti @tab James B. Rawlings ! @item Eric S. Raymond @tab Balint Reczey @tab Michael Reifenberger ! @item Jason Riedy @tab Petter Risholm @tab Matthew W. Roberts ! @item Andrew Ross @tab Mark van Rossum @tab Kevin Ruland ! @item Ryan Rusaw @tab Olli Saarela @tab Toni Saarela ! @item Juhani Saastamoinen @tab Radek Salac @tab Ben Sapp ! @item Alois Schloegl @tab Michel D. Schmid @tab Julian Schnidder ! @item Nicol N. Schraudolph @tab Sebastian Schubert @tab Ludwig Schwardt ! @item Thomas L. Scofield @tab Daniel J. Sebald @tab Dmitri A. Sergatskov ! @item Baylis Shanks @tab Joseph P. Skudlarek @tab John Smith ! @item Julius Smith @tab Shan G. Smith @tab Joerg Specht ! @item Quentin H. Spencer @tab Christoph Spiel @tab Richard Stallman ! @item Russell Standish @tab Doug Stewart @tab Jonathan Stickel ! @item Thomas Stuart @tab Ivan Sutoris @tab John Swensen ! @item Ariel Tankus @tab Georg Thimm @tab Duncan Temple Lang ! @item Kris Thielemans @tab Olaf Till @tab Thomas Treichl ! @item Frederick Umminger @tab Utkarsh Upadhyay @tab Stefan van der Walt ! @item Peter Van Wieren @tab James R. Van Zandt @tab Gregory Vanuxem ! @item Ivana Varekova @tab Thomas Walter @tab Olaf Weber ! @item Thomas Weber @tab Rik Wehbring @tab Bob Weigel ! @item Andreas Weingessel @tab Michael Weitzel @tab Fook Fah Yap ! @item Michael Zeising @tab Federico Zenith @tab Alex Zvoleff @end multitable --- 43,80 ---- @item Emil Lucretiu @tab Hoxide Ma @tab James Macnicol @item Jens-Uwe Mager @tab Ricardo Marranita @tab Orestes Mas @item Makoto Matsumoto @tab Tatsuro Matsuoka @tab Laurent Mazet ! @item G. D. McBain @tab Alexander Mamonov @tab Christoph Mayer ! @item Thorsten Meyer @tab Petr Mikulik @tab Stefan Monnier ! @item Antoine Moreau @tab Kai P. Mueller @tab Victor Munoz ! @item Carmen Navarrete @tab Todd Neal @tab Al Niessner ! @item Rick Niles @tab Takuji Nishimura @tab Kai Noda ! @item Eric Norum @tab Krzesimir Nowak @tab Michael O'Brien ! @item Peter O'Gorman @tab Thorsten Ohl @tab Arno Onken ! @item Luis F. Ortiz @tab Scott Pakin @tab Gabriele Pannocchia ! @item Sylvain Pelissier @tab Per Persson @tab Primozz Peterlin ! @item Jim Peterson @tab Danilo Piazzalunga @tab Nicholas Piper ! @item Robert Platt @tab Hans Ekkehard Plesser @tab Tom Poage ! @item Orion Poplawski @tab Ondrej Popp @tab Jef Poskanzer ! @item Francesco Potorti @tab James B. Rawlings @tab Eric S. Raymond ! @item Balint Reczey @tab Michael Reifenberger @tab Jason Riedy ! @item Petter Risholm @tab Matthew W. Roberts @tab Andrew Ross ! @item Mark van Rossum @tab Kevin Ruland @tab Ryan Rusaw ! @item Olli Saarela @tab Toni Saarela @tab Juhani Saastamoinen ! @item Radek Salac @tab Ben Sapp @tab Alois Schloegl ! @item Michel D. Schmid @tab Julian Schnidder @tab Nicol N. Schraudolph ! @item Sebastian Schubert @tab Ludwig Schwardt @tab Thomas L. Scofield ! @item Daniel J. Sebald @tab Dmitri A. Sergatskov @tab Baylis Shanks ! @item Joseph P. Skudlarek @tab John Smith @tab Julius Smith ! @item Shan G. Smith @tab Joerg Specht @tab Quentin H. Spencer ! @item Christoph Spiel @tab Richard Stallman @tab Russell Standish ! @item Doug Stewart @tab Jonathan Stickel @tab Thomas Stuart ! @item Ivan Sutoris @tab John Swensen @tab Ariel Tankus ! @item Georg Thimm @tab Duncan Temple Lang @tab Kris Thielemans ! @item Olaf Till @tab Thomas Treichl @tab Frederick Umminger ! @item Utkarsh Upadhyay @tab Stefan van der Walt @tab Peter Van Wieren ! @item James R. Van Zandt @tab Gregory Vanuxem @tab Ivana Varekova ! @item Thomas Walter @tab Olaf Weber @tab Thomas Weber ! @item Rik Wehbring @tab Bob Weigel @tab Andreas Weingessel ! @item Michael Weitzel @tab Fook Fah Yap @tab Michael Zeising ! @item Federico Zenith @tab Alex Zvoleff @end multitable diff -cNr octave-3.2.0/doc/interpreter/data.texi octave-3.2.2/doc/interpreter/data.texi *** octave-3.2.0/doc/interpreter/data.texi 2009-06-03 14:36:33.000000000 +0200 --- octave-3.2.2/doc/interpreter/data.texi 2009-07-21 07:11:08.000000000 +0200 *************** *** 181,192 **** @c data.cc @anchor{doc-NA} ! @deftypefn {Built-in Function} {} NA (@var{x}) @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m}) @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m}, @var{k}, @dots{}) @deftypefnx {Built-in Function} {} NA (@dots{}, @var{class}) ! Return a matrix or N-dimensional array whose elements are all equal to the special constant used to designate missing values. @end deftypefn --- 181,205 ---- @c data.cc @anchor{doc-NA} ! @deftypefn {Built-in Function} {} NA ! @deftypefnx {Built-in Function} {} NA (@var{n}) @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m}) @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m}, @var{k}, @dots{}) @deftypefnx {Built-in Function} {} NA (@dots{}, @var{class}) ! Return a scalar, matrix, or N-dimensional array whose elements are all equal to the special constant used to designate missing values. + + Note that NA always compares not equal to NA (NA != NA). + To find NA values, use the @code{isna} function. + + When called with no arguments, return a scalar with the value @samp{NA}. + When called with a single argument, return a square matrix with the dimension + specified. When called with more than one scalar argument the first two + arguments are taken as the number of rows and columns and any further + arguments specify additional matrix dimensions. + The optional argument @var{class} specifies the return type and may be + either "double" or "single". + @seealso{@ref{doc-isna,,isna}} @end deftypefn *************** *** 202,207 **** --- 215,221 ---- @result{} [ 0, 0, 1, 0 ] @end group @end example + @seealso{@ref{doc-isnan,,isnan}} @end deftypefn diff -cNr octave-3.2.0/doc/interpreter/debug.texi octave-3.2.2/doc/interpreter/debug.texi *** octave-3.2.0/doc/interpreter/debug.texi 2009-06-03 14:36:33.000000000 +0200 --- octave-3.2.2/doc/interpreter/debug.texi 2009-07-21 07:11:09.000000000 +0200 *************** *** 229,245 **** @c input.cc @anchor{doc-keyboard} ! @deftypefn {Built-in Function} {} keyboard (@var{prompt}) This function is normally used for simple debugging. When the @code{keyboard} function is executed, Octave prints a prompt and waits for user input. The input strings are then evaluated and the results are printed. This makes it possible to examine the values of variables ! within a function, and to assign new values to variables. No value is ! returned from the @code{keyboard} function, and it continues to prompt ! for input until the user types @samp{quit}, or @samp{exit}. ! If @code{keyboard} is invoked without any arguments, a default prompt of @samp{debug> } is used. @end deftypefn --- 229,247 ---- @c input.cc @anchor{doc-keyboard} ! @deftypefn {Built-in Function} {} keyboard () ! @deftypefnx {Built-in Function} {} keyboard (@var{prompt}) This function is normally used for simple debugging. When the @code{keyboard} function is executed, Octave prints a prompt and waits for user input. The input strings are then evaluated and the results are printed. This makes it possible to examine the values of variables ! within a function, and to assign new values if necessary. To leave the ! prompt and return to normal execution type @samp{return} or @samp{dbcont}. ! The @code{keyboard} function does not return an exit status. ! If @code{keyboard} is invoked without arguments, a default prompt of @samp{debug> } is used. + @seealso{@ref{doc-dbcont,,dbcont}, @ref{doc-dbquit,,dbquit}} @end deftypefn diff -cNr octave-3.2.0/doc/interpreter/doc-cache octave-3.2.2/doc/interpreter/doc-cache *** octave-3.2.0/doc/interpreter/doc-cache 2009-06-03 14:36:26.000000000 +0200 --- octave-3.2.2/doc/interpreter/doc-cache 2009-07-21 07:11:08.000000000 +0200 *************** *** 1,4 **** ! # Created by Octave 3.2.0, Wed Jun 03 14:36:26 2009 CEST # name: cache # type: cell # rows: 3 --- 1,4 ---- ! # Created by Octave 3.2.2, Tue Jul 21 07:11:08 2009 CEST # name: cache # type: cell # rows: 3 *************** *** 648,663 **** # name: # type: string # elements: 1 ! # length: 271 -- Loadable Function: C = num2cell (M) -- Loadable Function: C = num2cell (M, DIM) ! Convert the matrix M into a cell array. If DIM is defined, the value C is of dimension 1 in this dimension and the elements of M are placed in slices in C. See also: mat2cell. # name: # type: string # elements: 1 ! # length: 39 ! Convert the matrix M into a cell array. # name: # type: string --- 648,663 ---- # name: # type: string # elements: 1 ! # length: 269 -- Loadable Function: C = num2cell (M) -- Loadable Function: C = num2cell (M, DIM) ! Convert the matrix M to a cell array. If DIM is defined, the value C is of dimension 1 in this dimension and the elements of M are placed in slices in C. See also: mat2cell. # name: # type: string # elements: 1 ! # length: 37 ! Convert the matrix M to a cell array. # name: # type: string *************** *** 2096,2111 **** # name: # type: string # elements: 1 ! # length: 117 ! -- Built-in Function: complex (VAL) -- Built-in Function: complex (RE, IM) ! Convert X to a complex value. # name: # type: string # elements: 1 ! # length: 29 ! Convert X to a complex value. # name: # type: string --- 2096,2116 ---- # name: # type: string # elements: 1 ! # length: 458 ! -- Built-in Function: complex (X) -- Built-in Function: complex (RE, IM) ! Return a complex result from real arguments. With 1 real argument X, return the complex result `X + 0i'. With 2 real arguments, return the complex result `RE + IM'. `complex' can often be more convenient than expressions such as `a + i*b'. For example: ! ! complex ([1, 2], [3, 4]) ! => ! 1 + 3i 2 + 4i ! See also: real, imag, iscomplex. # name: # type: string # elements: 1 ! # length: 44 ! Return a complex result from real arguments. # name: # type: string *************** *** 2259,2265 **** # name: # type: string # elements: 1 ! # length: 1013 -- Built-in Function: Inf -- Built-in Function: Inf (N) -- Built-in Function: Inf (N, M) --- 2264,2270 ---- # name: # type: string # elements: 1 ! # length: 1031 -- Built-in Function: Inf -- Built-in Function: Inf (N) -- Built-in Function: Inf (N, M) *************** *** 2272,2278 **** => Inf Inf ! When called with no arguments, return a scalar with the value `Inf'. When called with a single argument, return a square matrix with the dimension specified. When called with more than one scalar argument the first two arguments are taken as the number of rows and columns and any further arguments specify additional matrix dimensions. The optional argument CLASS specifies the return type and may be either "double" or "single". # name: # type: string --- 2277,2283 ---- => Inf Inf ! When called with no arguments, return a scalar with the value `Inf'. When called with a single argument, return a square matrix with the dimension specified. When called with more than one scalar argument the first two arguments are taken as the number of rows and columns and any further arguments specify additional matrix dimensions. The optional argument CLASS specifies the return type and may be either "double" or "single". See also: isinf. # name: # type: string *************** *** 2458,2475 **** # name: # type: string # elements: 1 ! # length: 281 ! -- Built-in Function: NA (X) -- Built-in Function: NA (N, M) -- Built-in Function: NA (N, M, K, ...) -- Built-in Function: NA (..., CLASS) ! Return a matrix or N-dimensional array whose elements are all equal to the special constant used to designate missing values. # name: # type: string # elements: 1 ! # length: 125 ! Return a matrix or N-dimensional array whose elements are all equal to the special constant used to designate missing values. # name: # type: string --- 2463,2485 ---- # name: # type: string # elements: 1 ! # length: 881 ! -- Built-in Function: NA ! -- Built-in Function: NA (N) -- Built-in Function: NA (N, M) -- Built-in Function: NA (N, M, K, ...) -- Built-in Function: NA (..., CLASS) ! Return a scalar, matrix, or N-dimensional array whose elements are all equal to the special constant used to designate missing values. ! ! Note that NA always compares not equal to NA (NA != NA). To find NA values, use the `isna' function. ! ! When called with no arguments, return a scalar with the value `NA'. When called with a single argument, return a square matrix with the dimension specified. When called with more than one scalar argument the first two arguments are taken as the number of rows and columns and any further arguments specify additional matrix dimensions. The optional argument CLASS specifies the return type and may be either "double" or "single". See also: isna. # name: # type: string # elements: 1 ! # length: 134 ! Return a scalar, matrix, or N-dimensional array whose elements are all equal to the special constant used to designate missing values. # name: # type: string *************** *** 4039,4052 **** # name: # type: string # elements: 1 ! # length: 548 -- Loadable Function: LAMBDA = eig (A) -- Loadable Function: LAMBDA = eig (A, B) -- Loadable Function: [V, LAMBDA] = eig (A) -- Loadable Function: [V, LAMBDA] = eig (A, B) The eigenvalues (and eigenvectors) of a matrix are computed in a several step process which begins with a Hessenberg decomposition, followed by a Schur decomposition, from which the eigenvalues are apparent. The eigenvectors, when desired, are computed by further manipulations of the Schur decomposition. ! The eigenvalues returned by `eig' are not ordered. # name: # type: string --- 4049,4062 ---- # name: # type: string # elements: 1 ! # length: 565 -- Loadable Function: LAMBDA = eig (A) -- Loadable Function: LAMBDA = eig (A, B) -- Loadable Function: [V, LAMBDA] = eig (A) -- Loadable Function: [V, LAMBDA] = eig (A, B) The eigenvalues (and eigenvectors) of a matrix are computed in a several step process which begins with a Hessenberg decomposition, followed by a Schur decomposition, from which the eigenvalues are apparent. The eigenvectors, when desired, are computed by further manipulations of the Schur decomposition. ! The eigenvalues returned by `eig' are not ordered. See also: eigs. # name: # type: string *************** *** 5569,5575 **** # name: # type: string # elements: 1 ! # length: 1524 -- Loadable Function: find (X) -- Loadable Function: find (X, N) -- Loadable Function: find (X, N, DIRECTION) --- 5579,5585 ---- # name: # type: string # elements: 1 ! # length: 1566 -- Loadable Function: find (X) -- Loadable Function: find (X, N) -- Loadable Function: find (X, N, DIRECTION) *************** *** 5591,5599 **** => j = [ 1; 2 ] => v = [ 3; 3 ] ! If two inputs are given, N indicates the number of elements to find from the beginning of the matrix or vector. ! If three inputs are given, DIRECTION should be one of "first" or "last" indicating that it should start counting found elements from the first or last element. Note that this function is particularly useful for sparse matrices, as it extracts the non-zero elements as vectors, which can then be used to create the original matrix. For example, --- 5601,5609 ---- => j = [ 1; 2 ] => v = [ 3; 3 ] ! If two inputs are given, N indicates the maximum number of elements to find from the beginning of the matrix or vector. ! If three inputs are given, DIRECTION should be one of "first" or "last", requesting only the first or last N indices, respectively. However, the indices are always returned in ascending order. Note that this function is particularly useful for sparse matrices, as it extracts the non-zero elements as vectors, which can then be used to create the original matrix. For example, *************** *** 6005,6019 **** # name: # type: string # elements: 1 ! # length: 93 -- Built-in Function: available_backends () ! Returns resgistered graphics backends. # name: # type: string # elements: 1 ! # length: 38 ! Returns resgistered graphics backends. # name: # type: string --- 6015,6029 ---- # name: # type: string # elements: 1 ! # length: 107 -- Built-in Function: available_backends () ! Return a cell array of registered graphics backends. # name: # type: string # elements: 1 ! # length: 52 ! Return a cell array of registered graphics backends. # name: # type: string *************** *** 6023,6038 **** # name: # type: string # elements: 1 ! # length: 152 ! -- Built-in Function: __go_drawnow__ () ! -- Built-in Function: __go_drawnow__ (TERM, FILE, MONO, DEBUG_FILE) ! Undocumented internal function. # name: # type: string # elements: 1 ! # length: 31 ! Undocumented internal function. # name: # type: string --- 6033,6049 ---- # name: # type: string # elements: 1 ! # length: 457 ! -- Built-in Function: drawnow () ! -- Built-in Function: drawnow ("expose") ! -- Built-in Function: drawnow (TERM, FILE, MONO, DEBUG_FILE) ! Update figure windows and their children. The event queue is flushed and any callbacks generated are executed. With the optional argument `"expose"', only graphic objects are updated and no other events or callbacks are processed. The third calling form of `drawnow' is for debugging and is undocumented. # name: # type: string # elements: 1 ! # length: 41 ! Update figure windows and their children. # name: # type: string *************** *** 6399,6409 **** # name: # type: string # elements: 1 ! # length: 601 -- Built-in Function: keyboard (PROMPT) ! This function is normally used for simple debugging. When the `keyboard' function is executed, Octave prints a prompt and waits for user input. The input strings are then evaluated and the results are printed. This makes it possible to examine the values of variables within a function, and to assign new values to variables. No value is returned from the `keyboard' function, and it continues to prompt for input until the user types `quit', or `exit'. ! If `keyboard' is invoked without any arguments, a default prompt of `debug> ' is used. # name: # type: string --- 6410,6421 ---- # name: # type: string # elements: 1 ! # length: 667 ! -- Built-in Function: keyboard () -- Built-in Function: keyboard (PROMPT) ! This function is normally used for simple debugging. When the `keyboard' function is executed, Octave prints a prompt and waits for user input. The input strings are then evaluated and the results are printed. This makes it possible to examine the values of variables within a function, and to assign new values if necessary. To leave the prompt and return to normal execution type `return' or `dbcont'. The `keyboard' function does not return an exit status. ! If `keyboard' is invoked without arguments, a default prompt of `debug> ' is used. See also: dbcont, dbquit. # name: # type: string *************** *** 6913,6923 **** # name: # type: string # elements: 1 ! # length: 3266 -- Command: load options file v1 v2 ... ! Load the named variables V1, V2, ..., from the file FILE. As with `save', you may specify a list of variables and `load' will only extract those variables with names that match. For example, to restore the variables saved in the file `data', use the command ! ! load data If load is invoked using the functional form --- 6925,6936 ---- # name: # type: string # elements: 1 ! # length: 3368 ! -- Command: load file ! -- Command: load options file -- Command: load options file v1 v2 ... ! -- Command: S = load("options", "file", "v1", "v2", ...) ! Load the named variables V1, V2, ..., from the file FILE. If no variables are specified then all variables found in the file will be loaded. As with `save', the list of variables to extract can be full names or use a pattern syntax. The format of the file is automatically detected but may be overridden by supplying the appropriate option. If load is invoked using the functional form *************** *** 6925,6940 **** then the OPTIONS, FILE, and variable name arguments (V1, ...) must be specified as character strings. ! If a variable that is not marked as global is loaded from a file when a global symbol with the same name already exists, it is loaded in the global symbol table. Also, if a variable is marked as global in a file and a local symbol exists, the local symbol is moved to the global symbol table and given the value from the file. Since it seems that both of these cases are likely to be the result of some sort of error, they will generate warnings. If invoked with a single output argument, Octave returns data instead of inserting variables in the symbol table. If the data file contains only numbers (TAB- or space-delimited columns), a matrix of values is returned. Otherwise, `load' returns a structure with members corresponding to the names of the variables in the file. ! The `load' command can read data stored in Octave's text and binary formats, and MATLAB's binary format. If compiled with zlib support, it can load gzip-compressed files as well. It will automatically detect the type of file and do conversion from different floating point formats (currently only IEEE big and little endian, though other formats may added in the future). Valid options for `load' are listed in the following table. `-force' ! The `-force' option is accepted but ignored for backward compatibility. Octave now overwrites variables currently in memory with the same name as those found in the file. `-ascii' Force Octave to assume the file contains columns of numbers in text format without any header or other information. Data in the file will be loaded as a single numeric matrix with the name of the variable derived from the name of the file. --- 6938,6953 ---- then the OPTIONS, FILE, and variable name arguments (V1, ...) must be specified as character strings. ! If a variable that is not marked as global is loaded from a file when a global symbol with the same name already exists, it is loaded in the global symbol table. Also, if a variable is marked as global in a file and a local symbol exists, the local symbol is moved to the global symbol table and given the value from the file. If invoked with a single output argument, Octave returns data instead of inserting variables in the symbol table. If the data file contains only numbers (TAB- or space-delimited columns), a matrix of values is returned. Otherwise, `load' returns a structure with members corresponding to the names of the variables in the file. ! The `load' command can read data stored in Octave's text and binary formats, and MATLAB's binary format. If compiled with zlib support, it can also load gzip-compressed files. It will automatically detect the type of file and do conversion from different floating point formats (currently only IEEE big and little endian, though other formats may be added in the future). Valid options for `load' are listed in the following table. `-force' ! This option is accepted for backward compatibility but is ignored. Octave now overwrites variables currently in memory with those of the same name found in the file. `-ascii' Force Octave to assume the file contains columns of numbers in text format without any header or other information. Data in the file will be loaded as a single numeric matrix with the name of the variable derived from the name of the file. *************** *** 6942,6947 **** --- 6955,6966 ---- `-binary' Force Octave to assume the file is in Octave's binary format. + `-hdf5' + Force Octave to assume the file is in HDF5 format. (HDF5 is a free, portable binary format developed by the National Center for Supercomputing Applications at the University of Illinois.) Note that Octave can read HDF5 files not created by itself, but may skip some datasets in formats that it cannot support. + + `-import' + This option is accepted for backward compatibility but is ignored. Octave can now support multi-dimensional HDF data and automatically modifies variable names if they are invalid Octave identifiers. + `-mat' `-mat-binary' `-6' *************** *** 6950,6970 **** `-v7' Force Octave to assume the file is in MATLAB's version 6 or 7 binary format. - `-V4' - `-v4' - `-4' `-mat4-binary' Force Octave to assume the file is in the binary format written by MATLAB version 4. - `-hdf5' - Force Octave to assume the file is in HDF5 format. (HDF5 is a free, portable binary format developed by the National Center for Supercomputing Applications at the University of Illinois.) Note that Octave can read HDF5 files not created by itself, but may skip some datasets in formats that it cannot support. - - `-import' - The `-import' is accepted but ignored for backward compatibility. Octave can now support multi-dimensional HDF data and automatically modifies variable names if they are invalid Octave identifiers. - `-text' Force Octave to assume the file is in Octave's text format. ! # name: # type: string # elements: 1 --- 6969,6984 ---- `-v7' Force Octave to assume the file is in MATLAB's version 6 or 7 binary format. `-mat4-binary' + `-4' + `-v4' + `-V4' Force Octave to assume the file is in the binary format written by MATLAB version 4. `-text' Force Octave to assume the file is in Octave's text format. ! See also: save, dlmwrite, csvwrite, fwrite. ! # name: # type: string # elements: 1 *************** *** 6979,6988 **** # name: # type: string # elements: 1 ! # length: 3255 -- Command: save options file V1 V2 ... ! -- Command: save options file -struct STR F1 F2 ... ! Save the named variables V1, V2, ..., in the file FILE. The special filename `-' may be used to write the output to your terminal. If no variable names are listed, Octave saves all the variables in the current scope. If the `-struct' modifier is used, fields F1 F2 ... of the scalar structure STR are saved as if they were variables with corresponding names. Valid options for the `save' command are listed in the following table. Options that modify the output format override the format specified by `default_save_options'. If save is invoked using the functional form --- 6993,7004 ---- # name: # type: string # elements: 1 ! # length: 3522 ! -- Command: save file ! -- Command: save options file -- Command: save options file V1 V2 ... ! -- Command: save options file -struct STRUCT F1 F2 ... ! Save the named variables V1, V2, ..., in the file FILE. The special filename `-' may be used to write output to the terminal. If no variable names are listed, Octave saves all the variables in the current scope. Otherwise, full variable names or pattern syntax can be used to specify the variables to save. If the `-struct' modifier is used, fields F1 F2 ... of the scalar structure STRUCT are saved as if they were variables with corresponding names. Valid options for the `save' command are listed in the following table. Options that modify the output format override the format specified by `default_save_options'. If save is invoked using the functional form *************** *** 6991,7003 **** then the OPTIONS, FILE, and variable name arguments (V1, ...) must be specified as character strings. `-ascii' ! Save a single matrix in a text file. `-binary' Save the data in Octave's binary data format. `-float-binary' ! Save the data in Octave's binary data format but only using single precision. You should use this format only if you know that all the values to be saved can be represented in single precision. `-V7' `-v7' --- 7007,7025 ---- then the OPTIONS, FILE, and variable name arguments (V1, ...) must be specified as character strings. `-ascii' ! Save a single matrix in a text file without header or any other information. `-binary' Save the data in Octave's binary data format. `-float-binary' ! Save the data in Octave's binary data format but only using single precision. Only use this format if you know that all the values to be saved can be represented in single precision. ! ! `-hdf5' ! Save the data in HDF5 format. (HDF5 is a free, portable binary format developed by the National Center for Supercomputing Applications at the University of Illinois.) ! ! `-float-hdf5' ! Save the data in HDF5 format but only using single precision. Only use this format if you know that all the values to be saved can be represented in single precision. `-V7' `-v7' *************** *** 7018,7034 **** `-mat4-binary' Save the data in the binary format written by MATLAB version 4. ! `-hdf5' ! Save the data in HDF5 format. (HDF5 is a free, portable binary format developed by the National Center for Supercomputing Applications at the University of Illinois.) ! ! `-float-hdf5' ! Save the data in HDF5 format but only using single precision. You should use this format only if you know that all the values to be saved can be represented in single precision. `-zip' `-z' Use the gzip algorithm to compress the file. This works equally on files that are compressed with gzip outside of octave, and gzip can equally be used to convert the files for backward compatibility. ! The list of variables to save may include wildcard patterns containing the following special characters: `?' Match any single character. --- 7040,7053 ---- `-mat4-binary' Save the data in the binary format written by MATLAB version 4. ! `-text' ! Save the data in Octave's text data format. (default). `-zip' `-z' Use the gzip algorithm to compress the file. This works equally on files that are compressed with gzip outside of octave, and gzip can equally be used to convert the files for backward compatibility. ! The list of variables to save may use wildcard patterns containing the following special characters: `?' Match any single character. *************** *** 7038,7055 **** `[ LIST ]' Match the list of characters specified by LIST. If the first character is `!' or `^', match all characters except those specified by LIST. For example, the pattern `[a-zA-Z]' will match all lower and upper case alphabetic characters. ! Wildcards may also be used in the field names specifications when using the `-struct' modifier (but not in the struct name itself). - `-text' - Save the data in Octave's text data format. ! Except when using the MATLAB binary data file format, saving global variables also saves the global status of the variable, so that if it is restored at a later time using `load', it will be restored as a global variable. The command save -binary data a b* ! saves the variable `a' and all variables beginning with `b' to the file `data' in Octave's binary format. # name: # type: string --- 7057,7072 ---- `[ LIST ]' Match the list of characters specified by LIST. If the first character is `!' or `^', match all characters except those specified by LIST. For example, the pattern `[a-zA-Z]' will match all lower and upper case alphabetic characters. ! Wildcards may also be used in the field name specifications when using the `-struct' modifier (but not in the struct name itself). ! Except when using the MATLAB binary data file format or the `-ascii' format, saving global variables also saves the global status of the variable. If the variable is restored at a later time using `load', it will be restored as a global variable. The command save -binary data a b* ! saves the variable `a' and all variables beginning with `b' to the file `data' in Octave's binary format. See also: load, default_save_options, dlmread, csvread, fread. # name: # type: string *************** *** 7084,7093 **** # name: # type: string # elements: 1 ! # length: 353 -- Built-in Function: VAL = default_save_options () -- Built-in Function: OLD_VAL = default_save_options (NEW_VAL) ! Query or set the internal variable that specifies the default options for the `save' command, and defines the default format. Typical values include `"-ascii"', `"-ascii -zip"'. The default value is `-ascii'. See also: save. # name: # type: string --- 7101,7110 ---- # name: # type: string # elements: 1 ! # length: 351 -- Built-in Function: VAL = default_save_options () -- Built-in Function: OLD_VAL = default_save_options (NEW_VAL) ! Query or set the internal variable that specifies the default options for the `save' command, and defines the default format. Typical values include `"-ascii"', `"-text -zip"'. The default value is `-text'. See also: save. # name: # type: string *************** *** 7160,7172 **** # name: # type: string # elements: 1 ! # length: 665 -- Built-in Function: VAL = save_header_format_string () -- Built-in Function: OLD_VAL = save_header_format_string (NEW_VAL) Query or set the internal variable that specifies the format string used for the comment line written at the beginning of text-format data files saved by Octave. The format string is passed to `strftime' and should begin with the character `#' and contain no newline characters. If the value of `save_header_format_string' is the empty string, the header comment is omitted from text-format data files. The default value is "# Created by Octave VERSION, %a %b %d %H:%M:%S %Y %Z " ! See also: strftime. # name: # type: string --- 7177,7189 ---- # name: # type: string # elements: 1 ! # length: 671 -- Built-in Function: VAL = save_header_format_string () -- Built-in Function: OLD_VAL = save_header_format_string (NEW_VAL) Query or set the internal variable that specifies the format string used for the comment line written at the beginning of text-format data files saved by Octave. The format string is passed to `strftime' and should begin with the character `#' and contain no newline characters. If the value of `save_header_format_string' is the empty string, the header comment is omitted from text-format data files. The default value is "# Created by Octave VERSION, %a %b %d %H:%M:%S %Y %Z " ! See also: strftime, save. # name: # type: string *************** *** 8034,8046 **** # name: # type: string # elements: 1 ! # length: 197 -- Mapping Function: isna (X) Return 1 for elements of X that are NA (missing) values and zero otherwise. For example, isna ([13, Inf, NA, NaN]) => [ 0, 0, 1, 0 ] ! # name: # type: string # elements: 1 --- 8051,8064 ---- # name: # type: string # elements: 1 ! # length: 222 -- Mapping Function: isna (X) Return 1 for elements of X that are NA (missing) values and zero otherwise. For example, isna ([13, Inf, NA, NaN]) => [ 0, 0, 1, 0 ] ! See also: isnan. ! # name: # type: string # elements: 1 *************** *** 8055,8067 **** # name: # type: string # elements: 1 ! # length: 233 -- Mapping Function: isnan (X) Return 1 for elements of X that are NaN values and zero otherwise. NA values are also considered NaN values. For example, isnan ([13, Inf, NA, NaN]) => [ 0, 0, 1, 1 ] ! # name: # type: string # elements: 1 --- 8073,8086 ---- # name: # type: string # elements: 1 ! # length: 257 -- Mapping Function: isnan (X) Return 1 for elements of X that are NaN values and zero otherwise. NA values are also considered NaN values. For example, isnan ([13, Inf, NA, NaN]) => [ 0, 0, 1, 1 ] ! See also: isna. ! # name: # type: string # elements: 1 *************** *** 9285,9293 **** # name: # type: string # elements: 1 ! # length: 79 -- Built-in Function: single (X) ! Convert X to single precision type. # name: # type: string --- 9304,9312 ---- # name: # type: string # elements: 1 ! # length: 98 -- Built-in Function: single (X) ! Convert X to single precision type. See also: double. # name: # type: string *************** *** 9494,9502 **** # name: # type: string # elements: 1 ! # length: 79 -- Built-in Function: double (X) ! Convert X to double precision type. # name: # type: string --- 9513,9521 ---- # name: # type: string # elements: 1 ! # length: 98 -- Built-in Function: double (X) ! Convert X to double precision type. See also: single. # name: # type: string *************** *** 10280,10310 **** # name: # type: string # elements: 1 ! # length: 4795 -- Command: format options ! Control the format of the output produced by `disp' and Octave's normal echoing mechanism. Valid options are listed in the following table. `short' ! Octave will try to print numbers with at least 5 significant figures within a field that is a maximum of 10 characters wide (not counting additional spacing that is added between columns of a matrix). ! If Octave is unable to format a matrix so that columns line up on the decimal point and all the numbers fit within the maximum field width, it switches to an `e' format. `long' ! Octave will try to print numbers with at least 15 significant figures within a field that is a maximum of 20 characters wide (not counting additional spacing that is added between columns of a matrix). ! As will the `short' format, Octave will switch to an `e' format if it is unable to format a matrix so that columns line up on the decimal point and all the numbers fit within the maximum field width. - `long e' `short e' ! The same as `format long' or `format short' but always display output with an `e' format. For example, with the `short e' format, `pi' is displayed as `3.14e+00'. - `long E' `short E' ! The same as `format long e' or `format short e' but always display output with an uppercase `E' format. For example, with the `long E' format, `pi' is displayed as `3.14159265358979E+00'. - `long g' `short g' ! Choose between normal `long' (or `short') and `long e' (or `short e') formats based on the magnitude of the number. For example, with the `short g' format, `pi .^ [2; 4; 8; 16; 32]' is displayed as ans = --- 10299,10334 ---- # name: # type: string # elements: 1 ! # length: 4769 ! -- Command: format -- Command: format options ! Reset or specify the format of the output produced by `disp' and Octave's normal echoing mechanism. This command only affects the display of numbers but not how they are stored or computed. To change the internal representation from the default double use one of the conversion functions such as `single', `uint8', `int64', etc. ! ! By default, Octave displays 5 significant digits in a human readable form (option `short' paired with `loose' format for matrices). If `format' is invoked without any options, this default format is restored. ! ! Valid formats for floating point numbers are listed in the following table. `short' ! Fixed point format with 5 significant figures in a field that is a maximum of 10 characters wide. (default). ! If Octave is unable to format a matrix so that columns line up on the decimal point and all numbers fit within the maximum field width then it switches to an exponential `e' format. `long' ! Fixed point format with 15 significant figures in a field that is a maximum of 20 characters wide. ! As with the `short' format, Octave will switch to an exponential `e' format if it is unable to format a matrix properly using the current format. `short e' ! `long e' ! Exponential format. The number to be represented is split between a mantissa and an exponent (power of 10). The mantissa has 5 significant digits in the short format and 15 digits in the long format. For example, with the `short e' format, `pi' is displayed as `3.1416e+00'. `short E' ! `long E' ! Identical to `short e' or `long e' but displays an uppercase `E' to indicate the exponent. For example, with the `long E' format, `pi' is displayed as `3.14159265358979E+00'. `short g' ! `long g' ! Optimally choose between fixed point and exponential format based on the magnitude of the number. For example, with the `short g' format, `pi .^ [2; 4; 8; 16; 32]' is displayed as ans = *************** *** 10316,10343 **** `long G' `short G' ! The same as `format long g' or `format short g' but use an uppercase `E' format. For example, with the `short G' format, `pi .^ [2; 4; 8; 16; 32]' is displayed as ! ! ans = ! ! 9.8696 ! 97.409 ! 9488.5 ! 9.0032E+07 ! 8.1058E+15 `free' `none' ! Print output in free format, without trying to line up columns of matrices on the decimal point. This also causes complex numbers to be formatted like this `(0.604194, 0.607088)' instead of like this `0.60419 + 0.60709i'. ! `bank' ! Print in a fixed format with two places to the right of the decimal point. `+' `+ CHARS' `plus' `plus CHARS' ! Print a `+' symbol for nonzero matrix elements and a space for zero matrix elements. This format can be very useful for examining the structure of a large matrix. The optional argument CHARS specifies a list of 3 characters to use for printing values greater than zero, less than zero and equal to zero. For example, with the `+ "+-."' format, `[1, 0, -1; -1, 0, 1]' is displayed as --- 10340,10358 ---- `long G' `short G' ! Identical to `short g' or `long g' but displays an uppercase `E' to indicate the exponent. `free' `none' ! Print output in free format, without trying to line up columns of matrices on the decimal point. This also causes complex numbers to be formatted as numeric pairs like this `(0.60419, 0.60709)' instead of like this `0.60419 + 0.60709i'. ! The following formats affect all numeric output (floating point and integer types). `+' `+ CHARS' `plus' `plus CHARS' ! Print a `+' symbol for nonzero matrix elements and a space for zero matrix elements. This format can be very useful for examining the structure of a large sparse matrix. The optional argument CHARS specifies a list of 3 characters to use for printing values greater than zero, less than zero and equal to zero. For example, with the `+ "+-."' format, `[1, 0, -1; -1, 0, 1]' is displayed as *************** *** 10346,10353 **** +.- -.+ `native-hex' ! Print the hexadecimal representation numbers as they are stored in memory. For example, on a workstation which stores 8 byte real values in IEEE format with the least significant byte first, the value of `pi' when printed in `hex' format is `400921fb54442d18'. This format only works for numeric values. `hex' The same as `native-hex', but always print the most significant byte first. --- 10361,10371 ---- +.- -.+ + `bank' + Print in a fixed format with two digits to the right of the decimal point. + `native-hex' ! Print the hexadecimal representation of numbers as they are stored in memory. For example, on a workstation which stores 8 byte real values in IEEE format with the least significant byte first, the value of `pi' when printed in `native-hex' format is `400921fb54442d18'. `hex' The same as `native-hex', but always print the most significant byte first. *************** *** 10358,10388 **** 01000000000010010010000111111011 01010100010001000010110100011000 ! (shown here in two 32 bit sections for typesetting purposes) when printed in bit format on a workstation which stores 8 byte real values in IEEE format with the least significant byte first. This format only works for numeric types. `bit' The same as `native-bit', but always print the most significant bits first. - `compact' - Remove extra blank space around column number labels. - - `loose' - Insert blank lines above and below column number labels (this is the default). - `rat' ! Print a rational approximation. That is the values are approximated by one small integer divided by another. ! By default, Octave will try to print numbers with at least 5 significant figures within a field that is a maximum of 10 characters wide. ! If Octave is unable to format a matrix so that columns line up on the decimal point and all the numbers fit within the maximum field width, it switches to an `e' format. - If `format' is invoked without any options, the default format state is restored. - # name: # type: string # elements: 1 ! # length: 90 ! Control the format of the output produced by `disp' and Octave's normal echoing mechanism. # name: # type: string --- 10376,10402 ---- 01000000000010010010000111111011 01010100010001000010110100011000 ! (shown here in two 32 bit sections for typesetting purposes) when printed in native-bit format on a workstation which stores 8 byte real values in IEEE format with the least significant byte first. `bit' The same as `native-bit', but always print the most significant bits first. `rat' ! Print a rational approximation, i.e., values are approximated as the ratio of small integers. For example, with the `rat' format, `pi' is displayed as `355/113'. ! The following two options affect the display of all matrices. ! `compact' ! Remove extra blank space around column number labels producing more compact output with more data per page. ! ! `loose' ! Insert blank lines above and below column number labels to produce a more readable output with less data per page. (default). # name: # type: string # elements: 1 ! # length: 99 ! Reset or specify the format of the output produced by `disp' and Octave's normal echoing mechanism. # name: # type: string *************** *** 11520,11545 **** # name: # type: string # elements: 1 ! # length: 781 -- Built-in Function: char (X) ! -- Built-in Function: char (CELL_ARRAY) -- Built-in Function: char (S1, S2, ...) ! Create a string array from one or more numeric matrices, character matrices or cell arrays. For numerical input, each element is converted to the corresponding ASCII character. The arguments (and elements of cell array(s)) are concatenated vertically. The returned values are padded with blanks as needed to make each row of the string array have the same length. Empty strings are not removed. For example, ! char ([97, 98, 99], "", {"98", "99", 100}, ["num", "bers"]) ! => ["abc " ! " " ! "98 " ! "99 " ! "d " ! "numbers"] # name: # type: string # elements: 1 ! # length: 91 ! Create a string array from one or more numeric matrices, character matrices or cell arrays. # name: # type: string --- 11534,11565 ---- # name: # type: string # elements: 1 ! # length: 1120 -- Built-in Function: char (X) ! -- Built-in Function: char (X, ...) -- Built-in Function: char (S1, S2, ...) ! -- Built-in Function: char (CELL_ARRAY) ! Create a string array from one or more numeric matrices, character matrices, or cell arrays. Arguments are concatenated vertically. The returned values are padded with blanks as needed to make each row of the string array have the same length. Empty input strings are significant and will concatenated in the output. ! For numerical input, each element is converted to the corresponding ASCII character. A range error results if an input is outside the ASCII range (0-255). ! ! For cell arrays, each element is concatenated separately. Cell arrays converted through `char' can mostly be converted back with `cellstr'. For example, + char ([97, 98, 99], "", {"98", "99", 100}, "str1", ["ha", "lf"]) + => ["abc " + " " + "98 " + "99 " + "d " + "str1 " + "half "] + See also: strvcat, cellstr. # name: # type: string # elements: 1 ! # length: 92 ! Create a string array from one or more numeric matrices, character matrices, or cell arrays. # name: # type: string *************** *** 11549,11574 **** # name: # type: string # elements: 1 ! # length: 817 -- Built-in Function: strvcat (X) ! -- Built-in Function: strvcat (CELL_ARRAY) -- Built-in Function: strvcat (S1, S2, ...) ! Create a character array from one or more numeric matrices, character matrices or cell arrays. For numerical input, each element is converted to the corresponding ASCII character. The arguments (and elements of cell array(s)) are concatenated vertically. The returned values are padded with blanks as needed to make each row of the string array have the same length. Unlike `char', empty strings are removed. For example, ! strvcat ([97, 98, 99], "", {"98", "99", 100}, ["num", "bers"]) ! => ["abc " ! "98 " ! "99 " ! "d " ! "numbers"] See also: char, strcat, cstrcat. # name: # type: string # elements: 1 ! # length: 94 ! Create a character array from one or more numeric matrices, character matrices or cell arrays. # name: # type: string --- 11569,11599 ---- # name: # type: string # elements: 1 ! # length: 1120 -- Built-in Function: strvcat (X) ! -- Built-in Function: strvcat (X, ...) -- Built-in Function: strvcat (S1, S2, ...) ! -- Built-in Function: strvcat (CELL_ARRAY) ! Create a character array from one or more numeric matrices, character matrices, or cell arrays. Arguments are concatenated vertically. The returned values are padded with blanks as needed to make each row of the string array have the same length. Unlike `char', empty strings are removed and will not appear in the output. ! For numerical input, each element is converted to the corresponding ASCII character. A range error results if an input is outside the ASCII range (0-255). + For cell arrays, each element is concatenated separately. Cell arrays converted through `strvcat' can mostly be converted back with `cellstr'. For example, + + strvcat ([97, 98, 99], "", {"98", "99", 100}, "str1", ["ha", "lf"]) + => ["abc " + "98 " + "99 " + "d " + "str1 " + "half "] See also: char, strcat, cstrcat. # name: # type: string # elements: 1 ! # length: 95 ! Create a character array from one or more numeric matrices, character matrices, or cell arrays. # name: # type: string *************** *** 14068,14096 **** # name: # type: string # elements: 1 ! # length: 992 ! -- Command: who options pattern ... ! -- Command: whos options pattern ... ! List currently defined symbols matching the given patterns. The following are valid options. They may be shortened to one character but may not be combined. `global' ! List the variables in the global scope rather than the current scope. `-regexp' ! The patterns are considered as regular expressions and will be used for matching the variables to display. The same pattern syntax as for the `regexp' function is used. `-file' ! The following argument is treated as a filename, and the variables that are found within this file are listed. ! Valid patterns are the same as described for the `clear' command above. If no patterns are supplied, all symbols from the given category are listed. By default, only user defined functions and variables visible in the local scope are displayed. ! ! The command `whos' is equivalent to `who -long'. See also: regexp. # name: # type: string # elements: 1 ! # length: 59 ! List currently defined symbols matching the given patterns. # name: # type: string --- 14093,14123 ---- # name: # type: string # elements: 1 ! # length: 1046 ! -- Command: who ! -- Command: who pattern ... ! -- Command: who option pattern ... ! -- Command: C = who("pattern", ...) ! List currently defined variables matching the given patterns. Valid pattern syntax is the same as described for the `clear' command. If no patterns are supplied, all variables are listed. By default, only variables visible in the local scope are displayed. ! ! The following are valid options but may not be combined. `global' ! List variables in the global scope rather than the current scope. `-regexp' ! The patterns are considered to be regular expressions when matching the variables to display. The same pattern syntax accepted by the `regexp' function is used. `-file' ! The next argument is treated as a filename. All variables found within the specified file are listed. No patterns are accepted when reading variables from a file. ! If called as a function, return a cell array of defined variable names matching the given patterns. See also: whos, regexp. # name: # type: string # elements: 1 ! # length: 61 ! List currently defined variables matching the given patterns. # name: # type: string *************** *** 14100,14114 **** # name: # type: string # elements: 1 ! # length: 55 ! -- Command: whos options pattern ... ! See who. # name: # type: string # elements: 1 ! # length: 8 ! See who. # name: # type: string --- 14127,14171 ---- # name: # type: string # elements: 1 ! # length: 1377 ! -- Command: whos ! -- Command: whos pattern ... ! -- Command: whos option pattern ... ! -- Command: S = whos("pattern", ...) ! Provide detailed information on currently defined variables matching the given patterns. Options and pattern syntax are the same as for the `who' command. Extended information about each variable is summarized in a table with the following default entries. ! ! Attr ! Attributes of the listed variable. Possible attributes are: ! blank ! Variable in local scope ! ! `g' ! Variable with global scope ! ! `p' ! Persistent variable ! ! Name ! The name of the variable. ! ! Size ! The logical size of the variable. A scalar is 1x1, a vector is 1xN or Nx1, a 2-D matrix is MxN. ! ! Bytes ! The amount of memory currently used to store the variable. ! ! Class ! The class of the variable. Examples include double, single, char, uint16, cell, and struct. ! ! The table can be customized to display more or less information through the function `whos_line_format'. ! ! If `whos' is called as a function, return a struct array of defined variable names matching the given patterns. Fields in the structure describing each variable are: name, size, bytes, class, global, sparse, complex, nesting, persistent. See also: who, whos_line_format. # name: # type: string # elements: 1 ! # length: 88 ! Provide detailed information on currently defined variables matching the given patterns. # name: # type: string *************** *** 14230,14241 **** # name: # type: string # elements: 1 ! # length: 1371 -- Built-in Function: VAL = whos_line_format () -- Built-in Function: OLD_VAL = whos_line_format (NEW_VAL) ! Query or set the format string used by the `whos'. - The following escape sequences may be used in the format: `%a' Prints attributes of variables (g=global, p=persistent, f=formal parameter, a=automatic variable). --- 14287,14303 ---- # name: # type: string # elements: 1 ! # length: 1622 -- Built-in Function: VAL = whos_line_format () -- Built-in Function: OLD_VAL = whos_line_format (NEW_VAL) ! Query or set the format string used by the command `whos'. ! ! A full format string is: ! ! %[modifier][:width[:left-min[:balance]]]; ! ! The following command sequences are available: `%a' Prints attributes of variables (g=global, p=persistent, f=formal parameter, a=automatic variable). *************** *** 14257,14285 **** `%t' Prints type names of variables. ! Every command may also have a modifier: `l' Left alignment. `r' ! Right alignment (this is the default). `c' ! Centered (may only be applied to command %s). ! ! A command is composed like this: ! %[modifier][:size_of_parameter[:center-specific[:balance]]]; ! Command and modifier is already explained. The `size_of_parameter' parameter tells how many columns the parameter will need for printing. The `center-specific' parameter may only be applied to command `%s'. The `balance' parameter specifies the offset for printing the dimensions string. ! The default format is `" %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\n"'. # name: # type: string # elements: 1 ! # length: 50 ! Query or set the format string used by the `whos'. # name: # type: string --- 14319,14346 ---- `%t' Prints type names of variables. ! Every command may also have an alignment modifier: ! `l' Left alignment. `r' ! Right alignment (default). `c' ! Column-aligned (only applicable to command %s). ! The `width' parameter is a positive integer specifying the minimum number of columns used for printing. No maximum is needed as the field will auto-expand as required. ! The parameters `left-min' and `balance' are only available when the column-aligned modifier is used with the command `%s'. `balance' specifies the column number within the field width which will be aligned between entries. Numbering starts from 0 which indicates the leftmost column. `left-min' specifies the minimum field width to the left of the specified balance column. ! The default format is `" %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\n"'. See also: whos. # name: # type: string # elements: 1 ! # length: 58 ! Query or set the format string used by the command `whos'. # name: # type: string *************** *** 20811,20827 **** # name: # type: string # elements: 1 ! # length: 405 -- Function File: H = allchild (HANDLES) ! Find all children including hidden children of an object. ! This function is similar to `get (h, "children")', but also returns includes hidden objects. If HANDLES is a scalar, H will be a vector, and if not, H will be a cell matrix with the same size as HANDLES and each cell will contain a vector of handles. See also: get, set, findall, findobj. # name: # type: string # elements: 1 ! # length: 57 ! Find all children including hidden children of an object. # name: # type: string --- 20872,20888 ---- # name: # type: string # elements: 1 ! # length: 413 -- Function File: H = allchild (HANDLES) ! Find all children, including hidden children, of a graphics object. ! This function is similar to `get (h, "children")', but also returns includes hidden objects. If HANDLES is a scalar, H will be a vector. Otherwise, H will be a cell matrix of the same size as HANDLES and each cell will contain a vector of handles. See also: get, set, findall, findobj. # name: # type: string # elements: 1 ! # length: 67 ! Find all children, including hidden children, of a graphics object. # name: # type: string *************** *** 22337,22355 **** # name: # type: string # elements: 1 ! # length: 475 -- Function File: clf () -- Function File: clf ("reset") -- Function File: clf (HFIG) -- Function File: clf (HFIG, "reset") ! -- Function File: HFIG = clf (...) ! Delete the children of the current figure with visible handles. If HFIG is specified and is an figure object handle, operate on it instead of the current figure. If the optional argument `"reset"' is specified, also delete the figure's children with hidden handles. See also: cla, close, delete. # name: # type: string # elements: 1 ! # length: 63 ! Delete the children of the current figure with visible handles. # name: # type: string --- 22398,22415 ---- # name: # type: string # elements: 1 ! # length: 481 -- Function File: clf () -- Function File: clf ("reset") -- Function File: clf (HFIG) -- Function File: clf (HFIG, "reset") ! Clear the current figure window. `clf' operates by deleting child graphics objects with visible handles (`HandleVisibility' = on). If HFIG is specified operate on it instead of the current figure. If the optional argument `"reset"' is specified, all objects including those with hidden handles are deleted. See also: cla, close, delete. # name: # type: string # elements: 1 ! # length: 32 ! Clear the current figure window. # name: # type: string *************** *** 22381,22392 **** # name: # type: string # elements: 1 ! # length: 422 -- Function File: backend (NAME) -- Function File: backend (HLIST, NAME) ! Change the default graphics backend to NAME. If the backend is not already loaded, it is first initialized (initialization is done through the execution of __init_NAME__). ! HLIST is a list of figure handles. When given, this function only switches the default backend for the corresponding figures. See also: available_backends. # name: # type: string --- 22441,22452 ---- # name: # type: string # elements: 1 ! # length: 399 -- Function File: backend (NAME) -- Function File: backend (HLIST, NAME) ! Change the default graphics backend to NAME. If the backend is not already loaded, it is first initialized (initialization is done through the execution of `__init_NAME__'). ! When called with a list of figure handles, HLIST, the backend is changed only for the listed figures. See also: available_backends. # name: # type: string *************** *** 22402,22414 **** # name: # type: string # elements: 1 ! # length: 713 -- Function File: refreshdata () -- Function File: refreshdata (H) ! -- Function File: refreshdata (H, WS) ! Evaluates any datasource properties of the current figure and updates the corresponding data. If call with one or more arguments H is a scalar or array of figure handles which to refresh. The data sources are by default evaluated in the "base" workspace but can also be set in the "caller" workspace. ! An example of the use of refreshdata is x = 0:0.1:10; y = sin (x); --- 22462,22480 ---- # name: # type: string # elements: 1 ! # length: 886 -- Function File: refreshdata () -- Function File: refreshdata (H) ! -- Function File: refreshdata (H, WORKSPACE) ! Evaluate any `datasource' properties of the current figure and update the plot if the corresponding data has changed. If called with one or more arguments H is a scalar or array of figure handles to refresh. The optional second argument WORKSPACE can take the following values. ! ! `"base"' ! Evaluate the datasource properties in the base workspace. (default). ! ! `"caller"' ! Evaluate the datasource properties in the workspace of the function that called `refreshdata'. ! An example of the use of `refreshdata' is: x = 0:0.1:10; y = sin (x); *************** *** 22419,22431 **** refreshdata(); endfor - See also: linkdata. - # name: # type: string # elements: 1 ! # length: 93 ! Evaluates any datasource properties of the current figure and updates the corresponding data. # name: # type: string --- 22485,22495 ---- refreshdata(); endfor # name: # type: string # elements: 1 ! # length: 117 ! Evaluate any `datasource' properties of the current figure and update the plot if the corresponding data has changed. # name: # type: string *************** *** 22899,22916 **** # name: # type: string # elements: 1 ! # length: 344 -- Function File: gtext (S) -- Function File: gtext (..., PROP, VAL) ! Place text on the current figure. The text can be defined by the string S. If S is a cell array, each element of the cell array is written to a separate line. ! ! Additional arguments are passed to the underlying text object as properties. See also: ginput. # name: # type: string # elements: 1 ! # length: 33 ! Place text on the current figure. # name: # type: string --- 22963,22979 ---- # name: # type: string # elements: 1 ! # length: 399 -- Function File: gtext (S) + -- Function File: gtext ({S1; S2; ...}) -- Function File: gtext (..., PROP, VAL) ! Place text on the current figure using the mouse. The text is defined by the string S. If S is a cell array, each element of the cell array is written to a separate line. Additional arguments are passed to the underlying text object as properties. See also: ginput, text. # name: # type: string # elements: 1 ! # length: 49 ! Place text on the current figure using the mouse. # name: # type: string *************** *** 23058,23069 **** # name: # type: string # elements: 1 ! # length: 4407 -- Function File: print (FILENAME, OPTIONS) -- Function File: print (H, FILENAME, OPTIONS) Print a graph, or save it to a file ! FILENAME defines the file name of the output file. If no filename is specified, output is sent to the printer. H specifies the figure handle. If no handle is specified the handle for the current figure is used. --- 23121,23134 ---- # name: # type: string # elements: 1 ! # length: 4534 ! -- Function File: print () ! -- Function File: print (OPTIONS) -- Function File: print (FILENAME, OPTIONS) -- Function File: print (H, FILENAME, OPTIONS) Print a graph, or save it to a file ! FILENAME defines the file name of the output file. If no filename is specified, the output is sent to the printer. H specifies the figure handle. If no handle is specified the handle for the current figure is used. *************** *** 23084,23090 **** `-portrait' `-landscape' ! Plot orientation, as returned by "orient". `-dDEVICE' Output device, where DEVICE is one of: --- 23149,23155 ---- `-portrait' `-landscape' ! Specify the orientation of the plot for printed output. `-dDEVICE' Output device, where DEVICE is one of: *************** *** 23178,23184 **** For a complete list, type `system ("gs -h")' to see what formats and devices are available. ! For output sent to a printer, the size is determined by the figure's "papersize" property. For output to a file the, size is determined by the "paperposition" property. `-rNUM' Resolution of bitmaps in pixels per inch. For both metafiles and SVG the default is the screen resolution, for other it is 150 dpi. To specify screen resolution, use "-r0". --- 23243,23249 ---- For a complete list, type `system ("gs -h")' to see what formats and devices are available. ! When the ghostscript is sent to a printer the size is determined by the figure's "papersize" property. When the ghostscript output is sent to a file the size is determined by the figure's "paperposition" property. `-rNUM' Resolution of bitmaps in pixels per inch. For both metafiles and SVG the default is the screen resolution, for other it is 150 dpi. To specify screen resolution, use "-r0". *************** *** 23831,23853 **** # name: # type: string # elements: 1 ! # length: 610 ! -- Function File: hold ARGS ! Tell Octave to `hold' the current data on the graph when executing subsequent plotting commands. This allows you to execute a series of plot commands and have all the lines end up on the same graph. The default is for each new plot command to clear the plot device first. For example, the command ! hold on ! turns the hold state on. An argument of `"off"' turns the hold state off, and `hold' with no arguments toggles the current hold state. ! -- Function File: hold (H, ...) ! Applies to a specific axis or axes, associated with the handle(s), H. # name: # type: string # elements: 1 ! # length: 69 ! Applies to a specific axis or axes, associated with the handle(s), H. # name: # type: string --- 23896,23925 ---- # name: # type: string # elements: 1 ! # length: 757 ! -- Function File: hold ! -- Function File: hold STATE ! -- Function File: hold (HAX, ...) ! Toggle or set the 'hold' state of the plotting engine which determines whether new graphic objects are added to the plot or replace the existing objects. ! `hold on' ! Retain plot data and settings so that subsequent plot commands are displayed on a single graph. ! `hold off' ! Clear plot and restore default graphics settings before each new plot command. (default). ! `hold' ! Toggle the current 'hold' state. + When given the additional argument HAX, the hold state is modified only for the given axis handle. + + To query the current 'hold' state use the `ishold' function. See also: ishold, cla, newplot, clf. # name: # type: string # elements: 1 ! # length: 153 ! Toggle or set the 'hold' state of the plotting engine which determines whether new graphic objects are added to the plot or replace the existing objects. # name: # type: string *************** *** 24343,24352 **** # name: # type: string # elements: 1 ! # length: 115 -- Function File: delete (FILE) ! -- Function File: delete (H) Delete the named file or graphics handle. # name: # type: string --- 24415,24426 ---- # name: # type: string # elements: 1 ! # length: 258 -- Function File: delete (FILE) ! -- Function File: delete (HANDLE) Delete the named file or graphics handle. + + Deleting graphics objects is the proper way to remove features from a plot without clearing the entire figure. See also: clf, cla. # name: # type: string *************** *** 26129,26135 **** # elements: 1 # length: 367 -- Function File: cond (A,P) ! Compute the P-norm condition number of a matrix. `cond (A)' is defined as `norm (A, P) * norm (inv (A), P)'. By default `P=2' is used which implies a (relatively slow) singular value decomposition. Other possible selections are `P= 1, Inf, inf, 'Inf', 'fro'' which are generally faster. See also: norm, inv, det, svd, rank. # name: # type: string --- 26203,26209 ---- # elements: 1 # length: 367 -- Function File: cond (A,P) ! Compute the P-norm condition number of a matrix. `cond (A)' is defined as `norm (A, P) * norm (inv (A), P)'. By default `P=2' is used which implies a (relatively slow) singular value decomposition. Other possible selections are `P= 1, Inf, inf, 'Inf', 'fro'' which are generally faster. See also: condest, rcond, norm, svd. # name: # type: string *************** *** 26423,26429 **** * Nicholas J. Higham and Françoise Tisseur, "A Block Algorithm for Matrix 1-Norm Estimation, with an Application to 1-Norm Pseudospectra." `http://citeseer.ist.psu.edu/223007.html' ! See also: norm, cond, onenormest. # name: # type: string --- 26497,26503 ---- * Nicholas J. Higham and Françoise Tisseur, "A Block Algorithm for Matrix 1-Norm Estimation, with an Application to 1-Norm Pseudospectra." `http://citeseer.ist.psu.edu/223007.html' ! See also: cond, norm, onenormest. # name: # type: string *************** *** 29384,29393 **** # name: # type: string # elements: 1 ! # length: 1306 -- Function File: assert (COND) -- Function File: assert (COND, ERRMSG, ...) ! -- Function File: assert (COND, {varmsg_id, ERRMSG, ...) -- Function File: assert (OBSERVED,EXPECTED) -- Function File: assert (OBSERVED,EXPECTED,TOL) Produces an error if the condition is not met. `assert' can be called in three different ways. --- 29458,29467 ---- # name: # type: string # elements: 1 ! # length: 1302 -- Function File: assert (COND) -- Function File: assert (COND, ERRMSG, ...) ! -- Function File: assert (COND, MSG_ID, ERRMSG, ...) -- Function File: assert (OBSERVED,EXPECTED) -- Function File: assert (OBSERVED,EXPECTED,TOL) Produces an error if the condition is not met. `assert' can be called in three different ways. *************** *** 32869,32875 **** # name: # type: string # elements: 1 ! # length: 3564 -- Function File: quadgk (F, A, B, ABSTOL, TRACE) -- Function File: quadgk (F, A, B, PROP, VAL, ...) -- Function File: [Q, ERR] = quadgk (...) --- 32943,32949 ---- # name: # type: string # elements: 1 ! # length: 3565 -- Function File: quadgk (F, A, B, ABSTOL, TRACE) -- Function File: quadgk (F, A, B, PROP, VAL, ...) -- Function File: [Q, ERR] = quadgk (...) *************** *** 32895,32901 **** `quadgk' initially subdivides the interval on which to perform the quadrature into 10 intervals. Sub-intervals that have an unacceptable error are sub-divided and re-evaluated. If the number of sub-intervals exceeds at any point 650 sub-intervals then a poor convergence is signaled and the current estimate of the integral is returned. The property 'MaxIntervalCount' can be used to alter the number of sub-intervals that can exist before exiting. `WayPoints' ! If there exists discontinuities in the first derivative of the function to integrate, then these can be flagged with the `"WayPoints"' property. This forces the ends of a sub-interval to fall on the breakpoints of the function and can result in significantly improved estimated of the error in the integral, faster computation or both. For example, quadgk (@(x) abs (1 - x .^ 2), 0, 2, 'Waypoints', 1) --- 32969,32975 ---- `quadgk' initially subdivides the interval on which to perform the quadrature into 10 intervals. Sub-intervals that have an unacceptable error are sub-divided and re-evaluated. If the number of sub-intervals exceeds at any point 650 sub-intervals then a poor convergence is signaled and the current estimate of the integral is returned. The property 'MaxIntervalCount' can be used to alter the number of sub-intervals that can exist before exiting. `WayPoints' ! If there exists discontinuities in the first derivative of the function to integrate, then these can be flagged with the `"WayPoints"' property. This forces the ends of a sub-interval to fall on the breakpoints of the function and can result in significantly improved estimation of the error in the integral, faster computation or both. For example, quadgk (@(x) abs (1 - x .^ 2), 0, 2, 'Waypoints', 1) diff -cNr octave-3.2.0/doc/interpreter/errorbar.eps octave-3.2.2/doc/interpreter/errorbar.eps *** octave-3.2.0/doc/interpreter/errorbar.eps 2009-05-25 08:47:05.000000000 +0200 --- octave-3.2.2/doc/interpreter/errorbar.eps 2009-06-08 07:38:55.000000000 +0200 *************** *** 1,7 **** %!PS-Adobe-2.0 EPSF-2.0 %%Title: errorbar.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon May 25 08:47:05 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments --- 1,7 ---- %!PS-Adobe-2.0 EPSF-2.0 %%Title: errorbar.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon Jun 8 07:38:55 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments *************** *** 50,56 **** /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon May 25 08:47:05 2009) /DOCINFO pdfmark end } ifelse --- 50,56 ---- /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon Jun 8 07:38:55 2009) /DOCINFO pdfmark end } ifelse *************** *** 543,564 **** } ifelse 0.500 UL LTb ! 913 532 M 88 0 V 5486 0 R -88 0 V stroke ! 0.00 0.00 0.00 C 829 532 M [ [(Helvetica) 120.0 0.0 true true 0 (-1)] ] -40.0 MRshow 0.500 UL LTb ! 913 1557 M 88 0 V 5486 0 R -88 0 V stroke ! 0.00 0.00 0.00 C 829 1557 M [ [(Helvetica) 120.0 0.0 true true 0 (-0.5)] ] -40.0 MRshow 0.500 UL --- 543,564 ---- } ifelse 0.500 UL LTb ! 913 718 M 88 0 V 5486 0 R -88 0 V stroke ! 0.00 0.00 0.00 C 829 718 M [ [(Helvetica) 120.0 0.0 true true 0 (-1)] ] -40.0 MRshow 0.500 UL LTb ! 913 1650 M 88 0 V 5486 0 R -88 0 V stroke ! 0.00 0.00 0.00 C 829 1650 M [ [(Helvetica) 120.0 0.0 true true 0 (-0.5)] ] -40.0 MRshow 0.500 UL *************** *** 573,594 **** ] -40.0 MRshow 0.500 UL LTb ! 913 3607 M 88 0 V 5486 0 R -88 0 V stroke ! 0.00 0.00 0.00 C 829 3607 M [ [(Helvetica) 120.0 0.0 true true 0 (0.5)] ] -40.0 MRshow 0.500 UL LTb ! 913 4632 M 88 0 V 5486 0 R -88 0 V stroke ! 0.00 0.00 0.00 C 829 4632 M [ [(Helvetica) 120.0 0.0 true true 0 (1)] ] -40.0 MRshow 0.500 UL --- 573,594 ---- ] -40.0 MRshow 0.500 UL LTb ! 913 3514 M 88 0 V 5486 0 R -88 0 V stroke ! 0.00 0.00 0.00 C 829 3514 M [ [(Helvetica) 120.0 0.0 true true 0 (0.5)] ] -40.0 MRshow 0.500 UL LTb ! 913 4446 M 88 0 V 5486 0 R -88 0 V stroke ! 0.00 0.00 0.00 C 829 4446 M [ [(Helvetica) 120.0 0.0 true true 0 (1)] ] -40.0 MRshow 0.500 UL *************** *** 668,1466 **** 1.000 UP 0.500 UL LT0 ! 0.00 0.00 1.00 C 913 2248 M ! 0 352 V ! 882 2248 M 62 0 V ! -62 352 R 62 0 V ! 25 330 R ! 0 -259 V ! -31 259 R 62 0 V ! 938 2671 M 62 0 V ! 24 610 R ! 0 -151 V ! -31 151 R 62 0 V ! 993 3130 M 62 0 V ! 25 -233 R ! 0 278 V ! -31 -278 R 62 0 V ! -62 278 R 62 0 V ! 25 166 R ! 0 -152 V ! -31 152 R 62 0 V ! -62 -152 R 62 0 V ! 25 394 R ! 0 135 V ! -31 -135 R 62 0 V ! -62 135 R 62 0 V ! 24 15 R ! 0 -332 V ! -31 332 R 62 0 V ! -62 -332 R 62 0 V ! 25 685 R ! 0 -62 V ! -31 62 R 62 0 V ! -62 -62 R 62 0 V ! 25 -95 R ! 0 285 V ! -31 -285 R 62 0 V ! -62 285 R 62 0 V ! 25 139 R ! 0 107 V ! -31 -107 R 62 0 V ! -62 107 R 62 0 V ! 24 140 R ! 0 -413 V ! -31 413 R 62 0 V ! -62 -413 R 62 0 V ! 25 62 R ! 0 31 V ! -31 -31 R 62 0 V ! -62 31 R 62 0 V ! 25 162 R ! 0 -147 V ! -31 147 R 62 0 V ! -62 -147 R 62 0 V ! 25 305 R ! 0 -173 V ! -31 173 R 62 0 V ! -62 -173 R 62 0 V ! 24 -129 R ! 0 334 V ! -31 -334 R 62 0 V ! -62 334 R 62 0 V ! 81 0 R ! 0 -93 V ! -31 93 R 62 0 V ! -62 -93 R 62 0 V ! 80 -163 R ! 0 256 V ! -31 -256 R 62 0 V ! -62 256 R 62 0 V ! 25 0 R ! 0 -176 V ! -31 176 R 62 0 V ! stroke 2003 4632 M ! -62 -176 R 62 0 V ! 25 -107 R ! 0 201 V ! -31 -201 R 62 0 V ! -62 201 R 62 0 V ! 25 -284 R ! 0 -143 V ! -31 143 R 62 0 V ! -62 -143 R 62 0 V ! 24 -36 R ! 0 79 V ! -31 -79 R 62 0 V ! -62 79 R 62 0 V ! 25 -62 R ! 0 -88 V ! -31 88 R 62 0 V ! -62 -88 R 62 0 V ! 25 9 R ! 0 -108 V ! -31 108 R 62 0 V ! -62 -108 R 62 0 V ! 25 -29 R 0 154 V -31 -154 R 62 0 V -62 154 R 62 0 V ! 24 -453 R ! 0 -74 V ! -31 74 R 62 0 V ! -62 -74 R 62 0 V ! 25 157 R ! 0 -265 V ! -31 265 R 62 0 V ! -62 -265 R 62 0 V ! 25 29 R ! 0 -6 V ! -31 6 R 62 0 V ! -62 -6 R 62 0 V ! 24 -424 R ! 0 14 V ! -31 -14 R 62 0 V ! -62 14 R 62 0 V ! 25 29 R ! 0 -132 V ! -31 132 R 62 0 V ! -62 -132 R 62 0 V ! 25 -152 R ! 0 -275 V ! -31 275 R 62 0 V ! -62 -275 R 62 0 V ! 25 -218 R ! 0 9 V ! -31 -9 R 62 0 V ! -62 9 R 62 0 V ! 24 4 R ! 0 82 V ! -31 -82 R 62 0 V ! -62 82 R 62 0 V ! 25 -246 R ! 0 39 V ! -31 -39 R 62 0 V ! -62 39 R 62 0 V ! 25 -405 R ! 0 -133 V ! -31 133 R 62 0 V ! -62 -133 R 62 0 V ! 25 -100 R ! 0 215 V ! -31 -215 R 62 0 V ! -62 215 R 62 0 V ! stroke 2951 1737 M ! 24 -77 R ! 0 161 V ! -31 -161 R 62 0 V ! -62 161 R 62 0 V ! 25 -519 R ! 0 -67 V ! -31 67 R 62 0 V ! -62 -67 R 62 0 V ! 25 -342 R ! 0 -72 V ! -31 72 R 62 0 V ! -62 -72 R 62 0 V ! 25 376 R ! 0 -33 V ! -31 33 R 62 0 V ! -62 -33 R 62 0 V ! 24 -15 R ! 0 -539 V ! -31 539 R 62 0 V ! 3167 610 M 62 0 V ! 25 399 R ! 0 54 V ! -31 -54 R 62 0 V ! -62 54 R 62 0 V ! 25 -397 R ! 0 412 V ! 3279 666 M 62 0 V ! -62 412 R 62 0 V ! 25 -17 R ! 0 -325 V ! -31 325 R 62 0 V ! 3335 736 M 62 0 V ! 24 -89 R ! 0 1 V ! -31 -1 R 62 0 V ! -62 1 R 62 0 V ! 25 -38 R ! 0 -40 V ! -31 40 R 62 0 V ! -62 -40 R 62 0 V ! 25 85 R ! 0 -123 V ! -31 123 R 62 0 V ! 3502 532 M 62 0 V ! 25 35 R ! 0 185 V ! 3558 567 M 62 0 V ! -62 185 R 62 0 V ! 24 196 R ! 0 -416 V ! -31 416 R 62 0 V ! 3613 532 M 62 0 V ! 25 49 R ! 0 -49 V ! -31 49 R 62 0 V ! -62 -49 R 62 0 V ! 25 499 R ! 0 -499 V ! -31 499 R 62 0 V ! 3725 532 M 62 0 V ! 24 250 R ! 0 -250 V ! -31 250 R 62 0 V ! 3780 532 M 62 0 V ! 25 647 R ! 0 -490 V ! -31 490 R 62 0 V ! 3836 689 M 62 0 V ! 25 562 R ! 0 -218 V ! stroke 3923 1033 M ! -31 218 R 62 0 V ! -62 -218 R 62 0 V ! 25 147 R ! 0 -362 V ! -31 362 R 62 0 V ! 3948 818 M 62 0 V ! 24 491 R ! 0 42 V ! -31 -42 R 62 0 V ! -62 42 R 62 0 V ! 25 -22 R ! 0 222 V ! -31 -222 R 62 0 V ! -62 222 R 62 0 V ! 25 214 R ! 0 -3 V ! -31 3 R 62 0 V ! -62 -3 R 62 0 V ! 25 79 R ! 0 325 V ! -31 -325 R 62 0 V ! -62 325 R 62 0 V ! 24 -425 R ! 0 10 V ! -31 -10 R 62 0 V ! -62 10 R 62 0 V ! 25 458 R ! 0 68 V ! -31 -68 R 62 0 V ! -62 68 R 62 0 V ! 25 -23 R ! 0 60 V ! -31 -60 R 62 0 V ! -62 60 R 62 0 V ! 25 89 R ! 0 301 V ! -31 -301 R 62 0 V ! -62 301 R 62 0 V ! 24 165 R ! 0 42 V ! -31 -42 R 62 0 V ! -62 42 R 62 0 V ! 25 368 R ! 0 -25 V ! -31 25 R 62 0 V ! -62 -25 R 62 0 V ! 25 54 R ! 0 -34 V ! -31 34 R 62 0 V ! -62 -34 R 62 0 V ! 25 321 R ! 0 13 V ! -31 -13 R 62 0 V ! -62 13 R 62 0 V ! 24 -30 R ! 0 -6 V ! -31 6 R 62 0 V ! -62 -6 R 62 0 V ! 25 472 R ! 0 -134 V ! -31 134 R 62 0 V ! -62 -134 R 62 0 V ! 25 -417 R ! 0 575 V ! -31 -575 R 62 0 V ! -62 575 R 62 0 V ! 25 -68 R ! 0 -83 V ! -31 83 R 62 0 V ! stroke 4902 4000 M ! -62 -83 R 62 0 V ! 24 441 R ! 0 123 V ! -31 -123 R 62 0 V ! -62 123 R 62 0 V ! 25 -215 R ! 0 -36 V ! -31 36 R 62 0 V ! -62 -36 R 62 0 V ! 25 148 R ! 0 -6 V ! -31 6 R 62 0 V ! -62 -6 R 62 0 V ! 25 159 R ! 0 -4 V ! -31 4 R 62 0 V ! -62 -4 R 62 0 V ! 24 -67 R ! 0 91 V ! -31 -91 R 62 0 V ! -62 91 R 62 0 V ! 81 4 R ! 0 -173 V ! -31 173 R 62 0 V ! -62 -173 R 62 0 V ! 24 96 R ! 0 -91 V ! -31 91 R 62 0 V ! -62 -91 R 62 0 V ! 81 60 R ! 0 185 V ! -31 -185 R 62 0 V ! -62 185 R 62 0 V ! 25 -5 R ! 0 5 V ! -31 -5 R 62 0 V ! -62 5 R 62 0 V ! 24 0 R ! 0 -168 V ! -31 168 R 62 0 V ! -62 -168 R 62 0 V ! 25 88 R ! 0 -307 V ! -31 307 R 62 0 V ! -62 -307 R 62 0 V ! 25 -185 R ! 0 47 V ! -31 -47 R 62 0 V ! -62 47 R 62 0 V ! 25 -46 R ! 0 438 V ! -31 -438 R 62 0 V ! -62 438 R 62 0 V ! 24 -756 R ! 0 316 V ! -31 -316 R 62 0 V ! -62 316 R 62 0 V ! 25 -54 R ! 0 -468 V ! -31 468 R 62 0 V ! -62 -468 R 62 0 V ! 25 191 R ! 0 -59 V ! -31 59 R 62 0 V ! -62 -59 R 62 0 V ! 25 -124 R ! 0 -208 V ! -31 208 R 62 0 V ! -62 -208 R 62 0 V ! stroke 5961 3337 M ! 24 -409 R ! 0 469 V ! -31 -469 R 62 0 V ! -62 469 R 62 0 V ! 25 -421 R ! 0 314 V ! -31 -314 R 62 0 V ! -62 314 R 62 0 V ! 25 -787 R ! 0 600 V ! -31 -600 R 62 0 V ! -62 600 R 62 0 V ! 25 -326 R ! 0 -53 V ! -31 53 R 62 0 V ! -62 -53 R 62 0 V ! 24 -295 R ! 0 -169 V ! -31 169 R 62 0 V ! -62 -169 R 62 0 V ! 25 -205 R ! 0 67 V ! -31 -67 R 62 0 V ! -62 67 R 62 0 V ! 25 39 R ! 0 -111 V ! -31 111 R 62 0 V ! -62 -111 R 62 0 V ! 25 -344 R ! 0 302 V ! -31 -302 R 62 0 V ! -62 302 R 62 0 V ! 24 -174 R ! 0 -293 V ! -31 293 R 62 0 V ! -62 -293 R 62 0 V ! 25 90 R ! 0 -387 V ! -31 387 R 62 0 V ! -62 -387 R 62 0 V 913 2582 Pls ! 969 2787 Pls ! 1024 2989 Pls ! 1080 3188 Pls ! 1136 3380 Pls ! 1192 3565 Pls ! 1247 3740 Pls ! 1303 3903 Pls ! 1359 4053 Pls ! 1415 4188 Pls ! 1470 4307 Pls ! 1526 4409 Pls ! 1582 4493 Pls ! 1638 4557 Pls ! 1693 4602 Pls ! 1749 4627 Pls ! 1805 4631 Pls ! 1861 4615 Pls ! 1916 4578 Pls ! 1972 4522 Pls ! 2028 4446 Pls ! 2084 4352 Pls ! 2139 4239 Pls ! 2195 4111 Pls ! 2251 3967 Pls ! 2307 3809 Pls ! 2362 3639 Pls ! 2418 3458 Pls ! 2474 3269 Pls ! 2529 3072 Pls ! 2585 2871 Pls ! 2641 2667 Pls ! 2697 2462 Pls ! 2752 2259 Pls ! 2808 2058 Pls ! 2864 1863 Pls ! 2920 1675 Pls ! 2975 1496 Pls ! 3031 1328 Pls ! 3087 1172 Pls ! 3143 1031 Pls ! 3198 905 Pls ! 3254 795 Pls ! 3310 704 Pls ! 3366 631 Pls ! 3421 578 Pls ! 3477 545 Pls ! 3533 532 Pls ! 3589 540 Pls ! 3644 568 Pls ! 3700 616 Pls ! 3756 684 Pls ! 3811 771 Pls ! 3867 876 Pls ! 3923 998 Pls ! 3979 1136 Pls ! 4034 1288 Pls ! 4090 1453 Pls ! 4146 1630 Pls ! 4202 1816 Pls ! 4257 2009 Pls ! 4313 2209 Pls ! 4369 2412 Pls ! 4425 2616 Pls ! 4480 2821 Pls ! 4536 3023 Pls ! 4592 3221 Pls ! 4648 3412 Pls ! 4703 3595 Pls ! 4759 3768 Pls ! 4815 3929 Pls ! 4871 4076 Pls ! 4926 4209 Pls ! 4982 4325 Pls ! 5038 4424 Pls ! 5094 4505 Pls ! 5149 4566 Pls ! 5205 4608 Pls ! 5261 4629 Pls ! 5316 4630 Pls ! 5372 4610 Pls ! 5428 4570 Pls ! 5484 4510 Pls ! 5539 4431 Pls ! 5595 4334 Pls ! 5651 4219 Pls ! 5707 4088 Pls ! 5762 3941 Pls ! 5818 3781 Pls ! 5874 3609 Pls ! 5930 3427 Pls ! 5985 3236 Pls ! 6041 3039 Pls ! 6097 2837 Pls ! 6153 2633 Pls ! 6208 2428 Pls ! 6264 2225 Pls ! 6320 2025 Pls ! 6376 1831 Pls ! 6431 1644 Pls ! 6487 1467 Pls % End plot #1 % Begin plot #2 0.500 UL LT1 0.00 0.00 1.00 C 913 2582 M ! 56 205 V ! 55 202 V ! 56 199 V ! 56 192 V ! 56 185 V ! 55 175 V ! 56 163 V ! 56 150 V ! 56 135 V ! 55 119 V ! 56 102 V ! 56 84 V ! 56 64 V ! 55 45 V ! 56 25 V 56 4 V ! 56 -16 V ! 55 -37 V ! 56 -56 V ! 56 -76 V ! 56 -94 V ! 55 -113 V ! 56 -128 V 56 -144 V ! 56 -158 V ! 55 -170 V ! 56 -181 V ! 56 -189 V ! 55 -197 V ! 56 -201 V ! 56 -204 V ! 56 -205 V ! 55 -203 V ! 56 -201 V ! 56 -195 V ! 56 -188 V ! 55 -179 V ! 56 -168 V ! 56 -156 V ! 56 -141 V ! 55 -126 V ! 56 -110 V ! 56 -91 V ! 56 -73 V ! 55 -53 V ! 56 -33 V ! 56 -13 V ! 56 8 V ! 55 28 V ! 56 48 V ! 56 68 V ! 55 87 V ! 56 105 V ! 56 122 V ! 56 138 V ! 55 152 V ! 56 165 V ! 56 177 V 56 186 V ! 55 193 V ! 56 200 V ! 56 203 V ! 56 204 V ! 55 205 V ! 56 202 V ! 56 198 V ! 56 191 V ! 55 183 V 56 173 V ! 56 161 V ! 56 147 V ! 55 133 V ! 56 116 V ! 56 99 V ! 56 81 V ! 55 61 V ! 56 42 V ! 56 21 V 55 1 V ! 56 -20 V ! 56 -40 V ! 56 -60 V ! 55 -79 V ! 56 -97 V ! 56 -115 V ! 56 -131 V ! 55 -147 V ! 56 -160 V ! 56 -172 V ! 56 -182 V ! 55 -191 V ! 56 -197 V ! 56 -202 V ! 56 -204 V ! 55 -205 V ! 56 -203 V ! 56 -200 V ! 56 -194 V ! 55 -187 V 56 -177 V % End plot #2 stroke LTb --- 668,1490 ---- 1.000 UP 0.500 UL LT0 ! 0.00 0.00 1.00 C 913 2404 M ! 0 246 V ! 882 2404 M 62 0 V ! -62 246 R 62 0 V ! 25 -59 R ! 0 209 V ! 938 2591 M 62 0 V ! -62 209 R 62 0 V ! 24 142 R ! 0 136 V ! 993 2942 M 62 0 V ! -62 136 R 62 0 V ! 25 39 R ! 0 31 V ! -31 -31 R 62 0 V ! -62 31 R 62 0 V ! 25 4 R ! 0 334 V ! -31 -334 R 62 0 V ! -62 334 R 62 0 V ! 25 -148 R ! 0 142 V ! -31 -142 R 62 0 V ! -62 142 R 62 0 V ! 24 29 R ! 0 261 V ! -31 -261 R 62 0 V ! -62 261 R 62 0 V ! 25 -45 R ! 0 62 V ! -31 -62 R 62 0 V ! -62 62 R 62 0 V ! 25 19 R ! 0 161 V ! -31 -161 R 62 0 V ! -62 161 R 62 0 V ! 25 -38 R ! 0 264 V ! -31 -264 R 62 0 V ! -62 264 R 62 0 V ! 24 -151 R ! 0 137 V ! -31 -137 R 62 0 V ! -62 137 R 62 0 V ! 25 34 R ! 0 64 V ! -31 -64 R 62 0 V ! -62 64 R 62 0 V ! 25 -38 R ! 0 209 V ! -31 -209 R 62 0 V ! -62 209 R 62 0 V ! 25 -144 R ! 0 146 V ! -31 -146 R 62 0 V ! -62 146 R 62 0 V ! 24 -166 R ! 0 143 V ! -31 -143 R 62 0 V ! -62 143 R 62 0 V ! 25 -171 R ! 0 369 V ! -31 -369 R 62 0 V ! -62 369 R 62 0 V ! 25 -357 R ! 0 205 V ! -31 -205 R 62 0 V ! -62 205 R 62 0 V ! 25 -144 R ! 0 108 V ! -31 -108 R 62 0 V ! stroke 1892 4329 M ! -62 108 R 62 0 V ! 24 -123 R ! 0 147 V ! -31 -147 R 62 0 V ! -62 147 R 62 0 V ! 25 -165 R ! 0 164 V ! -31 -164 R 62 0 V ! -62 164 R 62 0 V ! 25 -190 R ! 0 145 V ! -31 -145 R 62 0 V ! -62 145 R 62 0 V ! 25 -229 R ! 0 26 V ! -31 -26 R ! 62 0 V ! -62 26 R 62 0 V ! 24 -210 R ! 0 150 V ! -31 -150 R 62 0 V ! -62 150 R 62 0 V ! 25 -240 R ! 0 65 V ! -31 -65 R 62 0 V ! -62 65 R ! 62 0 V ! 25 -207 R 0 154 V -31 -154 R 62 0 V -62 154 R 62 0 V ! 25 -393 R ! 0 309 V ! -31 -309 R 62 0 V ! -62 309 R 62 0 V ! 24 -395 R ! 0 236 V ! -31 -236 R 62 0 V ! -62 236 R 62 0 V ! 25 -407 R ! 0 273 V ! -31 -273 R 62 0 V ! -62 273 R 62 0 V ! 25 -385 R ! 0 185 V ! -31 -185 R 62 0 V ! -62 185 R 62 0 V ! 24 -324 R ! 0 166 V ! -31 -166 R 62 0 V ! -62 166 R 62 0 V ! 25 -405 R ! 0 192 V ! -31 -192 R 62 0 V ! -62 192 R 62 0 V ! 25 -342 R ! 0 114 V ! -31 -114 R 62 0 V ! -62 114 R 62 0 V ! 25 -370 R ! 0 137 V ! -31 -137 R 62 0 V ! -62 137 R 62 0 V ! 24 -413 R ! 0 309 V ! -31 -309 R 62 0 V ! -62 309 R 62 0 V ! 25 -431 R ! 0 185 V ! -31 -185 R 62 0 V ! -62 185 R 62 0 V ! stroke 2839 2165 M ! 25 -271 R ! 0 53 V ! -31 -53 R 62 0 V ! -62 53 R 62 0 V ! 25 -356 R ! 0 250 V ! -31 -250 R 62 0 V ! -62 250 R 62 0 V ! 24 -395 R ! 0 312 V ! -31 -312 R 62 0 V ! -62 312 R 62 0 V ! 25 -453 R ! 0 160 V ! -31 -160 R 62 0 V ! -62 160 R 62 0 V ! 25 -334 R ! 0 278 V ! -31 -278 R 62 0 V ! -62 278 R 62 0 V ! 25 -380 R ! 0 216 V ! -31 -216 R 62 0 V ! -62 216 R 62 0 V ! 24 -335 R ! 0 243 V ! 3167 910 M 62 0 V ! -62 243 R 62 0 V ! 25 -261 R ! 0 93 V ! -31 -93 R 62 0 V ! -62 93 R 62 0 V ! 25 -293 R ! 0 361 V ! 3279 692 M 62 0 V ! -62 361 R 62 0 V ! 25 -424 R ! 0 228 V ! 3335 629 M 62 0 V ! -62 228 R 62 0 V ! 24 -127 R ! 0 143 V ! 3390 730 M 62 0 V ! -62 143 R 62 0 V ! 25 -283 R ! 0 218 V ! 3446 590 M 62 0 V ! -62 218 R 62 0 V ! 25 -223 R ! 0 137 V ! 3502 585 M 62 0 V ! -62 137 R 62 0 V ! 25 -82 R ! 0 189 V ! 3558 640 M 62 0 V ! -62 189 R 62 0 V ! 24 -177 R ! 0 125 V ! 3613 652 M 62 0 V ! -62 125 R 62 0 V ! 25 -73 R ! 0 101 V ! 3669 704 M 62 0 V ! -62 101 R 62 0 V ! 25 -121 R ! 0 179 V ! 3725 684 M 62 0 V ! -62 179 R 62 0 V ! 24 -21 R ! 0 124 V ! stroke 3811 966 M ! 3780 842 M 62 0 V ! -62 124 R 62 0 V ! 25 -90 R ! 0 173 V ! 3836 876 M 62 0 V ! -62 173 R 62 0 V ! 25 27 R ! 0 184 V ! -31 -184 R 62 0 V ! -62 184 R 62 0 V ! 25 -157 R ! 0 259 V ! -31 -259 R 62 0 V ! -62 259 R 62 0 V ! 24 -124 R ! 0 351 V ! -31 -351 R 62 0 V ! -62 351 R 62 0 V ! 25 -119 R ! 0 260 V ! -31 -260 R 62 0 V ! -62 260 R 62 0 V ! 25 -120 R ! 0 291 V ! -31 -291 R 62 0 V ! -62 291 R 62 0 V ! 25 -187 R ! 0 215 V ! -31 -215 R 62 0 V ! -62 215 R 62 0 V ! 24 -3 R ! 0 218 V ! -31 -218 R 62 0 V ! -62 218 R 62 0 V ! 25 8 R ! 0 137 V ! -31 -137 R 62 0 V ! -62 137 R ! 62 0 V ! 25 97 R ! 0 151 V ! -31 -151 R 62 0 V ! -62 151 R 62 0 V ! 25 16 R ! 0 177 V ! -31 -177 R 62 0 V ! -62 177 R 62 0 V ! 24 -61 R ! 0 279 V ! -31 -279 R 62 0 V ! -62 279 R 62 0 V ! 25 4 R ! 0 163 V ! -31 -163 R 62 0 V ! -62 163 R 62 0 V ! 25 -122 R ! 0 217 V ! -31 -217 R 62 0 V ! -62 217 R 62 0 V ! 25 77 R ! 0 128 V ! -31 -128 R 62 0 V ! -62 128 R 62 0 V ! 24 -82 R ! 0 268 V ! -31 -268 R 62 0 V ! -62 268 R 62 0 V ! 25 1 R ! 0 59 V ! -31 -59 R 62 0 V ! stroke 4790 3602 M ! -62 59 R 62 0 V ! 25 -33 R ! 0 185 V ! -31 -185 R 62 0 V ! -62 185 R 62 0 V ! 25 -4 R ! 0 208 V ! -31 -208 R 62 0 V ! -62 208 R 62 0 V ! 24 -50 R ! 0 115 V ! -31 -115 R 62 0 V ! -62 115 R 62 0 V ! 25 -12 R ! 0 232 V ! -31 -232 R 62 0 V ! -62 232 R 62 0 V ! 25 -167 R ! 0 167 V ! -31 -167 R 62 0 V ! -62 167 R 62 0 V ! 25 -81 R ! 0 128 V ! -31 -128 R 62 0 V ! -62 128 R 62 0 V ! 24 -21 R ! 0 92 V ! -31 -92 R ! 62 0 V ! -62 92 R 62 0 V ! 25 -35 R ! 0 82 V ! -31 -82 R 62 0 V ! -62 82 R 62 0 V ! 25 -119 R ! 0 135 V ! -31 -135 R 62 0 V ! -62 135 R 62 0 V ! 24 -213 R ! 0 271 V ! -31 -271 R 62 0 V ! -62 271 R 62 0 V ! 25 -231 R ! 0 202 V ! -31 -202 R 62 0 V ! -62 202 R 62 0 V ! 25 -137 R ! 0 72 V ! -31 -72 R 62 0 V ! -62 72 R 62 0 V ! 25 -265 R ! 0 273 V ! -31 -273 R 62 0 V ! -62 273 R 62 0 V ! 24 -327 R ! 0 175 V ! -31 -175 R 62 0 V ! -62 175 R 62 0 V ! 25 -297 R ! 0 338 V ! -31 -338 R 62 0 V ! -62 338 R 62 0 V ! 25 -310 R ! 0 216 V ! -31 -216 R 62 0 V ! -62 216 R 62 0 V ! 25 -438 R ! 0 274 V ! -31 -274 R 62 0 V ! -62 274 R 62 0 V ! stroke 5738 4086 M ! 24 -279 R ! 0 91 V ! -31 -91 R 62 0 V ! -62 91 R 62 0 V ! 25 -348 R ! 0 217 V ! -31 -217 R 62 0 V ! -62 217 R 62 0 V ! 25 -302 R ! 0 159 V ! -31 -159 R 62 0 V ! -62 159 R 62 0 V ! 25 -316 R ! 0 52 V ! -31 -52 R 62 0 V ! -62 52 R 62 0 V ! 24 -346 R ! 0 241 V ! -31 -241 R 62 0 V ! -62 241 R 62 0 V ! 25 -277 R ! 0 117 V ! -31 -117 R 62 0 V ! -62 117 R 62 0 V ! 25 -378 R ! 0 131 V ! -31 -131 R 62 0 V ! -62 131 R 62 0 V ! 25 -379 R ! 0 177 V ! -31 -177 R 62 0 V ! -62 177 R 62 0 V ! 24 -250 R ! 0 196 V ! -31 -196 R ! 62 0 V ! -62 196 R 62 0 V ! 25 -374 R ! 0 107 V ! -31 -107 R ! 62 0 V ! -62 107 R 62 0 V ! 25 -414 R ! 0 261 V ! -31 -261 R 62 0 V ! -62 261 R 62 0 V ! 25 -352 R ! 0 251 V ! -31 -251 R 62 0 V ! -62 251 R 62 0 V ! 24 -475 R ! 0 247 V ! -31 -247 R ! 62 0 V ! -62 247 R ! 62 0 V ! 25 -281 R ! 0 60 V ! -31 -60 R 62 0 V ! -62 60 R 62 0 V 913 2582 Pls ! 969 2768 Pls ! 1024 2952 Pls ! 1080 3133 Pls ! 1136 3308 Pls ! 1192 3475 Pls ! 1247 3634 Pls ! 1303 3783 Pls ! 1359 3919 Pls ! 1415 4042 Pls ! 1470 4150 Pls ! 1526 4243 Pls ! 1582 4319 Pls ! 1638 4378 Pls ! 1693 4419 Pls ! 1749 4441 Pls ! 1805 4445 Pls ! 1861 4430 Pls ! 1916 4397 Pls ! 1972 4346 Pls ! 2028 4277 Pls ! 2084 4191 Pls ! 2139 4089 Pls ! 2195 3972 Pls ! 2251 3841 Pls ! 2307 3697 Pls ! 2362 3543 Pls ! 2418 3378 Pls ! 2474 3206 Pls ! 2529 3028 Pls ! 2585 2845 Pls ! 2641 2659 Pls ! 2697 2473 Pls ! 2752 2288 Pls ! 2808 2106 Pls ! 2864 1928 Pls ! 2920 1757 Pls ! 2975 1595 Pls ! 3031 1442 Pls ! 3087 1300 Pls ! 3143 1172 Pls ! 3198 1057 Pls ! 3254 958 Pls ! 3310 875 Pls ! 3366 809 Pls ! 3421 760 Pls ! 3477 730 Pls ! 3533 719 Pls ! 3589 726 Pls ! 3644 751 Pls ! 3700 795 Pls ! 3756 857 Pls ! 3811 936 Pls ! 3867 1031 Pls ! 3923 1142 Pls ! 3979 1267 Pls ! 4034 1406 Pls ! 4090 1556 Pls ! 4146 1716 Pls ! 4202 1885 Pls ! 4257 2061 Pls ! 4313 2243 Pls ! 4369 2427 Pls ! 4425 2613 Pls ! 4480 2799 Pls ! 4536 2983 Pls ! 4592 3163 Pls ! 4648 3336 Pls ! 4703 3503 Pls ! 4759 3660 Pls ! 4815 3806 Pls ! 4871 3941 Pls ! 4926 4061 Pls ! 4982 4167 Pls ! 5038 4257 Pls ! 5094 4330 Pls ! 5149 4386 Pls ! 5205 4424 Pls ! 5261 4443 Pls ! 5316 4444 Pls ! 5372 4426 Pls ! 5428 4390 Pls ! 5484 4335 Pls ! 5539 4263 Pls ! 5595 4175 Pls ! 5651 4070 Pls ! 5707 3951 Pls ! 5762 3818 Pls ! 5818 3672 Pls ! 5874 3516 Pls ! 5930 3350 Pls ! 5985 3177 Pls ! 6041 2997 Pls ! 6097 2814 Pls ! 6153 2628 Pls ! 6208 2442 Pls ! 6264 2257 Pls ! 6320 2076 Pls ! 6376 1899 Pls ! 6431 1729 Pls ! 6487 1568 Pls % End plot #1 % Begin plot #2 0.500 UL LT1 0.00 0.00 1.00 C 913 2582 M ! 56 186 V ! 55 184 V ! 56 181 V ! 56 175 V ! 56 167 V ! 55 159 V ! 56 149 V ! 56 136 V ! 56 123 V ! 55 108 V ! 56 93 V ! 56 76 V ! 56 59 V ! 55 41 V ! 56 22 V 56 4 V ! 56 -15 V ! 55 -33 V ! 56 -51 V ! 56 -69 V ! 56 -86 V ! 55 -102 V ! 56 -117 V ! 56 -131 V 56 -144 V ! 55 -154 V ! 56 -165 V ! 56 -172 V ! 55 -178 V ! 56 -183 V ! 56 -186 V ! 56 -186 V ! 55 -185 V ! 56 -182 V ! 56 -178 V ! 56 -171 V ! 55 -162 V ! 56 -153 V ! 56 -142 V ! 56 -128 V ! 55 -115 V ! 56 -99 V ! 56 -83 V ! 56 -66 V ! 55 -49 V ! 56 -30 V ! 56 -11 V ! 56 7 V ! 55 25 V ! 56 44 V ! 56 62 V ! 55 79 V ! 56 95 V ! 56 111 V ! 56 125 V ! 55 139 V ! 56 150 V ! 56 160 V ! 56 169 V ! 55 176 V ! 56 182 V ! 56 184 V 56 186 V ! 55 186 V ! 56 184 V ! 56 180 V 56 173 V ! 55 167 V ! 56 157 V ! 56 146 V ! 56 135 V ! 55 120 V ! 56 106 V ! 56 90 V ! 56 73 V ! 55 56 V ! 56 38 V ! 56 19 V 55 1 V ! 56 -18 V ! 56 -36 V ! 56 -55 V ! 55 -72 V ! 56 -88 V ! 56 -105 V ! 56 -119 V ! 55 -133 V ! 56 -146 V ! 56 -156 V ! 56 -166 V ! 55 -173 V ! 56 -180 V ! 56 -183 V ! 56 -186 V ! 55 -186 V ! 56 -185 V ! 56 -181 V 56 -177 V + 55 -170 V + 56 -161 V % End plot #2 stroke LTb Files octave-3.2.0/doc/interpreter/errorbar.pdf and octave-3.2.2/doc/interpreter/errorbar.pdf differ Files octave-3.2.0/doc/interpreter/errorbar.png and octave-3.2.2/doc/interpreter/errorbar.png differ diff -cNr octave-3.2.0/doc/interpreter/extended.eps octave-3.2.2/doc/interpreter/extended.eps *** octave-3.2.0/doc/interpreter/extended.eps 2009-05-25 08:47:07.000000000 +0200 --- octave-3.2.2/doc/interpreter/extended.eps 2009-06-08 07:38:56.000000000 +0200 *************** *** 1,7 **** %!PS-Adobe-2.0 EPSF-2.0 %%Title: extended.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon May 25 08:47:07 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments --- 1,7 ---- %!PS-Adobe-2.0 EPSF-2.0 %%Title: extended.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon Jun 8 07:38:56 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments *************** *** 50,56 **** /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon May 25 08:47:07 2009) /DOCINFO pdfmark end } ifelse --- 50,56 ---- /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon Jun 8 07:38:56 2009) /DOCINFO pdfmark end } ifelse Files octave-3.2.0/doc/interpreter/extended.pdf and octave-3.2.2/doc/interpreter/extended.pdf differ diff -cNr octave-3.2.0/doc/interpreter/hist.eps octave-3.2.2/doc/interpreter/hist.eps *** octave-3.2.0/doc/interpreter/hist.eps 2009-05-25 08:47:04.000000000 +0200 --- octave-3.2.2/doc/interpreter/hist.eps 2009-06-08 07:38:55.000000000 +0200 *************** *** 1,7 **** %!PS-Adobe-2.0 EPSF-2.0 %%Title: hist.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon May 25 08:47:04 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments --- 1,7 ---- %!PS-Adobe-2.0 EPSF-2.0 %%Title: hist.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon Jun 8 07:38:55 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments *************** *** 50,56 **** /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon May 25 08:47:04 2009) /DOCINFO pdfmark end } ifelse --- 50,56 ---- /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon Jun 8 07:38:55 2009) /DOCINFO pdfmark end } ifelse *************** *** 619,664 **** 0 -88 V stroke 0.00 0.00 0.00 C 913 392 M [ [(Helvetica) 120.0 0.0 true true 0 (-4)] ] -40.0 MCshow 0.500 UL LTb ! 2028 532 M 0 88 V 0 4012 R 0 -88 V stroke ! 0.00 0.00 0.00 C 2028 392 M [ [(Helvetica) 120.0 0.0 true true 0 (-2)] ] -40.0 MCshow 0.500 UL LTb ! 3143 532 M 0 88 V 0 4012 R 0 -88 V stroke ! 0.00 0.00 0.00 C 3143 392 M [ [(Helvetica) 120.0 0.0 true true 0 (0)] ] -40.0 MCshow 0.500 UL LTb ! 4257 532 M 0 88 V 0 4012 R 0 -88 V stroke ! 0.00 0.00 0.00 C 4257 392 M [ [(Helvetica) 120.0 0.0 true true 0 (2)] ] -40.0 MCshow 0.500 UL LTb ! 5372 532 M 0 88 V 0 4012 R 0 -88 V stroke ! 0.00 0.00 0.00 C 5372 392 M [ [(Helvetica) 120.0 0.0 true true 0 (4)] ] -40.0 MCshow 0.500 UL --- 619,674 ---- 0 -88 V stroke 0.00 0.00 0.00 C 913 392 M + [ [(Helvetica) 120.0 0.0 true true 0 (-6)] + ] -40.0 MCshow + 0.500 UL + LTb + 1842 532 M + 0 88 V + 0 4012 R + 0 -88 V + stroke + 0.00 0.00 0.00 C 1842 392 M [ [(Helvetica) 120.0 0.0 true true 0 (-4)] ] -40.0 MCshow 0.500 UL LTb ! 2771 532 M 0 88 V 0 4012 R 0 -88 V stroke ! 0.00 0.00 0.00 C 2771 392 M [ [(Helvetica) 120.0 0.0 true true 0 (-2)] ] -40.0 MCshow 0.500 UL LTb ! 3700 532 M 0 88 V 0 4012 R 0 -88 V stroke ! 0.00 0.00 0.00 C 3700 392 M [ [(Helvetica) 120.0 0.0 true true 0 (0)] ] -40.0 MCshow 0.500 UL LTb ! 4629 532 M 0 88 V 0 4012 R 0 -88 V stroke ! 0.00 0.00 0.00 C 4629 392 M [ [(Helvetica) 120.0 0.0 true true 0 (2)] ] -40.0 MCshow 0.500 UL LTb ! 5558 532 M 0 88 V 0 4012 R 0 -88 V stroke ! 0.00 0.00 0.00 C 5558 392 M [ [(Helvetica) 120.0 0.0 true true 0 (4)] ] -40.0 MCshow 0.500 UL *************** *** 694,1290 **** stroke 1.000 UL LT1 ! 0.00 0.00 0.50 C gsave 1162 532 N 0 0 V 0 3 V 142 0 V 0 -3 V 1 PolyFill ! 1162 532 M 0 3 V ! 142 0 V 0 -3 V % End plot #2 % Begin plot #3 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 1162 532 M 0 3 V ! 142 0 V 0 -3 V ! -142 0 V % End plot #3 % Begin plot #4 stroke 1.000 UL LT3 ! 0.00 0.00 0.50 C gsave 1304 532 N 0 0 V 0 27 V 141 0 V 0 -27 V 1 PolyFill ! 1304 532 M ! 0 27 V ! 141 0 V ! 0 -27 V % End plot #4 % Begin plot #5 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 1304 532 M ! 0 27 V ! 141 0 V ! 0 -27 V ! -141 0 V % End plot #5 % Begin plot #6 stroke 1.000 UL LT5 ! 0.00 0.00 0.50 C gsave 1445 532 N 0 0 V 0 51 V 141 0 V 0 -51 V 1 PolyFill ! 1445 532 M ! 0 51 V ! 141 0 V ! 0 -51 V % End plot #6 % Begin plot #7 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 1445 532 M ! 0 51 V ! 141 0 V ! 0 -51 V ! -141 0 V % End plot #7 % Begin plot #8 stroke 1.000 UL LT7 ! 0.00 0.00 0.50 C gsave 1586 532 N 0 0 V 0 79 V 142 0 V 0 -79 V 1 PolyFill ! 1586 532 M ! 0 79 V ! 142 0 V ! 0 -79 V % End plot #8 % Begin plot #9 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 1586 532 M ! 0 79 V ! 142 0 V ! 0 -79 V ! -142 0 V % End plot #9 % Begin plot #10 stroke 1.000 UL LT0 ! 0.00 0.00 0.50 C gsave 1728 532 N 0 0 V 0 212 V 141 0 V 0 -212 V 1 PolyFill ! 1728 532 M ! 0 212 V ! 141 0 V ! 0 -212 V % End plot #10 % Begin plot #11 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 1728 532 M ! 0 212 V ! 141 0 V ! 0 -212 V ! -141 0 V % End plot #11 % Begin plot #12 stroke 1.000 UL LT2 ! 0.00 0.00 0.50 C gsave 1869 532 N 0 0 V 0 338 V 141 0 V 0 -338 V 1 PolyFill ! 1869 532 M ! 0 338 V ! 141 0 V ! 0 -338 V % End plot #12 % Begin plot #13 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 1869 532 M ! 0 338 V ! 141 0 V ! 0 -338 V ! -141 0 V % End plot #13 % Begin plot #14 stroke 1.000 UL LT4 ! 0.00 0.00 0.50 C gsave 2010 532 N 0 0 V 0 612 V 142 0 V 0 -612 V 1 PolyFill ! 2010 532 M ! 0 612 V ! 142 0 V ! 0 -612 V % End plot #14 % Begin plot #15 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2010 532 M ! 0 612 V ! 142 0 V ! 0 -612 V ! -142 0 V % End plot #15 % Begin plot #16 stroke 1.000 UL LT6 ! 0.00 0.00 0.50 C gsave 2152 532 N 0 0 V 0 929 V 141 0 V 0 -929 V 1 PolyFill ! 2152 532 M ! 0 929 V ! 141 0 V ! 0 -929 V % End plot #16 % Begin plot #17 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2152 532 M ! 0 929 V ! 141 0 V ! 0 -929 V ! -141 0 V % End plot #17 % Begin plot #18 stroke 1.000 UL LT8 ! 0.00 0.00 0.50 C gsave 2293 532 N 0 0 V 0 1432 V 141 0 V 0 -1432 V 1 PolyFill ! 2293 532 M ! 0 1432 V ! 141 0 V ! 0 -1432 V % End plot #18 % Begin plot #19 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2293 532 M ! 0 1432 V ! 141 0 V ! 0 -1432 V ! -141 0 V % End plot #19 % Begin plot #20 stroke 1.000 UL LT1 ! 0.00 0.00 0.50 C gsave 2434 532 N 0 0 V 0 1907 V 142 0 V 0 -1907 V 1 PolyFill ! 2434 532 M ! 0 1907 V ! 142 0 V ! 0 -1907 V % End plot #20 % Begin plot #21 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2434 532 M ! 0 1907 V ! 142 0 V ! 0 -1907 V ! -142 0 V % End plot #21 % Begin plot #22 stroke 1.000 UL LT3 ! 0.00 0.00 0.50 C gsave 2576 532 N 0 0 V 0 2354 V 141 0 V 0 -2354 V 1 PolyFill ! 2576 532 M ! 0 2354 V ! 141 0 V ! 0 -2354 V % End plot #22 % Begin plot #23 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2576 532 M ! 0 2354 V ! 141 0 V ! 0 -2354 V ! -141 0 V % End plot #23 % Begin plot #24 stroke 1.000 UL LT5 ! 0.00 0.00 0.50 C gsave 2717 532 N 0 0 V 0 2686 V 142 0 V 0 -2686 V 1 PolyFill ! 2717 532 M ! 0 2686 V ! 142 0 V ! 0 -2686 V % End plot #24 % Begin plot #25 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2717 532 M ! 0 2686 V ! 142 0 V ! 0 -2686 V ! -142 0 V % End plot #25 % Begin plot #26 stroke 1.000 UL LT7 ! 0.00 0.00 0.50 C gsave 2859 532 N 0 0 V 0 3201 V 141 0 V 0 -3201 V 1 PolyFill ! 2859 532 M ! 0 3201 V ! 141 0 V ! 0 -3201 V % End plot #26 % Begin plot #27 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2859 532 M ! 0 3201 V ! 141 0 V ! 0 -3201 V ! -141 0 V % End plot #27 % Begin plot #28 stroke 1.000 UL LT0 ! 0.00 0.00 0.50 C gsave 3000 532 N 0 0 V 0 3529 V 141 0 V 0 -3529 V 1 PolyFill ! 3000 532 M ! 0 3529 V ! 141 0 V ! 0 -3529 V % End plot #28 % Begin plot #29 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3000 532 M ! 0 3529 V ! 141 0 V ! 0 -3529 V ! -141 0 V % End plot #29 % Begin plot #30 stroke 1.000 UL LT2 ! 0.00 0.00 0.50 C gsave 3141 532 N 0 0 V 0 3365 V 142 0 V 0 -3365 V 1 PolyFill ! 3141 532 M ! 0 3365 V ! 142 0 V ! 0 -3365 V % End plot #30 % Begin plot #31 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3141 532 M ! 0 3365 V ! 142 0 V ! 0 -3365 V ! -142 0 V % End plot #31 % Begin plot #32 stroke 1.000 UL LT4 ! 0.00 0.00 0.50 C gsave 3283 532 N 0 0 V 0 3068 V 141 0 V 0 -3068 V 1 PolyFill ! 3283 532 M ! 0 3068 V ! 141 0 V ! 0 -3068 V % End plot #32 % Begin plot #33 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3283 532 M ! 0 3068 V ! 141 0 V ! 0 -3068 V ! -141 0 V % End plot #33 % Begin plot #34 stroke 1.000 UL LT6 ! 0.00 0.00 0.50 C gsave 3424 532 N 0 0 V 0 2768 V 141 0 V 0 -2768 V 1 PolyFill ! 3424 532 M ! 0 2768 V ! 141 0 V ! 0 -2768 V % End plot #34 % Begin plot #35 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3424 532 M ! 0 2768 V ! 141 0 V ! 0 -2768 V ! -141 0 V % End plot #35 % Begin plot #36 stroke 1.000 UL LT8 ! 0.00 0.00 0.50 C gsave 3565 532 N 0 0 V 0 2317 V 142 0 V 0 -2317 V 1 PolyFill ! 3565 532 M ! 0 2317 V ! 142 0 V ! 0 -2317 V % End plot #36 % Begin plot #37 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3565 532 M ! 0 2317 V ! 142 0 V ! 0 -2317 V ! -142 0 V % End plot #37 % Begin plot #38 stroke 1.000 UL LT1 ! 0.00 0.00 0.50 C gsave 3707 532 N 0 0 V 0 1852 V 141 0 V 0 -1852 V 1 PolyFill ! 3707 532 M ! 0 1852 V ! 141 0 V ! 0 -1852 V % End plot #38 % Begin plot #39 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3707 532 M ! 0 1852 V ! 141 0 V ! 0 -1852 V ! -141 0 V % End plot #39 % Begin plot #40 stroke 1.000 UL LT3 ! 0.00 0.00 0.50 C gsave 3848 532 N 0 0 V 0 1251 V 141 0 V 0 -1251 V 1 PolyFill ! 3848 532 M ! 0 1251 V ! 141 0 V ! 0 -1251 V % End plot #40 % Begin plot #41 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3848 532 M ! 0 1251 V ! 141 0 V ! 0 -1251 V ! -141 0 V % End plot #41 % Begin plot #42 stroke 1.000 UL LT5 ! 0.00 0.00 0.50 C gsave 3989 532 N 0 0 V 0 905 V 142 0 V 0 -905 V 1 PolyFill ! 3989 532 M ! 0 905 V ! 142 0 V ! 0 -905 V % End plot #42 % Begin plot #43 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3989 532 M ! 0 905 V ! 142 0 V ! 0 -905 V ! -142 0 V % End plot #43 % Begin plot #44 stroke 1.000 UL LT7 ! 0.00 0.00 0.50 C gsave 4131 532 N 0 0 V 0 526 V 141 0 V 0 -526 V 1 PolyFill ! 4131 532 M ! 0 526 V ! 141 0 V ! 0 -526 V % End plot #44 % Begin plot #45 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4131 532 M ! 0 526 V ! 141 0 V ! 0 -526 V ! -141 0 V % End plot #45 % Begin plot #46 stroke 1.000 UL LT0 ! 0.00 0.00 0.50 C gsave 4272 532 N 0 0 V 0 338 V 142 0 V 0 -338 V 1 PolyFill ! 4272 532 M ! 0 338 V ! 142 0 V ! 0 -338 V % End plot #46 % Begin plot #47 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4272 532 M ! 0 338 V ! 142 0 V ! 0 -338 V ! -142 0 V % End plot #47 % Begin plot #48 stroke 1.000 UL LT2 ! 0.00 0.00 0.50 C gsave 4414 532 N 0 0 V 0 185 V 141 0 V 0 -185 V 1 PolyFill ! 4414 532 M ! 0 185 V ! 141 0 V ! 0 -185 V % End plot #48 % Begin plot #49 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4414 532 M ! 0 185 V ! 141 0 V ! 0 -185 V ! -141 0 V % End plot #49 % Begin plot #50 stroke 1.000 UL LT4 ! 0.00 0.00 0.50 C gsave 4555 532 N 0 0 V 0 130 V 141 0 V 0 -130 V 1 PolyFill ! 4555 532 M ! 0 130 V ! 141 0 V ! 0 -130 V % End plot #50 % Begin plot #51 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4555 532 M ! 0 130 V ! 141 0 V ! 0 -130 V ! -141 0 V % End plot #51 % Begin plot #52 stroke 1.000 UL LT6 ! 0.00 0.00 0.50 C gsave 4696 532 N 0 0 V 0 72 V 142 0 V 0 -72 V 1 PolyFill ! 4696 532 M ! 0 72 V ! 142 0 V ! 0 -72 V % End plot #52 % Begin plot #53 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4696 532 M ! 0 72 V ! 142 0 V ! 0 -72 V ! -142 0 V % End plot #53 % Begin plot #54 stroke 1.000 UL LT8 ! 0.00 0.00 0.50 C gsave 4838 532 N 0 0 V 0 24 V 141 0 V 0 -24 V 1 PolyFill ! 4838 532 M ! 0 24 V ! 141 0 V ! 0 -24 V % End plot #54 % Begin plot #55 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4838 532 M ! 0 24 V ! 141 0 V ! 0 -24 V ! -141 0 V % End plot #55 % Begin plot #56 stroke 1.000 UL LT1 ! 0.00 0.00 0.50 C gsave 4979 532 N 0 0 V 0 0 V 141 0 V 0 0 V 1 PolyFill ! 4979 532 M ! 141 0 V % End plot #56 % Begin plot #57 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4979 532 M ! 141 0 V ! -141 0 V % End plot #57 % Begin plot #58 stroke 1.000 UL LT3 ! 0.00 0.00 0.50 C gsave 5120 532 N 0 0 V 0 3 V 142 0 V 0 -3 V 1 PolyFill ! 5120 532 M ! 0 3 V ! 142 0 V ! 0 -3 V % End plot #58 % Begin plot #59 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 5120 532 M ! 0 3 V ! 142 0 V ! 0 -3 V ! -142 0 V % End plot #59 % Begin plot #60 stroke 1.000 UL LT5 ! 0.00 0.00 0.50 C gsave 5262 532 N 0 0 V 0 3 V 141 0 V 0 -3 V 1 PolyFill ! 5262 532 M ! 0 3 V ! 141 0 V ! 0 -3 V % End plot #60 % Begin plot #61 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 5262 532 M ! 0 3 V ! 141 0 V ! 0 -3 V ! -141 0 V % End plot #61 stroke LTb --- 704,1296 ---- stroke 1.000 UL LT1 ! 0.00 0.00 0.50 C gsave 1744 532 N 0 0 V 0 3 V 131 0 V 0 -3 V 1 PolyFill ! 1744 532 M 0 3 V ! 131 0 V 0 -3 V % End plot #2 % Begin plot #3 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 1744 532 M 0 3 V ! 131 0 V 0 -3 V ! -131 0 V % End plot #3 % Begin plot #4 stroke 1.000 UL LT3 ! 0.00 0.00 0.50 C gsave 1875 532 N 0 0 V 0 0 V 131 0 V 0 0 V 1 PolyFill ! 1875 532 M ! 131 0 V % End plot #4 % Begin plot #5 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 1875 532 M ! 131 0 V ! -131 0 V % End plot #5 % Begin plot #6 stroke 1.000 UL LT5 ! 0.00 0.00 0.50 C gsave 2006 532 N 0 0 V 0 3 V 132 0 V 0 -3 V 1 PolyFill ! 2006 532 M ! 0 3 V ! 132 0 V ! 0 -3 V % End plot #6 % Begin plot #7 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2006 532 M ! 0 3 V ! 132 0 V ! 0 -3 V ! -132 0 V % End plot #7 % Begin plot #8 stroke 1.000 UL LT7 ! 0.00 0.00 0.50 C gsave 2138 532 N 0 0 V 0 31 V 131 0 V 0 -31 V 1 PolyFill ! 2138 532 M ! 0 31 V ! 131 0 V ! 0 -31 V % End plot #8 % Begin plot #9 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2138 532 M ! 0 31 V ! 131 0 V ! 0 -31 V ! -131 0 V % End plot #9 % Begin plot #10 stroke 1.000 UL LT0 ! 0.00 0.00 0.50 C gsave 2269 532 N 0 0 V 0 62 V 131 0 V 0 -62 V 1 PolyFill ! 2269 532 M ! 0 62 V ! 131 0 V ! 0 -62 V % End plot #10 % Begin plot #11 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2269 532 M ! 0 62 V ! 131 0 V ! 0 -62 V ! -131 0 V % End plot #11 % Begin plot #12 stroke 1.000 UL LT2 ! 0.00 0.00 0.50 C gsave 2400 532 N 0 0 V 0 140 V 131 0 V 0 -140 V 1 PolyFill ! 2400 532 M ! 0 140 V ! 131 0 V ! 0 -140 V % End plot #12 % Begin plot #13 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2400 532 M ! 0 140 V ! 131 0 V ! 0 -140 V ! -131 0 V % End plot #13 % Begin plot #14 stroke 1.000 UL LT4 ! 0.00 0.00 0.50 C gsave 2531 532 N 0 0 V 0 215 V 132 0 V 0 -215 V 1 PolyFill ! 2531 532 M ! 0 215 V ! 132 0 V ! 0 -215 V % End plot #14 % Begin plot #15 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2531 532 M ! 0 215 V ! 132 0 V ! 0 -215 V ! -132 0 V % End plot #15 % Begin plot #16 stroke 1.000 UL LT6 ! 0.00 0.00 0.50 C gsave 2663 532 N 0 0 V 0 461 V 131 0 V 0 -461 V 1 PolyFill ! 2663 532 M ! 0 461 V ! 131 0 V ! 0 -461 V % End plot #16 % Begin plot #17 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2663 532 M ! 0 461 V ! 131 0 V ! 0 -461 V ! -131 0 V % End plot #17 % Begin plot #18 stroke 1.000 UL LT8 ! 0.00 0.00 0.50 C gsave 2794 532 N 0 0 V 0 844 V 131 0 V 0 -844 V 1 PolyFill ! 2794 532 M ! 0 844 V ! 131 0 V ! 0 -844 V % End plot #18 % Begin plot #19 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2794 532 M ! 0 844 V ! 131 0 V ! 0 -844 V ! -131 0 V % End plot #19 % Begin plot #20 stroke 1.000 UL LT1 ! 0.00 0.00 0.50 C gsave 2925 532 N 0 0 V 0 1141 V 131 0 V 0 -1141 V 1 PolyFill ! 2925 532 M ! 0 1141 V ! 131 0 V ! 0 -1141 V % End plot #20 % Begin plot #21 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 2925 532 M ! 0 1141 V ! 131 0 V ! 0 -1141 V ! -131 0 V % End plot #21 % Begin plot #22 stroke 1.000 UL LT3 ! 0.00 0.00 0.50 C gsave 3056 532 N 0 0 V 0 1777 V 132 0 V 0 -1777 V 1 PolyFill ! 3056 532 M ! 0 1777 V ! 132 0 V ! 0 -1777 V % End plot #22 % Begin plot #23 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3056 532 M ! 0 1777 V ! 132 0 V ! 0 -1777 V ! -132 0 V % End plot #23 % Begin plot #24 stroke 1.000 UL LT5 ! 0.00 0.00 0.50 C gsave 3188 532 N 0 0 V 0 2504 V 131 0 V 0 -2504 V 1 PolyFill ! 3188 532 M ! 0 2504 V ! 131 0 V ! 0 -2504 V % End plot #24 % Begin plot #25 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3188 532 M ! 0 2504 V ! 131 0 V ! 0 -2504 V ! -131 0 V % End plot #25 % Begin plot #26 stroke 1.000 UL LT7 ! 0.00 0.00 0.50 C gsave 3319 532 N 0 0 V 0 3058 V 131 0 V 0 -3058 V 1 PolyFill ! 3319 532 M ! 0 3058 V ! 131 0 V ! 0 -3058 V % End plot #26 % Begin plot #27 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3319 532 M ! 0 3058 V ! 131 0 V ! 0 -3058 V ! -131 0 V % End plot #27 % Begin plot #28 stroke 1.000 UL LT0 ! 0.00 0.00 0.50 C gsave 3450 532 N 0 0 V 0 3488 V 131 0 V 0 -3488 V 1 PolyFill ! 3450 532 M ! 0 3488 V ! 131 0 V ! 0 -3488 V % End plot #28 % Begin plot #29 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3450 532 M ! 0 3488 V ! 131 0 V ! 0 -3488 V ! -131 0 V % End plot #29 % Begin plot #30 stroke 1.000 UL LT2 ! 0.00 0.00 0.50 C gsave 3581 532 N 0 0 V 0 3888 V 132 0 V 0 -3888 V 1 PolyFill ! 3581 532 M ! 0 3888 V ! 132 0 V ! 0 -3888 V % End plot #30 % Begin plot #31 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3581 532 M ! 0 3888 V ! 132 0 V ! 0 -3888 V ! -132 0 V % End plot #31 % Begin plot #32 stroke 1.000 UL LT4 ! 0.00 0.00 0.50 C gsave 3713 532 N 0 0 V 0 3752 V 131 0 V 0 -3752 V 1 PolyFill ! 3713 532 M ! 0 3752 V ! 131 0 V ! 0 -3752 V % End plot #32 % Begin plot #33 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3713 532 M ! 0 3752 V ! 131 0 V ! 0 -3752 V ! -131 0 V % End plot #33 % Begin plot #34 stroke 1.000 UL LT6 ! 0.00 0.00 0.50 C gsave 3844 532 N 0 0 V 0 3553 V 131 0 V 0 -3553 V 1 PolyFill ! 3844 532 M ! 0 3553 V ! 131 0 V ! 0 -3553 V % End plot #34 % Begin plot #35 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3844 532 M ! 0 3553 V ! 131 0 V ! 0 -3553 V ! -131 0 V % End plot #35 % Begin plot #36 stroke 1.000 UL LT8 ! 0.00 0.00 0.50 C gsave 3975 532 N 0 0 V 0 2791 V 131 0 V 0 -2791 V 1 PolyFill ! 3975 532 M ! 0 2791 V ! 131 0 V ! 0 -2791 V % End plot #36 % Begin plot #37 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 3975 532 M ! 0 2791 V ! 131 0 V ! 0 -2791 V ! -131 0 V % End plot #37 % Begin plot #38 stroke 1.000 UL LT1 ! 0.00 0.00 0.50 C gsave 4106 532 N 0 0 V 0 2238 V 132 0 V 0 -2238 V 1 PolyFill ! 4106 532 M ! 0 2238 V ! 132 0 V ! 0 -2238 V % End plot #38 % Begin plot #39 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4106 532 M ! 0 2238 V ! 132 0 V ! 0 -2238 V ! -132 0 V % End plot #39 % Begin plot #40 stroke 1.000 UL LT3 ! 0.00 0.00 0.50 C gsave 4238 532 N 0 0 V 0 1705 V 131 0 V 0 -1705 V 1 PolyFill ! 4238 532 M ! 0 1705 V ! 131 0 V ! 0 -1705 V % End plot #40 % Begin plot #41 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4238 532 M ! 0 1705 V ! 131 0 V ! 0 -1705 V ! -131 0 V % End plot #41 % Begin plot #42 stroke 1.000 UL LT5 ! 0.00 0.00 0.50 C gsave 4369 532 N 0 0 V 0 1090 V 131 0 V 0 -1090 V 1 PolyFill ! 4369 532 M ! 0 1090 V ! 131 0 V ! 0 -1090 V % End plot #42 % Begin plot #43 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4369 532 M ! 0 1090 V ! 131 0 V ! 0 -1090 V ! -131 0 V % End plot #43 % Begin plot #44 stroke 1.000 UL LT7 ! 0.00 0.00 0.50 C gsave 4500 532 N 0 0 V 0 639 V 131 0 V 0 -639 V 1 PolyFill ! 4500 532 M ! 0 639 V ! 131 0 V ! 0 -639 V % End plot #44 % Begin plot #45 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4500 532 M ! 0 639 V ! 131 0 V ! 0 -639 V ! -131 0 V % End plot #45 % Begin plot #46 stroke 1.000 UL LT0 ! 0.00 0.00 0.50 C gsave 4631 532 N 0 0 V 0 369 V 132 0 V 0 -369 V 1 PolyFill ! 4631 532 M ! 0 369 V ! 132 0 V ! 0 -369 V % End plot #46 % Begin plot #47 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4631 532 M ! 0 369 V ! 132 0 V ! 0 -369 V ! -132 0 V % End plot #47 % Begin plot #48 stroke 1.000 UL LT2 ! 0.00 0.00 0.50 C gsave 4763 532 N 0 0 V 0 205 V 131 0 V 0 -205 V 1 PolyFill ! 4763 532 M ! 0 205 V ! 131 0 V ! 0 -205 V % End plot #48 % Begin plot #49 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4763 532 M ! 0 205 V ! 131 0 V ! 0 -205 V ! -131 0 V % End plot #49 % Begin plot #50 stroke 1.000 UL LT4 ! 0.00 0.00 0.50 C gsave 4894 532 N 0 0 V 0 113 V 131 0 V 0 -113 V 1 PolyFill ! 4894 532 M ! 0 113 V ! 131 0 V ! 0 -113 V % End plot #50 % Begin plot #51 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 4894 532 M ! 0 113 V ! 131 0 V ! 0 -113 V ! -131 0 V % End plot #51 % Begin plot #52 stroke 1.000 UL LT6 ! 0.00 0.00 0.50 C gsave 5025 532 N 0 0 V 0 41 V 131 0 V 0 -41 V 1 PolyFill ! 5025 532 M ! 0 41 V ! 131 0 V ! 0 -41 V % End plot #52 % Begin plot #53 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 5025 532 M ! 0 41 V ! 131 0 V ! 0 -41 V ! -131 0 V % End plot #53 % Begin plot #54 stroke 1.000 UL LT8 ! 0.00 0.00 0.50 C gsave 5156 532 N 0 0 V 0 27 V 132 0 V 0 -27 V 1 PolyFill ! 5156 532 M ! 0 27 V ! 132 0 V ! 0 -27 V % End plot #54 % Begin plot #55 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 5156 532 M ! 0 27 V ! 132 0 V ! 0 -27 V ! -132 0 V % End plot #55 % Begin plot #56 stroke 1.000 UL LT1 ! 0.00 0.00 0.50 C gsave 5288 532 N 0 0 V 0 21 V 131 0 V 0 -21 V 1 PolyFill ! 5288 532 M ! 0 21 V ! 131 0 V ! 0 -21 V % End plot #56 % Begin plot #57 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 5288 532 M ! 0 21 V ! 131 0 V ! 0 -21 V ! -131 0 V % End plot #57 % Begin plot #58 stroke 1.000 UL LT3 ! 0.00 0.00 0.50 C gsave 5419 532 N 0 0 V 0 0 V 131 0 V 0 0 V 1 PolyFill ! 5419 532 M ! 131 0 V % End plot #58 % Begin plot #59 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 5419 532 M ! 131 0 V ! -131 0 V % End plot #59 % Begin plot #60 stroke 1.000 UL LT5 ! 0.00 0.00 0.50 C gsave 5550 532 N 0 0 V 0 7 V 131 0 V 0 -7 V 1 PolyFill ! 5550 532 M ! 0 7 V ! 131 0 V ! 0 -7 V % End plot #60 % Begin plot #61 stroke 0.500 UL LT0 ! 0.00 0.00 0.00 C 5550 532 M ! 0 7 V ! 131 0 V ! 0 -7 V ! -131 0 V % End plot #61 stroke LTb Files octave-3.2.0/doc/interpreter/hist.pdf and octave-3.2.2/doc/interpreter/hist.pdf differ Files octave-3.2.0/doc/interpreter/hist.png and octave-3.2.2/doc/interpreter/hist.png differ Files octave-3.2.0/doc/interpreter/HTML/errorbar.png and octave-3.2.2/doc/interpreter/HTML/errorbar.png differ Files octave-3.2.0/doc/interpreter/HTML/hist.png and octave-3.2.2/doc/interpreter/HTML/hist.png differ Files octave-3.2.0/doc/interpreter/HTML/interpft.png and octave-3.2.2/doc/interpreter/HTML/interpft.png differ Files octave-3.2.0/doc/interpreter/HTML/mesh.png and octave-3.2.2/doc/interpreter/HTML/mesh.png differ diff -cNr octave-3.2.0/doc/interpreter/interpderiv1.eps octave-3.2.2/doc/interpreter/interpderiv1.eps *** octave-3.2.0/doc/interpreter/interpderiv1.eps 2009-05-25 08:46:59.000000000 +0200 --- octave-3.2.2/doc/interpreter/interpderiv1.eps 2009-06-08 07:38:54.000000000 +0200 *************** *** 1,7 **** %!PS-Adobe-2.0 EPSF-2.0 %%Title: interpderiv1.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon May 25 08:46:59 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 625 481 %%EndComments --- 1,7 ---- %!PS-Adobe-2.0 EPSF-2.0 %%Title: interpderiv1.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon Jun 8 07:38:54 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 625 481 %%EndComments *************** *** 50,56 **** /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon May 25 08:46:59 2009) /DOCINFO pdfmark end } ifelse --- 50,56 ---- /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon Jun 8 07:38:54 2009) /DOCINFO pdfmark end } ifelse Files octave-3.2.0/doc/interpreter/interpderiv1.pdf and octave-3.2.2/doc/interpreter/interpderiv1.pdf differ diff -cNr octave-3.2.0/doc/interpreter/interpderiv2.eps octave-3.2.2/doc/interpreter/interpderiv2.eps *** octave-3.2.0/doc/interpreter/interpderiv2.eps 2009-05-25 08:47:00.000000000 +0200 --- octave-3.2.2/doc/interpreter/interpderiv2.eps 2009-06-08 07:38:54.000000000 +0200 *************** *** 1,7 **** %!PS-Adobe-2.0 EPSF-2.0 %%Title: interpderiv2.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon May 25 08:46:59 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 625 481 %%EndComments --- 1,7 ---- %!PS-Adobe-2.0 EPSF-2.0 %%Title: interpderiv2.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon Jun 8 07:38:54 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 625 481 %%EndComments *************** *** 50,56 **** /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon May 25 08:46:59 2009) /DOCINFO pdfmark end } ifelse --- 50,56 ---- /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon Jun 8 07:38:54 2009) /DOCINFO pdfmark end } ifelse Files octave-3.2.0/doc/interpreter/interpderiv2.pdf and octave-3.2.2/doc/interpreter/interpderiv2.pdf differ diff -cNr octave-3.2.0/doc/interpreter/interpft.eps octave-3.2.2/doc/interpreter/interpft.eps *** octave-3.2.0/doc/interpreter/interpft.eps 2009-05-25 08:46:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/interpft.eps 2009-06-08 07:38:54.000000000 +0200 *************** *** 1,7 **** %!PS-Adobe-2.0 EPSF-2.0 %%Title: interpft.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon May 25 08:46:58 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 625 481 %%EndComments --- 1,7 ---- %!PS-Adobe-2.0 EPSF-2.0 %%Title: interpft.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon Jun 8 07:38:54 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 625 481 %%EndComments *************** *** 50,56 **** /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon May 25 08:46:58 2009) /DOCINFO pdfmark end } ifelse --- 50,56 ---- /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon Jun 8 07:38:54 2009) /DOCINFO pdfmark end } ifelse *************** *** 699,705 **** LT0 0.00 1.00 0.00 C LCb setrgbcolor 9745 7829 M ! [ [(Helvetica) 120.0 0.0 true true 0 (sin\(4t+0.3\)cos\(3t-0.1)] ] -40.0 MRshow LT0 0.00 1.00 0.00 C 9829 7829 M --- 699,705 ---- LT0 0.00 1.00 0.00 C LCb setrgbcolor 9745 7829 M ! [ [(Helvetica) 120.0 0.0 true true 0 (sin\(4t+0.3\)cos\(3t-0.1\))] ] -40.0 MRshow LT0 0.00 1.00 0.00 C 9829 7829 M Files octave-3.2.0/doc/interpreter/interpft.pdf and octave-3.2.2/doc/interpreter/interpft.pdf differ Files octave-3.2.0/doc/interpreter/interpft.png and octave-3.2.2/doc/interpreter/interpft.png differ diff -cNr octave-3.2.0/doc/interpreter/interpimages.m octave-3.2.2/doc/interpreter/interpimages.m *** octave-3.2.0/doc/interpreter/interpimages.m 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/interpimages.m 2009-06-08 07:34:31.000000000 +0200 *************** *** 31,37 **** yp = sin (4*ti + 0.3) .* cos (3*ti - 0.1); plot (ti, yp, 'g', ti, interp1(t, y, ti, 'spline'), 'b', ... ti, interpft (y, k), 'c', t, y, 'r+'); ! legend ('sin(4t+0.3)cos(3t-0.1','spline','interpft','data'); print (cstrcat (nm, ".", typ), cstrcat ("-d", typ)) elseif (strcmp (nm, "interpn")) x = y = z = -1:1; --- 31,37 ---- yp = sin (4*ti + 0.3) .* cos (3*ti - 0.1); plot (ti, yp, 'g', ti, interp1(t, y, ti, 'spline'), 'b', ... ti, interpft (y, k), 'c', t, y, 'r+'); ! legend ('sin(4t+0.3)cos(3t-0.1)','spline','interpft','data'); print (cstrcat (nm, ".", typ), cstrcat ("-d", typ)) elseif (strcmp (nm, "interpn")) x = y = z = -1:1; diff -cNr octave-3.2.0/doc/interpreter/interpn.eps octave-3.2.2/doc/interpreter/interpn.eps *** octave-3.2.0/doc/interpreter/interpn.eps 2009-05-25 08:46:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/interpn.eps 2009-06-08 07:38:54.000000000 +0200 *************** *** 1,7 **** %!PS-Adobe-2.0 EPSF-2.0 %%Title: interpn.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon May 25 08:46:58 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 625 481 %%EndComments --- 1,7 ---- %!PS-Adobe-2.0 EPSF-2.0 %%Title: interpn.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon Jun 8 07:38:54 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 625 481 %%EndComments *************** *** 50,56 **** /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon May 25 08:46:58 2009) /DOCINFO pdfmark end } ifelse --- 50,56 ---- /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon Jun 8 07:38:54 2009) /DOCINFO pdfmark end } ifelse Files octave-3.2.0/doc/interpreter/interpn.pdf and octave-3.2.2/doc/interpreter/interpn.pdf differ diff -cNr octave-3.2.0/doc/interpreter/io.texi octave-3.2.2/doc/interpreter/io.texi *** octave-3.2.0/doc/interpreter/io.texi 2009-06-03 14:36:34.000000000 +0200 --- octave-3.2.2/doc/interpreter/io.texi 2009-07-21 07:11:10.000000000 +0200 *************** *** 92,139 **** @c pr-output.cc @anchor{doc-format} ! @deffn {Command} format options ! Control the format of the output produced by @code{disp} and Octave's ! normal echoing mechanism. Valid options are listed in the following table. @table @code @item short ! Octave will try to print numbers with at ! least 5 significant figures within a field that is a maximum of 10 ! characters wide (not counting additional spacing that is added between ! columns of a matrix). If Octave is unable to format a matrix so that columns line up on the ! decimal point and all the numbers fit within the maximum field width, ! it switches to an @samp{e} format. @item long ! Octave will try to print numbers with at least 15 significant figures ! within a field that is a maximum of 20 characters wide (not counting ! additional spacing that is added between columns of a matrix). ! ! As will the @samp{short} format, Octave will switch to an @samp{e} ! format if it is unable to format a matrix so that columns line up on the ! decimal point and all the numbers fit within the maximum field width. ! ! @item long e ! @itemx short e ! The same as @samp{format long} or @samp{format short} but always display ! output with an @samp{e} format. For example, with the @samp{short e} ! format, @code{pi} is displayed as @code{3.14e+00}. ! ! @item long E ! @itemx short E ! The same as @samp{format long e} or @samp{format short e} but always ! display output with an uppercase @samp{E} format. For example, with ! the @samp{long E} format, @code{pi} is displayed as @code{3.14159265358979E+00}. ! @item long g ! @itemx short g ! Choose between normal @samp{long} (or @samp{short}) and ! @samp{long e} (or @samp{short e}) formats based on the magnitude ! of the number. For example, with the @samp{short g} format, @code{pi .^ [2; 4; 8; 16; 32]} is displayed as @example --- 92,150 ---- @c pr-output.cc @anchor{doc-format} ! @deffn {Command} format ! @deffnx {Command} format options ! Reset or specify the format of the output produced by @code{disp} and ! Octave's normal echoing mechanism. This command only affects the display ! of numbers but not how they are stored or computed. To change the internal ! representation from the default double use one of the conversion functions ! such as @code{single}, @code{uint8}, @code{int64}, etc. ! ! By default, Octave displays 5 significant digits in a human readable form ! (option @samp{short} paired with @samp{loose} format for matrices). ! If @code{format} is invoked without any options, this default format ! is restored. ! ! Valid formats for floating point numbers are listed in the following table. @table @code @item short ! Fixed point format with 5 significant figures in a field that is a maximum ! of 10 characters wide. (default). If Octave is unable to format a matrix so that columns line up on the ! decimal point and all numbers fit within the maximum field width then ! it switches to an exponential @samp{e} format. @item long ! Fixed point format with 15 significant figures in a field that is a maximum ! of 20 characters wide. ! ! As with the @samp{short} format, Octave will switch to an exponential ! @samp{e} format if it is unable to format a matrix properly using the ! current format. ! ! @item short e ! @itemx long e ! Exponential format. The number to be represented is split between a mantissa ! and an exponent (power of 10). The mantissa has 5 significant digits in the ! short format and 15 digits in the long format. ! For example, with the @samp{short e} format, @code{pi} is displayed as ! @code{3.1416e+00}. ! ! @item short E ! @itemx long E ! Identical to @samp{short e} or @samp{long e} but displays an uppercase ! @samp{E} to indicate the exponent. ! For example, with the @samp{long E} format, @code{pi} is displayed as @code{3.14159265358979E+00}. ! ! @item short g ! @itemx long g ! Optimally choose between fixed point and exponential format based on ! the magnitude of the number. ! For example, with the @samp{short g} format, @code{pi .^ [2; 4; 8; 16; 32]} is displayed as @example *************** *** 150,189 **** @item long G @itemx short G ! The same as @samp{format long g} or @samp{format short g} but use an ! uppercase @samp{E} format. For example, with the @samp{short G} format, ! @code{pi .^ [2; 4; 8; 16; 32]} is displayed as ! ! @example ! @group ! ans = ! ! 9.8696 ! 97.409 ! 9488.5 ! 9.0032E+07 ! 8.1058E+15 ! @end group ! @end example @item free @itemx none Print output in free format, without trying to line up columns of matrices on the decimal point. This also causes complex numbers to be ! formatted like this @samp{(0.604194, 0.607088)} instead of like this ! @samp{0.60419 + 0.60709i}. ! @item bank ! Print in a fixed format with two places to the right of the decimal ! point. ! @item + @itemx + @var{chars} @itemx plus @itemx plus @var{chars} Print a @samp{+} symbol for nonzero matrix elements and a space for zero matrix elements. This format can be very useful for examining the ! structure of a large matrix. The optional argument @var{chars} specifies a list of 3 characters to use for printing values greater than zero, less than zero and equal to zero. --- 161,188 ---- @item long G @itemx short G ! Identical to @samp{short g} or @samp{long g} but displays an uppercase ! @samp{E} to indicate the exponent. @item free @itemx none Print output in free format, without trying to line up columns of matrices on the decimal point. This also causes complex numbers to be ! formatted as numeric pairs like this @samp{(0.60419, 0.60709)} instead ! of like this @samp{0.60419 + 0.60709i}. ! @end table ! The following formats affect all numeric output (floating point and ! integer types). ! @table @code ! @item + @itemx + @var{chars} @itemx plus @itemx plus @var{chars} Print a @samp{+} symbol for nonzero matrix elements and a space for zero matrix elements. This format can be very useful for examining the ! structure of a large sparse matrix. The optional argument @var{chars} specifies a list of 3 characters to use for printing values greater than zero, less than zero and equal to zero. *************** *** 199,210 **** @end group @end example ! @itemx native-hex ! Print the hexadecimal representation numbers as they are stored in memory. For example, on a workstation which stores 8 byte real values in IEEE format with the least significant byte first, the value of ! @code{pi} when printed in @code{hex} format is @code{400921fb54442d18}. ! This format only works for numeric values. @item hex The same as @code{native-hex}, but always print the most significant --- 198,212 ---- @end group @end example ! @item bank ! Print in a fixed format with two digits to the right of the decimal ! point. ! ! @item native-hex ! Print the hexadecimal representation of numbers as they are stored in memory. For example, on a workstation which stores 8 byte real values in IEEE format with the least significant byte first, the value of ! @code{pi} when printed in @code{native-hex} format is @code{400921fb54442d18}. @item hex The same as @code{native-hex}, but always print the most significant *************** *** 221,251 **** @end example (shown here in two 32 bit sections for typesetting purposes) when ! printed in bit format on a workstation which stores 8 byte real values ! in IEEE format with the least significant byte first. This format only ! works for numeric types. @item bit The same as @code{native-bit}, but always print the most significant bits first. ! @item compact ! Remove extra blank space around column number labels. ! @item loose ! Insert blank lines above and below column number labels (this is the ! default). @item rat ! Print a rational approximation. That is the values are approximated ! by one small integer divided by another. @end table ! By default, Octave will try to print numbers with at least 5 significant ! figures within a field that is a maximum of 10 characters wide. ! ! If Octave is unable to format a matrix so that columns line up on the ! decimal point and all the numbers fit within the maximum field width, ! it switches to an @samp{e} format. ! If @code{format} is invoked without any options, the default format ! state is restored. @end deffn --- 223,251 ---- @end example (shown here in two 32 bit sections for typesetting purposes) when ! printed in native-bit format on a workstation which stores 8 byte real values ! in IEEE format with the least significant byte first. @item bit The same as @code{native-bit}, but always print the most significant bits first. ! @item rat ! Print a rational approximation, i.e., values are approximated ! as the ratio of small integers. ! For example, with the @samp{rat} format, ! @code{pi} is displayed as @code{355/113}. @end table ! The following two options affect the display of all matrices. ! @table @code ! @item compact ! Remove extra blank space around column number labels producing more compact ! output with more data per page. ! @item loose ! Insert blank lines above and below column number labels to produce a more ! readable output with less data per page. (default). ! @end table @end deffn *************** *** 491,504 **** @c load-save.cc @anchor{doc-save} ! @deffn {Command} save options file @var{v1} @var{v2} @dots{} ! @deffnx {Command} save options file -struct @var{STR} @var{f1} @var{f2} @dots{} Save the named variables @var{v1}, @var{v2}, @dots{}, in the file ! @var{file}. The special filename @samp{-} may be used to write the ! output to your terminal. If no variable names are listed, Octave saves ! all the variables in the current scope. If the @code{-struct} modifier is used, fields @var{f1} @var{f2} @dots{} ! of the scalar structure @var{STR} are saved as if they were variables with corresponding names. Valid options for the @code{save} command are listed in the following table. Options that modify the output format override the format specified by --- 491,507 ---- @c load-save.cc @anchor{doc-save} ! @deffn {Command} save file ! @deffnx {Command} save options file ! @deffnx {Command} save options file @var{v1} @var{v2} @dots{} ! @deffnx {Command} save options file -struct @var{STRUCT} @var{f1} @var{f2} @dots{} Save the named variables @var{v1}, @var{v2}, @dots{}, in the file ! @var{file}. The special filename @samp{-} may be used to write ! output to the terminal. If no variable names are listed, Octave saves ! all the variables in the current scope. Otherwise, full variable names or ! pattern syntax can be used to specify the variables to save. If the @code{-struct} modifier is used, fields @var{f1} @var{f2} @dots{} ! of the scalar structure @var{STRUCT} are saved as if they were variables with corresponding names. Valid options for the @code{save} command are listed in the following table. Options that modify the output format override the format specified by *************** *** 516,529 **** @table @code @item -ascii ! Save a single matrix in a text file. @item -binary Save the data in Octave's binary data format. @item -float-binary Save the data in Octave's binary data format but only using single ! precision. You should use this format only if you know that all the values to be saved can be represented in single precision. @item -V7 --- 519,542 ---- @table @code @item -ascii ! Save a single matrix in a text file without header or any other information. @item -binary Save the data in Octave's binary data format. @item -float-binary Save the data in Octave's binary data format but only using single ! precision. Only use this format if you know that all the ! values to be saved can be represented in single precision. ! ! @item -hdf5 ! Save the data in HDF5 format. ! (HDF5 is a free, portable binary format developed by the National ! Center for Supercomputing Applications at the University of Illinois.) ! ! @item -float-hdf5 ! Save the data in HDF5 format but only using single precision. ! Only use this format if you know that all the values to be saved can be represented in single precision. @item -V7 *************** *** 545,559 **** @itemx -mat4-binary Save the data in the binary format written by @sc{matlab} version 4. ! @item -hdf5 ! Save the data in HDF5 format. ! (HDF5 is a free, portable binary format developed by the National ! Center for Supercomputing Applications at the University of Illinois.) ! ! @item -float-hdf5 ! Save the data in HDF5 format but only using single precision. ! You should use this format only if you know that all the ! values to be saved can be represented in single precision. @item -zip @itemx -z --- 558,565 ---- @itemx -mat4-binary Save the data in the binary format written by @sc{matlab} version 4. ! @item -text ! Save the data in Octave's text data format. (default). @item -zip @itemx -z *************** *** 562,568 **** convert the files for backward compatibility. @end table ! The list of variables to save may include wildcard patterns containing the following special characters: @table @code @item ? --- 568,574 ---- convert the files for backward compatibility. @end table ! The list of variables to save may use wildcard patterns containing the following special characters: @table @code @item ? *************** *** 574,592 **** @item [ @var{list} ] Match the list of characters specified by @var{list}. If the first character is @code{!} or @code{^}, match all characters except those ! specified by @var{list}. For example, the pattern @samp{[a-zA-Z]} will match all lower and upper case alphabetic characters. ! Wildcards may also be used in the field names specifications when using the @code{-struct} modifier (but not in the struct name itself). - @item -text - Save the data in Octave's text data format. @end table ! Except when using the @sc{matlab} binary data file format, saving global ! variables also saves the global status of the variable, so that if it is ! restored at a later time using @samp{load}, it will be restored as a global variable. The command --- 580,597 ---- @item [ @var{list} ] Match the list of characters specified by @var{list}. If the first character is @code{!} or @code{^}, match all characters except those ! specified by @var{list}. For example, the pattern @code{[a-zA-Z]} will match all lower and upper case alphabetic characters. ! Wildcards may also be used in the field name specifications when using the @code{-struct} modifier (but not in the struct name itself). @end table ! Except when using the @sc{matlab} binary data file format or the ! @samp{-ascii} format, saving global ! variables also saves the global status of the variable. If the variable ! is restored at a later time using @samp{load}, it will be restored as a global variable. The command *************** *** 598,618 **** @noindent saves the variable @samp{a} and all variables beginning with @samp{b} to the file @file{data} in Octave's binary format. @end deffn @c load-save.cc @anchor{doc-load} ! @deffn {Command} load options file v1 v2 @dots{} Load the named variables @var{v1}, @var{v2}, @dots{}, from the file ! @var{file}. As with @code{save}, you may specify a list of variables ! and @code{load} will only extract those variables with names that ! match. For example, to restore the variables saved in the file ! @file{data}, use the command ! ! @example ! load data ! @end example If load is invoked using the functional form --- 603,624 ---- @noindent saves the variable @samp{a} and all variables beginning with @samp{b} to the file @file{data} in Octave's binary format. + @seealso{@ref{doc-load,,load}, @ref{doc-default_save_options,,default_save_options}, @ref{doc-dlmread,,dlmread}, @ref{doc-csvread,,csvread}, @ref{doc-fread,,fread}} @end deffn @c load-save.cc @anchor{doc-load} ! @deffn {Command} load file ! @deffnx {Command} load options file ! @deffnx {Command} load options file v1 v2 @dots{} ! @deffnx {Command} S = load("options", "file", "v1", "v2", @dots{}) Load the named variables @var{v1}, @var{v2}, @dots{}, from the file ! @var{file}. If no variables are specified then all variables found in the ! file will be loaded. As with @code{save}, the list of variables to extract ! can be full names or use a pattern syntax. The format of the file is ! automatically detected but may be overridden by supplying the appropriate ! option. If load is invoked using the functional form *************** *** 628,636 **** global symbol with the same name already exists, it is loaded in the global symbol table. Also, if a variable is marked as global in a file and a local symbol exists, the local symbol is moved to the global ! symbol table and given the value from the file. Since it seems that ! both of these cases are likely to be the result of some sort of error, ! they will generate warnings. If invoked with a single output argument, Octave returns data instead of inserting variables in the symbol table. If the data file contains --- 634,640 ---- global symbol with the same name already exists, it is loaded in the global symbol table. Also, if a variable is marked as global in a file and a local symbol exists, the local symbol is moved to the global ! symbol table and given the value from the file. If invoked with a single output argument, Octave returns data instead of inserting variables in the symbol table. If the data file contains *************** *** 640,657 **** The @code{load} command can read data stored in Octave's text and binary formats, and @sc{matlab}'s binary format. If compiled with zlib ! support, it can load gzip-compressed files as well. It will automatically detect the type of file and do conversion from different floating point formats (currently only IEEE big and little endian, though other formats ! may added in the future). Valid options for @code{load} are listed in the following table. @table @code @item -force ! The @samp{-force} option is accepted but ignored for backward ! compatibility. Octave now overwrites variables currently in memory with ! the same name as those found in the file. @item -ascii Force Octave to assume the file contains columns of numbers in text format --- 644,661 ---- The @code{load} command can read data stored in Octave's text and binary formats, and @sc{matlab}'s binary format. If compiled with zlib ! support, it can also load gzip-compressed files. It will automatically detect the type of file and do conversion from different floating point formats (currently only IEEE big and little endian, though other formats ! may be added in the future). Valid options for @code{load} are listed in the following table. @table @code @item -force ! This option is accepted for backward compatibility but is ignored. ! Octave now overwrites variables currently in memory with ! those of the same name found in the file. @item -ascii Force Octave to assume the file contains columns of numbers in text format *************** *** 662,667 **** --- 666,683 ---- @item -binary Force Octave to assume the file is in Octave's binary format. + @item -hdf5 + Force Octave to assume the file is in HDF5 format. + (HDF5 is a free, portable binary format developed by the National + Center for Supercomputing Applications at the University of Illinois.) + Note that Octave can read HDF5 files not created by itself, but may + skip some datasets in formats that it cannot support. + + @item -import + This option is accepted for backward compatibility but is ignored. + Octave can now support multi-dimensional HDF data and automatically + modifies variable names if they are invalid Octave identifiers. + @item -mat @itemx -mat-binary @itemx -6 *************** *** 671,698 **** Force Octave to assume the file is in @sc{matlab}'s version 6 or 7 binary format. ! @item -V4 ! @itemx -v4 @itemx -4 ! @itemx -mat4-binary Force Octave to assume the file is in the binary format written by @sc{matlab} version 4. - @item -hdf5 - Force Octave to assume the file is in HDF5 format. - (HDF5 is a free, portable binary format developed by the National - Center for Supercomputing Applications at the University of Illinois.) - Note that Octave can read HDF5 files not created by itself, but may - skip some datasets in formats that it cannot support. - - @item -import - The @samp{-import} is accepted but ignored for backward compatibility. - Octave can now support multi-dimensional HDF data and automatically - modifies variable names if they are invalid Octave identifiers. - @item -text Force Octave to assume the file is in Octave's text format. @end table @end deffn --- 687,703 ---- Force Octave to assume the file is in @sc{matlab}'s version 6 or 7 binary format. ! @item -mat4-binary @itemx -4 ! @itemx -v4 ! @itemx -V4 Force Octave to assume the file is in the binary format written by @sc{matlab} version 4. @item -text Force Octave to assume the file is in Octave's text format. @end table + @seealso{@ref{doc-save,,save}, @ref{doc-dlmwrite,,dlmwrite}, @ref{doc-csvwrite,,csvwrite}, @ref{doc-fwrite,,fwrite}} @end deffn *************** *** 700,711 **** @c load-save.cc @anchor{doc-default_save_options} ! @deftypefn {Built-in Function} {@var{val} =} default_save_options () @deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val}) Query or set the internal variable that specifies the default options for the @code{save} command, and defines the default format. ! Typical values include @code{"-ascii"}, @code{"-ascii -zip"}. ! The default value is @code{-ascii}. @seealso{@ref{doc-save,,save}} @end deftypefn --- 705,716 ---- @c load-save.cc @anchor{doc-default_save_options} ! @deftypefn {Built-in Function} {@var{val} =} default_save_options () @deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val}) Query or set the internal variable that specifies the default options for the @code{save} command, and defines the default format. ! Typical values include @code{"-ascii"}, @code{"-text -zip"}. ! The default value is @code{-text}. @seealso{@ref{doc-save,,save}} @end deftypefn *************** *** 721,727 **** @c load-save.cc @anchor{doc-save_header_format_string} ! @deftypefn {Built-in Function} {@var{val} =} save_header_format_string () @deftypefnx {Built-in Function} {@var{old_val} =} save_header_format_string (@var{new_val}) Query or set the internal variable that specifies the format string used for the comment line written at the beginning of --- 726,732 ---- @c load-save.cc @anchor{doc-save_header_format_string} ! @deftypefn {Built-in Function} {@var{val} =} save_header_format_string () @deftypefnx {Built-in Function} {@var{old_val} =} save_header_format_string (@var{new_val}) Query or set the internal variable that specifies the format string used for the comment line written at the beginning of *************** *** 736,742 **** @smallexample "# Created by Octave VERSION, %a %b %d %H:%M:%S %Y %Z " @end smallexample ! @seealso{@ref{doc-strftime,,strftime}} @end deftypefn --- 741,747 ---- @smallexample "# Created by Octave VERSION, %a %b %d %H:%M:%S %Y %Z " @end smallexample ! @seealso{@ref{doc-strftime,,strftime}, @ref{doc-save,,save}} @end deftypefn diff -cNr octave-3.2.0/doc/interpreter/linalg.texi octave-3.2.2/doc/interpreter/linalg.texi *** octave-3.2.0/doc/interpreter/linalg.texi 2009-06-03 14:36:34.000000000 +0200 --- octave-3.2.2/doc/interpreter/linalg.texi 2009-07-21 07:11:10.000000000 +0200 *************** *** 134,140 **** By default @code{@var{p}=2} is used which implies a (relatively slow) singular value decomposition. Other possible selections are @code{@var{p}= 1, Inf, inf, 'Inf', 'fro'} which are generally faster. ! @seealso{@ref{doc-norm,,norm}, @ref{doc-inv,,inv}, @ref{doc-det,,det}, @ref{doc-svd,,svd}, @ref{doc-rank,,rank}} @end deftypefn --- 134,140 ---- By default @code{@var{p}=2} is used which implies a (relatively slow) singular value decomposition. Other possible selections are @code{@var{p}= 1, Inf, inf, 'Inf', 'fro'} which are generally faster. ! @seealso{@ref{doc-condest,,condest}, @ref{doc-rcond,,rcond}, @ref{doc-norm,,norm}, @ref{doc-svd,,svd}} @end deftypefn *************** *** 167,173 **** @c ./DLD-FUNCTIONS/eig.cc @anchor{doc-eig} ! @deftypefn {Loadable Function} {@var{lambda} =} eig (@var{a}) @deftypefnx {Loadable Function} {@var{lambda} =} eig (@var{a}, @var{b}) @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a}) @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a}, @var{b}) --- 167,173 ---- @c ./DLD-FUNCTIONS/eig.cc @anchor{doc-eig} ! @deftypefn {Loadable Function} {@var{lambda} =} eig (@var{a}) @deftypefnx {Loadable Function} {@var{lambda} =} eig (@var{a}, @var{b}) @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a}) @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a}, @var{b}) *************** *** 178,183 **** --- 178,184 ---- Schur decomposition. The eigenvalues returned by @code{eig} are not ordered. + @seealso{@ref{doc-eigs,,eigs}} @end deftypefn diff -cNr octave-3.2.0/doc/interpreter/matrix.texi octave-3.2.2/doc/interpreter/matrix.texi *** octave-3.2.0/doc/interpreter/matrix.texi 2009-06-03 14:36:34.000000000 +0200 --- octave-3.2.2/doc/interpreter/matrix.texi 2009-07-21 07:11:10.000000000 +0200 *************** *** 176,181 **** --- 176,182 ---- @result{} [ 0, 0, 1, 1 ] @end group @end example + @seealso{@ref{doc-isna,,isna}} @end deftypefn *************** *** 234,245 **** @end group @end example ! If two inputs are given, @var{n} indicates the number of elements to ! find from the beginning of the matrix or vector. If three inputs are given, @var{direction} should be one of "first" or ! "last" indicating that it should start counting found elements from the ! first or last element. Note that this function is particularly useful for sparse matrices, as it extracts the non-zero elements as vectors, which can then be used to --- 235,246 ---- @end group @end example ! If two inputs are given, @var{n} indicates the maximum number of ! elements to find from the beginning of the matrix or vector. If three inputs are given, @var{direction} should be one of "first" or ! "last", requesting only the first or last @var{n} indices, respectively. ! However, the indices are always returned in ascending order. Note that this function is particularly useful for sparse matrices, as it extracts the non-zero elements as vectors, which can then be used to diff -cNr octave-3.2.0/doc/interpreter/mesh.eps octave-3.2.2/doc/interpreter/mesh.eps *** octave-3.2.0/doc/interpreter/mesh.eps 2009-05-25 08:47:06.000000000 +0200 --- octave-3.2.2/doc/interpreter/mesh.eps 2009-06-08 07:38:56.000000000 +0200 *************** *** 1,7 **** %!PS-Adobe-2.0 EPSF-2.0 %%Title: mesh.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon May 25 08:47:06 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments --- 1,7 ---- %!PS-Adobe-2.0 EPSF-2.0 %%Title: mesh.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon Jun 8 07:38:56 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments *************** *** 50,56 **** /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon May 25 08:47:06 2009) /DOCINFO pdfmark end } ifelse --- 50,56 ---- /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon Jun 8 07:38:56 2009) /DOCINFO pdfmark end } ifelse Files octave-3.2.0/doc/interpreter/mesh.pdf and octave-3.2.2/doc/interpreter/mesh.pdf differ diff -cNr octave-3.2.0/doc/interpreter/mkoctfile.1 octave-3.2.2/doc/interpreter/mkoctfile.1 *** octave-3.2.0/doc/interpreter/mkoctfile.1 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/mkoctfile.1 2009-06-11 07:13:21.000000000 +0200 *************** *** 111,117 **** .BR octave (1). .RE .SH AUTHOR ! John W. Eaton This manual page was contributed by Dirk Eddelbuettel for the Debian GNU/Linux distribution but --- 111,117 ---- .BR octave (1). .RE .SH AUTHOR ! John W. Eaton This manual page was contributed by Dirk Eddelbuettel for the Debian GNU/Linux distribution but diff -cNr octave-3.2.0/doc/interpreter/numbers.texi octave-3.2.2/doc/interpreter/numbers.texi *** octave-3.2.0/doc/interpreter/numbers.texi 2009-06-03 14:36:34.000000000 +0200 --- octave-3.2.2/doc/interpreter/numbers.texi 2009-07-21 07:11:10.000000000 +0200 *************** *** 89,102 **** @anchor{doc-double} @deftypefn {Built-in Function} {} double (@var{x}) Convert @var{x} to double precision type. @end deftypefn @c data.cc @anchor{doc-complex} ! @deftypefn {Built-in Function} {} complex (@var{val}) @deftypefnx {Built-in Function} {} complex (@var{re}, @var{im}) ! Convert @var{x} to a complex value. @end deftypefn --- 89,114 ---- @anchor{doc-double} @deftypefn {Built-in Function} {} double (@var{x}) Convert @var{x} to double precision type. + @seealso{@ref{doc-single,,single}} @end deftypefn @c data.cc @anchor{doc-complex} ! @deftypefn {Built-in Function} {} complex (@var{x}) @deftypefnx {Built-in Function} {} complex (@var{re}, @var{im}) ! Return a complex result from real arguments. With 1 real argument @var{x}, ! return the complex result @code{@var{x} + 0i}. With 2 real arguments, ! return the complex result @code{@var{re} + @var{im}}. @code{complex} can ! often be more convenient than expressions such as @code{a + i*b}. ! For example: ! ! @example ! complex ([1, 2], [3, 4]) ! @result{} ! 1 + 3i 2 + 4i ! @end example ! @seealso{@ref{doc-real,,real}, @ref{doc-imag,,imag}, @ref{doc-iscomplex,,iscomplex}} @end deftypefn *************** *** 539,544 **** --- 551,557 ---- @anchor{doc-single} @deftypefn {Built-in Function} {} single (@var{x}) Convert @var{x} to single precision type. + @seealso{@ref{doc-double,,double}} @end deftypefn diff -cNr octave-3.2.0/doc/interpreter/octave.1 octave-3.2.2/doc/interpreter/octave.1 *** octave-3.2.0/doc/interpreter/octave.1 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/octave.1 2009-06-11 07:13:21.000000000 +0200 *************** *** 70,78 **** .SH AUTHOR .nf John W. Eaton ! Department of Chemical Engineering ! University of Wisconsin-Madison ! Madison, WI 53706 ! USA ! .fi --- 70,74 ---- .SH AUTHOR .nf John W. Eaton ! .fi Files octave-3.2.0/doc/interpreter/octave-a4.pdf and octave-3.2.2/doc/interpreter/octave-a4.pdf differ diff -cNr octave-3.2.0/doc/interpreter/octave-bug.1 octave-3.2.2/doc/interpreter/octave-bug.1 *** octave-3.2.0/doc/interpreter/octave-bug.1 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/octave-bug.1 2009-06-11 07:13:21.000000000 +0200 *************** *** 65,72 **** .SH AUTHOR .nf John W. Eaton ! Department of Chemical Engineering ! University of Wisconsin-Madison ! Madison, WI 53706 ! USA ! --- 65,68 ---- .SH AUTHOR .nf John W. Eaton ! diff -cNr octave-3.2.0/doc/interpreter/octave-config.1 octave-3.2.2/doc/interpreter/octave-config.1 *** octave-3.2.0/doc/interpreter/octave-config.1 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/octave-config.1 2009-06-11 07:13:21.000000000 +0200 *************** *** 74,80 **** Display a help page about .B octave-config .SH AUTHOR ! John W. Eaton This manual page was contributed by Dirk Eddelbuettel for the Debian GNU/Linux distribution but may be used by others. --- 74,80 ---- Display a help page about .B octave-config .SH AUTHOR ! John W. Eaton This manual page was contributed by Dirk Eddelbuettel for the Debian GNU/Linux distribution but may be used by others. Files octave-3.2.0/doc/interpreter/octave.pdf and octave-3.2.2/doc/interpreter/octave.pdf differ diff -cNr octave-3.2.0/doc/interpreter/package.texi octave-3.2.2/doc/interpreter/package.texi *** octave-3.2.0/doc/interpreter/package.texi 2009-06-03 14:36:34.000000000 +0200 --- octave-3.2.2/doc/interpreter/package.texi 2009-07-21 07:11:10.000000000 +0200 *************** *** 42,48 **** @node Installing and Removing Packages @section Installing and Removing Packages ! Assuming a package is available in the file @code{image-1.0.0.tar.gz} it can be installed from the Octave prompt with the command @example --- 42,48 ---- @node Installing and Removing Packages @section Installing and Removing Packages ! Assuming a package is available in the file @file{image-1.0.0.tar.gz} it can be installed from the Octave prompt with the command @example *************** *** 123,129 **** pkg install image-1.0.0.tar.gz @end example @noindent ! installs the package found in the file @code{image-1.0.0.tar.gz}. The @var{option} variable can contain options that affect the manner in which a package is installed. These options can be one or more of --- 123,129 ---- pkg install image-1.0.0.tar.gz @end example @noindent ! installs the package found in the file @file{image-1.0.0.tar.gz}. The @var{option} variable can contain options that affect the manner in which a package is installed. These options can be one or more of *************** *** 224,230 **** pkg prefix ~/my_octave_packages @end example @noindent ! sets the installation prefix to @code{~/my_octave_packages}. Packages will be installed in this directory. It is possible to get the current installation prefix by requesting an --- 224,230 ---- pkg prefix ~/my_octave_packages @end example @noindent ! sets the installation prefix to @file{~/my_octave_packages}. Packages will be installed in this directory. It is possible to get the current installation prefix by requesting an *************** *** 320,328 **** system-wide installations of a package. If the user performing the installation is @code{root} the packages will be installed in a system-wide directory that defaults to ! @code{OCTAVE_HOME/share/octave/packages/}. If the user is not @code{root} the default installation directory is ! @code{~/octave/}. Packages will be installed in a subdirectory of the installation directory that will be named after the package. It is possible to change the installation directory by using the @code{pkg prefix} command --- 320,328 ---- system-wide installations of a package. If the user performing the installation is @code{root} the packages will be installed in a system-wide directory that defaults to ! @file{OCTAVE_HOME/share/octave/packages/}. If the user is not @code{root} the default installation directory is ! @file{~/octave/}. Packages will be installed in a subdirectory of the installation directory that will be named after the package. It is possible to change the installation directory by using the @code{pkg prefix} command *************** *** 340,348 **** To function properly the package manager needs to keep some information about the installed packages. For per-user packages this ! information is by default stored in the file @code{~/.octave_packages} and for system-wide installations it is stored in ! @code{OCTAVE_HOME/share/octave/octave_packages}. The path to the per-user file can be changed with the @code{pkg local_list} command @example --- 340,348 ---- To function properly the package manager needs to keep some information about the installed packages. For per-user packages this ! information is by default stored in the file @file{~/.octave_packages} and for system-wide installations it is stored in ! @file{OCTAVE_HOME/share/octave/octave_packages}. The path to the per-user file can be changed with the @code{pkg local_list} command @example *************** *** 438,449 **** @item package/src An optional directory containing code that must be built prior to the packages installation. The Octave package manager will execute ! @code{./configure} in this directory if this script exists, and will ! then call @code{make} if a file @code{Makefile} exists in this directory. @code{make install} will however not be called. If a file ! called @code{FILES} exist all files listed there will be copied to the @code{inst} directory, so they also will be installed. If the ! @code{FILES} file doesn't exist, @code{src/*.m} and @code{src/*.oct} will be copied to the @code{inst} directory. @item package/doc --- 438,449 ---- @item package/src An optional directory containing code that must be built prior to the packages installation. The Octave package manager will execute ! @file{./configure} in this directory if this script exists, and will ! then call @code{make} if a file @file{Makefile} exists in this directory. @code{make install} will however not be called. If a file ! called @code{FILES} exists all files listed there will be copied to the @code{inst} directory, so they also will be installed. If the ! @code{FILES} file doesn't exist, @file{src/*.m} and @file{src/*.oct} will be copied to the @code{inst} directory. @item package/doc *************** *** 473,479 **** @noindent @itemize @item ! Lines starting with @code{#} are comments. @item Lines starting with a blank character are continuations from the --- 473,479 ---- @noindent @itemize @item ! Lines starting with @samp{#} are comments. @item Lines starting with a blank character are continuations from the *************** *** 607,613 **** @noindent @itemize ! @item Lines beginning with @code{#} are comments. @item The first non-comment line should look like this --- 607,613 ---- @noindent @itemize ! @item Lines beginning with @samp{#} are comments. @item The first non-comment line should look like this diff -cNr octave-3.2.0/doc/interpreter/package.txi octave-3.2.2/doc/interpreter/package.txi *** octave-3.2.0/doc/interpreter/package.txi 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/package.txi 2009-06-08 07:34:32.000000000 +0200 *************** *** 40,46 **** @node Installing and Removing Packages @section Installing and Removing Packages ! Assuming a package is available in the file @code{image-1.0.0.tar.gz} it can be installed from the Octave prompt with the command @example --- 40,46 ---- @node Installing and Removing Packages @section Installing and Removing Packages ! Assuming a package is available in the file @file{image-1.0.0.tar.gz} it can be installed from the Octave prompt with the command @example *************** *** 139,147 **** system-wide installations of a package. If the user performing the installation is @code{root} the packages will be installed in a system-wide directory that defaults to ! @code{OCTAVE_HOME/share/octave/packages/}. If the user is not @code{root} the default installation directory is ! @code{~/octave/}. Packages will be installed in a subdirectory of the installation directory that will be named after the package. It is possible to change the installation directory by using the @code{pkg prefix} command --- 139,147 ---- system-wide installations of a package. If the user performing the installation is @code{root} the packages will be installed in a system-wide directory that defaults to ! @file{OCTAVE_HOME/share/octave/packages/}. If the user is not @code{root} the default installation directory is ! @file{~/octave/}. Packages will be installed in a subdirectory of the installation directory that will be named after the package. It is possible to change the installation directory by using the @code{pkg prefix} command *************** *** 159,167 **** To function properly the package manager needs to keep some information about the installed packages. For per-user packages this ! information is by default stored in the file @code{~/.octave_packages} and for system-wide installations it is stored in ! @code{OCTAVE_HOME/share/octave/octave_packages}. The path to the per-user file can be changed with the @code{pkg local_list} command @example --- 159,167 ---- To function properly the package manager needs to keep some information about the installed packages. For per-user packages this ! information is by default stored in the file @file{~/.octave_packages} and for system-wide installations it is stored in ! @file{OCTAVE_HOME/share/octave/octave_packages}. The path to the per-user file can be changed with the @code{pkg local_list} command @example *************** *** 257,268 **** @item package/src An optional directory containing code that must be built prior to the packages installation. The Octave package manager will execute ! @code{./configure} in this directory if this script exists, and will ! then call @code{make} if a file @code{Makefile} exists in this directory. @code{make install} will however not be called. If a file ! called @code{FILES} exist all files listed there will be copied to the @code{inst} directory, so they also will be installed. If the ! @code{FILES} file doesn't exist, @code{src/*.m} and @code{src/*.oct} will be copied to the @code{inst} directory. @item package/doc --- 257,268 ---- @item package/src An optional directory containing code that must be built prior to the packages installation. The Octave package manager will execute ! @file{./configure} in this directory if this script exists, and will ! then call @code{make} if a file @file{Makefile} exists in this directory. @code{make install} will however not be called. If a file ! called @code{FILES} exists all files listed there will be copied to the @code{inst} directory, so they also will be installed. If the ! @code{FILES} file doesn't exist, @file{src/*.m} and @file{src/*.oct} will be copied to the @code{inst} directory. @item package/doc *************** *** 292,298 **** @noindent @itemize @item ! Lines starting with @code{#} are comments. @item Lines starting with a blank character are continuations from the --- 292,298 ---- @noindent @itemize @item ! Lines starting with @samp{#} are comments. @item Lines starting with a blank character are continuations from the *************** *** 426,432 **** @noindent @itemize ! @item Lines beginning with @code{#} are comments. @item The first non-comment line should look like this --- 426,432 ---- @noindent @itemize ! @item Lines beginning with @samp{#} are comments. @item The first non-comment line should look like this diff -cNr octave-3.2.0/doc/interpreter/plot3.eps octave-3.2.2/doc/interpreter/plot3.eps *** octave-3.2.0/doc/interpreter/plot3.eps 2009-05-25 08:47:07.000000000 +0200 --- octave-3.2.2/doc/interpreter/plot3.eps 2009-06-08 07:38:56.000000000 +0200 *************** *** 1,7 **** %!PS-Adobe-2.0 EPSF-2.0 %%Title: plot3.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon May 25 08:47:07 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments --- 1,7 ---- %!PS-Adobe-2.0 EPSF-2.0 %%Title: plot3.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon Jun 8 07:38:56 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments *************** *** 50,56 **** /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon May 25 08:47:07 2009) /DOCINFO pdfmark end } ifelse --- 50,56 ---- /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon Jun 8 07:38:56 2009) /DOCINFO pdfmark end } ifelse Files octave-3.2.0/doc/interpreter/plot3.pdf and octave-3.2.2/doc/interpreter/plot3.pdf differ diff -cNr octave-3.2.0/doc/interpreter/plot.eps octave-3.2.2/doc/interpreter/plot.eps *** octave-3.2.0/doc/interpreter/plot.eps 2009-05-25 08:47:04.000000000 +0200 --- octave-3.2.2/doc/interpreter/plot.eps 2009-06-08 07:38:55.000000000 +0200 *************** *** 1,7 **** %!PS-Adobe-2.0 EPSF-2.0 %%Title: plot.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon May 25 08:47:04 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments --- 1,7 ---- %!PS-Adobe-2.0 EPSF-2.0 %%Title: plot.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon Jun 8 07:38:55 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments *************** *** 50,56 **** /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon May 25 08:47:04 2009) /DOCINFO pdfmark end } ifelse --- 50,56 ---- /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon Jun 8 07:38:55 2009) /DOCINFO pdfmark end } ifelse diff -cNr octave-3.2.0/doc/interpreter/plotimages.m octave-3.2.2/doc/interpreter/plotimages.m *** octave-3.2.0/doc/interpreter/plotimages.m 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/plotimages.m 2009-06-08 07:34:31.000000000 +0200 *************** *** 30,43 **** plot (x, sin (x)); print (cstrcat (nm, ".", typ), cstrcat ("-d", typ)) elseif (strcmp (nm, "hist")) hist (randn (10000, 1), 30); print (cstrcat (nm, ".", typ), cstrcat ("-d", typ)) elseif (strcmp (nm, "errorbar")) x = 0:0.1:10; y = sin (x); ! yp = 0.1 .* randn (size (x)); ! ym = -0.1 .* randn (size (x)); ! errorbar (x, sin (x), ym, yp); print (cstrcat (nm, ".", typ), cstrcat ("-d", typ)) elseif (strcmp (nm, "polar")) polar (0:0.1:10*pi, 0:0.1:10*pi); --- 30,46 ---- plot (x, sin (x)); print (cstrcat (nm, ".", typ), cstrcat ("-d", typ)) elseif (strcmp (nm, "hist")) + rand ("state", 2); hist (randn (10000, 1), 30); print (cstrcat (nm, ".", typ), cstrcat ("-d", typ)) elseif (strcmp (nm, "errorbar")) + rand ("state", 2); x = 0:0.1:10; y = sin (x); ! yl = 0.1 .* rand (size (x)); ! yu = 0.1 .* rand (size (x)); ! errorbar (x, sin (x), yl, yu); ! axis ([0, 10, -1.1, 1.1]); print (cstrcat (nm, ".", typ), cstrcat ("-d", typ)) elseif (strcmp (nm, "polar")) polar (0:0.1:10*pi, 0:0.1:10*pi); Files octave-3.2.0/doc/interpreter/plot.pdf and octave-3.2.2/doc/interpreter/plot.pdf differ diff -cNr octave-3.2.0/doc/interpreter/plot.texi octave-3.2.2/doc/interpreter/plot.texi *** octave-3.2.0/doc/interpreter/plot.texi 2009-06-03 14:36:34.000000000 +0200 --- octave-3.2.2/doc/interpreter/plot.texi 2009-07-21 07:11:10.000000000 +0200 *************** *** 2768,2779 **** @c ./plot/print.m @anchor{doc-print} ! @deftypefn {Function File} {} print (@var{filename}, @var{options}) @deftypefnx {Function File} {} print (@var{h}, @var{filename}, @var{options}) Print a graph, or save it to a file @var{filename} defines the file name of the output file. If no ! filename is specified, output is sent to the printer. @var{h} specifies the figure handle. If no handle is specified the handle for the current figure is used. --- 2768,2781 ---- @c ./plot/print.m @anchor{doc-print} ! @deftypefn {Function File} {} print () ! @deftypefnx {Function File} {} print (@var{options}) ! @deftypefnx {Function File} {} print (@var{filename}, @var{options}) @deftypefnx {Function File} {} print (@var{h}, @var{filename}, @var{options}) Print a graph, or save it to a file @var{filename} defines the file name of the output file. If no ! filename is specified, the output is sent to the printer. @var{h} specifies the figure handle. If no handle is specified the handle for the current figure is used. *************** *** 2794,2800 **** Solid or dashed lines. @item -portrait @itemx -landscape ! Plot orientation, as returned by "orient". @item -d@var{device} Output device, where @var{device} is one of: @table @code --- 2796,2802 ---- Solid or dashed lines. @item -portrait @itemx -landscape ! Specify the orientation of the plot for printed output. @item -d@var{device} Output device, where @var{device} is one of: @table @code *************** *** 2880,2888 **** For a complete list, type `system ("gs -h")' to see what formats and devices are available. ! For output sent to a printer, the size is determined by the ! figure's "papersize" property. For output to a file the, size ! is determined by the "paperposition" property. @itemx -r@var{NUM} Resolution of bitmaps in pixels per inch. For both metafiles and --- 2882,2891 ---- For a complete list, type `system ("gs -h")' to see what formats and devices are available. ! When the ghostscript is sent to a printer the size is determined ! by the figure's "papersize" property. When the ghostscript output ! is sent to a file the size is determined by the figure's ! "paperposition" property. @itemx -r@var{NUM} Resolution of bitmaps in pixels per inch. For both metafiles and *************** *** 2953,2967 **** @c ./plot/gtext.m @anchor{doc-gtext} ! @deftypefn {Function File} {} gtext (@var{s}) @deftypefnx {Function File} {} gtext (@dots{}, @var{prop}, @var{val}) ! Place text on the current figure. The text can be defined by the ! string @var{s}. If @var{s} is a cell array, each element of the cell ! array is written to a separate line. ! ! Additional arguments are passed to the underlying text object as ! properties. ! @seealso{@ref{doc-ginput,,ginput}} @end deftypefn --- 2956,2969 ---- @c ./plot/gtext.m @anchor{doc-gtext} ! @deftypefn {Function File} {} gtext (@var{s}) ! @deftypefnx {Function File} {} gtext (@{@var{s1}; @var{s2}; @dots{}@}) @deftypefnx {Function File} {} gtext (@dots{}, @var{prop}, @var{val}) ! Place text on the current figure using the mouse. The text is defined ! by the string @var{s}. If @var{s} is a cell array, each element of the cell ! array is written to a separate line. Additional arguments are passed to ! the underlying text object as properties. ! @seealso{@ref{doc-ginput,,ginput}, @ref{doc-text,,text}} @end deftypefn *************** *** 3058,3064 **** @item axes @cindex axes graphics object @cindex graphics object, axes ! An set of axes. This object is a child of a figure object and may be a parent of line, text, image, patch, or surface objects. @item line --- 3060,3066 ---- @item axes @cindex axes graphics object @cindex graphics object, axes ! A set of axes. This object is a child of a figure object and may be a parent of line, text, image, patch, or surface objects. @item line *************** *** 3087,3093 **** A three-dimensional surface. @end table ! To determine whether an object is a graphics object index or a figure index, use the functions @code{ishandle} and @code{isfigure}. @c graphics.cc --- 3089,3095 ---- A three-dimensional surface. @end table ! To determine whether a variable is a graphics object index or a figure index, use the functions @code{ishandle} and @code{isfigure}. @c graphics.cc *************** *** 3169,3178 **** get (0) @result{} ans = @{ ! type = root figure currentfigure = [](0x0) children = [](0x0) visible = on @} @end group @end example --- 3171,3181 ---- get (0) @result{} ans = @{ ! type = root currentfigure = [](0x0) children = [](0x0) visible = on + @dots{} @} @end group @end example *************** *** 3259,3270 **** @c ./plot/allchild.m @anchor{doc-allchild} @deftypefn {Function File} {@var{h} =} allchild (@var{handles}) ! Find all children including hidden children of an object. This function is similar to @code{get (h, "children")}, but also returns includes hidden objects. If @var{handles} is a scalar, ! @var{h} will be a vector, and if not, @var{h} will be a cell matrix ! with the same size as @var{handles} and each cell will contain a vector of handles. @seealso{@ref{doc-get,,get}, @ref{doc-set,,set}, @ref{doc-findall,,findall}, @ref{doc-findobj,,findobj}} @end deftypefn --- 3262,3273 ---- @c ./plot/allchild.m @anchor{doc-allchild} @deftypefn {Function File} {@var{h} =} allchild (@var{handles}) ! Find all children, including hidden children, of a graphics object. This function is similar to @code{get (h, "children")}, but also returns includes hidden objects. If @var{handles} is a scalar, ! @var{h} will be a vector. Otherwise, @var{h} will be a cell matrix ! of the same size as @var{handles} and each cell will contain a vector of handles. @seealso{@ref{doc-get,,get}, @ref{doc-set,,set}, @ref{doc-findall,,findall}, @ref{doc-findobj,,findobj}} @end deftypefn *************** *** 3360,3374 **** @c graphics.cc @anchor{doc-drawnow} ! @deftypefn {Built-in Function} {} __go_drawnow__ () ! @deftypefnx {Built-in Function} {} __go_drawnow__ (@var{term}, @var{file}, @var{mono}, @var{debug_file}) ! Undocumented internal function. @end deftypefn Only figures that are modified will be updated. The @code{refresh} ! function can also be to force an update of the current figure, even if ! it is nor modified. @c ./plot/refresh.m @anchor{doc-refresh} --- 3363,3383 ---- @c graphics.cc @anchor{doc-drawnow} ! @deftypefn {Built-in Function} {} drawnow () ! @deftypefnx {Built-in Function} {} drawnow ("expose") ! @deftypefnx {Built-in Function} {} drawnow (@var{term}, @var{file}, @var{mono}, @var{debug_file}) ! Update figure windows and their children. The event queue is flushed and ! any callbacks generated are executed. With the optional argument ! @code{"expose"}, only graphic objects are updated and no other events or ! callbacks are processed. ! The third calling form of @code{drawnow} is for debugging and is ! undocumented. @end deftypefn Only figures that are modified will be updated. The @code{refresh} ! function can also be used to force an update of the current figure, even if ! it is not modified. @c ./plot/refresh.m @anchor{doc-refresh} *************** *** 3384,3399 **** Normally, high-level plot functions like @code{plot} or @code{mesh} call @code{newplot} to initialize the state of the current axes so that the next plot is drawn in a blank window with default property settings. To ! have two plots superimposed over one another, call the @code{hold} function. For example, @example @group ! hold ("on"); x = -10:0.1:10; plot (x, sin (x)); plot (x, cos (x)); ! hold ("off"); @end group @end example --- 3393,3408 ---- Normally, high-level plot functions like @code{plot} or @code{mesh} call @code{newplot} to initialize the state of the current axes so that the next plot is drawn in a blank window with default property settings. To ! have two plots superimposed over one another, use the @code{hold} function. For example, @example @group ! hold on; x = -10:0.1:10; plot (x, sin (x)); plot (x, cos (x)); ! hold off; @end group @end example *************** *** 3412,3438 **** @c ./plot/hold.m @anchor{doc-hold} ! @deftypefn {Function File} {} hold @var{args} ! Tell Octave to `hold' the current data on the graph when executing ! subsequent plotting commands. This allows you to execute a series of ! plot commands and have all the lines end up on the same graph. The ! default is for each new plot command to clear the plot device first. ! For example, the command ! @example ! hold on ! @end example ! @noindent ! turns the hold state on. An argument of @code{"off"} turns the hold ! state off, and @code{hold} with no arguments toggles the current hold ! state. ! @deftypefnx {Function File} {} hold (@var{h}, @dots{}) ! Applies to a specific axis or axes, associated with the handle(s), ! @var{h}. @end deftypefn --- 3421,3451 ---- @c ./plot/hold.m @anchor{doc-hold} ! @deftypefn {Function File} {} hold ! @deftypefnx {Function File} {} hold @var{state} ! @deftypefnx {Function File} {} hold (@var{hax}, @dots{}) ! Toggle or set the 'hold' state of the plotting engine which determines ! whether new graphic objects are added to the plot or replace the existing ! objects. ! @table @code ! @item hold on ! Retain plot data and settings so that subsequent plot commands are displayed ! on a single graph. ! @item hold off ! Clear plot and restore default graphics settings before each new plot ! command. (default). ! @item hold ! Toggle the current 'hold' state. ! @end table ! When given the additional argument @var{hax}, the hold state is modified ! only for the given axis handle. + To query the current 'hold' state use the @code{ishold} function. + @seealso{@ref{doc-ishold,,ishold}, @ref{doc-cla,,cla}, @ref{doc-newplot,,newplot}, @ref{doc-clf,,clf}} @end deftypefn *************** *** 3452,3466 **** @c ./plot/clf.m @anchor{doc-clf} ! @deftypefn {Function File} {} clf () @deftypefnx {Function File} {} clf ("reset") @deftypefnx {Function File} {} clf (@var{hfig}) @deftypefnx {Function File} {} clf (@var{hfig}, "reset") ! @deftypefnx {Function File} {@var{hfig} =} clf (@dots{}) ! Delete the children of the current figure with visible handles. ! If @var{hfig} is specified and is an figure object handle, operate on it ! instead of the current figure. If the optional argument @code{"reset"} ! is specified, also delete the figure's children with hidden handles. @seealso{@ref{doc-cla,,cla}, @ref{doc-close,,close}, @ref{doc-delete,,delete}} @end deftypefn --- 3465,3479 ---- @c ./plot/clf.m @anchor{doc-clf} ! @deftypefn {Function File} {} clf () @deftypefnx {Function File} {} clf ("reset") @deftypefnx {Function File} {} clf (@var{hfig}) @deftypefnx {Function File} {} clf (@var{hfig}, "reset") ! Clear the current figure window. @code{clf} operates by deleting child ! graphics objects with visible handles (@code{HandleVisibility} = on). ! If @var{hfig} is specified operate on it instead of the current figure. ! If the optional argument @code{"reset"} is specified, all objects including ! those with hidden handles are deleted. @seealso{@ref{doc-cla,,cla}, @ref{doc-close,,close}, @ref{doc-delete,,delete}} @end deftypefn *************** *** 3490,3498 **** @c ./miscellaneous/delete.m @anchor{doc-delete} ! @deftypefn {Function File} {} delete (@var{file}) ! @deftypefnx {Function File} {} delete (@var{h}) Delete the named file or graphics handle. @end deftypefn --- 3503,3515 ---- @c ./miscellaneous/delete.m @anchor{doc-delete} ! @deftypefn {Function File} {} delete (@var{file}) ! @deftypefnx {Function File} {} delete (@var{handle}) Delete the named file or graphics handle. + + Deleting graphics objects is the proper way to remove + features from a plot without clearing the entire figure. + @seealso{@ref{doc-clf,,clf}, @ref{doc-cla,,cla}} @end deftypefn *************** *** 4716,4731 **** @c ./plot/refreshdata.m @anchor{doc-refreshdata} ! @deftypefn {Function File} {} refreshdata () @deftypefnx {Function File} {} refreshdata (@var{h}) ! @deftypefnx {Function File} {} refreshdata (@var{h}, @var{ws}) ! Evaluates any datasource properties of the current figure and updates ! the corresponding data. If call with one or more arguments @var{h} is ! a scalar or array of figure handles which to refresh. The data ! sources are by default evaluated in the "base" workspace but can also ! be set in the "caller" workspace. ! An example of the use of refreshdata is @example @group --- 4733,4755 ---- @c ./plot/refreshdata.m @anchor{doc-refreshdata} ! @deftypefn {Function File} {} refreshdata () @deftypefnx {Function File} {} refreshdata (@var{h}) ! @deftypefnx {Function File} {} refreshdata (@var{h}, @var{workspace}) ! Evaluate any @samp{datasource} properties of the current figure and update ! the plot if the corresponding data has changed. If called with one or more ! arguments @var{h} is a scalar or array of figure handles to refresh. The ! optional second argument @var{workspace} can take the following values. ! @table @code ! @item "base" ! Evaluate the datasource properties in the base workspace. (default). ! @item "caller" ! Evaluate the datasource properties in the workspace of the function ! that called @code{refreshdata}. ! @end table ! ! An example of the use of @code{refreshdata} is: @example @group *************** *** 4739,4746 **** endfor @end group @end example - - @seealso{@ref{doc-linkdata,,linkdata}} @end deftypefn --- 4763,4768 ---- *************** *** 5217,5226 **** @deftypefnx {Function File} {} backend (@var{hlist}, @var{name}) Change the default graphics backend to @var{name}. If the backend is not already loaded, it is first initialized (initialization is done ! through the execution of __init_@var{name}__). ! @var{hlist} is a list of figure handles. When given, this function ! only switches the default backend for the corresponding figures. @seealso{@ref{doc-available_backends,,available_backends}} @end deftypefn --- 5239,5248 ---- @deftypefnx {Function File} {} backend (@var{hlist}, @var{name}) Change the default graphics backend to @var{name}. If the backend is not already loaded, it is first initialized (initialization is done ! through the execution of @code{__init_@var{name}__}). ! When called with a list of figure handles, @var{hlist}, the backend is ! changed only for the listed figures. @seealso{@ref{doc-available_backends,,available_backends}} @end deftypefn *************** *** 5228,5234 **** @c graphics.cc @anchor{doc-available_backends} @deftypefn {Built-in Function} {} available_backends () ! Returns resgistered graphics backends. @end deftypefn --- 5250,5256 ---- @c graphics.cc @anchor{doc-available_backends} @deftypefn {Built-in Function} {} available_backends () ! Return a cell array of registered graphics backends. @end deftypefn diff -cNr octave-3.2.0/doc/interpreter/plot.txi octave-3.2.2/doc/interpreter/plot.txi *** octave-3.2.0/doc/interpreter/plot.txi 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/plot.txi 2009-06-09 06:33:11.000000000 +0200 *************** *** 538,544 **** @item axes @cindex axes graphics object @cindex graphics object, axes ! An set of axes. This object is a child of a figure object and may be a parent of line, text, image, patch, or surface objects. @item line --- 538,544 ---- @item axes @cindex axes graphics object @cindex graphics object, axes ! A set of axes. This object is a child of a figure object and may be a parent of line, text, image, patch, or surface objects. @item line *************** *** 567,573 **** A three-dimensional surface. @end table ! To determine whether an object is a graphics object index or a figure index, use the functions @code{ishandle} and @code{isfigure}. @DOCSTRING(ishandle) --- 567,573 ---- A three-dimensional surface. @end table ! To determine whether a variable is a graphics object index or a figure index, use the functions @code{ishandle} and @code{isfigure}. @DOCSTRING(ishandle) *************** *** 593,602 **** get (0) @result{} ans = @{ ! type = root figure currentfigure = [](0x0) children = [](0x0) visible = on @} @end group @end example --- 593,603 ---- get (0) @result{} ans = @{ ! type = root currentfigure = [](0x0) children = [](0x0) visible = on + @dots{} @} @end group @end example *************** *** 673,696 **** @DOCSTRING(drawnow) Only figures that are modified will be updated. The @code{refresh} ! function can also be to force an update of the current figure, even if ! it is nor modified. @DOCSTRING(refresh) Normally, high-level plot functions like @code{plot} or @code{mesh} call @code{newplot} to initialize the state of the current axes so that the next plot is drawn in a blank window with default property settings. To ! have two plots superimposed over one another, call the @code{hold} function. For example, @example @group ! hold ("on"); x = -10:0.1:10; plot (x, sin (x)); plot (x, cos (x)); ! hold ("off"); @end group @end example --- 674,697 ---- @DOCSTRING(drawnow) Only figures that are modified will be updated. The @code{refresh} ! function can also be used to force an update of the current figure, even if ! it is not modified. @DOCSTRING(refresh) Normally, high-level plot functions like @code{plot} or @code{mesh} call @code{newplot} to initialize the state of the current axes so that the next plot is drawn in a blank window with default property settings. To ! have two plots superimposed over one another, use the @code{hold} function. For example, @example @group ! hold on; x = -10:0.1:10; plot (x, sin (x)); plot (x, cos (x)); ! hold off; @end group @end example diff -cNr octave-3.2.0/doc/interpreter/polar.eps octave-3.2.2/doc/interpreter/polar.eps *** octave-3.2.0/doc/interpreter/polar.eps 2009-05-25 08:47:05.000000000 +0200 --- octave-3.2.2/doc/interpreter/polar.eps 2009-06-08 07:38:55.000000000 +0200 *************** *** 1,7 **** %!PS-Adobe-2.0 EPSF-2.0 %%Title: polar.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon May 25 08:47:05 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments --- 1,7 ---- %!PS-Adobe-2.0 EPSF-2.0 %%Title: polar.eps %%Creator: gnuplot 4.3 patchlevel 0 ! %%CreationDate: Mon Jun 8 07:38:55 2009 %%DocumentFonts: (atend) %%BoundingBox: 50 50 409 301 %%EndComments *************** *** 50,56 **** /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon May 25 08:47:05 2009) /DOCINFO pdfmark end } ifelse --- 50,56 ---- /Author (Jaroslav Hajek) % /Producer (gnuplot) % /Keywords () ! /CreationDate (Mon Jun 8 07:38:55 2009) /DOCINFO pdfmark end } ifelse Files octave-3.2.0/doc/interpreter/polar.pdf and octave-3.2.2/doc/interpreter/polar.pdf differ diff -cNr octave-3.2.0/doc/interpreter/quad.texi octave-3.2.2/doc/interpreter/quad.texi *** octave-3.2.0/doc/interpreter/quad.texi 2009-06-03 14:36:34.000000000 +0200 --- octave-3.2.2/doc/interpreter/quad.texi 2009-07-21 07:11:10.000000000 +0200 *************** *** 279,285 **** function to integrate, then these can be flagged with the @code{"WayPoints"} property. This forces the ends of a sub-interval to fall on the breakpoints of the function and can result in ! significantly improved estimated of the error in the integral, faster computation or both. For example, @example --- 279,285 ---- function to integrate, then these can be flagged with the @code{"WayPoints"} property. This forces the ends of a sub-interval to fall on the breakpoints of the function and can result in ! significantly improved estimation of the error in the integral, faster computation or both. For example, @example diff -cNr octave-3.2.0/doc/interpreter/sparse.texi octave-3.2.2/doc/interpreter/sparse.texi *** octave-3.2.0/doc/interpreter/sparse.texi 2009-06-03 14:36:34.000000000 +0200 --- octave-3.2.2/doc/interpreter/sparse.texi 2009-07-21 07:11:10.000000000 +0200 *************** *** 1641,1647 **** Pseudospectra." @url{http://citeseer.ist.psu.edu/223007.html} @end itemize ! @seealso{@ref{doc-norm,,norm}, @ref{doc-cond,,cond}, @ref{doc-onenormest,,onenormest}} @end deftypefn --- 1641,1647 ---- Pseudospectra." @url{http://citeseer.ist.psu.edu/223007.html} @end itemize ! @seealso{@ref{doc-cond,,cond}, @ref{doc-norm,,norm}, @ref{doc-onenormest,,onenormest}} @end deftypefn diff -cNr octave-3.2.0/doc/interpreter/strings.texi octave-3.2.2/doc/interpreter/strings.texi *** octave-3.2.0/doc/interpreter/strings.texi 2009-06-03 14:36:34.000000000 +0200 --- octave-3.2.2/doc/interpreter/strings.texi 2009-07-21 07:11:11.000000000 +0200 *************** *** 381,437 **** @c strfns.cc @anchor{doc-char} ! @deftypefn {Built-in Function} {} char (@var{x}) ! @deftypefnx {Built-in Function} {} char (@var{cell_array}) @deftypefnx {Built-in Function} {} char (@var{s1}, @var{s2}, @dots{}) Create a string array from one or more numeric matrices, character ! matrices or cell arrays. For numerical input, each element is converted ! to the corresponding ASCII character. The arguments (and elements of ! cell array(s)) are concatenated vertically. The returned values are padded with blanks as needed to make each row ! of the string array have the same length. Empty strings are not removed. For example, @example @group ! char ([97, 98, 99], "", @{"98", "99", 100@}, ["num", "bers"]) @result{} ["abc " ! " " ! "98 " ! "99 " ! "d " ! "numbers"] @end group @end example ! @end deftypefn @c strfns.cc @anchor{doc-strvcat} ! @deftypefn {Built-in Function} {} strvcat (@var{x}) ! @deftypefnx {Built-in Function} {} strvcat (@var{cell_array}) @deftypefnx {Built-in Function} {} strvcat (@var{s1}, @var{s2}, @dots{}) Create a character array from one or more numeric matrices, character ! matrices or cell arrays. For numerical input, each element is converted ! to the corresponding ASCII character. The arguments (and elements of ! cell array(s)) are concatenated vertically. The returned values are padded with blanks as needed to make each row of the string array have the same length. Unlike @code{char}, empty ! strings are removed. For example, @example @group ! strvcat ([97, 98, 99], "", @{"98", "99", 100@}, ["num", "bers"]) @result{} ["abc " ! "98 " ! "99 " ! "d " ! "numbers"] @end group @end example - @seealso{@ref{doc-char,,char}, @ref{doc-strcat,,strcat}, @ref{doc-cstrcat,,cstrcat}} @end deftypefn --- 381,451 ---- @c strfns.cc @anchor{doc-char} ! @deftypefn {Built-in Function} {} char (@var{x}) ! @deftypefnx {Built-in Function} {} char (@var{x}, @dots{}) @deftypefnx {Built-in Function} {} char (@var{s1}, @var{s2}, @dots{}) + @deftypefnx {Built-in Function} {} char (@var{cell_array}) Create a string array from one or more numeric matrices, character ! matrices, or cell arrays. Arguments are concatenated vertically. The returned values are padded with blanks as needed to make each row ! of the string array have the same length. Empty input strings are ! significant and will concatenated in the output. ! ! For numerical input, each element is converted ! to the corresponding ASCII character. A range error results if an input ! is outside the ASCII range (0-255). ! ! For cell arrays, each element is concatenated separately. Cell arrays converted through ! @code{char} can mostly be converted back with @code{cellstr}. For example, @example @group ! char ([97, 98, 99], "", @{"98", "99", 100@}, "str1", ["ha", "lf"]) @result{} ["abc " ! " " ! "98 " ! "99 " ! "d " ! "str1 " ! "half "] @end group @end example ! @seealso{@ref{doc-strvcat,,strvcat}, @ref{doc-cellstr,,cellstr}} @end deftypefn @c strfns.cc @anchor{doc-strvcat} ! @deftypefn {Built-in Function} {} strvcat (@var{x}) ! @deftypefnx {Built-in Function} {} strvcat (@var{x}, @dots{}) @deftypefnx {Built-in Function} {} strvcat (@var{s1}, @var{s2}, @dots{}) + @deftypefnx {Built-in Function} {} strvcat (@var{cell_array}) Create a character array from one or more numeric matrices, character ! matrices, or cell arrays. Arguments are concatenated vertically. The returned values are padded with blanks as needed to make each row of the string array have the same length. Unlike @code{char}, empty ! strings are removed and will not appear in the output. ! ! For numerical input, each element is converted ! to the corresponding ASCII character. A range error results if an input ! is outside the ASCII range (0-255). ! ! For cell arrays, each element is concatenated separately. Cell arrays converted through ! @code{strvcat} can mostly be converted back with @code{cellstr}. For example, @example @group ! strvcat ([97, 98, 99], "", @{"98", "99", 100@}, "str1", ["ha", "lf"]) @result{} ["abc " ! "98 " ! "99 " ! "d " ! "str1 " ! "half "] @end group @end example @seealso{@ref{doc-char,,char}, @ref{doc-strcat,,strcat}, @ref{doc-cstrcat,,cstrcat}} @end deftypefn diff -cNr octave-3.2.0/doc/interpreter/testfun.texi octave-3.2.2/doc/interpreter/testfun.texi *** octave-3.2.0/doc/interpreter/testfun.texi 2009-06-03 14:36:35.000000000 +0200 --- octave-3.2.2/doc/interpreter/testfun.texi 2009-07-21 07:11:11.000000000 +0200 *************** *** 352,358 **** @anchor{doc-assert} @deftypefn {Function File} {} assert (@var{cond}) @deftypefnx {Function File} {} assert (@var{cond}, @var{errmsg}, @dots{}) ! @deftypefnx {Function File} {} assert (@var{cond}, @{var{msg_id}, @var{errmsg}, @dots{}) @deftypefnx {Function File} {} assert (@var{observed},@var{expected}) @deftypefnx {Function File} {} assert (@var{observed},@var{expected},@var{tol}) --- 352,358 ---- @anchor{doc-assert} @deftypefn {Function File} {} assert (@var{cond}) @deftypefnx {Function File} {} assert (@var{cond}, @var{errmsg}, @dots{}) ! @deftypefnx {Function File} {} assert (@var{cond}, @var{msg_id}, @var{errmsg}, @dots{}) @deftypefnx {Function File} {} assert (@var{observed},@var{expected}) @deftypefnx {Function File} {} assert (@var{observed},@var{expected},@var{tol}) diff -cNr octave-3.2.0/doc/interpreter/tips.texi octave-3.2.2/doc/interpreter/tips.texi *** octave-3.2.0/doc/interpreter/tips.texi 2009-06-03 14:36:35.000000000 +0200 --- octave-3.2.2/doc/interpreter/tips.texi 2009-07-21 07:11:11.000000000 +0200 *************** *** 87,100 **** @itemize @bullet @item ! Avoid looping wherever possible. @item ! Use iteration rather than recursion whenever possible. ! Function calls are slow in Octave. @item ! Avoid resizing matrices unnecessarily. When building a single result matrix from a series of calculations, set the size of the result matrix first, then insert values into it. Write --- 87,169 ---- @itemize @bullet @item ! Vectorize loops. For instance, rather than ! @example ! for i = 1:n-1 ! a(i) = b(i+1) - b(i); ! endfor ! @end example ! ! write ! ! @example ! a = b(2:n) - b(1:n-1); ! @end example ! ! This is especially important for loops with "cheap" bodies. Often it suffices to vectorize ! just the innermost loop to get acceptable performance. A general rule of thumb is that the ! "order" of the vectorized body should be greater or equal to the "order" of the enclosing loop. ! ! @item ! Use built-in and library functions if possible. Built-in and compiled functions are very fast. ! Even with a m-file library function, chances are good that it is already optimized, or will be ! optimized more in a future release. @item ! Avoid computing costly intermediate results multiple times. Octave currently ! does not eliminate common subexpressions. @item ! Be aware of lazy copies (copy-on-write). When a copy of an object ! is created, the data is not immediately copied, but rather shared. The actual ! copying is postponed until the copied data needs to be modified. For example: ! ! @example ! a = zeros (1000); # create a 1000x1000 matrix ! b = a; # no copying done here ! b(1) = 1; # copying done here ! @end example ! ! Lazy copying applies to whole Octave objects such as matrices, cells, struct, ! and also individual cell or struct elements (not array elements). ! ! Additionally, index expressions also use lazy copying when Octave can determine ! that the indexed portion is contiguous in memory. For example: ! ! @example ! a = zeros (1000); # create a 1000x1000 matrix ! b = a(:,10:100); # no copying done here ! b = a(10:100,:); # copying done here ! @end example ! ! This applies to arrays (matrices), cell arrays, and structs indexed using (). ! Index expressions generating cs-lists can also benefit of shallow copying ! in some cases. In particular, when @var{a} is a struct array, expressions like ! @code{@{a.x@}, @{a(:,2).x@}} will use lazy copying, so that data can be shared ! between a struct array and a cell array. ! ! Most indexing expressions do not live longer than their `parent' objects. ! In rare cases, however, a lazily copied slice outlasts its parent, in which ! case it becomes orphaned, still occupying unnecessarily more memory than needed. ! To provide a remedy working in most real cases, ! Octave checks for orphaned lazy slices at certain situations, when a value ! is stored into a "permanent" location, such as a named variable or cell or ! struct element, and possibly economizes them. For example ! ! @example ! a = zeros (1000); # create a 1000x1000 matrix ! b = a(:,10:100); # lazy slice ! a = []; # the original a array is still allocated ! c@{1@} = b; # b is reallocated at this point ! @end example ! ! @item ! Avoid deep recursion. Function calls to m-file functions carry a relatively significant overhead, ! so rewriting a recursion as a loop often helps. Also, note that the maximum level of recursion is ! limited. ! ! @item ! Avoid resizing matrices unnecessarily. When building a single result matrix from a series of calculations, set the size of the result matrix first, then insert values into it. Write *************** *** 121,128 **** @end group @end example @item ! Avoid calling @code{eval} or @code{feval} whenever possible, because they require Octave to parse input or look up the name of a function in the symbol table. --- 190,228 ---- @end group @end example + Sometimes the number of items can't be computed in advance, and stack-like operations + are needed. When elements are being repeatedly inserted at/removed from the end of an + array, Octave detects it as stack usage and attempts to use a smarter memory management + strategy preallocating the array in bigger chunks. Likewise works for cell and + struct arrays. + + @example + a = []; + while (condition) + @dots{} + a(end+1) = value; # "push" operation + @dots{} + a(end) = []; # "pop" operation + @dots{} + endwhile + @end example + + @item + Use @code{cellfun} intelligently. The @code{cellfun} function is a useful tool + for avoiding loops. @xref{Processing Data in Cell Arrays}. + @code{cellfun} is often use with anonymous function handles; however, calling + an anonymous function involves an overhead quite comparable to the overhead + of an m-file function. Passing a handle to a built-in function is faster, + because the interpreter is not involved in the internal loop. For example: + + @example + a = @{@dots{}@} + v = cellfun (@@(x) det(x), a); # compute determinants + v = cellfun (@@det, a); # faster + @end example + @item ! Avoid calling @code{eval} or @code{feval} excessively, because they require Octave to parse input or look up the name of a function in the symbol table. *************** *** 245,251 **** author of the library. @example ! ## Author: John W. Eaton @end example @item Maintainer --- 345,351 ---- author of the library. @example ! ## Author: John W. Eaton @end example @item Maintainer diff -cNr octave-3.2.0/doc/interpreter/tips.txi octave-3.2.2/doc/interpreter/tips.txi *** octave-3.2.0/doc/interpreter/tips.txi 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/tips.txi 2009-06-18 07:09:18.000000000 +0200 *************** *** 85,98 **** @itemize @bullet @item ! Avoid looping wherever possible. @item ! Use iteration rather than recursion whenever possible. ! Function calls are slow in Octave. @item ! Avoid resizing matrices unnecessarily. When building a single result matrix from a series of calculations, set the size of the result matrix first, then insert values into it. Write --- 85,167 ---- @itemize @bullet @item ! Vectorize loops. For instance, rather than ! @example ! for i = 1:n-1 ! a(i) = b(i+1) - b(i); ! endfor ! @end example ! ! write ! ! @example ! a = b(2:n) - b(1:n-1); ! @end example ! ! This is especially important for loops with "cheap" bodies. Often it suffices to vectorize ! just the innermost loop to get acceptable performance. A general rule of thumb is that the ! "order" of the vectorized body should be greater or equal to the "order" of the enclosing loop. ! ! @item ! Use built-in and library functions if possible. Built-in and compiled functions are very fast. ! Even with a m-file library function, chances are good that it is already optimized, or will be ! optimized more in a future release. @item ! Avoid computing costly intermediate results multiple times. Octave currently ! does not eliminate common subexpressions. @item ! Be aware of lazy copies (copy-on-write). When a copy of an object ! is created, the data is not immediately copied, but rather shared. The actual ! copying is postponed until the copied data needs to be modified. For example: ! ! @example ! a = zeros (1000); # create a 1000x1000 matrix ! b = a; # no copying done here ! b(1) = 1; # copying done here ! @end example ! ! Lazy copying applies to whole Octave objects such as matrices, cells, struct, ! and also individual cell or struct elements (not array elements). ! ! Additionally, index expressions also use lazy copying when Octave can determine ! that the indexed portion is contiguous in memory. For example: ! ! @example ! a = zeros (1000); # create a 1000x1000 matrix ! b = a(:,10:100); # no copying done here ! b = a(10:100,:); # copying done here ! @end example ! ! This applies to arrays (matrices), cell arrays, and structs indexed using (). ! Index expressions generating cs-lists can also benefit of shallow copying ! in some cases. In particular, when @var{a} is a struct array, expressions like ! @code{@{a.x@}, @{a(:,2).x@}} will use lazy copying, so that data can be shared ! between a struct array and a cell array. ! ! Most indexing expressions do not live longer than their `parent' objects. ! In rare cases, however, a lazily copied slice outlasts its parent, in which ! case it becomes orphaned, still occupying unnecessarily more memory than needed. ! To provide a remedy working in most real cases, ! Octave checks for orphaned lazy slices at certain situations, when a value ! is stored into a "permanent" location, such as a named variable or cell or ! struct element, and possibly economizes them. For example ! ! @example ! a = zeros (1000); # create a 1000x1000 matrix ! b = a(:,10:100); # lazy slice ! a = []; # the original a array is still allocated ! c@{1@} = b; # b is reallocated at this point ! @end example ! ! @item ! Avoid deep recursion. Function calls to m-file functions carry a relatively significant overhead, ! so rewriting a recursion as a loop often helps. Also, note that the maximum level of recursion is ! limited. ! ! @item ! Avoid resizing matrices unnecessarily. When building a single result matrix from a series of calculations, set the size of the result matrix first, then insert values into it. Write *************** *** 119,126 **** @end group @end example @item ! Avoid calling @code{eval} or @code{feval} whenever possible, because they require Octave to parse input or look up the name of a function in the symbol table. --- 188,226 ---- @end group @end example + Sometimes the number of items can't be computed in advance, and stack-like operations + are needed. When elements are being repeatedly inserted at/removed from the end of an + array, Octave detects it as stack usage and attempts to use a smarter memory management + strategy preallocating the array in bigger chunks. Likewise works for cell and + struct arrays. + + @example + a = []; + while (condition) + @dots{} + a(end+1) = value; # "push" operation + @dots{} + a(end) = []; # "pop" operation + @dots{} + endwhile + @end example + + @item + Use @code{cellfun} intelligently. The @code{cellfun} function is a useful tool + for avoiding loops. @xref{Processing Data in Cell Arrays}. + @code{cellfun} is often use with anonymous function handles; however, calling + an anonymous function involves an overhead quite comparable to the overhead + of an m-file function. Passing a handle to a built-in function is faster, + because the interpreter is not involved in the internal loop. For example: + + @example + a = @{@dots{}@} + v = cellfun (@@(x) det(x), a); # compute determinants + v = cellfun (@@det, a); # faster + @end example + @item ! Avoid calling @code{eval} or @code{feval} excessively, because they require Octave to parse input or look up the name of a function in the symbol table. *************** *** 243,249 **** author of the library. @example ! ## Author: John W. Eaton @end example @item Maintainer --- 343,349 ---- author of the library. @example ! ## Author: John W. Eaton @end example @item Maintainer diff -cNr octave-3.2.0/doc/interpreter/var.texi octave-3.2.2/doc/interpreter/var.texi *** octave-3.2.0/doc/interpreter/var.texi 2009-06-03 14:36:35.000000000 +0200 --- octave-3.2.2/doc/interpreter/var.texi 2009-07-21 07:11:11.000000000 +0200 *************** *** 393,399 **** The value of a persistent variable is kept in memory until it is explicitly cleared. Assuming that the implementation of @code{count_calls} ! is saved on disc, we get the following behavior. @example for i = 1:2 --- 393,399 ---- The value of a persistent variable is kept in memory until it is explicitly cleared. Assuming that the implementation of @code{count_calls} ! is saved on disk, we get the following behavior. @example for i = 1:2 *************** *** 454,501 **** @c variables.cc @anchor{doc-who} ! @deffn {Command} who options pattern @dots{} ! @deffnx {Command} whos options pattern @dots{} ! List currently defined symbols matching the given patterns. The ! following are valid options. They may be shortened to one character but ! may not be combined. @table @code @item global ! List the variables in the global scope rather than the current scope. @item -regexp ! The patterns are considered as regular expressions and will be used ! for matching the variables to display. The same pattern syntax as for the @code{regexp} function is used. @item -file ! The following argument is treated as a filename, and the variables that ! are found within this file are listed. @end table ! Valid patterns are the same as described for the @code{clear} command ! above. If no patterns are supplied, all symbols from the given category ! are listed. By default, only user defined functions and variables ! visible in the local scope are displayed. ! ! The command @kbd{whos} is equivalent to @kbd{who -long}. ! @seealso{@ref{doc-regexp,,regexp}} @end deffn @c variables.cc @anchor{doc-whos} ! @deffn {Command} whos options pattern @dots{} ! See who. @end deffn @c variables.cc @anchor{doc-whos_line_format} ! @deftypefn {Built-in Function} {@var{val} =} whos_line_format () @deftypefnx {Built-in Function} {@var{old_val} =} whos_line_format (@var{new_val}) ! Query or set the format string used by the @code{whos}. - The following escape sequences may be used in the format: @table @code @item %a Prints attributes of variables (g=global, p=persistent, --- 454,549 ---- @c variables.cc @anchor{doc-who} ! @deffn {Command} who ! @deffnx {Command} who pattern @dots{} ! @deffnx {Command} who option pattern @dots{} ! @deffnx {Command} C = who("pattern", @dots{}) ! List currently defined variables matching the given patterns. Valid ! pattern syntax is the same as described for the @code{clear} command. ! If no patterns are supplied, all variables are listed. ! By default, only variables visible in the local scope are displayed. ! ! The following are valid options but may not be combined. @table @code @item global ! List variables in the global scope rather than the current scope. @item -regexp ! The patterns are considered to be regular expressions when matching the ! variables to display. The same pattern syntax accepted by the @code{regexp} function is used. @item -file ! The next argument is treated as a filename. All variables found within the ! specified file are listed. No patterns are accepted when reading variables ! from a file. @end table ! If called as a function, return a cell array of defined variable names ! matching the given patterns. ! @seealso{@ref{doc-whos,,whos}, @ref{doc-regexp,,regexp}} @end deffn @c variables.cc @anchor{doc-whos} ! @deffn {Command} whos ! @deffnx {Command} whos pattern @dots{} ! @deffnx {Command} whos option pattern @dots{} ! @deffnx {Command} S = whos("pattern", @dots{}) ! Provide detailed information on currently defined variables matching the ! given patterns. Options and pattern syntax are the same as for the ! @code{who} command. Extended information about each variable is ! summarized in a table with the following default entries. ! ! @table @asis ! @item Attr ! Attributes of the listed variable. Possible attributes are: ! @table @asis ! @item blank ! Variable in local scope ! @item @code{g} ! Variable with global scope ! @item @code{p} ! Persistent variable ! @end table ! @item Name ! The name of the variable. ! @item Size ! The logical size of the variable. A scalar is 1x1, a vector is 1xN or Nx1, ! a 2-D matrix is MxN. ! @item Bytes ! The amount of memory currently used to store the variable. ! @item Class ! The class of the variable. Examples include double, single, char, uint16, ! cell, and struct. ! @end table ! ! The table can be customized to display more or less information through ! the function @code{whos_line_format}. ! ! If @code{whos} is called as a function, return a struct array of defined ! variable names matching the given patterns. Fields in the structure ! describing each variable are: name, size, bytes, class, global, sparse, ! complex, nesting, persistent. ! @seealso{@ref{doc-who,,who}, @ref{doc-whos_line_format,,whos_line_format}} @end deffn @c variables.cc @anchor{doc-whos_line_format} ! @deftypefn {Built-in Function} {@var{val} =} whos_line_format () @deftypefnx {Built-in Function} {@var{old_val} =} whos_line_format (@var{new_val}) ! Query or set the format string used by the command @code{whos}. ! ! A full format string is: ! ! @c Set example in small font to prevent overfull line ! @smallexample ! %[modifier][:width[:left-min[:balance]]]; ! @end smallexample ! ! The following command sequences are available: @table @code @item %a Prints attributes of variables (g=global, p=persistent, *************** *** 514,545 **** Prints type names of variables. @end table ! Every command may also have a modifier: @table @code @item l Left alignment. @item r ! Right alignment (this is the default). @item c ! Centered (may only be applied to command %s). @end table ! A command is composed like this: ! ! @c Set example in small font to prevent overfull line ! @smallexample ! %[modifier][:size_of_parameter[:center-specific[:balance]]]; ! @end smallexample ! ! Command and modifier is already explained. The @code{size_of_parameter} ! parameter tells how many columns the parameter will need for printing. ! The @code{center-specific} parameter may only be applied to command ! @samp{%s}. ! The @code{balance} parameter specifies the offset for printing ! the dimensions string. The default format is @code{" %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\n"}. @end deftypefn --- 562,592 ---- Prints type names of variables. @end table ! Every command may also have an alignment modifier: ! @table @code @item l Left alignment. @item r ! Right alignment (default). @item c ! Column-aligned (only applicable to command %s). @end table ! The @code{width} parameter is a positive integer specifying the minimum ! number of columns used for printing. No maximum is needed as the field will ! auto-expand as required. ! ! The parameters @code{left-min} and @code{balance} are only available when the ! column-aligned modifier is used with the command @samp{%s}. ! @code{balance} specifies the column number within the field width which will ! be aligned between entries. Numbering starts from 0 which indicates the ! leftmost column. @code{left-min} specifies the minimum field width to the ! left of the specified balance column. The default format is @code{" %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\n"}. + @seealso{@ref{doc-whos,,whos}} @end deftypefn diff -cNr octave-3.2.0/doc/interpreter/var.txi octave-3.2.2/doc/interpreter/var.txi *** octave-3.2.0/doc/interpreter/var.txi 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/interpreter/var.txi 2009-06-08 07:34:32.000000000 +0200 *************** *** 265,271 **** The value of a persistent variable is kept in memory until it is explicitly cleared. Assuming that the implementation of @code{count_calls} ! is saved on disc, we get the following behavior. @example for i = 1:2 --- 265,271 ---- The value of a persistent variable is kept in memory until it is explicitly cleared. Assuming that the implementation of @code{count_calls} ! is saved on disk, we get the following behavior. @example for i = 1:2 Files octave-3.2.0/doc/liboctave/liboctave.pdf and octave-3.2.2/doc/liboctave/liboctave.pdf differ diff -cNr octave-3.2.0/doc/Makefile.in octave-3.2.2/doc/Makefile.in *** octave-3.2.0/doc/Makefile.in 2009-06-03 13:55:40.000000000 +0200 --- octave-3.2.2/doc/Makefile.in 2009-06-25 06:36:29.000000000 +0200 *************** *** 2,10 **** # Makefile for octave's doc directory # # John W. Eaton ! # jwe@bevo.che.wisc.edu ! # University of Wisconsin-Madison ! # Department of Chemical Engineering TOPDIR = .. --- 2,8 ---- # Makefile for octave's doc directory # # John W. Eaton ! # jwe@octave.org TOPDIR = .. *************** *** 61,67 **** maintainer-clean:: rm -f tags TAGS Makefile ! dist: conf.texi ln $(DISTFILES) ../`cat ../.fname`/doc for dir in $(DISTSUBDIRS); do mkdir ../`cat ../.fname`/doc/$$dir; $(MAKE) -C $$dir $@; done .PHONY: dist --- 59,65 ---- maintainer-clean:: rm -f tags TAGS Makefile ! dist: ln $(DISTFILES) ../`cat ../.fname`/doc for dir in $(DISTSUBDIRS); do mkdir ../`cat ../.fname`/doc/$$dir; $(MAKE) -C $$dir $@; done .PHONY: dist Files octave-3.2.0/doc/refcard/refcard-a4.pdf and octave-3.2.2/doc/refcard/refcard-a4.pdf differ Files octave-3.2.0/doc/refcard/refcard-legal.pdf and octave-3.2.2/doc/refcard/refcard-legal.pdf differ Files octave-3.2.0/doc/refcard/refcard-letter.pdf and octave-3.2.2/doc/refcard/refcard-letter.pdf differ diff -cNr octave-3.2.0/doc/refcard/refcard.tex octave-3.2.2/doc/refcard/refcard.tex *** octave-3.2.0/doc/refcard/refcard.tex 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/doc/refcard/refcard.tex 2009-06-11 07:13:21.000000000 +0200 *************** *** 961,967 **** {\smrm\parskip=6pt Edition \refcardedition\ for Octave Version \octaveversion. Copyright 1996, 2007, John W. Eaton ! (jwe@bevo.che.wisc.edu). The author assumes no responsibility for any errors on this card. This card may be freely distributed under the terms of the GNU --- 961,967 ---- {\smrm\parskip=6pt Edition \refcardedition\ for Octave Version \octaveversion. Copyright 1996, 2007, John W. Eaton ! (jwe@octave.org). The author assumes no responsibility for any errors on this card. This card may be freely distributed under the terms of the GNU diff -cNr octave-3.2.0/emacs/octave-hlp.el octave-3.2.2/emacs/octave-hlp.el *** octave-3.2.0/emacs/octave-hlp.el 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/emacs/octave-hlp.el 2009-06-11 07:13:21.000000000 +0200 *************** *** 4,10 **** ;; Free Software Foundation, Inc. ;; Author: Kurt Hornik ! ;; Author: John Eaton ;; Maintainer: Kurt Hornik ;; Keywords: languages --- 4,10 ---- ;; Free Software Foundation, Inc. ;; Author: Kurt Hornik ! ;; Author: John Eaton ;; Maintainer: Kurt Hornik ;; Keywords: languages diff -cNr octave-3.2.0/emacs/octave-inf.el octave-3.2.2/emacs/octave-inf.el *** octave-3.2.0/emacs/octave-inf.el 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/emacs/octave-inf.el 2009-06-11 07:13:21.000000000 +0200 *************** *** 4,10 **** ;; Free Software Foundation, Inc. ;; Author: Kurt Hornik ! ;; Author: John Eaton ;; Maintainer: Kurt Hornik ;; Keywords: languages --- 4,10 ---- ;; Free Software Foundation, Inc. ;; Author: Kurt Hornik ! ;; Author: John Eaton ;; Maintainer: Kurt Hornik ;; Keywords: languages diff -cNr octave-3.2.0/emacs/octave-mod.el octave-3.2.2/emacs/octave-mod.el *** octave-3.2.0/emacs/octave-mod.el 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/emacs/octave-mod.el 2009-06-11 07:13:21.000000000 +0200 *************** *** 4,10 **** ;; Free Software Foundation, Inc. ;; Author: Kurt Hornik ! ;; Author: John Eaton ;; Maintainer: Kurt Hornik ;; Keywords: languages --- 4,10 ---- ;; Free Software Foundation, Inc. ;; Author: Kurt Hornik ! ;; Author: John Eaton ;; Maintainer: Kurt Hornik ;; Keywords: languages diff -cNr octave-3.2.0/examples/@polynomial/subsasgn.m octave-3.2.2/examples/@polynomial/subsasgn.m *** octave-3.2.0/examples/@polynomial/subsasgn.m 2009-06-02 10:21:40.000000000 +0200 --- octave-3.2.2/examples/@polynomial/subsasgn.m 2009-06-12 10:45:14.000000000 +0200 *************** *** 9,15 **** error ("polynomial: need exactly one index"); else if (length (s) == 1) ! p.poly(ind{1}+1) = val; else error ("polynomial: chained subscripts not allowed for {}"); endif --- 9,19 ---- error ("polynomial: need exactly one index"); else if (length (s) == 1) ! if (isnumeric (ind{1})) ! p.poly(ind{1}+1) = val; ! else ! p.poly(ind{1}) = val; ! endif else error ("polynomial: chained subscripts not allowed for {}"); endif diff -cNr octave-3.2.0/examples/@polynomial/subsref.m octave-3.2.2/examples/@polynomial/subsref.m *** octave-3.2.0/examples/@polynomial/subsref.m 2009-06-02 10:21:40.000000000 +0200 --- octave-3.2.2/examples/@polynomial/subsref.m 2009-06-12 10:45:14.000000000 +0200 *************** *** 15,21 **** if (numel (ind) != 1) error ("polynomial: need exactly one index"); else ! b = a.poly(ind{1}+1); endif case "." fld = s.subs; --- 15,25 ---- if (numel (ind) != 1) error ("polynomial: need exactly one index"); else ! if (isnumeric (ind{1})) ! b = a.poly(ind{1}+1); ! else ! b = a.poly(ind{1}); ! endif endif case "." fld = s.subs; diff -cNr octave-3.2.0/libcruft/ChangeLog octave-3.2.2/libcruft/ChangeLog *** octave-3.2.0/libcruft/ChangeLog 2009-06-03 14:32:51.000000000 +0200 --- octave-3.2.2/libcruft/ChangeLog 2009-07-21 06:52:30.000000000 +0200 *************** *** 1,3 **** --- 1,19 ---- + 2009-07-21 Jaroslav Hajek + + Version 3.2.2 released. + + 2009-06-22 John W. Eaton + + * Makefile.in (MISC_OBJ): Remove misc/machar.o and misc/smachar.o + from the list. + + * misc/i1mach.f, misc/r1mach.f, misc/d1mach.f: Rewite in terms of + LAPACK functions slamch and dlamch. + * misc/machar.c: Delete. + * misc/Makefile.in (CSRC): Remove machar.c from the list. + (CEXTRA, XCC, XALL_CFLAGS): Delete variables. + (machar.o, smachar.o, pic/machar.o, pic/smachar.o): Delete rules. + 2009-05-25 Jaroslav Hajek Version 3.2.0 released. diff -cNr octave-3.2.0/libcruft/Makefile.in octave-3.2.2/libcruft/Makefile.in *** octave-3.2.0/libcruft/Makefile.in 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/libcruft/Makefile.in 2009-06-24 08:45:41.000000000 +0200 *************** *** 75,82 **** # FIXME -- this should build the shared library directly from # a normal archive file (created from PIC code, though). ! MISC_OBJ := misc/machar.o misc/smachar.o misc/f77-extern.o \ ! misc/f77-fcn.o misc/lo-error.o misc/quit.o misc/cquit.o CRUFT_FSRC := $(foreach dir, $(SUBDIRS), $(wildcard $(srcdir)/$(dir)/*.f)) CRUFT_OBJ2 := $(patsubst $(srcdir)/%, %, $(CRUFT_FSRC)) --- 75,82 ---- # FIXME -- this should build the shared library directly from # a normal archive file (created from PIC code, though). ! MISC_OBJ := misc/f77-extern.o misc/f77-fcn.o misc/lo-error.o \ ! misc/quit.o misc/cquit.o CRUFT_FSRC := $(foreach dir, $(SUBDIRS), $(wildcard $(srcdir)/$(dir)/*.f)) CRUFT_OBJ2 := $(patsubst $(srcdir)/%, %, $(CRUFT_FSRC)) diff -cNr octave-3.2.0/libcruft/misc/d1mach.f octave-3.2.2/libcruft/misc/d1mach.f *** octave-3.2.0/libcruft/misc/d1mach.f 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/libcruft/misc/d1mach.f 2009-06-24 08:13:17.000000000 +0200 *************** *** 2,18 **** integer i logical init double precision dmach(5) save init, dmach data init /.false./ if (.not. init) then ! call machar (dmach(1), dmach(2), dmach(3), dmach(4), dmach(5)) init = .true. endif ! if (i .lt. 1 .or. i .gt. 5) goto 999 d1mach = dmach(i) return ! 999 write(*,1999) i ! 1999 format(' d1mach - i out of bounds', i10) call xstopx (' ') d1mach = 0 end --- 2,24 ---- integer i logical init double precision dmach(5) + double precision dlamch + external dlamch save init, dmach data init /.false./ if (.not. init) then ! dmach(1) = dlamch ('u') ! dmach(2) = dlamch ('o') ! dmach(3) = dlamch ('e') ! dmach(4) = dlamch ('p') ! dmach(5) = log10 (dlamch ('b')) init = .true. endif ! if (i .lt. 1 .or. i .gt. 5) goto 999 d1mach = dmach(i) return ! 999 write (*, 1999) i ! 1999 format (' d1mach - i out of bounds', i10) call xstopx (' ') d1mach = 0 end diff -cNr octave-3.2.0/libcruft/misc/i1mach.f octave-3.2.2/libcruft/misc/i1mach.f *** octave-3.2.0/libcruft/misc/i1mach.f 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/libcruft/misc/i1mach.f 2009-06-24 08:13:17.000000000 +0200 *************** *** 1,528 **** ! INTEGER FUNCTION I1MACH(I) ! C ! C I/O UNIT NUMBERS. ! C ! C I1MACH( 1) = THE STANDARD INPUT UNIT. ! C ! C I1MACH( 2) = THE STANDARD OUTPUT UNIT. ! C ! C I1MACH( 3) = THE STANDARD PUNCH UNIT. ! C ! C I1MACH( 4) = THE STANDARD ERROR MESSAGE UNIT. ! C ! C WORDS. ! C ! C I1MACH( 5) = THE NUMBER OF BITS PER INTEGER STORAGE UNIT. ! C ! C I1MACH( 6) = THE NUMBER OF CHARACTERS PER CHARACTER STORAGE UNIT. ! C FOR FORTRAN 77, THIS IS ALWAYS 1. FOR FORTRAN 66, ! C CHARACTER STORAGE UNIT = INTEGER STORAGE UNIT. ! C ! C INTEGERS. ! C ! C ASSUME INTEGERS ARE REPRESENTED IN THE S-DIGIT, BASE-A FORM ! C ! C SIGN ( X(S-1)*A**(S-1) + ... + X(1)*A + X(0) ) ! C ! C WHERE 0 .LE. X(I) .LT. A FOR I=0,...,S-1. ! C ! C I1MACH( 7) = A, THE BASE. ! C ! C I1MACH( 8) = S, THE NUMBER OF BASE-A DIGITS. ! C ! C I1MACH( 9) = A**S - 1, THE LARGEST MAGNITUDE. ! C ! C FLOATING-POINT NUMBERS. ! C ! C ASSUME FLOATING-POINT NUMBERS ARE REPRESENTED IN THE T-DIGIT, ! C BASE-B FORM ! C ! C SIGN (B**E)*( (X(1)/B) + ... + (X(T)/B**T) ) ! C ! C WHERE 0 .LE. X(I) .LT. B FOR I=1,...,T, ! C 0 .LT. X(1), AND EMIN .LE. E .LE. EMAX. ! C ! C I1MACH(10) = B, THE BASE. ! C ! C SINGLE-PRECISION ! C ! C I1MACH(11) = T, THE NUMBER OF BASE-B DIGITS. ! C ! C I1MACH(12) = EMIN, THE SMALLEST EXPONENT E. ! C ! C I1MACH(13) = EMAX, THE LARGEST EXPONENT E. ! C ! C DOUBLE-PRECISION ! C ! C I1MACH(14) = T, THE NUMBER OF BASE-B DIGITS. ! C ! C I1MACH(15) = EMIN, THE SMALLEST EXPONENT E. ! C ! C I1MACH(16) = EMAX, THE LARGEST EXPONENT E. ! C ! C TO ALTER THIS FUNCTION FOR A PARTICULAR ENVIRONMENT, ! C THE DESIRED SET OF DATA STATEMENTS SHOULD BE ACTIVATED BY ! C REMOVING THE C FROM COLUMN 1. ALSO, THE VALUES OF ! C I1MACH(1) - I1MACH(4) SHOULD BE CHECKED FOR CONSISTENCY ! C WITH THE LOCAL OPERATING SYSTEM. FOR FORTRAN 77, YOU MAY WISH ! C TO ADJUST THE DATA STATEMENT SO IMACH(6) IS SET TO 1, AND ! C THEN TO COMMENT OUT THE EXECUTABLE TEST ON I .EQ. 6 BELOW. ! C ON RARE MACHINES A STATIC STATEMENT MAY NEED TO BE ADDED. ! C (BUT PROBABLY MORE SYSTEMS PROHIBIT IT THAN REQUIRE IT.) ! C ! C FOR IEEE-ARITHMETIC MACHINES (BINARY STANDARD), THE FIRST ! C SET OF CONSTANTS BELOW SHOULD BE APPROPRIATE, EXCEPT PERHAPS ! C FOR IMACH(1) - IMACH(4). ! C ! INTEGER IMACH(16),OUTPUT,SANITY ! C ! EQUIVALENCE (IMACH(4),OUTPUT) ! C ! C MACHINE CONSTANTS FOR IEEE ARITHMETIC MACHINES, SUCH AS THE AT&T ! C 3B SERIES, MOTOROLA 68000 BASED MACHINES (E.G. SUN 3 AND AT&T ! C PC 7300), AND 8087 BASED MICROS (E.G. IBM PC AND AT&T 6300). ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 32 / ! C DATA IMACH( 6) / 4 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 31 / ! C DATA IMACH( 9) / 2147483647 / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 24 / ! C DATA IMACH(12) / -125 / ! C DATA IMACH(13) / 128 / ! C DATA IMACH(14) / 53 / ! C DATA IMACH(15) / -1021 / ! C DATA IMACH(16) / 1024 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR AMDAHL MACHINES. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 32 / ! C DATA IMACH( 6) / 4 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 31 / ! C DATA IMACH( 9) / 2147483647 / ! C DATA IMACH(10) / 16 / ! C DATA IMACH(11) / 6 / ! C DATA IMACH(12) / -64 / ! C DATA IMACH(13) / 63 / ! C DATA IMACH(14) / 14 / ! C DATA IMACH(15) / -64 / ! C DATA IMACH(16) / 63 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE BURROUGHS 1700 SYSTEM. ! C ! C DATA IMACH( 1) / 7 / ! C DATA IMACH( 2) / 2 / ! C DATA IMACH( 3) / 2 / ! C DATA IMACH( 4) / 2 / ! C DATA IMACH( 5) / 36 / ! C DATA IMACH( 6) / 4 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 33 / ! C DATA IMACH( 9) / Z1FFFFFFFF / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 24 / ! C DATA IMACH(12) / -256 / ! C DATA IMACH(13) / 255 / ! C DATA IMACH(14) / 60 / ! C DATA IMACH(15) / -256 / ! C DATA IMACH(16) / 255 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE BURROUGHS 5700 SYSTEM. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 48 / ! C DATA IMACH( 6) / 6 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 39 / ! C DATA IMACH( 9) / O0007777777777777 / ! C DATA IMACH(10) / 8 / ! C DATA IMACH(11) / 13 / ! C DATA IMACH(12) / -50 / ! C DATA IMACH(13) / 76 / ! C DATA IMACH(14) / 26 / ! C DATA IMACH(15) / -50 / ! C DATA IMACH(16) / 76 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE BURROUGHS 6700/7700 SYSTEMS. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 48 / ! C DATA IMACH( 6) / 6 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 39 / ! C DATA IMACH( 9) / O0007777777777777 / ! C DATA IMACH(10) / 8 / ! C DATA IMACH(11) / 13 / ! C DATA IMACH(12) / -50 / ! C DATA IMACH(13) / 76 / ! C DATA IMACH(14) / 26 / ! C DATA IMACH(15) / -32754 / ! C DATA IMACH(16) / 32780 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR FTN4 ON THE CDC 6000/7000 SERIES. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 60 / ! C DATA IMACH( 6) / 10 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 48 / ! C DATA IMACH( 9) / 00007777777777777777B / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 47 / ! C DATA IMACH(12) / -929 / ! C DATA IMACH(13) / 1070 / ! C DATA IMACH(14) / 94 / ! C DATA IMACH(15) / -929 / ! C DATA IMACH(16) / 1069 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR FTN5 ON THE CDC 6000/7000 SERIES. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 60 / ! C DATA IMACH( 6) / 10 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 48 / ! C DATA IMACH( 9) / O"00007777777777777777" / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 47 / ! C DATA IMACH(12) / -929 / ! C DATA IMACH(13) / 1070 / ! C DATA IMACH(14) / 94 / ! C DATA IMACH(15) / -929 / ! C DATA IMACH(16) / 1069 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR CONVEX C-1. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 32 / ! C DATA IMACH( 6) / 4 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 31 / ! C DATA IMACH( 9) / 2147483647 / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 24 / ! C DATA IMACH(12) / -128 / ! C DATA IMACH(13) / 127 / ! C DATA IMACH(14) / 53 / ! C DATA IMACH(15) /-1024 / ! C DATA IMACH(16) / 1023 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE CRAY 1, XMP, 2, AND 3. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 102 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 64 / ! C DATA IMACH( 6) / 8 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 63 / ! C DATA IMACH( 9) / 777777777777777777777B / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 47 / ! C DATA IMACH(12) / -8189 / ! C DATA IMACH(13) / 8190 / ! C DATA IMACH(14) / 94 / ! C DATA IMACH(15) / -8099 / ! C DATA IMACH(16) / 8190 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE DATA GENERAL ECLIPSE S/200. ! C ! C DATA IMACH( 1) / 11 / ! C DATA IMACH( 2) / 12 / ! C DATA IMACH( 3) / 8 / ! C DATA IMACH( 4) / 10 / ! C DATA IMACH( 5) / 16 / ! C DATA IMACH( 6) / 2 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 15 / ! C DATA IMACH( 9) /32767 / ! C DATA IMACH(10) / 16 / ! C DATA IMACH(11) / 6 / ! C DATA IMACH(12) / -64 / ! C DATA IMACH(13) / 63 / ! C DATA IMACH(14) / 14 / ! C DATA IMACH(15) / -64 / ! C DATA IMACH(16) / 63 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE HARRIS SLASH 6 AND SLASH 7. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 0 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 24 / ! C DATA IMACH( 6) / 3 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 23 / ! C DATA IMACH( 9) / 8388607 / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 23 / ! C DATA IMACH(12) / -127 / ! C DATA IMACH(13) / 127 / ! C DATA IMACH(14) / 38 / ! C DATA IMACH(15) / -127 / ! C DATA IMACH(16) / 127 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE HONEYWELL DPS 8/70 SERIES. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 43 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 36 / ! C DATA IMACH( 6) / 4 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 35 / ! C DATA IMACH( 9) / O377777777777 / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 27 / ! C DATA IMACH(12) / -127 / ! C DATA IMACH(13) / 127 / ! C DATA IMACH(14) / 63 / ! C DATA IMACH(15) / -127 / ! C DATA IMACH(16) / 127 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE IBM 360/370 SERIES, ! C THE XEROX SIGMA 5/7/9 AND THE SEL SYSTEMS 85/86. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 32 / ! C DATA IMACH( 6) / 4 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 31 / ! C DATA IMACH( 9) / Z7FFFFFFF / ! C DATA IMACH(10) / 16 / ! C DATA IMACH(11) / 6 / ! C DATA IMACH(12) / -64 / ! C DATA IMACH(13) / 63 / ! C DATA IMACH(14) / 14 / ! C DATA IMACH(15) / -64 / ! C DATA IMACH(16) / 63 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE INTERDATA 8/32 ! C WITH THE UNIX SYSTEM FORTRAN 77 COMPILER. ! C ! C FOR THE INTERDATA FORTRAN VII COMPILER REPLACE ! C THE Z'S SPECIFYING HEX CONSTANTS WITH Y'S. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 6 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 32 / ! C DATA IMACH( 6) / 4 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 31 / ! C DATA IMACH( 9) / Z'7FFFFFFF' / ! C DATA IMACH(10) / 16 / ! C DATA IMACH(11) / 6 / ! C DATA IMACH(12) / -64 / ! C DATA IMACH(13) / 62 / ! C DATA IMACH(14) / 14 / ! C DATA IMACH(15) / -64 / ! C DATA IMACH(16) / 62 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE PDP-10 (KA PROCESSOR). ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 36 / ! C DATA IMACH( 6) / 5 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 35 / ! C DATA IMACH( 9) / "377777777777 / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 27 / ! C DATA IMACH(12) / -128 / ! C DATA IMACH(13) / 127 / ! C DATA IMACH(14) / 54 / ! C DATA IMACH(15) / -101 / ! C DATA IMACH(16) / 127 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE PDP-10 (KI PROCESSOR). ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 36 / ! C DATA IMACH( 6) / 5 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 35 / ! C DATA IMACH( 9) / "377777777777 / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 27 / ! C DATA IMACH(12) / -128 / ! C DATA IMACH(13) / 127 / ! C DATA IMACH(14) / 62 / ! C DATA IMACH(15) / -128 / ! C DATA IMACH(16) / 127 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR PDP-11 FORTRANS SUPPORTING ! C 32-BIT INTEGER ARITHMETIC. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 32 / ! C DATA IMACH( 6) / 4 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 31 / ! C DATA IMACH( 9) / 2147483647 / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 24 / ! C DATA IMACH(12) / -127 / ! C DATA IMACH(13) / 127 / ! C DATA IMACH(14) / 56 / ! C DATA IMACH(15) / -127 / ! C DATA IMACH(16) / 127 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR PDP-11 FORTRANS SUPPORTING ! C 16-BIT INTEGER ARITHMETIC. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 16 / ! C DATA IMACH( 6) / 2 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 15 / ! C DATA IMACH( 9) / 32767 / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 24 / ! C DATA IMACH(12) / -127 / ! C DATA IMACH(13) / 127 / ! C DATA IMACH(14) / 56 / ! C DATA IMACH(15) / -127 / ! C DATA IMACH(16) / 127 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE PRIME 50 SERIES SYSTEMS ! C WTIH 32-BIT INTEGERS AND 64V MODE INSTRUCTIONS, ! C SUPPLIED BY IGOR BRAY. ! C ! C DATA IMACH( 1) / 1 / ! C DATA IMACH( 2) / 1 / ! C DATA IMACH( 3) / 2 / ! C DATA IMACH( 4) / 1 / ! C DATA IMACH( 5) / 32 / ! C DATA IMACH( 6) / 4 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 31 / ! C DATA IMACH( 9) / :17777777777 / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 23 / ! C DATA IMACH(12) / -127 / ! C DATA IMACH(13) / +127 / ! C DATA IMACH(14) / 47 / ! C DATA IMACH(15) / -32895 / ! C DATA IMACH(16) / +32637 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE SEQUENT BALANCE 8000. ! C ! C DATA IMACH( 1) / 0 / ! C DATA IMACH( 2) / 0 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 0 / ! C DATA IMACH( 5) / 32 / ! C DATA IMACH( 6) / 1 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 31 / ! C DATA IMACH( 9) / 2147483647 / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 24 / ! C DATA IMACH(12) / -125 / ! C DATA IMACH(13) / 128 / ! C DATA IMACH(14) / 53 / ! C DATA IMACH(15) / -1021 / ! C DATA IMACH(16) / 1024 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR THE UNIVAC 1100 SERIES. ! C ! C NOTE THAT THE PUNCH UNIT, I1MACH(3), HAS BEEN SET TO 7 ! C WHICH IS APPROPRIATE FOR THE UNIVAC-FOR SYSTEM. ! C IF YOU HAVE THE UNIVAC-FTN SYSTEM, SET IT TO 1. ! C ! C DATA IMACH( 1) / 5 / ! C DATA IMACH( 2) / 6 / ! C DATA IMACH( 3) / 7 / ! C DATA IMACH( 4) / 6 / ! C DATA IMACH( 5) / 36 / ! C DATA IMACH( 6) / 6 / ! C DATA IMACH( 7) / 2 / ! C DATA IMACH( 8) / 35 / ! C DATA IMACH( 9) / O377777777777 / ! C DATA IMACH(10) / 2 / ! C DATA IMACH(11) / 27 / ! C DATA IMACH(12) / -128 / ! C DATA IMACH(13) / 127 / ! C DATA IMACH(14) / 60 / ! C DATA IMACH(15) /-1024 / ! C DATA IMACH(16) / 1023 /, SANITY/987/ ! C ! C MACHINE CONSTANTS FOR VAX. ! C ! DATA IMACH( 1) / 5 / ! DATA IMACH( 2) / 6 / ! DATA IMACH( 3) / 7 / ! DATA IMACH( 4) / 6 / ! DATA IMACH( 5) / 32 / ! DATA IMACH( 6) / 4 / ! DATA IMACH( 7) / 2 / ! DATA IMACH( 8) / 31 / ! DATA IMACH( 9) / 2147483647 / ! DATA IMACH(10) / 2 / ! DATA IMACH(11) / 24 / ! DATA IMACH(12) / -127 / ! DATA IMACH(13) / 127 / ! DATA IMACH(14) / 56 / ! DATA IMACH(15) / -127 / ! DATA IMACH(16) / 127 /, SANITY/987/ ! C ! C *** ISSUE STOP 777 IF ALL DATA STATEMENTS ARE COMMENTED... ! IF (SANITY .NE. 987) STOP 777 ! IF (I .LT. 1 .OR. I .GT. 16) GO TO 10 ! C ! I1MACH = IMACH(I) ! C/6S ! C/7S ! IF(I.EQ.6) I1MACH=1 ! C/ ! RETURN ! 10 WRITE(OUTPUT,1999) I ! 1999 FORMAT(' I1MACH - I OUT OF BOUNDS',I10) ! CALL XSTOPX (' ') ! I1MACH = 0 ! END --- 1,27 ---- ! integer function i1mach (i) ! integer i, imach(16) ! logical init ! double precision dlamch ! real slamch ! external dlamch, slamch ! save imach, init ! data imach / 5, 6, 0, 6, 32, 4, 2, 31, 2147483647, ! $ 2, 0, 0, 0, 0, 0, 0 / ! data init /.false./ ! if (.not. init) then ! imach(11) = slamch ('n') ! imach(12) = slamch ('m') ! imach(13) = slamch ('l') ! imach(14) = dlamch ('n') ! imach(15) = dlamch ('m') ! imach(16) = dlamch ('l') ! init = .true. ! endif ! if (i .lt. 1 .or. i .gt. 16) goto 999 ! i1mach = imach(i) ! return ! 999 write (*, 1999) i ! 1999 format (' i1mach - i out of bounds', i10) ! call xstopx (' ') ! i1mach = 0 ! end diff -cNr octave-3.2.0/libcruft/misc/machar.c octave-3.2.2/libcruft/misc/machar.c *** octave-3.2.0/libcruft/misc/machar.c 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/libcruft/misc/machar.c 1970-01-01 01:00:00.000000000 +0100 *************** *** 1,480 **** - #ifdef HAVE_CONFIG_H - #include - #endif - - #include - - #ifndef TEST - #include "f77-fcn.h" - #endif - - /* - - This file combines the single and double precision versions of machar, - selected by cc -DSP or cc -DDP. This feature provided by D. G. Hough, - August 3, 1988. - - */ - - #ifdef SP - #define REAL float - #define ZERO 0.0 - #define ONE 1.0 - #define PREC "Single " - #define REALSIZE 1 - #endif - - #ifdef DP - #define REAL double - #define ZERO 0.0e0 - #define ONE 1.0e0 - #define PREC "Double " - #define REALSIZE 2 - #endif - - #include - #include - - #define ABS(xxx) ((xxx>ZERO)?(xxx):(-xxx)) - - static void - rmachar(int *ibeta, int *it, int *irnd, int *ngrd, int *machep, - int *negep, int *iexp, int *minexp, int *maxexp, REAL *eps, - REAL *epsneg, REAL *xmin, REAL *xmax) - - /* - - This subroutine is intended to determine the parameters of the - floating-point arithmetic system specified below. The - determination of the first three uses an extension of an algorithm - due to M. Malcolm, CACM 15 (1972), pp. 949-951, incorporating some, - but not all, of the improvements suggested by M. Gentleman and S. - Marovich, CACM 17 (1974), pp. 276-277. An earlier version of this - program was published in the book Software Manual for the - Elementary Functions by W. J. Cody and W. Waite, Prentice-Hall, - Englewood Cliffs, NJ, 1980. The present program is a - translation of the Fortran 77 program in W. J. Cody, "MACHAR: - A subroutine to dynamically determine machine parameters". - TOMS (14), 1988. - - Parameter values reported are as follows: - - ibeta - the radix for the floating-point representation - it - the number of base ibeta digits in the floating-point - significand - irnd - 0 if floating-point addition chops - 1 if floating-point addition rounds, but not in the - IEEE style - 2 if floating-point addition rounds in the IEEE style - 3 if floating-point addition chops, and there is - partial underflow - 4 if floating-point addition rounds, but not in the - IEEE style, and there is partial underflow - 5 if floating-point addition rounds in the IEEE style, - and there is partial underflow - ngrd - the number of guard digits for multiplication with - truncating arithmetic. It is - 0 if floating-point arithmetic rounds, or if it - truncates and only it base ibeta digits - participate in the post-normalization shift of the - floating-point significand in multiplication; - 1 if floating-point arithmetic truncates and more - than it base ibeta digits participate in the - post-normalization shift of the floating-point - significand in multiplication. - machep - the largest negative integer such that - 1.0+FLOAT(ibeta)**machep .NE. 1.0, except that - machep is bounded below by -(it+3) - negeps - the largest negative integer such that - 1.0-FLOAT(ibeta)**negeps .NE. 1.0, except that - negeps is bounded below by -(it+3) - iexp - the number of bits (decimal places if ibeta = 10) - reserved for the representation of the exponent - (including the bias or sign) of a floating-point - number - minexp - the largest in magnitude negative integer such that - FLOAT(ibeta)**minexp is positive and normalized - maxexp - the smallest positive power of BETA that overflows - eps - the smallest positive floating-point number such - that 1.0+eps .NE. 1.0. In particular, if either - ibeta = 2 or IRND = 0, eps = FLOAT(ibeta)**machep. - Otherwise, eps = (FLOAT(ibeta)**machep)/2 - epsneg - A small positive floating-point number such that - 1.0-epsneg .NE. 1.0. In particular, if ibeta = 2 - or IRND = 0, epsneg = FLOAT(ibeta)**negeps. - Otherwise, epsneg = (ibeta**negeps)/2. Because - negeps is bounded below by -(it+3), epsneg may not - be the smallest number that can alter 1.0 by - subtraction. - xmin - the smallest non-vanishing normalized floating-point - power of the radix, i.e., xmin = FLOAT(ibeta)**minexp - xmax - the largest finite floating-point number. In - particular xmax = (1.0-epsneg)*FLOAT(ibeta)**maxexp - Note - on some machines xmax will be only the - second, or perhaps third, largest number, being - too small by 1 or 2 units in the last digit of - the significand. - - Latest revision - August 4, 1988 - - Author - W. J. Cody - Argonne National Laboratory - - */ - - { - int i,iz,j,k; - int mx,itmp,nxres; - volatile REAL a,b,beta,betain,one,y,z,zero; - volatile REAL betah,two,t,tmp,tmpa,tmp1; - - (*irnd) = 1; - one = (REAL)(*irnd); - two = one + one; - a = two; - b = a; - zero = 0.0e0; - - /* - determine ibeta,beta ala malcolm - */ - - tmp = ((a+one)-a)-one; - - while (tmp == zero) { - a = a+a; - tmp = a+one; - tmp1 = tmp-a; - tmp = tmp1-one; - } - - tmp = a+b; - itmp = (int)(tmp-a); - while (itmp == 0) { - b = b+b; - tmp = a+b; - itmp = (int)(tmp-a); - } - - *ibeta = itmp; - beta = (REAL)(*ibeta); - - /* - determine irnd, it - */ - - (*it) = 0; - b = one; - tmp = ((b+one)-b)-one; - - while (tmp == zero) { - *it = *it+1; - b = b*beta; - tmp = b+one; - tmp1 = tmp-b; - tmp = tmp1-one; - } - - *irnd = 0; - betah = beta/two; - tmp = a+betah; - tmp1 = tmp-a; - if (tmp1 != zero) *irnd = 1; - tmpa = a+beta; - tmp = tmpa+betah; - if ((*irnd == 0) && (tmp-tmpa != zero)) *irnd = 2; - - /* - determine negep, epsneg - */ - - (*negep) = (*it) + 3; - betain = one / beta; - a = one; - - for (i = 1; i<=(*negep); i++) { - a = a * betain; - } - - b = a; - tmp = (one-a); - tmp = tmp-one; - - while (tmp == zero) { - a = a*beta; - *negep = *negep-1; - tmp1 = one-a; - tmp = tmp1-one; - } - - (*negep) = -(*negep); - (*epsneg) = a; - - /* - determine machep, eps - */ - - (*machep) = -(*it) - 3; - a = b; - tmp = one+a; - - while (tmp-one == zero) { - a = a*beta; - *machep = *machep+1; - tmp = one+a; - } - - *eps = a; - - /* - determine ngrd - */ - - (*ngrd) = 0; - tmp = one+*eps; - tmp = tmp*one; - if (((*irnd) == 0) && (tmp-one) != zero) (*ngrd) = 1; - - /* - determine iexp, minexp, xmin - - loop to determine largest i such that - (1/beta) ** (2**(i)) - does not underflow. - exit from loop is signaled by an underflow. - */ - - i = 0; - k = 1; - z = betain; - t = one+*eps; - nxres = 0; - - for (;;) { - y = z; - z = y * y; - - /* - check for underflow - */ - - a = z * one; - tmp = z*t; - if ((a+a == zero) || (ABS(z) > y)) break; - tmp1 = tmp*betain; - if (tmp1*beta == z) break; - i = i + 1; - k = k+k; - } - - /* - determine k such that (1/beta)**k does not underflow - first set k = 2 ** i - */ - - (*iexp) = i + 1; - mx = k + k; - if (*ibeta == 10) { - - /* - for decimal machines only - */ - - (*iexp) = 2; - iz = *ibeta; - while (k >= iz) { - iz = iz * (*ibeta); - (*iexp) = (*iexp) + 1; - } - mx = iz + iz - 1; - } - - /* - loop to determine minexp, xmin. - exit from loop is signaled by an underflow. - */ - - for (;;) { - (*xmin) = y; - y = y * betain; - a = y * one; - tmp = y*t; - tmp1 = a+a; - if ((tmp1 == zero) || (ABS(y) >= (*xmin))) break; - k = k + 1; - tmp1 = tmp*betain; - tmp1 = tmp1*beta; - - if ((tmp1 == y) && (tmp != y)) { - nxres = 3; - *xmin = y; - break; - } - - } - - (*minexp) = -k; - - /* - determine maxexp, xmax - */ - - if ((mx <= k+k-3) && ((*ibeta) != 10)) { - mx = mx + mx; - (*iexp) = (*iexp) + 1; - } - - (*maxexp) = mx + (*minexp); - - /* - Adjust *irnd to reflect partial underflow. - */ - - (*irnd) = (*irnd)+nxres; - - /* - Adjust for IEEE style machines. - */ - - if ((*irnd) >= 2) (*maxexp) = (*maxexp)-2; - - /* - adjust for machines with implicit leading bit in binary - significand and machines with radix point at extreme - right of significand. - */ - - i = (*maxexp) + (*minexp); - if (((*ibeta) == 2) && (i == 0)) (*maxexp) = (*maxexp) - 1; - if (i > 20) (*maxexp) = (*maxexp) - 1; - if (a != y) (*maxexp) = (*maxexp) - 2; - (*xmax) = one - (*epsneg); - tmp = (*xmax)*one; - if (tmp != (*xmax)) (*xmax) = one - beta * (*epsneg); - (*xmax) = (*xmax) / (beta * beta * beta * (*xmin)); - i = (*maxexp) + (*minexp) + 3; - if (i > 0) { - - for (j = 1; j<=i; j++ ) { - if ((*ibeta) == 2) (*xmax) = (*xmax) + (*xmax); - if ((*ibeta) != 2) (*xmax) = (*xmax) * beta; - } - - } - - return; - - } - - #ifndef TEST - - #ifdef SP - F77_RET_T - F77_FUNC (smachar, SMACHAR) (REAL *xmin, REAL *xmax, REAL *epsneg, - REAL *eps, REAL *log10_ibeta) - { - #else - F77_RET_T - F77_FUNC (machar, MACHAR) (REAL *xmin, REAL *xmax, REAL *epsneg, - REAL *eps, REAL *log10_ibeta) - { - #endif - - #if defined (_CRAY) - - // FIXME -- make machar work for the Cray too. - - int ibeta = FLT_RADIX; - *xmin = DBL_MIN; - *xmax = DBL_MAX; - *epsneg = DBL_EPSILON; - *eps = DBL_EPSILON; - - #else - - int ibeta, iexp, irnd, it, machep, maxexp, minexp, negep, ngrd; - - rmachar (&ibeta, &it, &irnd, &ngrd, &machep, &negep, &iexp, &minexp, - &maxexp, eps, epsneg, xmin, xmax); - #endif - - *log10_ibeta = log10 ((REAL) ibeta); - - F77_RETURN (0) - } - - #else - - - /* - - This program prints hardware-determined double-precision machine - constants obtained from rmachar. Dmachar is a C translation of the - Fortran routine MACHAR from W. J. Cody, "MACHAR: A subroutine to - dynamically determine machine parameters". TOMS (14), 1988. - - Descriptions of the machine constants are given in the prologue - comments in rmachar. - - Subprograms called - - rmachar - - Original driver: Richard Bartels, October 16, 1985 - - Modified by: W. J. Cody - July 26, 1988 - - */ - int - main (void) - { - - int ibeta, iexp, irnd, it, machep, maxexp, minexp, negep, ngrd; - - int i; - - REAL eps, epsneg, xmax, xmin; - - union wjc - { - long int jj[REALSIZE]; - REAL xbig; - } uval; - - rmachar (&ibeta, &it, &irnd, &ngrd, &machep, &negep, &iexp, - &minexp, &maxexp, &eps, &epsneg, &xmin, &xmax); - - printf (PREC); - printf (" precision MACHAR constants\n"); - printf ("ibeta = %d\n", ibeta); - printf ("it = %d\n", it); - printf ("irnd = %d\n", irnd); - printf ("ngrd = %d\n", ngrd); - printf ("machep = %d\n", machep); - printf ("negep = %d\n", negep); - printf ("iexp = %d\n", iexp); - printf ("minexp = %d\n", minexp); - printf ("maxexp = %d\n", maxexp); - - #define DISPLAY(s, x) \ - do \ - { \ - uval.xbig = x ; \ - printf (s); \ - printf (" %24.16e ", (double) x) ; \ - for (i = 0; i < REALSIZE; i++) \ - printf (" %9X ", uval.jj[i]) ; \ - printf ("\n"); \ - } \ - while (0) - - DISPLAY ("eps ", eps); - DISPLAY ("epsneg", epsneg); - DISPLAY ("xmin ", xmin); - DISPLAY ("xmax ", xmax); - - return 0; - } - - #endif --- 0 ---- diff -cNr octave-3.2.0/libcruft/misc/Makefile.in octave-3.2.2/libcruft/misc/Makefile.in *** octave-3.2.0/libcruft/misc/Makefile.in 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/libcruft/misc/Makefile.in 2009-06-24 08:13:17.000000000 +0200 *************** *** 29,40 **** FSRC = d1mach.f r1mach.f i1mach.f ! CSRC = machar.c f77-fcn.c lo-error.c cquit.c CXXSRC = f77-extern.cc quit.cc - CEXTRA = smachar.c - MAKEDEPS := $(patsubst %.c, %.d, $(CSRC)) $(patsubst %.cc, %.d, $(CXXSRC)) INCLUDES := f77-fcn.h lo-error.h oct-dlldefs.h quit.h --- 29,38 ---- FSRC = d1mach.f r1mach.f i1mach.f ! CSRC = f77-fcn.c lo-error.c cquit.c CXXSRC = f77-extern.cc quit.cc MAKEDEPS := $(patsubst %.c, %.d, $(CSRC)) $(patsubst %.cc, %.d, $(CXXSRC)) INCLUDES := f77-fcn.h lo-error.h oct-dlldefs.h quit.h *************** *** 60,82 **** uninstall:: for f in $(INCLUDES); do rm -f $(DESTDIR)$(octincludedir)/octave/$$f; done - # Don't optimize. - - XCC = $(patsubst -O%, , $(CC)) - XALL_CFLAGS = $(patsubst -O%, , $(ALL_CFLAGS)) - - machar.o: $(srcdir)/machar.c - $(XCC) -c $(CPPFLAGS) $(XALL_CFLAGS) -DDP $< -o $@ - - smachar.o: $(srcdir)/machar.c - $(XCC) -c $(CPPFLAGS) $(XALL_CFLAGS) -DSP $< -o $@ - - pic/machar.o: $(srcdir)/machar.c - $(XCC) -c $(CPPFLAGS) $(CPICFLAG) $(XALL_CFLAGS) -DDP $< -o $@ - - pic/smachar.o: $(srcdir)/machar.c - $(XCC) -c $(CPPFLAGS) $(CPICFLAG) $(XALL_CFLAGS) -DSP $< -o $@ - ifdef omit_deps .PHONY: $(MAKEDEPS) endif --- 58,63 ---- diff -cNr octave-3.2.0/libcruft/misc/r1mach.f octave-3.2.2/libcruft/misc/r1mach.f *** octave-3.2.0/libcruft/misc/r1mach.f 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/libcruft/misc/r1mach.f 2009-06-24 08:13:17.000000000 +0200 *************** *** 1,18 **** ! real function r1mach (i) integer i logical init ! real rmach(5) save init, rmach data init /.false./ if (.not. init) then ! call smachar (rmach(1), rmach(2), rmach(3), rmach(4), rmach(5)) init = .true. endif ! if (i .lt. 1 .or. i .gt. 5) goto 999 r1mach = rmach(i) return ! 999 write(*,1999) i ! 1999 format(' s1mach - i out of bounds', i10) call xstopx (' ') ! r1mach = 0 end --- 1,24 ---- ! double precision function r1mach (i) integer i logical init ! double precision rmach(5) ! double precision slamch ! external slamch save init, rmach data init /.false./ if (.not. init) then ! rmach(1) = slamch ('u') ! rmach(2) = slamch ('o') ! rmach(3) = slamch ('e') ! rmach(4) = slamch ('p') ! rmach(5) = log10 (slamch ('b')) init = .true. endif ! if (i .lt. 1 .or. i .gt. 5) goto 999 r1mach = rmach(i) return ! 999 write (*, 1999) i ! 1999 format (' r1mach - i out of bounds', i10) call xstopx (' ') ! d1mach = 0 end diff -cNr octave-3.2.0/libcruft/STOP.patch octave-3.2.2/libcruft/STOP.patch *** octave-3.2.0/libcruft/STOP.patch 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/libcruft/STOP.patch 2009-06-11 07:13:21.000000000 +0200 *************** *** 6,15 **** something like it) to your sources. John W. Eaton ! jwe@che.utexas.edu ! Department of Chemical Engineering ! The University of Texas at Austin ! diff -rc libcruft.orig/blas/xerbla.f libcruft/blas/xerbla.f *** libcruft.orig/blas/xerbla.f Wed Feb 19 21:46:03 1992 --- 6,12 ---- something like it) to your sources. John W. Eaton ! jwe@octave.org diff -rc libcruft.orig/blas/xerbla.f libcruft/blas/xerbla.f *** libcruft.orig/blas/xerbla.f Wed Feb 19 21:46:03 1992 diff -cNr octave-3.2.0/liboctave/Array.cc octave-3.2.2/liboctave/Array.cc *** octave-3.2.0/liboctave/Array.cc 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/Array.cc 2009-06-08 07:34:33.000000000 +0200 *************** *** 2476,2482 **** const T *src = data (); octave_idx_type nel = nelem (); const T zero = T (); ! if (n < 0) { // We want all elements, which means we'll almost surely need // to resize. So count first, then allocate array of exact size. --- 2476,2482 ---- const T *src = data (); octave_idx_type nel = nelem (); const T zero = T (); ! if (n < 0 || n >= nel) { // We want all elements, which means we'll almost surely need // to resize. So count first, then allocate array of exact size. *************** *** 2509,2514 **** --- 2509,2516 ---- } if (k < n) retval.resize (k); + octave_idx_type *rdata = retval.fortran_vec (); + std::reverse (rdata, rdata + k); } else { diff -cNr octave-3.2.0/liboctave/ChangeLog octave-3.2.2/liboctave/ChangeLog *** octave-3.2.0/liboctave/ChangeLog 2009-06-03 14:32:51.000000000 +0200 --- octave-3.2.2/liboctave/ChangeLog 2009-07-21 06:52:30.000000000 +0200 *************** *** 1,3 **** --- 1,61 ---- + 2009-07-21 Jaroslav Hajek + + Version 3.2.2 released. + + 2009-07-03 Jaroslav Hajek + + * Sparse-op-defs.h (SPARSE_ALL_OP): Fix typo. + * dSparse.cc (SparseMatrix::prod): Ditto. + * CSparse.cc (ComplexSparseMatrix::prod): Ditto. + + 2009-07-02 Jaroslav Hajek + + * Sparse-diag-op-defs.h (inner_do_add_sm_dm): Rewrite to ensure + ordering of row indices. + + 2009-06-26 Michael Goffioul + + * pathsearch.h (class dir_path::static_members): Decorate with + OCTAVE_API. + + 2009-06-24 Alexander Barth + + * eigs-base.cc (EigsRealSymmetricMatrix, + EigsRealSymmetricMatrixShift, EigsRealSymmetricFunc, + EigsRealNonSymmetricMatrix, EigsRealNonSymmetricMatrixShift, + EigsRealNonSymmetricFunc, EigsComplexNonSymmetricMatrix, + EigsComplexNonSymmetricMatrixShift, EigsComplexNonSymmetricFunc): + Use octave_idx_type for parameters of type LOGICAL in ARPACK. + + 2009-06-22 Jaroslav Hajek + + * chMatrix.cc (charMatrix::charMatrix (const string_vector&)): + Optimize w.r.t. COW of std::string. + + 2009-06-18 Jaroslav Hajek + + * dMatrix.cc (xgemm): Replace resize() with uninitialized allocations + where appropriate. + * fMatrix.cc (xgemm): Ditto. + * CMatrix.cc (xgemm): Ditto. + * fCMatrix.cc (xgemm): Ditto. + + 2009-06-09 Jaroslav Hajek + + * cmd-edit.cc (command_editor::force_default_editor): New static + method. + * cmd-edit.h: Declare it. + + 2009-06-09 Jaroslav Hajek + + * lo-mappers.cc (xlog2 (const Complex&, int&), xlog2 (const + FloatComplex&, int&)): Use more robust expression. + + 2009-06-07 Jaroslav Hajek + + * Array.cc (Array::find): Avoid allocating excessive memory. Fix + order for backward searches. + 2009-05-25 Jaroslav Hajek Version 3.2.0 released. diff -cNr octave-3.2.0/liboctave/chMatrix.cc octave-3.2.2/liboctave/chMatrix.cc *** octave-3.2.0/liboctave/chMatrix.cc 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/chMatrix.cc 2009-06-22 09:00:44.000000000 +0200 *************** *** 81,89 **** for (octave_idx_type i = 0; i < nr; i++) { ! octave_idx_type nc = s[i].length (); for (octave_idx_type j = 0; j < nc; j++) ! elem (i, j) = s[i][j]; } } --- 81,90 ---- for (octave_idx_type i = 0; i < nr; i++) { ! const std::string si = s(i); ! octave_idx_type nc = si.length (); for (octave_idx_type j = 0; j < nc; j++) ! elem (i, j) = si[j]; } } diff -cNr octave-3.2.0/liboctave/CMatrix.cc octave-3.2.2/liboctave/CMatrix.cc *** octave-3.2.0/liboctave/CMatrix.cc 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/CMatrix.cc 2009-06-18 09:31:47.000000000 +0200 *************** *** 2903,2909 **** { octave_idx_type a_len = a.length (); ! retval.resize (len, a_len); Complex *c = retval.fortran_vec (); F77_XFCN (zgemm, ZGEMM, (F77_CONST_CHAR_ARG2 ("N", 1), --- 2903,2909 ---- { octave_idx_type a_len = a.length (); ! retval = ComplexMatrix (len, a_len); Complex *c = retval.fortran_vec (); F77_XFCN (zgemm, ZGEMM, (F77_CONST_CHAR_ARG2 ("N", 1), *************** *** 3788,3799 **** else { if (a_nr == 0 || a_nc == 0 || b_nc == 0) ! retval.resize (a_nr, b_nc, 0.0); else if (a.data () == b.data () && a_nr == b_nc && transa != transb) { octave_idx_type lda = a.rows (); ! retval.resize (a_nr, b_nc); Complex *c = retval.fortran_vec (); const char *ctransa = get_blas_trans_arg (transa, conja); --- 3788,3799 ---- else { if (a_nr == 0 || a_nc == 0 || b_nc == 0) ! retval = ComplexMatrix (a_nr, b_nc, 0.0); else if (a.data () == b.data () && a_nr == b_nc && transa != transb) { octave_idx_type lda = a.rows (); ! retval = ComplexMatrix (a_nr, b_nc); Complex *c = retval.fortran_vec (); const char *ctransa = get_blas_trans_arg (transa, conja); *************** *** 3829,3835 **** octave_idx_type lda = a.rows (), tda = a.cols (); octave_idx_type ldb = b.rows (), tdb = b.cols (); ! retval.resize (a_nr, b_nc); Complex *c = retval.fortran_vec (); if (b_nc == 1 && a_nr == 1) --- 3829,3835 ---- octave_idx_type lda = a.rows (), tda = a.cols (); octave_idx_type ldb = b.rows (), tdb = b.cols (); ! retval = ComplexMatrix (a_nr, b_nc); Complex *c = retval.fortran_vec (); if (b_nc == 1 && a_nr == 1) diff -cNr octave-3.2.0/liboctave/cmd-edit.cc octave-3.2.2/liboctave/cmd-edit.cc *** octave-3.2.0/liboctave/cmd-edit.cc 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/cmd-edit.cc 2009-06-11 07:13:20.000000000 +0200 *************** *** 837,842 **** --- 837,849 ---- #endif } + void + command_editor::force_default_editor (void) + { + delete instance; + instance = new default_command_editor (); + } + int command_editor::startup_handler (void) { diff -cNr octave-3.2.0/liboctave/cmd-edit.h octave-3.2.2/liboctave/cmd-edit.h *** octave-3.2.0/liboctave/cmd-edit.h 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/cmd-edit.h 2009-06-11 07:13:20.000000000 +0200 *************** *** 150,155 **** --- 150,157 ---- static void increment_current_command_number (void); + static void force_default_editor (void); + private: // No copying! diff -cNr octave-3.2.0/liboctave/CSparse.cc octave-3.2.2/liboctave/CSparse.cc *** octave-3.2.0/liboctave/CSparse.cc 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/CSparse.cc 2009-07-03 12:21:51.000000000 +0200 *************** *** 7373,7379 **** else { SPARSE_REDUCTION_OP (SparseComplexMatrix, Complex, *=, ! (cidx(j+1) - cidx(j) < nc ? 0.0 : 1.0), 1.0); } } --- 7373,7379 ---- else { SPARSE_REDUCTION_OP (SparseComplexMatrix, Complex, *=, ! (cidx(j+1) - cidx(j) < nr ? 0.0 : 1.0), 1.0); } } diff -cNr octave-3.2.0/liboctave/dMatrix.cc octave-3.2.2/liboctave/dMatrix.cc *** octave-3.2.0/liboctave/dMatrix.cc 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/dMatrix.cc 2009-06-18 09:31:47.000000000 +0200 *************** *** 2592,2598 **** { octave_idx_type a_len = a.length (); ! retval.resize (len, a_len); double *c = retval.fortran_vec (); F77_XFCN (dgemm, DGEMM, (F77_CONST_CHAR_ARG2 ("N", 1), --- 2592,2598 ---- { octave_idx_type a_len = a.length (); ! retval = Matrix (len, a_len); double *c = retval.fortran_vec (); F77_XFCN (dgemm, DGEMM, (F77_CONST_CHAR_ARG2 ("N", 1), *************** *** 3188,3199 **** else { if (a_nr == 0 || a_nc == 0 || b_nc == 0) ! retval.resize (a_nr, b_nc, 0.0); else if (a.data () == b.data () && a_nr == b_nc && transa != transb) { octave_idx_type lda = a.rows (); ! retval.resize (a_nr, b_nc); double *c = retval.fortran_vec (); const char *ctransa = get_blas_trans_arg (transa); --- 3188,3199 ---- else { if (a_nr == 0 || a_nc == 0 || b_nc == 0) ! retval = Matrix (a_nr, b_nc, 0.0); else if (a.data () == b.data () && a_nr == b_nc && transa != transb) { octave_idx_type lda = a.rows (); ! retval = Matrix (a_nr, b_nc); double *c = retval.fortran_vec (); const char *ctransa = get_blas_trans_arg (transa); *************** *** 3213,3219 **** octave_idx_type lda = a.rows (), tda = a.cols (); octave_idx_type ldb = b.rows (), tdb = b.cols (); ! retval.resize (a_nr, b_nc); double *c = retval.fortran_vec (); if (b_nc == 1) --- 3213,3219 ---- octave_idx_type lda = a.rows (), tda = a.cols (); octave_idx_type ldb = b.rows (), tdb = b.cols (); ! retval = Matrix (a_nr, b_nc); double *c = retval.fortran_vec (); if (b_nc == 1) diff -cNr octave-3.2.0/liboctave/dSparse.cc octave-3.2.2/liboctave/dSparse.cc *** octave-3.2.0/liboctave/dSparse.cc 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/dSparse.cc 2009-07-03 12:21:51.000000000 +0200 *************** *** 7483,7489 **** else { SPARSE_REDUCTION_OP (SparseMatrix, double, *=, ! (cidx(j+1) - cidx(j) < nc ? 0.0 : 1.0), 1.0); } } --- 7483,7489 ---- else { SPARSE_REDUCTION_OP (SparseMatrix, double, *=, ! (cidx(j+1) - cidx(j) < nr ? 0.0 : 1.0), 1.0); } } diff -cNr octave-3.2.0/liboctave/eigs-base.cc octave-3.2.2/liboctave/eigs-base.cc *** octave-3.2.0/liboctave/eigs-base.cc 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/eigs-base.cc 2009-06-25 06:36:34.000000000 +0200 *************** *** 64,70 **** F77_RET_T F77_FUNC (dseupd, DSEUPD) (const int&, F77_CONST_CHAR_ARG_DECL, ! int*, double*, double*, const octave_idx_type&, const double&, F77_CONST_CHAR_ARG_DECL, const octave_idx_type&, F77_CONST_CHAR_ARG_DECL, const octave_idx_type&, --- 64,70 ---- F77_RET_T F77_FUNC (dseupd, DSEUPD) (const int&, F77_CONST_CHAR_ARG_DECL, ! octave_idx_type*, double*, double*, const octave_idx_type&, const double&, F77_CONST_CHAR_ARG_DECL, const octave_idx_type&, F77_CONST_CHAR_ARG_DECL, const octave_idx_type&, *************** *** 87,93 **** F77_RET_T F77_FUNC (dneupd, DNEUPD) (const int&, F77_CONST_CHAR_ARG_DECL, ! int*, double*, double*, double*, const octave_idx_type&, const double&, const double&, double*, F77_CONST_CHAR_ARG_DECL, const octave_idx_type&, F77_CONST_CHAR_ARG_DECL, --- 87,93 ---- F77_RET_T F77_FUNC (dneupd, DNEUPD) (const int&, F77_CONST_CHAR_ARG_DECL, ! octave_idx_type*, double*, double*, double*, const octave_idx_type&, const double&, const double&, double*, F77_CONST_CHAR_ARG_DECL, const octave_idx_type&, F77_CONST_CHAR_ARG_DECL, *************** *** 111,117 **** F77_RET_T F77_FUNC (zneupd, ZNEUPD) (const int&, F77_CONST_CHAR_ARG_DECL, ! int*, Complex*, Complex*, const octave_idx_type&, const Complex&, Complex*, F77_CONST_CHAR_ARG_DECL, const octave_idx_type&, F77_CONST_CHAR_ARG_DECL, --- 111,117 ---- F77_RET_T F77_FUNC (zneupd, ZNEUPD) (const int&, F77_CONST_CHAR_ARG_DECL, ! octave_idx_type*, Complex*, Complex*, const octave_idx_type&, const Complex&, Complex*, F77_CONST_CHAR_ARG_DECL, const octave_idx_type&, F77_CONST_CHAR_ARG_DECL, *************** *** 984,997 **** // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! int *sel = s.fortran_vec (); ! eig_vec.resize (n, k); double *z = eig_vec.fortran_vec (); --- 984,997 ---- // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4- or 8-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! octave_idx_type *sel = s.fortran_vec (); ! eig_vec.resize (n, k); double *z = eig_vec.fortran_vec (); *************** *** 1321,1333 **** // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! int *sel = s.fortran_vec (); eig_vec.resize (n, k); double *z = eig_vec.fortran_vec (); --- 1321,1333 ---- // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4- or 8-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! octave_idx_type *sel = s.fortran_vec (); eig_vec.resize (n, k); double *z = eig_vec.fortran_vec (); *************** *** 1579,1591 **** // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! int *sel = s.fortran_vec (); eig_vec.resize (n, k); double *z = eig_vec.fortran_vec (); --- 1579,1591 ---- // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4- or 8-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! octave_idx_type *sel = s.fortran_vec (); eig_vec.resize (n, k); double *z = eig_vec.fortran_vec (); *************** *** 1898,1910 **** // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! int *sel = s.fortran_vec (); Matrix eig_vec2 (n, k + 1); double *z = eig_vec2.fortran_vec (); --- 1898,1910 ---- // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4- or 8-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! octave_idx_type *sel = s.fortran_vec (); Matrix eig_vec2 (n, k + 1); double *z = eig_vec2.fortran_vec (); *************** *** 2277,2289 **** // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! int *sel = s.fortran_vec (); Matrix eig_vec2 (n, k + 1); double *z = eig_vec2.fortran_vec (); --- 2277,2289 ---- // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4- or 8-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! octave_idx_type *sel = s.fortran_vec (); Matrix eig_vec2 (n, k + 1); double *z = eig_vec2.fortran_vec (); *************** *** 2582,2594 **** // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! int *sel = s.fortran_vec (); Matrix eig_vec2 (n, k + 1); double *z = eig_vec2.fortran_vec (); --- 2582,2594 ---- // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4- or 8-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! octave_idx_type *sel = s.fortran_vec (); Matrix eig_vec2 (n, k + 1); double *z = eig_vec2.fortran_vec (); *************** *** 2945,2957 **** // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! int *sel = s.fortran_vec (); eig_vec.resize (n, k); Complex *z = eig_vec.fortran_vec (); --- 2945,2957 ---- // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4- or 8-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! octave_idx_type *sel = s.fortran_vec (); eig_vec.resize (n, k); Complex *z = eig_vec.fortran_vec (); *************** *** 3285,3297 **** // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! int *sel = s.fortran_vec (); eig_vec.resize (n, k); Complex *z = eig_vec.fortran_vec (); --- 3285,3297 ---- // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4- or 8-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! octave_idx_type *sel = s.fortran_vec (); eig_vec.resize (n, k); Complex *z = eig_vec.fortran_vec (); *************** *** 3549,3561 **** // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! int *sel = s.fortran_vec (); eig_vec.resize (n, k); Complex *z = eig_vec.fortran_vec (); --- 3549,3561 ---- // We have a problem in that the size of the C++ bool // type relative to the fortran logical type. It appears ! // that fortran uses 4- or 8-bytes per logical and C++ 1-byte // per bool, though this might be system dependent. As // long as the HOWMNY arg is not "S", the logical array // is just workspace for ARPACK, so use int type to // avoid problems. ! Array s (p); ! octave_idx_type *sel = s.fortran_vec (); eig_vec.resize (n, k); Complex *z = eig_vec.fortran_vec (); diff -cNr octave-3.2.0/liboctave/fCMatrix.cc octave-3.2.2/liboctave/fCMatrix.cc *** octave-3.2.0/liboctave/fCMatrix.cc 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/fCMatrix.cc 2009-06-18 09:31:47.000000000 +0200 *************** *** 2896,2902 **** { octave_idx_type a_len = a.length (); ! retval.resize (len, a_len); FloatComplex *c = retval.fortran_vec (); F77_XFCN (cgemm, CGEMM, (F77_CONST_CHAR_ARG2 ("N", 1), --- 2896,2902 ---- { octave_idx_type a_len = a.length (); ! retval = FloatComplexMatrix (len, a_len); FloatComplex *c = retval.fortran_vec (); F77_XFCN (cgemm, CGEMM, (F77_CONST_CHAR_ARG2 ("N", 1), *************** *** 3781,3792 **** else { if (a_nr == 0 || a_nc == 0 || b_nc == 0) ! retval.resize (a_nr, b_nc, 0.0); else if (a.data () == b.data () && a_nr == b_nc && transa != transb) { octave_idx_type lda = a.rows (); ! retval.resize (a_nr, b_nc); FloatComplex *c = retval.fortran_vec (); const char *ctransa = get_blas_trans_arg (transa, conja); --- 3781,3792 ---- else { if (a_nr == 0 || a_nc == 0 || b_nc == 0) ! retval = FloatComplexMatrix (a_nr, b_nc, 0.0); else if (a.data () == b.data () && a_nr == b_nc && transa != transb) { octave_idx_type lda = a.rows (); ! retval = FloatComplexMatrix (a_nr, b_nc); FloatComplex *c = retval.fortran_vec (); const char *ctransa = get_blas_trans_arg (transa, conja); *************** *** 3822,3828 **** octave_idx_type lda = a.rows (), tda = a.cols (); octave_idx_type ldb = b.rows (), tdb = b.cols (); ! retval.resize (a_nr, b_nc); FloatComplex *c = retval.fortran_vec (); if (b_nc == 1 && a_nr == 1) --- 3822,3828 ---- octave_idx_type lda = a.rows (), tda = a.cols (); octave_idx_type ldb = b.rows (), tdb = b.cols (); ! retval = FloatComplexMatrix (a_nr, b_nc); FloatComplex *c = retval.fortran_vec (); if (b_nc == 1 && a_nr == 1) diff -cNr octave-3.2.0/liboctave/fMatrix.cc octave-3.2.2/liboctave/fMatrix.cc *** octave-3.2.0/liboctave/fMatrix.cc 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/fMatrix.cc 2009-06-18 09:31:47.000000000 +0200 *************** *** 2591,2597 **** { octave_idx_type a_len = a.length (); ! retval.resize (len, a_len); float *c = retval.fortran_vec (); F77_XFCN (sgemm, SGEMM, (F77_CONST_CHAR_ARG2 ("N", 1), --- 2591,2597 ---- { octave_idx_type a_len = a.length (); ! retval = FloatMatrix (len, a_len); float *c = retval.fortran_vec (); F77_XFCN (sgemm, SGEMM, (F77_CONST_CHAR_ARG2 ("N", 1), *************** *** 3187,3198 **** else { if (a_nr == 0 || a_nc == 0 || b_nc == 0) ! retval.resize (a_nr, b_nc, 0.0); else if (a.data () == b.data () && a_nr == b_nc && transa != transb) { octave_idx_type lda = a.rows (); ! retval.resize (a_nr, b_nc); float *c = retval.fortran_vec (); const char *ctransa = get_blas_trans_arg (transa); --- 3187,3198 ---- else { if (a_nr == 0 || a_nc == 0 || b_nc == 0) ! retval = FloatMatrix (a_nr, b_nc, 0.0); else if (a.data () == b.data () && a_nr == b_nc && transa != transb) { octave_idx_type lda = a.rows (); ! retval = FloatMatrix (a_nr, b_nc); float *c = retval.fortran_vec (); const char *ctransa = get_blas_trans_arg (transa); *************** *** 3212,3218 **** octave_idx_type lda = a.rows (), tda = a.cols (); octave_idx_type ldb = b.rows (), tdb = b.cols (); ! retval.resize (a_nr, b_nc); float *c = retval.fortran_vec (); if (b_nc == 1) --- 3212,3218 ---- octave_idx_type lda = a.rows (), tda = a.cols (); octave_idx_type ldb = b.rows (), tdb = b.cols (); ! retval = FloatMatrix (a_nr, b_nc); float *c = retval.fortran_vec (); if (b_nc == 1) diff -cNr octave-3.2.0/liboctave/lo-mappers.cc octave-3.2.2/liboctave/lo-mappers.cc *** octave-3.2.0/liboctave/lo-mappers.cc 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/lo-mappers.cc 2009-06-09 07:18:29.000000000 +0200 *************** *** 185,191 **** { double ax = std::abs (x); double lax = xlog2 (ax, exp); ! return (exp == 0) ? x : (x / ax) * lax; } // double -> bool mappers. --- 185,191 ---- { double ax = std::abs (x); double lax = xlog2 (ax, exp); ! return (ax != lax) ? (x / ax) * lax : x; } // double -> bool mappers. *************** *** 503,509 **** { float ax = std::abs (x); float lax = xlog2 (ax, exp); ! return (exp == 0) ? x : (x / ax) * lax; } // float -> bool mappers. --- 503,509 ---- { float ax = std::abs (x); float lax = xlog2 (ax, exp); ! return (ax != lax) ? (x / ax) * lax : x; } // float -> bool mappers. diff -cNr octave-3.2.0/liboctave/pathsearch.h octave-3.2.2/liboctave/pathsearch.h *** octave-3.2.0/liboctave/pathsearch.h 2009-05-27 07:22:55.000000000 +0200 --- octave-3.2.2/liboctave/pathsearch.h 2009-06-29 14:17:11.000000000 +0200 *************** *** 125,131 **** // making them static members of the dir_path class so that we can // ensure proper initialization. ! class static_members { public: --- 125,131 ---- // making them static members of the dir_path class so that we can // ensure proper initialization. ! class OCTAVE_API static_members { public: diff -cNr octave-3.2.0/liboctave/Sparse-diag-op-defs.h octave-3.2.2/liboctave/Sparse-diag-op-defs.h *** octave-3.2.0/liboctave/Sparse-diag-op-defs.h 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/Sparse-diag-op-defs.h 2009-07-02 08:21:50.000000000 +0200 *************** *** 134,159 **** { OCTAVE_QUIT; const octave_idx_type colend = a.cidx (j+1); - bool found_diag = false; r.xcidx (j) = k; ! for (octave_idx_type k_src = a.cidx (j); k_src < colend; ++k_src, ++k) ! { ! const octave_idx_type i = a.ridx (k_src); ! r.xridx (k) = i; ! if (i != j) ! r.xdata (k) = opa (a.data (k_src)); ! else ! { ! r.xdata (k) = opa (a.data (k_src)) + opd (d.dgelem (j)); ! found_diag = true; ! } ! } ! if (!found_diag) ! { ! r.xridx (k) = j; ! r.xdata (k) = opd (d.dgelem (j)); ! ++k; ! } } r.xcidx (nc) = k; --- 134,171 ---- { OCTAVE_QUIT; const octave_idx_type colend = a.cidx (j+1); r.xcidx (j) = k; ! octave_idx_type k_src = a.cidx (j), k_split; ! ! for (k_split = k_src; k_split < colend; k_split++) ! if (a.ridx (k_split) >= j) ! break; ! ! for (; k_src < k_split; k_src++, k++) ! { ! r.xridx (k) = a.ridx (k_src); ! r.xdata (k) = opa (a.data (k_src)); ! } ! ! if (k_src < colend && a.ridx (k_src) == j) ! { ! r.xridx (k) = j; ! r.xdata (k) = opa (a.data (k_src)) + opd (d.dgelem (j)); ! k++; k_src++; ! } ! else ! { ! r.xridx (k) = j; ! r.xdata (k) = opd (d.dgelem (j)); ! k++; ! } ! ! for (; k_src < colend; k_src++, k++) ! { ! r.xridx (k) = a.ridx (k_src); ! r.xdata (k) = opa (a.data (k_src)); ! } ! } r.xcidx (nc) = k; diff -cNr octave-3.2.0/liboctave/Sparse-op-defs.h octave-3.2.2/liboctave/Sparse-op-defs.h *** octave-3.2.0/liboctave/Sparse-op-defs.h 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/liboctave/Sparse-op-defs.h 2009-07-03 12:21:51.000000000 +0200 *************** *** 1828,1834 **** return transpose (). all (0). transpose(); \ else \ { \ ! SPARSE_ANY_ALL_OP (DIM, (cidx(j+1) - cidx(j) < nc ? false : true), \ true, ==, false); \ } --- 1828,1834 ---- return transpose (). all (0). transpose(); \ else \ { \ ! SPARSE_ANY_ALL_OP (DIM, (cidx(j+1) - cidx(j) < nr ? false : true), \ true, ==, false); \ } diff -cNr octave-3.2.0/mkoctfile.cc.in octave-3.2.2/mkoctfile.cc.in *** octave-3.2.0/mkoctfile.cc.in 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/mkoctfile.cc.in 2009-06-08 07:34:31.000000000 +0200 *************** *** 533,539 **** --- 533,541 ---- else if (arg == "--mex") { incflags += " -I."; + #ifdef _MSC_VER ldflags += " -Wl,-export:mexFunction"; + #endif output_ext = ".mex"; } else if (starts_with (arg, "-W")) diff -cNr octave-3.2.0/README.Cygwin octave-3.2.2/README.Cygwin *** octave-3.2.0/README.Cygwin 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/README.Cygwin 2009-06-11 07:13:21.000000000 +0200 *************** *** 45,53 **** John W. Eaton ! jwe@bevo.che.wisc.edu ! University of Wisconsin-Madison ! Department of Chemical & Biological Engineering Tatsuro MATSUOKA tmacchant@yahoo.co.jp --- 45,51 ---- John W. Eaton ! jwe@octave.org Tatsuro MATSUOKA tmacchant@yahoo.co.jp diff -cNr octave-3.2.0/README.kpathsea octave-3.2.2/README.kpathsea *** octave-3.2.0/README.kpathsea 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/README.kpathsea 2009-06-11 07:13:21.000000000 +0200 *************** *** 166,173 **** John W. Eaton ! jwe@bevo.che.wisc.edu ! University of Wisconsin-Madison ! Department of Chemical & Biological Engineering Last updated: Wed, 31 Oct 2007 16:33:13 EDT --- 166,171 ---- John W. Eaton ! jwe@octave.org Last updated: Wed, 31 Oct 2007 16:33:13 EDT diff -cNr octave-3.2.0/README.Linux octave-3.2.2/README.Linux *** octave-3.2.0/README.Linux 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/README.Linux 2009-06-11 07:13:21.000000000 +0200 *************** *** 5,12 **** John W. Eaton ! jwe@bevo.che.wisc.edu ! University of Wisconsin-Madison ! Department of Chemical & Biological Engineering Last updated: Wed, 31 Oct 2007 16:22:26 EDT --- 5,10 ---- John W. Eaton ! jwe@octave.org Last updated: Wed, 31 Oct 2007 16:22:26 EDT diff -cNr octave-3.2.0/README.Windows octave-3.2.2/README.Windows *** octave-3.2.0/README.Windows 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/README.Windows 2009-06-11 07:13:21.000000000 +0200 *************** *** 6,13 **** John W. Eaton ! jwe@bevo.che.wisc.edu ! University of Wisconsin-Madison ! Department of Chemical & Biological Engineering Last updated: Wed, 31 Oct 2007 16:34:12 EDT --- 6,11 ---- John W. Eaton ! jwe@octave.org Last updated: Wed, 31 Oct 2007 16:34:12 EDT diff -cNr octave-3.2.0/ROADMAP octave-3.2.2/ROADMAP *** octave-3.2.0/ROADMAP 2009-05-25 08:04:58.000000000 +0200 --- octave-3.2.2/ROADMAP 2009-06-11 07:13:21.000000000 +0200 *************** *** 68,75 **** John W. Eaton ! jwe@bevo.che.wisc.edu ! University of Wisconsin-Madison ! Department of Chemical & Biological Engineering Last updated: Wed, 31 Oct 2007 16:44:04 EDT --- 68,73 ---- John W. Eaton ! jwe@octave.org Last updated: Wed, 31 Oct 2007 16:44:04 EDT diff -cNr octave-3.2.0/scripts/ChangeLog octave-3.2.2/scripts/ChangeLog *** octave-3.2.0/scripts/ChangeLog 2009-06-03 14:32:51.000000000 +0200 --- octave-3.2.2/scripts/ChangeLog 2009-07-21 06:52:30.000000000 +0200 *************** *** 1,3 **** --- 1,123 ---- + 2009-07-21 Jaroslav Hajek + + Version 3.2.2 released. + + 2009-06-25 Ben Abbott + + * plot/gnuplot_drawnow.m: Apply feature 'wxt_has_size'. + * plot/__gnuplot_has_feature__.m: Add feature 'wxt_has_size' for + gnuplot >= 4.3.0. + + 2009-06-24 Ben Abbott + + * plot/__go_draw_figure__.m: Modify the implicit margin when gnuplot's + output is landscape. + * plot/gnuplot_drawnow.m: Simplify handling of the figure's paper + properties, and rely upon listeners for units conversion. Minor code + improvements. + * plot/print.m: Reimplement -landscape and -portrait to modify the + properties papersize and paperposition. Produce compatible results + when paperpositionmode=='auto'. Simplfy units conversion and + restoration of initial figure properties. + + 2009-06-24 Marco Caliari + + * general/repmat.m: Call kron, not spkron. + + 2009-06-24 Alexander Mamonov + + * plot/plot3.m: Correctly compute offsets for property/value pairs. + + 2009-06-22 Ben Abbott + + * plot/grid.m: Add missing semi-colon. Allow grid to be toggled + on/off for each axis independently. Gnuplot requires that minor + ticks accompany minor ticks. Add demo. + * plot/__go_draw_axes__.m: For {x,y,z}scale == 'log' use 10 minor + ticks. + + 2009-06-22 John W. Eaton + + * statistics/base/var.m: Return zero for scalar case. Handle + empty arguments in a Matlab compatible way. New tests. + + 2009-06-18 Ben Abbott + + * plot/__go_draw_axes__.m: Change the default x11 fontspec from '*,0' + to ',0' to avoid delays searching the fontpath for a font named '*'. + + 2009-06-18 Daniel Gualberto + + * polynomial/mpoles.m: Fix infinite loop for a multiplicity of + poles at zero. Test added. + + 2009-06-17 Bertrand Roessli + + * plot/axis.m: Fix bug for 'axis tight' with multiple surface plots, + add demo. + + 2009-06-14 Ben Abbott + + * plot/quiver.m: Add 'clf' to demos. + * plot/plotyy.m: Fix compatibility with subplot, add listeners for + dataaspectratio, and add a demo. + + 2009-06-14 Eric Chassande-Mottin + + * plot/plotyy.m: Correct behavior when there is no currentfigure. + + 2009-06-11 Ben Abbott + + * plot/print.m: Fix logic associated with 'have_ghostscript'. + * plot/gnuplot_drawnow.m: Add support for pdfcairo and pngcairo + terminals. Minor code improvements. + * plot/print.m: Associate '-mono' with devices ps, ps2, eps, & eps2. + Have '-mono' render all objects in monochrome. + For pdf or png output, favor gnuplot's cairo terminals. + + 2009-06-10 Marco Caliari + + * plot/hold.m: Add demo including a hggroup. + * plot/__go_draw_axes__.m: Fix order when pushing group children onto + the axes kid list. + * general/quadgk.m: Better waypoint transform. + + 2009-06-09 David Bateman + + * general/quadgk.m: Add test case and fixed doubly infinite + waypoint transform for x = 0 case. + + 2009-06-09 Marco Caliari + + * general/quadgk.m: Fix doubly infinite transformation to the finite + interval. + + 2009-06-08 Ben Abbott + + * plot/axis.m: Fix bug for 'axis tight' with multiple lines, modify + demo. + + 2009-06-07 Thorsten Meyer + + * testfun/assert.m: Fix texinfo bug. + + 2009-06-04 Ben Abbott + + * plot/__go_draw_axes__.m: Change strncmpi(scale,'lo') to + strcmp(scale,'log'). + * plot/__go_draw_axes__.m: For log-scale axes use format '10^{%T}'. + + 2009-06-03 Ben Abbott + + * plot/colorbar.m: Colorbar 'handlevisibility' should be 'on'. + Add additional demos which illustrate problems with the present + implementation. + * plot/__gnuplot_has_feature__.m: Change version for + "x11_figure_position" from ">=4.3.0" to ">=4.2.5". + * plot/__scatter__.m: If the color spec is empty, set using + __next_line_color__. + * plot/scatter3.m: Add demos. + 2009-05-25 Jaroslav Hajek Version 3.2.0 released. diff -cNr octave-3.2.0/scripts/DOCSTRINGS octave-3.2.2/scripts/DOCSTRINGS *** octave-3.2.0/scripts/DOCSTRINGS 2009-06-03 07:55:31.000000000 +0200 --- octave-3.2.2/scripts/DOCSTRINGS 2009-06-26 13:20:54.000000000 +0200 *************** *** 4209,4220 **** @c ./plot/allchild.m -*- texinfo -*- @deftypefn {Function File} {@var{h} =} allchild (@var{handles}) ! Find all children including hidden children of an object. This function is similar to @code{get (h, "children")}, but also returns includes hidden objects. If @var{handles} is a scalar, ! @var{h} will be a vector, and if not, @var{h} will be a cell matrix ! with the same size as @var{handles} and each cell will contain a vector of handles. @seealso{get, set, findall, findobj} @end deftypefn --- 4209,4220 ---- @c ./plot/allchild.m -*- texinfo -*- @deftypefn {Function File} {@var{h} =} allchild (@var{handles}) ! Find all children, including hidden children, of a graphics object. This function is similar to @code{get (h, "children")}, but also returns includes hidden objects. If @var{handles} is a scalar, ! @var{h} will be a vector. Otherwise, @var{h} will be a cell matrix ! of the same size as @var{handles} and each cell will contain a vector of handles. @seealso{get, set, findall, findobj} @end deftypefn *************** *** 5753,5767 **** clf @c ./plot/clf.m -*- texinfo -*- ! @deftypefn {Function File} {} clf () @deftypefnx {Function File} {} clf ("reset") @deftypefnx {Function File} {} clf (@var{hfig}) @deftypefnx {Function File} {} clf (@var{hfig}, "reset") ! @deftypefnx {Function File} {@var{hfig} =} clf (@dots{}) ! Delete the children of the current figure with visible handles. ! If @var{hfig} is specified and is an figure object handle, operate on it ! instead of the current figure. If the optional argument @code{"reset"} ! is specified, also delete the figure's children with hidden handles. @seealso{cla, close, delete} @end deftypefn hggroup --- 5753,5767 ---- clf @c ./plot/clf.m -*- texinfo -*- ! @deftypefn {Function File} {} clf () @deftypefnx {Function File} {} clf ("reset") @deftypefnx {Function File} {} clf (@var{hfig}) @deftypefnx {Function File} {} clf (@var{hfig}, "reset") ! Clear the current figure window. @code{clf} operates by deleting child ! graphics objects with visible handles (@code{HandleVisibility} = on). ! If @var{hfig} is specified operate on it instead of the current figure. ! If the optional argument @code{"reset"} is specified, all objects including ! those with hidden handles are deleted. @seealso{cla, close, delete} @end deftypefn hggroup *************** *** 5790,5799 **** @deftypefnx {Function File} {} backend (@var{hlist}, @var{name}) Change the default graphics backend to @var{name}. If the backend is not already loaded, it is first initialized (initialization is done ! through the execution of __init_@var{name}__). ! @var{hlist} is a list of figure handles. When given, this function ! only switches the default backend for the corresponding figures. @seealso{available_backends} @end deftypefn __clabel__ --- 5790,5799 ---- @deftypefnx {Function File} {} backend (@var{hlist}, @var{name}) Change the default graphics backend to @var{name}. If the backend is not already loaded, it is first initialized (initialization is done ! through the execution of @code{__init_@var{name}__}). ! When called with a list of figure handles, @var{hlist}, the backend is ! changed only for the listed figures. @seealso{available_backends} @end deftypefn __clabel__ *************** *** 5805,5820 **** refreshdata @c ./plot/refreshdata.m -*- texinfo -*- ! @deftypefn {Function File} {} refreshdata () @deftypefnx {Function File} {} refreshdata (@var{h}) ! @deftypefnx {Function File} {} refreshdata (@var{h}, @var{ws}) ! Evaluates any datasource properties of the current figure and updates ! the corresponding data. If call with one or more arguments @var{h} is ! a scalar or array of figure handles which to refresh. The data ! sources are by default evaluated in the "base" workspace but can also ! be set in the "caller" workspace. ! An example of the use of refreshdata is @example @group --- 5805,5827 ---- refreshdata @c ./plot/refreshdata.m -*- texinfo -*- ! @deftypefn {Function File} {} refreshdata () @deftypefnx {Function File} {} refreshdata (@var{h}) ! @deftypefnx {Function File} {} refreshdata (@var{h}, @var{workspace}) ! Evaluate any @samp{datasource} properties of the current figure and update ! the plot if the corresponding data has changed. If called with one or more ! arguments @var{h} is a scalar or array of figure handles to refresh. The ! optional second argument @var{workspace} can take the following values. ! @table @code ! @item "base" ! Evaluate the datasource properties in the base workspace. (default). ! @item "caller" ! Evaluate the datasource properties in the workspace of the function ! that called @code{refreshdata}. ! @end table ! ! An example of the use of @code{refreshdata} is: @example @group *************** *** 5828,5835 **** endfor @end group @end example - - @seealso{linkdata} @end deftypefn line @c ./plot/line.m --- 5835,5840 ---- *************** *** 6339,6353 **** gtext @c ./plot/gtext.m -*- texinfo -*- ! @deftypefn {Function File} {} gtext (@var{s}) @deftypefnx {Function File} {} gtext (@dots{}, @var{prop}, @var{val}) ! Place text on the current figure. The text can be defined by the ! string @var{s}. If @var{s} is a cell array, each element of the cell ! array is written to a separate line. ! ! Additional arguments are passed to the underlying text object as ! properties. ! @seealso{ginput} @end deftypefn spinmap @c ./plot/spinmap.m --- 6344,6357 ---- gtext @c ./plot/gtext.m -*- texinfo -*- ! @deftypefn {Function File} {} gtext (@var{s}) ! @deftypefnx {Function File} {} gtext (@{@var{s1}; @var{s2}; @dots{}@}) @deftypefnx {Function File} {} gtext (@dots{}, @var{prop}, @var{val}) ! Place text on the current figure using the mouse. The text is defined ! by the string @var{s}. If @var{s} is a cell array, each element of the cell ! array is written to a separate line. Additional arguments are passed to ! the underlying text object as properties. ! @seealso{ginput, text} @end deftypefn spinmap @c ./plot/spinmap.m *************** *** 6461,6472 **** print @c ./plot/print.m -*- texinfo -*- ! @deftypefn {Function File} {} print (@var{filename}, @var{options}) @deftypefnx {Function File} {} print (@var{h}, @var{filename}, @var{options}) Print a graph, or save it to a file @var{filename} defines the file name of the output file. If no ! filename is specified, output is sent to the printer. @var{h} specifies the figure handle. If no handle is specified the handle for the current figure is used. --- 6465,6478 ---- print @c ./plot/print.m -*- texinfo -*- ! @deftypefn {Function File} {} print () ! @deftypefnx {Function File} {} print (@var{options}) ! @deftypefnx {Function File} {} print (@var{filename}, @var{options}) @deftypefnx {Function File} {} print (@var{h}, @var{filename}, @var{options}) Print a graph, or save it to a file @var{filename} defines the file name of the output file. If no ! filename is specified, the output is sent to the printer. @var{h} specifies the figure handle. If no handle is specified the handle for the current figure is used. *************** *** 6487,6493 **** Solid or dashed lines. @item -portrait @itemx -landscape ! Plot orientation, as returned by "orient". @item -d@var{device} Output device, where @var{device} is one of: @table @code --- 6493,6499 ---- Solid or dashed lines. @item -portrait @itemx -landscape ! Specify the orientation of the plot for printed output. @item -d@var{device} Output device, where @var{device} is one of: @table @code *************** *** 6573,6581 **** For a complete list, type `system ("gs -h")' to see what formats and devices are available. ! For output sent to a printer, the size is determined by the ! figure's "papersize" property. For output to a file the, size ! is determined by the "paperposition" property. @itemx -r@var{NUM} Resolution of bitmaps in pixels per inch. For both metafiles and --- 6579,6588 ---- For a complete list, type `system ("gs -h")' to see what formats and devices are available. ! When the ghostscript is sent to a printer the size is determined ! by the figure's "papersize" property. When the ghostscript output ! is sent to a file the size is determined by the figure's ! "paperposition" property. @itemx -r@var{NUM} Resolution of bitmaps in pixels per inch. For both metafiles and *************** *** 7181,7207 **** hold @c ./plot/hold.m -*- texinfo -*- ! @deftypefn {Function File} {} hold @var{args} ! Tell Octave to `hold' the current data on the graph when executing ! subsequent plotting commands. This allows you to execute a series of ! plot commands and have all the lines end up on the same graph. The ! default is for each new plot command to clear the plot device first. ! For example, the command ! @example ! hold on ! @end example ! @noindent ! turns the hold state on. An argument of @code{"off"} turns the hold ! state off, and @code{hold} with no arguments toggles the current hold ! state. ! @deftypefnx {Function File} {} hold (@var{h}, @dots{}) ! Applies to a specific axis or axes, associated with the handle(s), ! @var{h}. @end deftypefn slice @c ./plot/slice.m --- 7188,7218 ---- hold @c ./plot/hold.m -*- texinfo -*- ! @deftypefn {Function File} {} hold ! @deftypefnx {Function File} {} hold @var{state} ! @deftypefnx {Function File} {} hold (@var{hax}, @dots{}) ! Toggle or set the 'hold' state of the plotting engine which determines ! whether new graphic objects are added to the plot or replace the existing ! objects. ! @table @code ! @item hold on ! Retain plot data and settings so that subsequent plot commands are displayed ! on a single graph. ! @item hold off ! Clear plot and restore default graphics settings before each new plot ! command. (default). ! @item hold ! Toggle the current 'hold' state. ! @end table ! When given the additional argument @var{hax}, the hold state is modified ! only for the given axis handle. + To query the current 'hold' state use the @code{ishold} function. + @seealso{ishold, cla, newplot, clf} @end deftypefn slice @c ./plot/slice.m *************** *** 7850,7858 **** delete @c ./miscellaneous/delete.m -*- texinfo -*- ! @deftypefn {Function File} {} delete (@var{file}) ! @deftypefnx {Function File} {} delete (@var{h}) Delete the named file or graphics handle. @end deftypefn ans @c ./miscellaneous/ans.m --- 7861,7873 ---- delete @c ./miscellaneous/delete.m -*- texinfo -*- ! @deftypefn {Function File} {} delete (@var{file}) ! @deftypefnx {Function File} {} delete (@var{handle}) Delete the named file or graphics handle. + + Deleting graphics objects is the proper way to remove + features from a plot without clearing the entire figure. + @seealso{clf, cla} @end deftypefn ans @c ./miscellaneous/ans.m *************** *** 8692,8698 **** pkg install image-1.0.0.tar.gz @end example @noindent ! installs the package found in the file @code{image-1.0.0.tar.gz}. The @var{option} variable can contain options that affect the manner in which a package is installed. These options can be one or more of --- 8707,8713 ---- pkg install image-1.0.0.tar.gz @end example @noindent ! installs the package found in the file @file{image-1.0.0.tar.gz}. The @var{option} variable can contain options that affect the manner in which a package is installed. These options can be one or more of *************** *** 8793,8799 **** pkg prefix ~/my_octave_packages @end example @noindent ! sets the installation prefix to @code{~/my_octave_packages}. Packages will be installed in this directory. It is possible to get the current installation prefix by requesting an --- 8808,8814 ---- pkg prefix ~/my_octave_packages @end example @noindent ! sets the installation prefix to @file{~/my_octave_packages}. Packages will be installed in this directory. It is possible to get the current installation prefix by requesting an *************** *** 9381,9387 **** By default @code{@var{p}=2} is used which implies a (relatively slow) singular value decomposition. Other possible selections are @code{@var{p}= 1, Inf, inf, 'Inf', 'fro'} which are generally faster. ! @seealso{norm, inv, det, svd, rank} @end deftypefn planerot @c ./linear-algebra/planerot.m --- 9396,9402 ---- By default @code{@var{p}=2} is used which implies a (relatively slow) singular value decomposition. Other possible selections are @code{@var{p}= 1, Inf, inf, 'Inf', 'fro'} which are generally faster. ! @seealso{condest, rcond, norm, svd} @end deftypefn planerot @c ./linear-algebra/planerot.m *************** *** 9659,9665 **** Pseudospectra." @url{http://citeseer.ist.psu.edu/223007.html} @end itemize ! @seealso{norm, cond, onenormest} @end deftypefn rank @c ./linear-algebra/rank.m --- 9674,9680 ---- Pseudospectra." @url{http://citeseer.ist.psu.edu/223007.html} @end itemize ! @seealso{cond, norm, onenormest} @end deftypefn rank @c ./linear-algebra/rank.m *************** *** 12397,12403 **** -*- texinfo -*- @deftypefn {Function File} {} assert (@var{cond}) @deftypefnx {Function File} {} assert (@var{cond}, @var{errmsg}, @dots{}) ! @deftypefnx {Function File} {} assert (@var{cond}, @{var{msg_id}, @var{errmsg}, @dots{}) @deftypefnx {Function File} {} assert (@var{observed},@var{expected}) @deftypefnx {Function File} {} assert (@var{observed},@var{expected},@var{tol}) --- 12412,12418 ---- -*- texinfo -*- @deftypefn {Function File} {} assert (@var{cond}) @deftypefnx {Function File} {} assert (@var{cond}, @var{errmsg}, @dots{}) ! @deftypefnx {Function File} {} assert (@var{cond}, @var{msg_id}, @var{errmsg}, @dots{}) @deftypefnx {Function File} {} assert (@var{observed},@var{expected}) @deftypefnx {Function File} {} assert (@var{observed},@var{expected},@var{tol}) *************** *** 15313,15319 **** function to integrate, then these can be flagged with the @code{"WayPoints"} property. This forces the ends of a sub-interval to fall on the breakpoints of the function and can result in ! significantly improved estimated of the error in the integral, faster computation or both. For example, @example --- 15328,15334 ---- function to integrate, then these can be flagged with the @code{"WayPoints"} property. This forces the ends of a sub-interval to fall on the breakpoints of the function and can result in ! significantly improved estimation of the error in the integral, faster computation or both. For example, @example diff -cNr octave-3.2.0/scripts/general/quadgk.m octave-3.2.2/scripts/general/quadgk.m *** octave-3.2.0/scripts/general/quadgk.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/general/quadgk.m 2009-06-11 07:13:22.000000000 +0200 *************** *** 77,83 **** ## function to integrate, then these can be flagged with the ## @code{"WayPoints"} property. This forces the ends of a sub-interval ## to fall on the breakpoints of the function and can result in ! ## significantly improved estimated of the error in the integral, faster ## computation or both. For example, ## ## @example --- 77,83 ---- ## function to integrate, then these can be flagged with the ## @code{"WayPoints"} property. This forces the ends of a sub-interval ## to fall on the breakpoints of the function and can result in ! ## significantly improved estimation of the error in the integral, faster ## computation or both. For example, ## ## @example *************** *** 191,208 **** ## \int_{-\infinity_^\infinity f(x) dx = \int_-1^1 f (g(t)) g'(t) dt ## where ## g(t) = t / (1 - t^2) ! ## g'(t) = 1 / (1 + t^2) ^ 2 ## waypoint transform is then ! ## t = (-1 + sqrt(1 + 4 * g(t) .^ 2)) ./ (2 * g(t)) if (!isempty (waypoints)) ! trans = @(x) (-1 + sqrt(1 + 4 * x .^ 2)) ./ (2 * x); subs = [-1; trans(waypoints); 1]; else subs = linspace (-1, 1, 11)'; endif h = 2; trans = @(t) t ./ (1 - t.^2); ! f = @(t) f (t ./ (1 + t .^ 2)) ./ ((1 + t .^ 2) .^ 2); elseif (isinf(a)) ## Formula defined in Shampine paper as two separate steps. One to ## weaken singularity at finite end, then a second to transform to --- 191,208 ---- ## \int_{-\infinity_^\infinity f(x) dx = \int_-1^1 f (g(t)) g'(t) dt ## where ## g(t) = t / (1 - t^2) ! ## g'(t) = (1 + t^2) / (1 - t^2) ^ 2 ## waypoint transform is then ! ## t = (2 * g(t)) ./ (1 + sqrt(1 + 4 * g(t) .^ 2)) if (!isempty (waypoints)) ! trans = @(x) (2 * x) ./ (1 + sqrt(1 + 4 * x .^ 2)); subs = [-1; trans(waypoints); 1]; else subs = linspace (-1, 1, 11)'; endif h = 2; trans = @(t) t ./ (1 - t.^2); ! f = @(t) f (t ./ (1 - t .^ 2)) .* (1 + t .^ 2) ./ ((1 - t .^ 2) .^ 2); elseif (isinf(a)) ## Formula defined in Shampine paper as two separate steps. One to ## weaken singularity at finite end, then a second to transform to *************** *** 442,444 **** --- 442,446 ---- %!assert (quadgk (@(x) abs (1 - x.^2), 0, 2, 'Waypoints', 1), 2, 1e-6) %!assert (quadgk(@(x) 1./(sqrt(x).*(x+1)), 0, Inf), pi, 1e-6) %!assert (quadgk (@(z) log (z), 1+1i, 1+1i, 'WayPoints', [1-1i, -1,-1i, -1+1i]), -pi * 1i, 1e-6) + + %!assert (quadgk (@(x) exp(-x .^ 2), -Inf, Inf), sqrt(pi), 1e-6) \ No newline at end of file diff -cNr octave-3.2.0/scripts/general/repmat.m octave-3.2.2/scripts/general/repmat.m *** octave-3.2.0/scripts/general/repmat.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/general/repmat.m 2009-06-25 06:36:19.000000000 +0200 *************** *** 64,70 **** x = reshape (x, idx); elseif (ndims (a) == 2 && length (idx) < 3) if (issparse (a)) ! x = spkron (ones (idx), a); else ## indexing is now faster, so we use it rather than kron. m = rows (a); n = columns (a); --- 64,70 ---- x = reshape (x, idx); elseif (ndims (a) == 2 && length (idx) < 3) if (issparse (a)) ! x = kron (ones (idx), a); else ## indexing is now faster, so we use it rather than kron. m = rows (a); n = columns (a); diff -cNr octave-3.2.0/scripts/linear-algebra/condest.m octave-3.2.2/scripts/linear-algebra/condest.m *** octave-3.2.0/scripts/linear-algebra/condest.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/linear-algebra/condest.m 2009-06-08 07:34:32.000000000 +0200 *************** *** 61,67 **** ## Pseudospectra." @url{http://citeseer.ist.psu.edu/223007.html} ## @end itemize ## ! ## @seealso{norm, cond, onenormest} ## @end deftypefn ## Code originally licensed under --- 61,67 ---- ## Pseudospectra." @url{http://citeseer.ist.psu.edu/223007.html} ## @end itemize ## ! ## @seealso{cond, norm, onenormest} ## @end deftypefn ## Code originally licensed under diff -cNr octave-3.2.0/scripts/linear-algebra/cond.m octave-3.2.2/scripts/linear-algebra/cond.m *** octave-3.2.0/scripts/linear-algebra/cond.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/linear-algebra/cond.m 2009-06-08 07:34:32.000000000 +0200 *************** *** 24,30 **** ## By default @code{@var{p}=2} is used which implies a (relatively slow) ## singular value decomposition. Other possible selections are ## @code{@var{p}= 1, Inf, inf, 'Inf', 'fro'} which are generally faster. ! ## @seealso{norm, inv, det, svd, rank} ## @end deftypefn ## Author: jwe --- 24,30 ---- ## By default @code{@var{p}=2} is used which implies a (relatively slow) ## singular value decomposition. Other possible selections are ## @code{@var{p}= 1, Inf, inf, 'Inf', 'fro'} which are generally faster. ! ## @seealso{condest, rcond, norm, svd} ## @end deftypefn ## Author: jwe diff -cNr octave-3.2.0/scripts/miscellaneous/delete.m octave-3.2.2/scripts/miscellaneous/delete.m *** octave-3.2.0/scripts/miscellaneous/delete.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/miscellaneous/delete.m 2009-06-09 06:33:11.000000000 +0200 *************** *** 17,25 **** ## . ## -*- texinfo -*- ! ## @deftypefn {Function File} {} delete (@var{file}) ! ## @deftypefnx {Function File} {} delete (@var{h}) ## Delete the named file or graphics handle. ## @end deftypefn ## Author: jwe --- 17,29 ---- ## . ## -*- texinfo -*- ! ## @deftypefn {Function File} {} delete (@var{file}) ! ## @deftypefnx {Function File} {} delete (@var{handle}) ## Delete the named file or graphics handle. + ## + ## Deleting graphics objects is the proper way to remove + ## features from a plot without clearing the entire figure. + ## @seealso{clf, cla} ## @end deftypefn ## Author: jwe diff -cNr octave-3.2.0/scripts/pkg/pkg.m octave-3.2.2/scripts/pkg/pkg.m *** octave-3.2.0/scripts/pkg/pkg.m 2009-05-26 13:38:48.000000000 +0200 --- octave-3.2.2/scripts/pkg/pkg.m 2009-06-08 07:34:32.000000000 +0200 *************** *** 29,35 **** ## pkg install image-1.0.0.tar.gz ## @end example ## @noindent ! ## installs the package found in the file @code{image-1.0.0.tar.gz}. ## ## The @var{option} variable can contain options that affect the manner ## in which a package is installed. These options can be one or more of --- 29,35 ---- ## pkg install image-1.0.0.tar.gz ## @end example ## @noindent ! ## installs the package found in the file @file{image-1.0.0.tar.gz}. ## ## The @var{option} variable can contain options that affect the manner ## in which a package is installed. These options can be one or more of *************** *** 130,136 **** ## pkg prefix ~/my_octave_packages ## @end example ## @noindent ! ## sets the installation prefix to @code{~/my_octave_packages}. ## Packages will be installed in this directory. ## ## It is possible to get the current installation prefix by requesting an --- 130,136 ---- ## pkg prefix ~/my_octave_packages ## @end example ## @noindent ! ## sets the installation prefix to @file{~/my_octave_packages}. ## Packages will be installed in this directory. ## ## It is possible to get the current installation prefix by requesting an diff -cNr octave-3.2.0/scripts/plot/allchild.m octave-3.2.2/scripts/plot/allchild.m *** octave-3.2.0/scripts/plot/allchild.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/allchild.m 2009-06-09 06:33:11.000000000 +0200 *************** *** 18,29 **** ## -*- texinfo -*- ## @deftypefn {Function File} {@var{h} =} allchild (@var{handles}) ! ## Find all children including hidden children of an object. ## ## This function is similar to @code{get (h, "children")}, but also ## returns includes hidden objects. If @var{handles} is a scalar, ! ## @var{h} will be a vector, and if not, @var{h} will be a cell matrix ! ## with the same size as @var{handles} and each cell will contain a ## vector of handles. ## @seealso{get, set, findall, findobj} ## @end deftypefn --- 18,29 ---- ## -*- texinfo -*- ## @deftypefn {Function File} {@var{h} =} allchild (@var{handles}) ! ## Find all children, including hidden children, of a graphics object. ## ## This function is similar to @code{get (h, "children")}, but also ## returns includes hidden objects. If @var{handles} is a scalar, ! ## @var{h} will be a vector. Otherwise, @var{h} will be a cell matrix ! ## of the same size as @var{handles} and each cell will contain a ## vector of handles. ## @seealso{get, set, findall, findobj} ## @end deftypefn diff -cNr octave-3.2.0/scripts/plot/axis.m octave-3.2.2/scripts/plot/axis.m *** octave-3.2.0/scripts/plot/axis.m 2009-05-28 07:57:14.000000000 +0200 --- octave-3.2.2/scripts/plot/axis.m 2009-06-18 07:09:18.000000000 +0200 *************** *** 298,305 **** else data = get (kids, strcat (ax, "data")); if (iscell (data)) ! lims(1) = min (cellfun (@min, data)(:)); ! lims(2) = min (cellfun (@max, data)(:)); else lims = [min(data(:)), max(data(:))]; endif --- 298,311 ---- else data = get (kids, strcat (ax, "data")); if (iscell (data)) ! data = data (find (! cellfun (@isempty, data))); ! if (! isempty (data)) ! lims_min = min (cellfun (@min, cellfun (@min, data, 'UniformOutput', false)(:))); ! lims_max = max (cellfun (@max, cellfun (@max, data, 'UniformOutput', false)(:))); ! lims = [lims_min, lims_max]; ! else ! lims = [0, 1]; ! endif else lims = [min(data(:)), max(data(:))]; endif *************** *** 430,436 **** %! title("axes at [3 6 0 1], then autoy"); %! %! subplot(326); ! %! plot(t, x); %! axis("tight"); %! title("tight"); --- 436,442 ---- %! title("axes at [3 6 0 1], then autoy"); %! %! subplot(326); ! %! plot(t, sin(t), t, -2*sin(t/2)) %! axis("tight"); %! title("tight"); *************** *** 442,445 **** --- 448,461 ---- %! axis image %! title("image") + %!demo + %! clf + %! [x,y,z] = peaks(50); + %! x1 = max(x(:)); + %! pcolor(x-x1,y-x1/2,z) + %! hold on + %! [x,y,z] = sombrero; + %! s = x1/max(x(:)); + %! pcolor(s*x+x1,s*y+x1/2,5*z) + %! axis tight diff -cNr octave-3.2.0/scripts/plot/backend.m octave-3.2.2/scripts/plot/backend.m *** octave-3.2.0/scripts/plot/backend.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/backend.m 2009-06-09 06:33:11.000000000 +0200 *************** *** 21,30 **** ## @deftypefnx {Function File} {} backend (@var{hlist}, @var{name}) ## Change the default graphics backend to @var{name}. If the backend is ## not already loaded, it is first initialized (initialization is done ! ## through the execution of __init_@var{name}__). ## ! ## @var{hlist} is a list of figure handles. When given, this function ! ## only switches the default backend for the corresponding figures. ## @seealso{available_backends} ## @end deftypefn --- 21,30 ---- ## @deftypefnx {Function File} {} backend (@var{hlist}, @var{name}) ## Change the default graphics backend to @var{name}. If the backend is ## not already loaded, it is first initialized (initialization is done ! ## through the execution of @code{__init_@var{name}__}). ## ! ## When called with a list of figure handles, @var{hlist}, the backend is ! ## changed only for the listed figures. ## @seealso{available_backends} ## @end deftypefn diff -cNr octave-3.2.0/scripts/plot/clf.m octave-3.2.2/scripts/plot/clf.m *** octave-3.2.0/scripts/plot/clf.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/clf.m 2009-06-09 06:33:11.000000000 +0200 *************** *** 17,31 **** ## . ## -*- texinfo -*- ! ## @deftypefn {Function File} {} clf () ## @deftypefnx {Function File} {} clf ("reset") ## @deftypefnx {Function File} {} clf (@var{hfig}) ## @deftypefnx {Function File} {} clf (@var{hfig}, "reset") ! ## @deftypefnx {Function File} {@var{hfig} =} clf (@dots{}) ! ## Delete the children of the current figure with visible handles. ! ## If @var{hfig} is specified and is an figure object handle, operate on it ! ## instead of the current figure. If the optional argument @code{"reset"} ! ## is specified, also delete the figure's children with hidden handles. ## @seealso{cla, close, delete} ## @end deftypefn --- 17,31 ---- ## . ## -*- texinfo -*- ! ## @deftypefn {Function File} {} clf () ## @deftypefnx {Function File} {} clf ("reset") ## @deftypefnx {Function File} {} clf (@var{hfig}) ## @deftypefnx {Function File} {} clf (@var{hfig}, "reset") ! ## Clear the current figure window. @code{clf} operates by deleting child ! ## graphics objects with visible handles (@code{HandleVisibility} = on). ! ## If @var{hfig} is specified operate on it instead of the current figure. ! ## If the optional argument @code{"reset"} is specified, all objects including ! ## those with hidden handles are deleted. ## @seealso{cla, close, delete} ## @end deftypefn diff -cNr octave-3.2.0/scripts/plot/colorbar.m octave-3.2.2/scripts/plot/colorbar.m *** octave-3.2.0/scripts/plot/colorbar.m 2009-06-02 07:22:16.000000000 +0200 --- octave-3.2.2/scripts/plot/colorbar.m 2009-06-08 07:34:31.000000000 +0200 *************** *** 113,119 **** set (ax, "activepositionproperty", "position", "position", pos); cax = __go_axes__ (get (ax, "parent"), "tag", "colorbar", ! "handlevisibility", "off", "activepositionproperty", "position", "position", cpos); addproperty ("location", cax, "radio", --- 113,119 ---- set (ax, "activepositionproperty", "position", "position", pos); cax = __go_axes__ (get (ax, "parent"), "tag", "colorbar", ! "handlevisibility", "on", "activepositionproperty", "position", "position", cpos); addproperty ("location", cax, "radio", *************** *** 550,552 **** --- 550,599 ---- %! ytick = get(h, "ytick"); %! set (h, "yticklabel", sprintf ('10^{%g}|', ytick)); + %!demo + %! clf + %! n=5;x=linspace(0,5,n);y=linspace(0,1,n); + %! imagesc(1./hilb(n)); axis equal; colorbar + + %!demo + %! clf + %! n=5;x=linspace(0,5,n);y=linspace(0,1,n); + %! imagesc(x,y,1./hilb(n)); axis equal; colorbar + + %!demo + %! clf + %! n=5;x=linspace(0,5,n);y=linspace(0,1,n); + %! imagesc(y,x,1./hilb(n)); axis equal; colorbar + ## This requires that the axes position be properly determined for "axes equal" + + %!demo + %! clf + %! axes + %! colorbar + %! hold on + %! contour(peaks) + %! hold off + + %!demo + %! clf + %! plot([0, 2]) + %! colorbar ("east") + %! axis square + + %!demo + %! clf + %! plot([0, 2]) + %! colorbar ("eastoutside") + %! axis square + + %!demo + %! clf + %! plot([0, 2]) + %! colorbar ("east") + %! axis equal + + %!demo + %! clf + %! plot([0, 2]) + %! colorbar ("eastoutside") + %! axis equal diff -cNr octave-3.2.0/scripts/plot/gnuplot_drawnow.m octave-3.2.2/scripts/plot/gnuplot_drawnow.m *** octave-3.2.0/scripts/plot/gnuplot_drawnow.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/gnuplot_drawnow.m 2009-06-26 12:56:17.000000000 +0200 *************** *** 109,118 **** endfunction function [enhanced, implicit_margin] = gnuplot_set_term (plot_stream, new_stream, h, term, file) ! ## Generate the gnuplot "set terminal ..." command. Include ! ## the subset of properties "position", "units", "paperposition", ! ## "paperunits", "name", and "numbertitle". When "term" originates ! ## from print.m, it may include gnuplot terminal options. if (nargin < 4) ## This supports the gnuplot backend. term = gnuplot_default_term (); --- 109,116 ---- endfunction function [enhanced, implicit_margin] = gnuplot_set_term (plot_stream, new_stream, h, term, file) ! ## Generate the gnuplot "set terminal ..." command. ! ## When "term" originates from print.m, it may include other options. if (nargin < 4) ## This supports the gnuplot backend. term = gnuplot_default_term (); *************** *** 166,176 **** || any (strfind (opts_str, "size ") == 1))) ## Convert position to units used by gnuplot. if (output_to_screen (term)) ! ## Get figure size in pixels. ! [gnuplot_size, gnuplot_pos] = get_figsize (h); else ! ## Get size of the printed plot in inches. ! gnuplot_size = get_papersize (h); if (term_units_are_pixels (term)) ## Convert to inches using the property set by print(). gnuplot_size = gnuplot_size * get (h, "__pixels_per_inch__"); --- 164,190 ---- || any (strfind (opts_str, "size ") == 1))) ## Convert position to units used by gnuplot. if (output_to_screen (term)) ! ## Get figure size in pixels. Rely on listener ! ## to handle coversion of position property. ! units = get (h, "units"); ! unwind_protect ! set (h, "units", "pixels"); ! position_in_pixesl = get (h, "position"); ! unwind_protect_cleanup ! set (h, "units", units); ! end_unwind_protect ! gnuplot_pos = position_in_pixesl(1:2); ! gnuplot_size = position_in_pixesl(3:4); else ! ## Get size of the printed plot in inches. Rely on listener ! ## to handle coversion of papersize property. ! paperunits = get (h, "paperunits"); ! unwind_protect ! set (h, "paperunits", "inches"); ! gnuplot_size = get (h, "papersize"); ! unwind_protect_cleanup ! set (h, "paperunits", paperunits); ! end_unwind_protect if (term_units_are_pixels (term)) ## Convert to inches using the property set by print(). gnuplot_size = gnuplot_size * get (h, "__pixels_per_inch__"); *************** *** 191,207 **** "epslatex", "pstex", "pslatex"}; if (__gnuplot_has_feature__ ("x11_figure_position")) terminals_with_size{end+1} = "x11"; terminals_with_size{end+1} = "wxt"; endif if (any (strncmpi (term, terminals_with_size, 3))) if (term_units_are_pixels (term)) ! size_str = sprintf ("size %d,%d", gnuplot_size(1), gnuplot_size(2)); else ! size_str = sprintf ("size %.15g,%.15g", gnuplot_size(1), gnuplot_size(2)); endif if (strncmpi (term, "X11", 3) && __gnuplot_has_feature__ ("x11_figure_position")) ## X11 allows the window to be positioned as well. ! screen_size = get (0, "screensize")(3:4); if (all (screen_size > 0)) ## For X11, set the figure positon as well as the size ## gnuplot position is UL, Octave's is LL (same for screen/window) --- 205,229 ---- "epslatex", "pstex", "pslatex"}; if (__gnuplot_has_feature__ ("x11_figure_position")) terminals_with_size{end+1} = "x11"; + endif + if (__gnuplot_has_feature__ ("wxt_figure_size")) terminals_with_size{end+1} = "wxt"; endif if (any (strncmpi (term, terminals_with_size, 3))) if (term_units_are_pixels (term)) ! size_str = sprintf ("size %d,%d", gnuplot_size); else ! size_str = sprintf ("size %.15g,%.15g", gnuplot_size); endif if (strncmpi (term, "X11", 3) && __gnuplot_has_feature__ ("x11_figure_position")) ## X11 allows the window to be positioned as well. ! units = get (0, "units"); ! unwind_protect ! set (0, "units", "pixels"); ! screen_size = get (0, "screensize")(3:4); ! unwind_protect_cleanup ! set (0, "units", units); ! end_unwind_protect if (all (screen_size > 0)) ## For X11, set the figure positon as well as the size ## gnuplot position is UL, Octave's is LL (same for screen/window) *************** *** 213,225 **** endif elseif (strncmpi (term, "aqua", 3)) ## Aqua has size, but the format is different. ! size_str = sprintf ("size %d %d", gnuplot_size(1), gnuplot_size(2)); elseif (strncmpi (term, "fig", 3)) ## Fig also has size, but the format is different. ! size_str = sprintf ("size %.15g %.15g", gnuplot_size(1), gnuplot_size(2)); elseif (any (strncmpi (term, {"corel", "hpgl"}, 3))) ## The size for corel and hpgl are goes at the end (implicit). ! size_str = sprintf ("%.15g %.15g",gnuplot_size(1), gnuplot_size(2)); elseif (any (strncmpi (term, {"dxf"}, 3))) ## DXF uses autocad units. size_str = ""; --- 235,247 ---- endif elseif (strncmpi (term, "aqua", 3)) ## Aqua has size, but the format is different. ! size_str = sprintf ("size %d %d", gnuplot_size); elseif (strncmpi (term, "fig", 3)) ## Fig also has size, but the format is different. ! size_str = sprintf ("size %.15g %.15g", gnuplot_size); elseif (any (strncmpi (term, {"corel", "hpgl"}, 3))) ## The size for corel and hpgl are goes at the end (implicit). ! size_str = sprintf ("%.15g %.15g", gnuplot_size); elseif (any (strncmpi (term, {"dxf"}, 3))) ## DXF uses autocad units. size_str = ""; *************** *** 323,336 **** ## Determine the default gnuplot terminal. term = gnuplot_default_term (); endif ! have_enhanced = false; ! for n = 1 : length (enhanced_terminals) ! t = enhanced_terminals{n}; ! if (strncmp (term, t, min (length (term), length (t)))) ! have_enhanced = true; ! break; ! endif ! endfor endfunction function ret = output_to_screen (term) --- 345,351 ---- ## Determine the default gnuplot terminal. term = gnuplot_default_term (); endif ! have_enhanced = any (strncmp (enhanced_terminals, term, min (numel (term), 3))); endfunction function ret = output_to_screen (term) *************** *** 338,433 **** endfunction function ret = term_units_are_pixels (term) ! ret = any (strcmpi ({"emf", "gif", "jpeg", "pbm", "png", "svg"}, term)); ! endfunction ! ! function [fig_size, fig_pos] = get_figsize (h) ! ## Determine the size of the figure in pixels. ! position = get (h, "position"); ! units = get (h, "units"); ! t.inches = 1; ! t.centimeters = 2.54; ! t.pixels = get (0, "screenpixelsperinch"); ! ## gnuplot treats pixels/points for the screen the same (?). ! t.points = t.pixels; ! screensize = get (0, "screensize")(3:4); ! t.normalized = screensize / t.pixels; ! fig_size = position(3:4) * (t.pixels / t.(units)); ! fig_pos = position(1:2) * (t.pixels / t.(units)); ! fig_pos(1) = max (min (fig_pos(1), screensize(1)), 10); ! fig_pos(2) = max (min (fig_pos(2), screensize(2)), 10); ! fig_size(1) = max (min (fig_size(1), screensize(1)), 10-fig_pos(1)); ! fig_size(2) = max (min (fig_size(2), screensize(2)), 10-fig_pos(2)); endfunction - function papersize = get_papersize (h) - ## Returns the papersize in inches - ## FIXME - a listener should hanlde this. - persistent papertypes papersizes - if (isempty (papertypes)) - papertypes = {"usletter", "uslegal", ... - "a0", "a1", "a2", "a3", "a4", "a5", ... - "b0", "b1", "b2", "b3", "b4", "b5", ... - "arch-a", "arch-b", "arch-c", "arch-d", "arch-e", ... - "a", "b", "c", "d", "e", ... - "tabloid", ""}; - papersizes = [ 8.500, 11.000; - 8.500, 14.000; - 33.135, 46.847; - 23.404, 33.135; - 16.548, 23.404; - 11.694, 16.528; - 8.268, 11.693; - 5.847, 8.264; - 40.543, 57.366; - 28.683, 40.503; - 20.252, 28.683; - 14.342, 20.252; - 10.126, 14.342; - 7.171, 10.126; - 9.000, 12.000; - 12.000, 18.000; - 18.000, 24.000; - 24.000, 36.000; - 36.000, 48.000; - 8.500, 11.000; - 11.000, 17.000; - 17.000, 22.000; - 22.000, 34.000; - 34.000, 44.000; - 11.000, 17.000; - 8.500, 11.000]; - ## has a page size since we're not doing any checking here. - papersizes = round (1000 * papersizes); - endif - - paperunits = get (h, "paperunits"); - if (strcmpi (paperunits, "normalized")) - papertype = get (h, "papertype"); - n = find (strcmpi (papertypes, papertype)); - papersize = 0.001 * papersizes(n, :); - paperunits = "inches"; - else - t.points = 72; - t.centimeters = 2.54; - t.inches = 1.00; - ## FIXME -- this papersize/type administration should be done at a - ## lower level. - if (strcmpi (get (h, "papertype"), "")) - ## If the type is custom but the size is a standard, then set the - ## standard type. - papersize = get (h, "papersize"); - papersize = papersize * t.(paperunits); - n = find (all ((ones ([size(papersizes, 1), 1]) - * round (1000*papersize) - papersizes) == 0, 2)); - if (! isempty (n)) - set (h, "papertype", papertypes{n}); - endif - else - papertype = get (h, "papertype"); - n = find (strcmpi (papertypes, papertype)); - papersize = papersizes(n,:) * 0.001; - set (h, "papersize", papersize * t.(paperunits)); - endif - endif - endfunction --- 353,358 ---- endfunction function ret = term_units_are_pixels (term) ! ret = any (strncmpi ({"emf", "gif", "jpeg", "pbm", "png", "svg"}, term, 3)); endfunction diff -cNr octave-3.2.0/scripts/plot/__gnuplot_has_feature__.m octave-3.2.2/scripts/plot/__gnuplot_has_feature__.m *** octave-3.2.0/scripts/plot/__gnuplot_has_feature__.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/__gnuplot_has_feature__.m 2009-06-26 12:56:17.000000000 +0200 *************** *** 25,30 **** --- 25,31 ---- function res = __gnuplot_has_feature__ (feature) persistent features has_features features = {"x11_figure_position", + "wxt_figure_size", "transparent_patches", "transparent_surface", "epslatex_implies_eps_filesuffix", *************** *** 35,42 **** if (isempty (has_features)) gnuplot_version = __gnuplot_version__ (); ! versions = {"4.3", "4.3", "4.3", "4.2", "4.2", "4.3", "4.3", "4.3"}; ! operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="}; have_features = logical (zeros (size (features))); for n = 1 : numel (have_features) has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n}); --- 36,43 ---- if (isempty (has_features)) gnuplot_version = __gnuplot_version__ (); ! versions = {"4.2.5", "4.3.0", "4.3", "4.3", "4.2", "4.2", "4.3", "4.3", "4.3"}; ! operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="}; have_features = logical (zeros (size (features))); for n = 1 : numel (have_features) has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n}); diff -cNr octave-3.2.0/scripts/plot/__go_draw_axes__.m octave-3.2.2/scripts/plot/__go_draw_axes__.m *** octave-3.2.0/scripts/plot/__go_draw_axes__.m 2009-06-02 07:22:16.000000000 +0200 --- octave-3.2.2/scripts/plot/__go_draw_axes__.m 2009-06-23 12:57:58.000000000 +0200 *************** *** 226,232 **** if (strcmpi (axis_obj.xminorgrid, "on")) have_grid = true; ! fprintf (plot_stream, "set m%stics 5;\n", xaxisloc); fprintf (plot_stream, "set grid m%stics;\n", xaxisloc); else fprintf (plot_stream, "set grid nom%stics;\n", xaxisloc); --- 226,237 ---- if (strcmpi (axis_obj.xminorgrid, "on")) have_grid = true; ! if (strcmp (axis_obj.xscale, "log")) ! m = 10; ! else ! m = 5; ! endif ! fprintf (plot_stream, "set m%stics %d;\n", xaxisloc, m); fprintf (plot_stream, "set grid m%stics;\n", xaxisloc); else fprintf (plot_stream, "set grid nom%stics;\n", xaxisloc); *************** *** 234,240 **** if (strcmpi (axis_obj.yminorgrid, "on")) have_grid = true; ! fprintf (plot_stream, "set m%stics 5;\n", yaxisloc); fprintf (plot_stream, "set grid m%stics;\n", yaxisloc); else fprintf (plot_stream, "set grid nom%stics;\n", yaxisloc); --- 239,250 ---- if (strcmpi (axis_obj.yminorgrid, "on")) have_grid = true; ! if (strcmp (axis_obj.yscale, "log")) ! m = 10; ! else ! m = 5; ! endif ! fprintf (plot_stream, "set m%stics %d;\n", yaxisloc, m); fprintf (plot_stream, "set grid m%stics;\n", yaxisloc); else fprintf (plot_stream, "set grid nom%stics;\n", yaxisloc); *************** *** 242,248 **** if (strcmpi (axis_obj.zminorgrid, "on")) have_grid = true; ! fputs (plot_stream, "set mztics 5;\n"); fputs (plot_stream, "set grid mztics;\n"); else fputs (plot_stream, "set grid nomztics;\n"); --- 252,263 ---- if (strcmpi (axis_obj.zminorgrid, "on")) have_grid = true; ! if (strcmp (axis_obj.zscale, "log")) ! m = 10; ! else ! m = 5; ! endif ! fprintf (plot_stream, "set mztics %d;\n", m); fputs (plot_stream, "set grid mztics;\n"); else fputs (plot_stream, "set grid nomztics;\n"); *************** *** 1028,1034 **** if (isempty (kids)) kids = obj.children; elseif (! isempty (obj.children)) ! kids = [obj.children; kids]; endif otherwise --- 1043,1049 ---- if (isempty (kids)) kids = obj.children; elseif (! isempty (obj.children)) ! kids = [kids; obj.children]; endif otherwise *************** *** 1337,1343 **** endfunction function fontspec = create_fontspec (f, s, gp_term) ! if (strcmp (f, "*") && ! strcmp (gp_term, "x11")) fontspec = sprintf ("font \",%d\"", s); else fontspec = sprintf ("font \"%s,%d\"", f, s); --- 1352,1358 ---- endfunction function fontspec = create_fontspec (f, s, gp_term) ! if (strcmp (f, "*")) fontspec = sprintf ("font \",%d\"", s); else fontspec = sprintf ("font \"%s,%d\"", f, s); *************** *** 1535,1540 **** --- 1550,1565 ---- obj.yticklabel = ticklabel_to_cell (obj.yticklabel); obj.zticklabel = ticklabel_to_cell (obj.zticklabel); + if (strcmp (obj.xminorgrid, "on")) + obj.xminortick = "on"; + endif + if (strcmp (obj.yminorgrid, "on")) + obj.yminortick = "on"; + endif + if (strcmp (obj.zminorgrid, "on")) + obj.zminortick = "on"; + endif + [fontname, fontsize] = get_fontname_and_size (obj); fontspec = create_fontspec (fontname, fontsize, gnuplot_term); *************** *** 1545,1605 **** do_tics_1 (obj.xtickmode, obj.xtick, obj.xminortick, obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x2", plot_stream, true, mono, "border", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter); do_tics_1 ("manual", [], "off", obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x", plot_stream, true, mono, "border", ! "", "", fontname, fontspec, obj.interpreter); elseif (strcmpi (obj.xaxislocation, "zero")) do_tics_1 (obj.xtickmode, obj.xtick, obj.xminortick, obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x", plot_stream, true, mono, "axis", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter); do_tics_1 ("manual", [], "off", obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x2", plot_stream, true, mono, "axis", ! "", "", fontname, fontspec, obj.interpreter); else do_tics_1 (obj.xtickmode, obj.xtick, obj.xminortick, obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x", plot_stream, true, mono, "border", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter); do_tics_1 ("manual", [], "off", obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x2", plot_stream, true, mono, "border", ! "", "", fontname, fontspec, obj.interpreter); endif if (strcmpi (obj.yaxislocation, "right")) do_tics_1 (obj.ytickmode, obj.ytick, obj.yminortick, obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y2", plot_stream, ymirror, mono, "border", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter); do_tics_1 ("manual", [], "off", obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y", plot_stream, ymirror, mono, "border", ! "", "", fontname, fontspec, obj.interpreter); elseif (strcmpi (obj.yaxislocation, "zero")) do_tics_1 (obj.ytickmode, obj.ytick, obj.yminortick, obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y", plot_stream, ymirror, mono, "axis", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter); do_tics_1 ("manual", [], "off", obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y2", plot_stream, ymirror, mono, "axis", ! "", "", fontname, fontspec, obj.interpreter); else do_tics_1 (obj.ytickmode, obj.ytick, obj.yminortick, obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y", plot_stream, ymirror, mono, "border", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter); do_tics_1 ("manual", [], "off", obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y2", plot_stream, ymirror, mono, "border", ! "", "", fontname, fontspec, obj.interpreter); endif do_tics_1 (obj.ztickmode, obj.ztick, obj.zminortick, obj.zticklabelmode, obj.zticklabel, obj.zcolor, "z", plot_stream, true, mono, "border", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter); endfunction function do_tics_1 (ticmode, tics, mtics, labelmode, labels, color, ax, plot_stream, mirror, mono, axispos, tickdir, ticklength, ! fontname, fontspec, interpreter) persistent warned_latex = false; if (strcmpi (interpreter, "tex")) for n = 1 : numel(labels) --- 1570,1630 ---- do_tics_1 (obj.xtickmode, obj.xtick, obj.xminortick, obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x2", plot_stream, true, mono, "border", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter, obj.xscale); do_tics_1 ("manual", [], "off", obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x", plot_stream, true, mono, "border", ! "", "", fontname, fontspec, obj.interpreter, obj.xscale); elseif (strcmpi (obj.xaxislocation, "zero")) do_tics_1 (obj.xtickmode, obj.xtick, obj.xminortick, obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x", plot_stream, true, mono, "axis", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter, obj.xscale); do_tics_1 ("manual", [], "off", obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x2", plot_stream, true, mono, "axis", ! "", "", fontname, fontspec, obj.interpreter, obj.xscale); else do_tics_1 (obj.xtickmode, obj.xtick, obj.xminortick, obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x", plot_stream, true, mono, "border", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter, obj.xscale); do_tics_1 ("manual", [], "off", obj.xticklabelmode, obj.xticklabel, obj.xcolor, "x2", plot_stream, true, mono, "border", ! "", "", fontname, fontspec, obj.interpreter, obj.xscale); endif if (strcmpi (obj.yaxislocation, "right")) do_tics_1 (obj.ytickmode, obj.ytick, obj.yminortick, obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y2", plot_stream, ymirror, mono, "border", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter, obj.yscale); do_tics_1 ("manual", [], "off", obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y", plot_stream, ymirror, mono, "border", ! "", "", fontname, fontspec, obj.interpreter, obj.yscale); elseif (strcmpi (obj.yaxislocation, "zero")) do_tics_1 (obj.ytickmode, obj.ytick, obj.yminortick, obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y", plot_stream, ymirror, mono, "axis", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter, obj.yscale); do_tics_1 ("manual", [], "off", obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y2", plot_stream, ymirror, mono, "axis", ! "", "", fontname, fontspec, obj.interpreter, obj.yscale); else do_tics_1 (obj.ytickmode, obj.ytick, obj.yminortick, obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y", plot_stream, ymirror, mono, "border", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter, obj.yscale); do_tics_1 ("manual", [], "off", obj.yticklabelmode, obj.yticklabel, obj.ycolor, "y2", plot_stream, ymirror, mono, "border", ! "", "", fontname, fontspec, obj.interpreter, obj.yscale); endif do_tics_1 (obj.ztickmode, obj.ztick, obj.zminortick, obj.zticklabelmode, obj.zticklabel, obj.zcolor, "z", plot_stream, true, mono, "border", obj.tickdir, ticklength, fontname, fontspec, ! obj.interpreter, obj.yscale); endfunction function do_tics_1 (ticmode, tics, mtics, labelmode, labels, color, ax, plot_stream, mirror, mono, axispos, tickdir, ticklength, ! fontname, fontspec, interpreter, scale) persistent warned_latex = false; if (strcmpi (interpreter, "tex")) for n = 1 : numel(labels) *************** *** 1611,1616 **** --- 1636,1648 ---- warned_latex = true; endif endif + if (strcmp (scale, "log")) + fmt = "10^{%T}"; + num_mtics = 10; + else + fmt = "%g"; + num_mtics = 5; + endif colorspec = get_text_colorspec (color, mono); if (strcmpi (ticmode, "manual") || strcmpi (labelmode, "manual")) if (isempty (tics)) *************** *** 1650,1656 **** endfor fprintf (plot_stream, ") %s %s;\n", colorspec, fontspec); if (strcmp (mtics, "on")) ! fprintf (plot_stream, "set m%stics 5;\n", ax); else fprintf (plot_stream, "unset m%stics;\n", ax); endif --- 1682,1688 ---- endfor fprintf (plot_stream, ") %s %s;\n", colorspec, fontspec); if (strcmp (mtics, "on")) ! fprintf (plot_stream, "set m%stics %d;\n", ax, num_mtics); else fprintf (plot_stream, "unset m%stics;\n", ax); endif *************** *** 1658,1664 **** error ("unsupported type of ticklabel"); endif else ! fprintf (plot_stream, "set format %s \"%%g\";\n", ax); if (mirror) fprintf (plot_stream, "set %stics %s %s %s mirror (", ax, tickdir, ticklength, axispos); --- 1690,1696 ---- error ("unsupported type of ticklabel"); endif else ! fprintf (plot_stream, "set format %s \"%s\";\n", ax, fmt); if (mirror) fprintf (plot_stream, "set %stics %s %s %s mirror (", ax, tickdir, ticklength, axispos); *************** *** 1669,1681 **** fprintf (plot_stream, " %.15g,", tics(1:end-1)); fprintf (plot_stream, " %.15g) %s;\n", tics(end), fontspec); if (strcmp (mtics, "on")) ! fprintf (plot_stream, "set m%stics 5;\n", ax); else fprintf (plot_stream, "unset m%stics;\n", ax); endif endif else ! fprintf (plot_stream, "set format %s \"%%g\";\n", ax); if (mirror) fprintf (plot_stream, "set %stics %s %s %s mirror %s %s;\n", ax, axispos, tickdir, ticklength, colorspec, fontspec); --- 1701,1713 ---- fprintf (plot_stream, " %.15g,", tics(1:end-1)); fprintf (plot_stream, " %.15g) %s;\n", tics(end), fontspec); if (strcmp (mtics, "on")) ! fprintf (plot_stream, "set m%stics %d;\n", ax, num_mtics); else fprintf (plot_stream, "unset m%stics;\n", ax); endif endif else ! fprintf (plot_stream, "set format %s \"%s\";\n", ax, fmt); if (mirror) fprintf (plot_stream, "set %stics %s %s %s mirror %s %s;\n", ax, axispos, tickdir, ticklength, colorspec, fontspec); *************** *** 1684,1690 **** tickdir, ticklength, axispos, colorspec, fontspec); endif if (strcmp (mtics, "on")) ! fprintf (plot_stream, "set m%stics 5;\n", ax); else fprintf (plot_stream, "unset m%stics;\n", ax); endif --- 1716,1722 ---- tickdir, ticklength, axispos, colorspec, fontspec); endif if (strcmp (mtics, "on")) ! fprintf (plot_stream, "set m%stics %d;\n", ax, num_mtics); else fprintf (plot_stream, "unset m%stics;\n", ax); endif diff -cNr octave-3.2.0/scripts/plot/__go_draw_figure__.m octave-3.2.2/scripts/plot/__go_draw_figure__.m *** octave-3.2.0/scripts/plot/__go_draw_figure__.m 2009-06-02 07:22:16.000000000 +0200 --- octave-3.2.2/scripts/plot/__go_draw_figure__.m 2009-06-25 06:36:46.000000000 +0200 *************** *** 36,54 **** if (nargin >= 4 && nargin <= 6) htype = get (h, "type"); if (strcmp (htype, "figure")) ! ! ## When printing, determine the paperposition in inches. if (output_to_paper) orig_paper_units = get (h, "paperunits"); unwind_protect set (h, "paperunits", "inches"); paper_size = get (h, "papersize"); paper_position = get (h, "paperposition"); paper_position = paper_position ./ paper_size([1, 2, 1, 2]); ! implicit_margin = implicit_margin ./ paper_size([1, 2]); unwind_protect_cleanup set (h, "paperunits", orig_paper_units); end_unwind_protect else implicit_margin = implicit_margin * [1 1]; endif --- 36,61 ---- if (nargin >= 4 && nargin <= 6) htype = get (h, "type"); if (strcmp (htype, "figure")) ! ## When printing, set paperunits to inches and rely on a listener to convert ! ## the values for papersize and paperposition. if (output_to_paper) orig_paper_units = get (h, "paperunits"); + gpval_term = __gnuplot_get_var__ (h, "GPVAL_TERM"); + gpval_termoptions = __gnuplot_get_var__ (h, "GPVAL_TERMOPTIONS"); unwind_protect set (h, "paperunits", "inches"); paper_size = get (h, "papersize"); paper_position = get (h, "paperposition"); paper_position = paper_position ./ paper_size([1, 2, 1, 2]); ! implicit_margin = implicit_margin ./ paper_size; unwind_protect_cleanup set (h, "paperunits", orig_paper_units); end_unwind_protect + if (strcmp (gpval_term, "postscript") + && ! isempty (strfind (gpval_termoptions, "landscape"))) + ## This needed to obtain the expected result. + implicit_margin(2) = -implicit_margin(2); + endif else implicit_margin = implicit_margin * [1 1]; endif diff -cNr octave-3.2.0/scripts/plot/grid.m octave-3.2.2/scripts/plot/grid.m *** octave-3.2.0/scripts/plot/grid.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/grid.m 2009-06-23 12:57:58.000000000 +0200 *************** *** 39,49 **** function grid (varargin) - persistent grid_on = false; - persistent minor_on = false; - [ax, varargin, nargs] = __plt_get_axis_arg__ ("grid", varargin{:}); if (nargs > 2) print_usage (); elseif (nargs == 0) --- 39,54 ---- function grid (varargin) [ax, varargin, nargs] = __plt_get_axis_arg__ ("grid", varargin{:}); + grid_on = (strcmp (get (ax, "xgrid"), "on") + && strcmp (get (ax, "ygrid"), "on") + && strcmp (get (ax, "zgrid"), "on")); + + minor_on = (strcmp (get (ax, "xminorgrid"), "on") + && strcmp (get (ax, "yminorgrid"), "on") + && strcmp (get (ax, "zminorgrid"), "on")); + if (nargs > 2) print_usage (); elseif (nargs == 0) *************** *** 67,73 **** print_usage (); endif else ! minor_on = ! minor_on if (minor_on) grid_on = true; endif --- 72,78 ---- print_usage (); endif else ! minor_on = ! minor_on; if (minor_on) grid_on = true; endif *************** *** 93,95 **** --- 98,122 ---- endif endfunction + + %!demo + %! clf + %! subplot (2,2,1) + %! plot (1:100) + %! grid minor + %! grid minor + %! grid + %! title ("no grid") + %! subplot (2,2,2) + %! plot (1:100) + %! grid + %! title ("grid on") + %! subplot (2,2,3) + %! plot (1:100) + %! grid minor + %! title ("grid minor") + %! subplot (2,2,4) + %! semilogy (1:100) + %! grid minor + %! title ("grid minor") + diff -cNr octave-3.2.0/scripts/plot/gtext.m octave-3.2.2/scripts/plot/gtext.m *** octave-3.2.0/scripts/plot/gtext.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/gtext.m 2009-06-08 07:34:32.000000000 +0200 *************** *** 17,31 **** ## . ## -*- texinfo -*- ! ## @deftypefn {Function File} {} gtext (@var{s}) ## @deftypefnx {Function File} {} gtext (@dots{}, @var{prop}, @var{val}) ! ## Place text on the current figure. The text can be defined by the ! ## string @var{s}. If @var{s} is a cell array, each element of the cell ! ## array is written to a separate line. ! ## ! ## Additional arguments are passed to the underlying text object as ! ## properties. ! ## @seealso{ginput} ## @end deftypefn function gtext (s, varargin) --- 17,30 ---- ## . ## -*- texinfo -*- ! ## @deftypefn {Function File} {} gtext (@var{s}) ! ## @deftypefnx {Function File} {} gtext (@{@var{s1}; @var{s2}; @dots{}@}) ## @deftypefnx {Function File} {} gtext (@dots{}, @var{prop}, @var{val}) ! ## Place text on the current figure using the mouse. The text is defined ! ## by the string @var{s}. If @var{s} is a cell array, each element of the cell ! ## array is written to a separate line. Additional arguments are passed to ! ## the underlying text object as properties. ! ## @seealso{ginput, text} ## @end deftypefn function gtext (s, varargin) diff -cNr octave-3.2.0/scripts/plot/hold.m octave-3.2.2/scripts/plot/hold.m *** octave-3.2.0/scripts/plot/hold.m 2009-05-27 09:31:39.000000000 +0200 --- octave-3.2.2/scripts/plot/hold.m 2009-06-11 07:13:22.000000000 +0200 *************** *** 17,43 **** ## . ## -*- texinfo -*- ! ## @deftypefn {Function File} {} hold @var{args} ! ## Tell Octave to `hold' the current data on the graph when executing ! ## subsequent plotting commands. This allows you to execute a series of ! ## plot commands and have all the lines end up on the same graph. The ! ## default is for each new plot command to clear the plot device first. ! ## For example, the command ! ## ! ## @example ! ## hold on ! ## @end example ## ! ## @noindent ! ## turns the hold state on. An argument of @code{"off"} turns the hold ! ## state off, and @code{hold} with no arguments toggles the current hold ! ## state. ## ! ## @deftypefnx {Function File} {} hold (@var{h}, @dots{}) ! ## ! ## Applies to a specific axis or axes, associated with the handle(s), ! ## @var{h}. ## ## @end deftypefn function hold (varargin) --- 17,47 ---- ## . ## -*- texinfo -*- ! ## @deftypefn {Function File} {} hold ! ## @deftypefnx {Function File} {} hold @var{state} ! ## @deftypefnx {Function File} {} hold (@var{hax}, @dots{}) ! ## Toggle or set the 'hold' state of the plotting engine which determines ! ## whether new graphic objects are added to the plot or replace the existing ! ## objects. ! ## ! ## @table @code ! ## @item hold on ! ## Retain plot data and settings so that subsequent plot commands are displayed ! ## on a single graph. ## ! ## @item hold off ! ## Clear plot and restore default graphics settings before each new plot ! ## command. (default). ## ! ## @item hold ! ## Toggle the current 'hold' state. ! ## @end table ## + ## When given the additional argument @var{hax}, the hold state is modified + ## only for the given axis handle. + ## + ## To query the current 'hold' state use the @code{ishold} function. + ## @seealso{ishold, cla, newplot, clf} ## @end deftypefn function hold (varargin) *************** *** 117,119 **** --- 121,138 ---- %! imagesc(1./hilb(4)); %! hold off + %!demo + %! clf + %! colormap (jet) + %! t = linspace (-3, 3, 50); + %! [x, y] = meshgrid (t, t); + %! z = peaks (x, y); + %! contourf (x, y, z, 10); + %! hold ("on"); + %! plot (vec (x), vec (y), "^"); + %! patch ([-1.0 1.0 1.0 -1.0 -1.0], [-1.0 -1.0 1.0 1.0 -1.0], "red"); + %! xlim ([-2.0 2.0]); + %! ylim ([-2.0 2.0]); + %! colorbar ("SouthOutside"); + %! title ("Test script for some plot functions"); + diff -cNr octave-3.2.0/scripts/plot/plot3.m octave-3.2.2/scripts/plot/plot3.m *** octave-3.2.0/scripts/plot/plot3.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/plot3.m 2009-06-25 06:35:14.000000000 +0200 *************** *** 145,151 **** if (nargin - arg < 2) error ("plot3: properties must appear followed by a value"); endif ! properties = [properties, varargin(arg:arg+1)]; arg += 2; endwhile endif --- 145,151 ---- if (nargin - arg < 2) error ("plot3: properties must appear followed by a value"); endif ! properties = [properties, varargin(arg+1:arg+2)]; arg += 2; endwhile endif diff -cNr octave-3.2.0/scripts/plot/plotyy.m octave-3.2.2/scripts/plot/plotyy.m *** octave-3.2.0/scripts/plot/plotyy.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/plotyy.m 2009-06-16 06:43:57.000000000 +0200 *************** *** 73,93 **** else f = get (0, "currentfigure"); if (isempty (f)) ax(1) = axes (); ax(2) = axes (); - else - ax = get (f, "children"); - if (length (ax) > 2) - for i = 3 : length (ax) - delete (ax (i)); - endfor - ax = ax(1:2); - elseif (length (ax) == 1) - ax(2) = axes (); - elseif (isempty (ax)) - ax(1) = axes (); - ax(2) = axes (); - endif endif if (nargin < 2) varargin = {}; --- 73,98 ---- else f = get (0, "currentfigure"); if (isempty (f)) + f = figure (); + endif + ca = get (f, "currentaxes"); + if (isempty (ca)) + ax = []; + elseif (strcmp (get (ca, "tag"), "plotyy")); + ax = get (ca, "__plotyy_axes__"); + else + ax = ca; + endif + if (length (ax) > 2) + for i = 3 : length (ax) + delete (ax (i)); + endfor + ax = ax(1:2); + elseif (length (ax) == 1) + ax(2) = axes (); + elseif (isempty (ax)) ax(1) = axes (); ax(2) = axes (); endif if (nargin < 2) varargin = {}; *************** *** 177,187 **** --- 182,198 ---- addlistener (ax(2), "position", {@update_position, ax(1)}); addlistener (ax(1), "view", {@update_position, ax(2)}); addlistener (ax(2), "view", {@update_position, ax(1)}); + addlistener (ax(1), "dataaspectratio", {@update_position, ax(2)}); + addlistener (ax(2), "dataaspectratio", {@update_position, ax(1)}); ## Tag the plotyy axes, so we can use that information ## not to mirror the y axis tick marks set (ax, "tag", "plotyy") + ## Store the axes handles for the sister axes. + addproperty ("__plotyy_axes__", ax(1), "data", ax); + addproperty ("__plotyy_axes__", ax(2), "data", ax); + endfunction %!demo *************** *** 194,199 **** --- 205,223 ---- %! ylabel (ax(1), "Axis 1"); %! ylabel (ax(2), "Axis 2"); + %!demo + %! clf + %! x = linspace (-1, 1, 201); + %! subplot (2, 2, 1) + %! plotyy (x, sin(pi*x), x, 10*cos(pi*x)) + %! subplot (2, 2, 2) + %! surf (peaks (25)) + %! subplot (2, 2, 3) + %! contour (peaks (25)) + %! subplot (2, 2, 4) + %! plotyy (x, 10*sin(2*pi*x), x, cos(2*pi*x)) + %! axis square + function deleteplotyy (h, d, ax2, t2) if (ishandle (ax2) && strcmp (get (ax2, "type"), "axes") && (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off")) && *************** *** 212,221 **** recursion = true; position = get (h, "position"); view = get (h, "view"); oldposition = get (ax2, "position"); oldview = get (ax2, "view"); ! if (! (isequal (position, oldposition) && isequal (view, oldview))) ! set (ax2, "position", position, "view", view); endif unwind_protect_cleanup recursion = false; --- 236,251 ---- recursion = true; position = get (h, "position"); view = get (h, "view"); + dataaspectratio = get (h, "dataaspectratio"); oldposition = get (ax2, "position"); oldview = get (ax2, "view"); ! olddataaspectratio = get (ax2, "dataaspectratio"); ! if (! (isequal (position, oldposition) ! && isequal (view, oldview) ! && isequal (dataaspectratio, olddataaspectratio))) ! set (ax2, "position", position, ! "view", view, ! "dataaspectratio", dataaspectratio); endif unwind_protect_cleanup recursion = false; diff -cNr octave-3.2.0/scripts/plot/print.m octave-3.2.2/scripts/plot/print.m *** octave-3.2.0/scripts/plot/print.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/print.m 2009-06-25 06:36:46.000000000 +0200 *************** *** 18,29 **** ## . ## -*- texinfo -*- ! ## @deftypefn {Function File} {} print (@var{filename}, @var{options}) ## @deftypefnx {Function File} {} print (@var{h}, @var{filename}, @var{options}) ## Print a graph, or save it to a file ## ## @var{filename} defines the file name of the output file. If no ! ## filename is specified, output is sent to the printer. ## ## @var{h} specifies the figure handle. If no handle is specified ## the handle for the current figure is used. --- 18,31 ---- ## . ## -*- texinfo -*- ! ## @deftypefn {Function File} {} print () ! ## @deftypefnx {Function File} {} print (@var{options}) ! ## @deftypefnx {Function File} {} print (@var{filename}, @var{options}) ## @deftypefnx {Function File} {} print (@var{h}, @var{filename}, @var{options}) ## Print a graph, or save it to a file ## ## @var{filename} defines the file name of the output file. If no ! ## filename is specified, the output is sent to the printer. ## ## @var{h} specifies the figure handle. If no handle is specified ## the handle for the current figure is used. *************** *** 44,50 **** ## Solid or dashed lines. ## @item -portrait ## @itemx -landscape ! ## Plot orientation, as returned by "orient". ## @item -d@var{device} ## Output device, where @var{device} is one of: ## @table @code --- 46,52 ---- ## Solid or dashed lines. ## @item -portrait ## @itemx -landscape ! ## Specify the orientation of the plot for printed output. ## @item -d@var{device} ## Output device, where @var{device} is one of: ## @table @code *************** *** 130,138 **** ## For a complete list, type `system ("gs -h")' to see what formats ## and devices are available. ## ! ## For output sent to a printer, the size is determined by the ! ## figure's "papersize" property. For output to a file the, size ! ## is determined by the "paperposition" property. ## ## @itemx -r@var{NUM} ## Resolution of bitmaps in pixels per inch. For both metafiles and --- 132,141 ---- ## For a complete list, type `system ("gs -h")' to see what formats ## and devices are available. ## ! ## When the ghostscript is sent to a printer the size is determined ! ## by the figure's "papersize" property. When the ghostscript output ! ## is sent to a file the size is determined by the figure's ! ## "paperposition" property. ## ## @itemx -r@var{NUM} ## Resolution of bitmaps in pixels per inch. For both metafiles and *************** *** 169,175 **** function print (varargin) ! orientation = orient (); use_color = 0; # 0=default, -1=mono, +1=color force_solid = 0; # 0=default, -1=dashed, +1=solid fontsize = ""; --- 172,179 ---- function print (varargin) ! persistent warn_on_inconsistent_orientation = true ! orientation = ""; use_color = 0; # 0=default, -1=mono, +1=color force_solid = 0; # 0=default, -1=dashed, +1=solid fontsize = ""; *************** *** 311,321 **** "ps", "ps2", "psc", "psc2", "eps", "eps2", ... "epsc", "epsc2", "emf", "pdf", "pslatex", ... "epslatex", "epslatexstandalone", "pstex"}; ! if (! any (strcmp (dev, dev_list))) ghostscript_output = name; ghostscript_device = dev; ! dev = "epsc"; ! name = cstrcat (tmpnam, ".eps"); else ghostscript_output = ""; endif --- 315,332 ---- "ps", "ps2", "psc", "psc2", "eps", "eps2", ... "epsc", "epsc2", "emf", "pdf", "pslatex", ... "epslatex", "epslatexstandalone", "pstex"}; ! if (! any (strcmp (dev, dev_list)) && have_ghostscript) ghostscript_output = name; ghostscript_device = dev; ! if (doprint) ! ## If printing, use color postscript. ! dev = "psc"; ! name = cstrcat (tmpnam, ".ps"); ! else ! ## If saving to a file, use color encapsulated postscript. ! dev = "epsc"; ! name = cstrcat (tmpnam, ".eps"); ! endif else ghostscript_output = ""; endif *************** *** 344,355 **** if (dev(1) == "e") options = "eps "; else ! options = cstrcat (orientation, " "); endif termn = "postscript"; endif ! if (any (dev == "c") || use_color > 0) if (force_solid < 0) options = cstrcat (options, "color dashed "); else --- 355,373 ---- if (dev(1) == "e") options = "eps "; else ! options = ""; endif termn = "postscript"; endif + + if (any (dev == "c") || use_color > 0 + || (! isempty (strfind (dev, "tex")) && use_color == 0)) + use_color = 1; + else + use_color = -1; + endif ! if (use_color > 0) if (force_solid < 0) options = cstrcat (options, "color dashed "); else *************** *** 370,377 **** options = cstrcat (options, " ", fontsize); endif - new_terminal = cstrcat (termn, " ", options); - elseif (strcmp (dev, "aifm") || strcmp (dev, "corel")) ## Adobe Illustrator, CorelDraw if (use_color >= 0) --- 388,393 ---- *************** *** 421,427 **** if (isempty (canvas_size) && isempty (resolution) && any (strcmp (dev, {"pbm", "gif", "jpeg", "png"}))) ! options = "large"; elseif (strcmp (dev, "svg")) ## Referring to size, either "dynamic" or "fixed" options = "fixed"; --- 437,443 ---- if (isempty (canvas_size) && isempty (resolution) && any (strcmp (dev, {"pbm", "gif", "jpeg", "png"}))) ! options = ""; elseif (strcmp (dev, "svg")) ## Referring to size, either "dynamic" or "fixed" options = "fixed"; *************** *** 459,467 **** endif if (__gnuplot_has_feature__ ("variable_GPVAL_TERMINALS")) ! available_terminals = __gnuplot_get_var__ (gcf, "GPVAL_TERMINALS"); ! available_terminals = regexp (available_terminals, "\\b\\w+\\b", "match"); gnuplot_supports_term = any (strcmp (available_terminals, termn)); elseif (strcmp (termn, "pdf")) ## Some Linux variants do not include a "pdf" capable gnuplot. ## To be safe, use Ghostscript. --- 475,494 ---- endif if (__gnuplot_has_feature__ ("variable_GPVAL_TERMINALS")) ! available_terminals = __gnuplot_get_var__ (gcf, "GPVAL_TERMINALS"); ! available_terminals = regexp (available_terminals, "\\b\\w+\\b", "match"); ! ## Favor the cairo terminals. ! if (strcmp (termn, "pdf") ! && any (strcmp (available_terminals, "pdfcairo"))) ! termn = "pdfcairo"; ! gnuplot_supports_term = true; ! elseif (strcmp (termn, "png") ! && any (strcmp (available_terminals, "pngcairo"))) ! termn = "pngcairo"; ! gnuplot_supports_term = true; ! else gnuplot_supports_term = any (strcmp (available_terminals, termn)); + endif elseif (strcmp (termn, "pdf")) ## Some Linux variants do not include a "pdf" capable gnuplot. ## To be safe, use Ghostscript. *************** *** 486,504 **** endif name = cstrcat (tmpnam, ".ps"); termn = "postscript"; - options = cstrcat (options, " portrait"); ## All "options" for pdf work for postscript as well. else ! error ("print: the gnuplot terminal, \"%s\", is not available.", termn) endif endif new_terminal = cstrcat (termn, " ", options); ! mono = use_color < 0; if (isempty (resolution)) ! if (any (strcmp (termn, {"emf", "svg"}))) resolution = get (0, "screenpixelsperinch"); else resolution = 150; --- 513,563 ---- endif name = cstrcat (tmpnam, ".ps"); termn = "postscript"; ## All "options" for pdf work for postscript as well. else ! error ("print: the device, \"%s\", is not available.", dev) endif endif + is_eps_file = strncmp (dev, "eps", 3); + p.units = get (gcf, "units"); + p.paperunits = get (gcf, "paperunits"); + p.papersize = get (gcf, "papersize"); + p.paperposition = get (gcf, "paperposition"); + p.paperpositionmode = get (gcf, "paperpositionmode"); + p.paperorientation = get (gcf, "paperorientation"); + if (p.papersize(1) > p.papersize(2)) + paperorientation = "landscape"; + else + paperorientation = "portrait"; + endif + if (! strcmp (paperorientation, get (gcf, "paperorientation")) + && warn_on_inconsistent_orientation) + msg = {"print.m - inconsistent papersize and paperorientation properties.\n", + sprintf(" papersize = %.2f, %.2f\n", p.papersize), + sprintf(" paperorientation = \"%s\"\n", p.paperorientation), + " the paperorientation property has been ignored"}; + warning ("%s",msg{:}) + warn_on_inconsistent_orientation = false; + endif + + if (strcmp (termn, "postscript") && ! strncmp (dev, "eps", 3)) + if (isempty (orientation)) + orientation = paperorientation; + endif + ## This is done here to accommodate ghostscript conversion. + options = cstrcat (orientation, " ", options); + end + new_terminal = cstrcat (termn, " ", options); ! mono = (use_color < 0); ! ! terminals_for_prn = {"postscript", "pdf", "pdfcairo"}; ! output_for_printer = any (strncmp (termn, terminals_for_prn, numel(termn))); if (isempty (resolution)) ! if (any (strcmp (dev, {"emf", "svg"})) || output_for_printer) resolution = get (0, "screenpixelsperinch"); else resolution = 150; *************** *** 516,536 **** set (gcf, "__pixels_per_inch__", resolution) unwind_protect ! paper_position_mode = get (gcf, "paperpositionmode"); ! terminals_for_prn = {"postscript", "pdf"}; ! restore_properties = false; ! is_eps_file = strncmp (dev, "eps", 3); ! output_for_printer = any (strncmp (termn, terminals_for_prn, numel(termn))); if ((! output_for_printer || is_eps_file) && ! doprint) ## If not PDF or PostScript, and the result is not being sent to a printer, ## render an image the size of the paperposition box. ! restore_properties = true; ! p.paperunits = get (gcf, "paperunits"); ! p.papertype = get (gcf, "papertype"); ! p.papersize = get (gcf, "papersize"); ! p.paperposition = get (gcf, "paperposition"); ! p.paperpositionmode = get (gcf, "paperpositionmode"); ! set (gcf, "paperunits", "inches"); if (! isempty (canvas_size)) size_in_pixels = sscanf (canvas_size ,"%d, %d"); size_in_pixels = reshape (size_in_pixels, [1, numel(size_in_pixels)]); --- 575,587 ---- set (gcf, "__pixels_per_inch__", resolution) unwind_protect ! set (gcf, "paperunits", "inches"); ! set (gcf, "units", "pixels"); ! restore_properties = true; if ((! output_for_printer || is_eps_file) && ! doprint) ## If not PDF or PostScript, and the result is not being sent to a printer, ## render an image the size of the paperposition box. ! ## Trigger the listener to convert all paper props to inches. if (! isempty (canvas_size)) size_in_pixels = sscanf (canvas_size ,"%d, %d"); size_in_pixels = reshape (size_in_pixels, [1, numel(size_in_pixels)]); *************** *** 541,550 **** paperposition_in_inches(1:2) = 0; papersize_in_inches = paperposition_in_inches(3:4); endif - set (gcf, "papertype", ""); set (gcf, "papersize", papersize_in_inches); set (gcf, "paperposition", paperposition_in_inches); set (gcf, "paperpositionmode", "manual"); endif if (debug) drawnow (new_terminal, name, mono, debug_file); --- 592,620 ---- paperposition_in_inches(1:2) = 0; papersize_in_inches = paperposition_in_inches(3:4); endif set (gcf, "papersize", papersize_in_inches); set (gcf, "paperposition", paperposition_in_inches); set (gcf, "paperpositionmode", "manual"); + else + if (strcmp (p.paperpositionmode, "auto")) + size_in_pixels = get (gcf, "position")(3:4); + paperposition_in_inches(3:4) = size_in_pixels ./ resolution; + paperposition_in_inches(1:2) = (p.papersize - paperposition_in_inches(3:4))/2; + else + paperposition_in_inches = p.paperposition; + endif + if (! isempty (orientation) && ! strcmp (orientation, paperorientation)) + ## When -landscape/portrait changes the orientation, flip both the + ## papersize and paperposition. + restore_properties = true; + set (gcf, "papersize", p.papersize([2, 1])); + set (gcf, "paperposition", paperposition_in_inches([2, 1, 4, 3])); + else + set (gcf, "paperposition", paperposition_in_inches); + endif + endif + if (use_color < 0) + [objs_with_color, color_of_objs] = convert_color2mono (gcf); endif if (debug) drawnow (new_terminal, name, mono, debug_file); *************** *** 559,564 **** --- 629,637 ---- set (gcf, props{n}, p.(props{n})) endfor endif + if (use_color < 0) + convert_mono_to_or_from_color (objs_with_color, color_of_objs, false); + endif end_unwind_protect if (! isempty (ghostscript_output)) *************** *** 581,592 **** [errcode, output] = system (command); unlink (name); if (errcode) ! error ("print: Conversion failed, %s -> %s.\nError was:\n%s\n", name, ghostscript_output, output); endif elseif (is_eps_file && tight_flag && ! doprint) ## If the saved output file is an eps file, use ghostscript to set a tight bbox. ## This may result in a smaller or larger bbox geometry. ! fix_eps_bbox (name, ghostscript_binary); endif if (doprint) --- 654,668 ---- [errcode, output] = system (command); unlink (name); if (errcode) ! error ("print: Conversion failed, %s -> %s.\nError was:\n%s\n", ! name, ghostscript_output, output); endif elseif (is_eps_file && tight_flag && ! doprint) ## If the saved output file is an eps file, use ghostscript to set a tight bbox. ## This may result in a smaller or larger bbox geometry. ! if (have_ghostscript) ! fix_eps_bbox (name, ghostscript_binary); ! endif endif if (doprint) *************** *** 630,636 **** box_string = "%%BoundingBox:"; ghostscript_options = "-q -dBATCH -dSAFER -dNOPAUSE -dTextAlphaBits=4 -sDEVICE=bbox"; ! cmd = sprintf ("\"%s\" %s \"%s\" 2>&1", ghostscript_binary, ghostscript_options, eps_file_name); [status, output] = system (cmd); if (status == 0) --- 706,713 ---- box_string = "%%BoundingBox:"; ghostscript_options = "-q -dBATCH -dSAFER -dNOPAUSE -dTextAlphaBits=4 -sDEVICE=bbox"; ! cmd = sprintf ("\"%s\" %s \"%s\" 2>&1", ghostscript_binary, ! ghostscript_options, eps_file_name); [status, output] = system (cmd); if (status == 0) *************** *** 677,684 **** end_unwind_protect elseif (warn_on_no_ghostscript) warn_on_no_ghostscript = false; ! warning ("print.m: Ghostscript could not be used to adjust bounding box.\nError was:\n%s\n", output) endif endfunction --- 754,803 ---- end_unwind_protect elseif (warn_on_no_ghostscript) warn_on_no_ghostscript = false; ! warning ("print.m: Ghostscript failed to determine the bounding box.\nError was:\n%s\n", output) endif endfunction + function [h, c] = convert_color2mono (hfig) + unwind_protect + showhiddenhandles = get (0, "showhiddenhandles"); + set (0, "showhiddenhandles", "on"); + h.color = findobj (hfig, "-property", "color"); + h.facecolor = findobj (hfig, "-property", "facecolor"); + h.edgecolor = findobj (hfig, "-property", "edgecolor"); + h.backgroundcolor = findobj (hfig, "-property", "backgroundcolor"); + h.colormap = findobj (hfig, "-property", "colormap"); + unwind_protect_cleanup + set (0, "showhiddenhandles", showhiddenhandles); + end_unwind_protect + f = fieldnames (h); + for nf = 1:numel(f) + if (! isempty (h.(f{nf}))) + v = get (h.(f{nf}), f{nf}); + if (! iscell (v)) + v = {v}; + endif + c.(f{nf}) = v; + endif + endfor + convert_mono_to_or_from_color (h, c, true) + endfunction + + function convert_mono_to_or_from_color (h, c, mono) + f = fieldnames (h); + for nf = 1:numel(f) + for nh = 1:numel (h.(f{nf})) + color = c.(f{nf}){nh}; + ## Ignore color == {"none", "flat", ...} + if (isfloat (color)) + if (mono) + ## Same method as used by rgb2gray in the image pkg. + color = rgb2ntsc (color)(:,1) * ones (1, 3); + endif + set (h.(f{nf})(nh), f{nf}, color); + endif + endfor + endfor + endfunction + diff -cNr octave-3.2.0/scripts/plot/quiver.m octave-3.2.2/scripts/plot/quiver.m *** octave-3.2.0/scripts/plot/quiver.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/quiver.m 2009-06-16 06:43:58.000000000 +0200 *************** *** 82,87 **** --- 82,88 ---- endfunction %!demo + %! clf %! [x,y] = meshgrid(1:2:20); %! h = quiver(x,y,sin(2*pi*x/10),sin(2*pi*y/10)); %! set (h, "maxheadsize", 0.33); diff -cNr octave-3.2.0/scripts/plot/refreshdata.m octave-3.2.2/scripts/plot/refreshdata.m *** octave-3.2.0/scripts/plot/refreshdata.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/refreshdata.m 2009-06-09 06:33:11.000000000 +0200 *************** *** 17,32 **** ## . ## -*- texinfo -*- ! ## @deftypefn {Function File} {} refreshdata () ## @deftypefnx {Function File} {} refreshdata (@var{h}) ! ## @deftypefnx {Function File} {} refreshdata (@var{h}, @var{ws}) ! ## Evaluates any datasource properties of the current figure and updates ! ## the corresponding data. If call with one or more arguments @var{h} is ! ## a scalar or array of figure handles which to refresh. The data ! ## sources are by default evaluated in the "base" workspace but can also ! ## be set in the "caller" workspace. ## ! ## An example of the use of refreshdata is ## ## @example ## @group --- 17,39 ---- ## . ## -*- texinfo -*- ! ## @deftypefn {Function File} {} refreshdata () ## @deftypefnx {Function File} {} refreshdata (@var{h}) ! ## @deftypefnx {Function File} {} refreshdata (@var{h}, @var{workspace}) ! ## Evaluate any @samp{datasource} properties of the current figure and update ! ## the plot if the corresponding data has changed. If called with one or more ! ## arguments @var{h} is a scalar or array of figure handles to refresh. The ! ## optional second argument @var{workspace} can take the following values. ## ! ## @table @code ! ## @item "base" ! ## Evaluate the datasource properties in the base workspace. (default). ! ## @item "caller" ! ## Evaluate the datasource properties in the workspace of the function ! ## that called @code{refreshdata}. ! ## @end table ! ## ! ## An example of the use of @code{refreshdata} is: ## ## @example ## @group *************** *** 40,47 **** ## endfor ## @end group ## @end example - ## - ## @seealso{linkdata} ## @end deftypefn function refreshdata (h, ws) --- 47,52 ---- diff -cNr octave-3.2.0/scripts/plot/scatter3.m octave-3.2.2/scripts/plot/scatter3.m *** octave-3.2.0/scripts/plot/scatter3.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/scatter3.m 2009-06-08 07:34:25.000000000 +0200 *************** *** 83,85 **** --- 83,106 ---- %!demo %! [x, y, z] = peaks (20); %! scatter3 (x(:), y(:), z(:), [], z(:)); + + %!demo + %! x = rand (20,1); + %! y = rand (20,1); + %! z = rand (20,1); + %! scatter3 (x(:), y(:), z(:), 10, z(:), "s"); + + %!demo + %! x = rand (20,1); + %! y = rand (20,1); + %! z = rand (20,1); + %! scatter3 (x(:), y(:), z(:), 20*z(:), z(:), "s"); + + %!demo + %! x = rand (20,1); + %! y = rand (20,1); + %! z = rand (20,1); + %! scatter3 (x(:), y(:), z(:), 20*z(:), [], "s"); + + + diff -cNr octave-3.2.0/scripts/plot/__scatter__.m octave-3.2.2/scripts/plot/__scatter__.m *** octave-3.2.0/scripts/plot/__scatter__.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/plot/__scatter__.m 2009-06-08 07:34:25.000000000 +0200 *************** *** 74,79 **** --- 74,82 ---- else c = c(:); endif + elseif (isempty (c)) + cc = __next_line_color__(); + c = repmat (cc, numel(x), 1); endif elseif (firstnonnumeric == istart + 1 && ischar (varargin{istart + 1})) c = varargin{istart + 1}; diff -cNr octave-3.2.0/scripts/polynomial/mpoles.m octave-3.2.2/scripts/polynomial/mpoles.m *** octave-3.2.0/scripts/polynomial/mpoles.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/polynomial/mpoles.m 2009-06-22 07:56:24.000000000 +0200 *************** *** 92,99 **** while (n) dp = abs (p-p(n)); if (p(n) == 0.0) ! p0 = mean (abs (p(find (abs (p) > 0)))); ! if (isempty (p0)) p0 = 1; endif else --- 92,100 ---- while (n) dp = abs (p-p(n)); if (p(n) == 0.0) ! if (any (abs (p) > 0 & isfinite (p))) ! p0 = mean (abs (p(abs (p) > 0 & isfinite (p)))); ! else p0 = 1; endif else *************** *** 113,115 **** --- 114,121 ---- indx = ordr(indx); endfunction + + %!test + %! [mp, n] = mpoles ([0 0], 0.01); + %! assert (mp, [1; 2]) + diff -cNr octave-3.2.0/scripts/statistics/base/var.m octave-3.2.2/scripts/statistics/base/var.m *** octave-3.2.0/scripts/statistics/base/var.m 2009-05-25 08:04:59.000000000 +0200 --- octave-3.2.2/scripts/statistics/base/var.m 2009-06-23 12:57:58.000000000 +0200 *************** *** 56,68 **** opt = 0; endif ! n = size (x, dim); ! if (n == 1) retval = zeros (sz); - elseif (numel (x) > 0) - retval = sumsq (center (x, dim), dim) / (n + opt - 1); else ! error ("var: x must not be empty"); endif endfunction --- 56,94 ---- opt = 0; endif ! sz = size (x); ! n = sz(dim); ! if (isempty (x)) ! ## FIXME -- is there a way to obtain these results without all the ! ## special cases? ! if (ndims (x) == 2 && sz(1) == 0 && sz(2) == 0) ! retval = NaN; ! else ! sz(dim) = 1; ! if (n == 0) ! if (prod (sz) == 0) ! retval = zeros (sz); ! else ! retval = NaN (sz); ! endif ! else ! retval = zeros (sz); ! endif ! endif ! elseif (n == 1) retval = zeros (sz); else ! retval = sumsq (center (x, dim), dim) / (n + opt - 1); endif endfunction + + %!assert (var (13), 0) + %!assert (var ([]), NaN) + %!assert (var (ones (0, 0, 0), 0, 1), zeros (1, 0, 0)) + %!assert (var (ones (0, 0, 0), 0, 2), zeros (0, 1, 0)) + %!assert (var (ones (0, 0, 0), 0, 3), zeros (0, 0)) + %!assert (var (ones (1, 2, 0)), zeros (1, 1, 0)) + %!assert (var (ones (1, 2, 0, 0), 0, 1), zeros (1, 2, 0, 0)) + %!assert (var (ones (1, 2, 0, 0), 0, 2), zeros (1, 1, 0, 0)) + %!assert (var (ones (1, 2, 0, 0), 0, 3), zeros (1, 2, 1, 0)) diff -cNr octave-3.2.0/scripts/testfun/assert.m octave-3.2.2/scripts/testfun/assert.m *** octave-3.2.0/scripts/testfun/assert.m 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/scripts/testfun/assert.m 2009-06-08 07:34:33.000000000 +0200 *************** *** 19,25 **** ## -*- texinfo -*- ## @deftypefn {Function File} {} assert (@var{cond}) ## @deftypefnx {Function File} {} assert (@var{cond}, @var{errmsg}, @dots{}) ! ## @deftypefnx {Function File} {} assert (@var{cond}, @{var{msg_id}, @var{errmsg}, @dots{}) ## @deftypefnx {Function File} {} assert (@var{observed},@var{expected}) ## @deftypefnx {Function File} {} assert (@var{observed},@var{expected},@var{tol}) ## --- 19,25 ---- ## -*- texinfo -*- ## @deftypefn {Function File} {} assert (@var{cond}) ## @deftypefnx {Function File} {} assert (@var{cond}, @var{errmsg}, @dots{}) ! ## @deftypefnx {Function File} {} assert (@var{cond}, @var{msg_id}, @var{errmsg}, @dots{}) ## @deftypefnx {Function File} {} assert (@var{observed},@var{expected}) ## @deftypefnx {Function File} {} assert (@var{observed},@var{expected},@var{tol}) ## diff -cNr octave-3.2.0/src/Cell.cc octave-3.2.2/src/Cell.cc *** octave-3.2.0/src/Cell.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/Cell.cc 2009-07-02 11:32:28.000000000 +0200 *************** *** 139,145 **** idx_vector i = idx_arg(0).index_vector (); if (! error_state) ! retval = ArrayN::index (i, resize_ok); } break; --- 139,145 ---- idx_vector i = idx_arg(0).index_vector (); if (! error_state) ! retval = ArrayN::index (i, resize_ok, resize_fill_value ()); } break; *************** *** 152,158 **** idx_vector j = idx_arg(1).index_vector (); if (! error_state) ! retval = ArrayN::index (i, j, resize_ok); } } break; --- 152,159 ---- idx_vector j = idx_arg(1).index_vector (); if (! error_state) ! retval = ArrayN::index (i, j, resize_ok, ! resize_fill_value ()); } } break; *************** *** 170,176 **** } if (!error_state) ! retval = ArrayN::index (iv, resize_ok); } break; } --- 171,178 ---- } if (!error_state) ! retval = ArrayN::index (iv, resize_ok, ! resize_fill_value ()); } break; } diff -cNr octave-3.2.0/src/ChangeLog octave-3.2.2/src/ChangeLog *** octave-3.2.0/src/ChangeLog 2009-06-03 14:32:51.000000000 +0200 --- octave-3.2.2/src/ChangeLog 2009-07-21 06:52:30.000000000 +0200 *************** *** 1,3 **** --- 1,183 ---- + 2009-07-21 Jaroslav Hajek + + Version 3.2.2 released. + + 2009-07-03 Jaroslav Hajek + + * pt-eval.cc (do_unwind_protect_cleanup_code): Add missing + unwind_protect::run. + + 2009-07-02 Jaroslav Hajek + + * help.cc (do_which): Also look for files. + + 2009-07-02 Jaroslav Hajek + + * Cell.cc (Cell::index): Use proper resize_fill_value. + + 2008-07-01 David Bateman + + * pr-output.cc (static inline std::string rational_approx (double, + int)): Test for underflow of fractional part of rational approximation + earlier in the loop. + + 2009-07-01 Joe Rothweiler + + * input.cc (raw_mode): Use TCSADRAIN if no wait. + + 2009-06-30 Jaroslav Hajek + + * symtab.h (force_variable): Remove assertion. + + 2009-06-26 John W. Eaton + + * load-path.cc (Faddpath): Preserve order of prepended elements. + + 2009-06-24 Thorsten Meyer + + * oct-map.cc (Octave_map::squeeze, Octave_map::permute, + Octave_map::transpose, Octave_map::reshape, Octave_map::concat, + Octave_map::index): Add tests for preservation of key order in + struct arrays. + + 2009-06-24 Jaroslav Hajek + + * pt-mat.cc (get_concat_class): Use empty string as zero value. + (tm_row_const_rep::tm_row_const_rep): Initialize class_nm to empty + string. + (tm_const::tm_const): Ditto. + + 2009-06-24 John W. Eaton + + * pt-assign.cc (former_built_in_variables): Remove "ans" from the list. + + 2009-06-24 Jaroslav Hajek + + * pt-eval.cc (do_unwind_protect_cleanup_code): + Workaround sig_atomic_t != int. + + 2009-06-23 Jaroslav Hajek + + * quit.h (octave_quit_exception): Delete. + (exit_status, quitting_gracefully): New globals. + * quit.cc: Initialize them. + (Fquit): Set the globals, simulate interrupt. + (main_loop): Handle exit properly. + * octave.cc (execute_eval_option_code): Ditto. + (execute_command_line_file): Ditto. + * pt-eval.cc (do_unwind_protect_cleanup_code): + Fix order of unwind_protect calls. + + 2009-06-23 John W. Eaton + + * oct-map.cc (Octave_map::squeeze, Octave_map::permute, + Octave_map::transpose, Octave_map::reshape, Octave_map::concat): + Preserve key order. + + 2009-06-22 Jaroslav Hajek + + * ov-cell.cc (octave_cell::all_strings): Avoid duplicate conversions. + + 2009-06-20 Jaroslav Hajek + + * ov.cc (Fsubsasgn): Uniquify shared value before assigning to it. + + 2009-06-17 John W. Eaton + + * mex.cc (mxArray_octave_value::get_data): + If octave_value::mex_get_data returns a valid pointer, mark it as + foreign and return it instead of enumerating the types that can be + handled directly. + + * ov-re-mat.h (octave_matrix::mex_get_data): New function. + * ov-bool-mat.h (octave_bool_matrix::mex_get_data): Ditto. + * ov-flt-re-mat.h (octave_float_matrix::mex_get_data): Ditto. + * ov-intx.h (OCTAVE_VALUE_INT_MATRIX_T::mex_get_data): Ditto. + * ov-base-mat.h (octave_base_matrix::mex_get_data): Delete. + + 2009-06-16 Jaroslav Hajek + + * symtab.h (symbol_table::set_scope_and_context): Avoid checking + error_state for setting context. + + 2009-06-12 Kai NODA + + * ls-mat4.h: Fix include guard + * ov-type-conv.h: Add missing include guard. + + 2009-06-12 Jaroslav Hajek + + * ov-cell.cc (octave_cell::sort (Array&)): Simplify. + + 2009-06-10 John W. Eaton + + * pt-fcn-handle.cc (tree_anon_fcn_handle::dup): Don't convert to + tree_constant object here. Do inherit from current symbol table + scope and context. New test. + + * lex.l (handle_identifier): Set lexer_flags.looking_for_object_index + false if identifier is a keyword. + ({IDENT}{S}*): Don't set lexer_flags.looking_for_object_index here. + + 2009-06-09 Jaroslav Hajek + + * octave.cc (octave_main): Call initialize_command_input + conditionally. Move line_editing update in front of it. + Call command_editor::force_default_editor if not line_editing. + + 2009-06-09 Jaroslav Hajek + + * data.cc (Flog2): Fix tests. + + 2009-06-08 John W. Eaton + + * variables.cc (symbol_exist): Returnn 1 for function handles and + inline function objects. + + 2009-06-08 Jaroslav Hajek + + * symtab.h (symbol_table::do_clear_global, + symbol_table::do_clear_global_pattern): Properly erase from both local + and global table. + + 2009-06-08 Jaroslav Hajek + + * variables.cc (Fclear): Clear also globals when called without + arguments. + + 2009-06-07 Jaroslav Hajek + + * graphics.cc (color_property::do_set): Allow a wider range of types. + + 2009-06-07 Jaroslav Hajek + + * DLD-FUNCTIONS/find.cc (Ffind): Fix docs. Improve second argument + handling. Add regression tests. + + 2009-06-06 Rik + + * data.cc: Update documentation for 'complex' function + + 2009-06-06 Rik + + * load-save.cc: Update documentation for NA and isna functions + + 2009-06-06 Rik + + * load-save.cc: Update documentation for load and save + + 2009-06-06 Rik + + * pr-output.cc: Update documentation for 'format' + + 2009-06-05 Rik + + * variables.cc: Update documentation for 'who' family of functions + + 2009-06-03 Rik + + * input.cc: Correct documentation for keyboard function + 2009-05-25 Jaroslav Hajek Version 3.2.0 released. diff -cNr octave-3.2.0/src/data.cc octave-3.2.2/src/data.cc *** octave-3.2.0/src/data.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/data.cc 2009-06-09 07:18:29.000000000 +0200 *************** *** 1082,1093 **** %!test %! [f, e] = log2 ([0,-1; 2,-4; Inf,-Inf]); %! assert (f, [0,-0.5; 0.5,-0.5; Inf,-Inf]); ! %! assert (e, [0,1;2,3;0,0]) %!test %! [f, e] = log2 (complex (zeros (3, 2), [0,-1; 2,-4; Inf,-Inf])); %! assert (f, complex (zeros (3, 2), [0,-0.5; 0.5,-0.5; Inf,-Inf])); ! %! assert (e, [0,1; 2,3; 0,0]); */ DEFUN (fmod, args, , --- 1082,1093 ---- %!test %! [f, e] = log2 ([0,-1; 2,-4; Inf,-Inf]); %! assert (f, [0,-0.5; 0.5,-0.5; Inf,-Inf]); ! %! assert (e(1:2,:), [0,1;2,3]) %!test %! [f, e] = log2 (complex (zeros (3, 2), [0,-1; 2,-4; Inf,-Inf])); %! assert (f, complex (zeros (3, 2), [0,-0.5; 0.5,-0.5; Inf,-Inf])); ! %! assert (e(1:2,:), [0,1; 2,3]); */ DEFUN (fmod, args, , *************** *** 2783,2791 **** DEFUN (complex, args, , "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {} complex (@var{val})\n\ @deftypefnx {Built-in Function} {} complex (@var{re}, @var{im})\n\ ! Convert @var{x} to a complex value.\n\ @end deftypefn") { octave_value retval; --- 2783,2802 ---- DEFUN (complex, args, , "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {} complex (@var{x})\n\ @deftypefnx {Built-in Function} {} complex (@var{re}, @var{im})\n\ ! Return a complex result from real arguments. With 1 real argument @var{x},\n\ ! return the complex result @code{@var{x} + 0i}. With 2 real arguments,\n\ ! return the complex result @code{@var{re} + @var{im}}. @code{complex} can\n\ ! often be more convenient than expressions such as @code{a + i*b}.\n\ ! For example:\n\ ! \n\ ! @example\n\ ! complex ([1, 2], [3, 4])\n\ ! @result{}\n\ ! 1 + 3i 2 + 4i\n\ ! @end example\n\ ! @seealso{real, imag, iscomplex}\n\ @end deftypefn") { octave_value retval; *************** *** 3707,3712 **** --- 3718,3724 ---- arguments specify additional matrix dimensions.\n\ The optional argument @var{class} specifies the return type and may be\n\ either \"double\" or \"single\".\n\ + @seealso{isinf}\n\ @end deftypefn") { return fill_matrix (args, lo_ieee_inf_value (), *************** *** 4085,4096 **** DEFUN (NA, args, , "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {} NA (@var{x})\n\ @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m})\n\ @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m}, @var{k}, @dots{})\n\ @deftypefnx {Built-in Function} {} NA (@dots{}, @var{class})\n\ ! Return a matrix or N-dimensional array whose elements are all equal\n\ to the special constant used to designate missing values.\n\ @end deftypefn") { return fill_matrix (args, lo_ieee_na_value (), --- 4097,4121 ---- DEFUN (NA, args, , "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {} NA\n\ ! @deftypefnx {Built-in Function} {} NA (@var{n})\n\ @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m})\n\ @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m}, @var{k}, @dots{})\n\ @deftypefnx {Built-in Function} {} NA (@dots{}, @var{class})\n\ ! Return a scalar, matrix, or N-dimensional array whose elements are all equal\n\ to the special constant used to designate missing values.\n\ + \n\ + Note that NA always compares not equal to NA (NA != NA).\n\ + To find NA values, use the @code{isna} function.\n\ + \n\ + When called with no arguments, return a scalar with the value @samp{NA}.\n\ + When called with a single argument, return a square matrix with the dimension\n\ + specified. When called with more than one scalar argument the first two\n\ + arguments are taken as the number of rows and columns and any further\n\ + arguments specify additional matrix dimensions.\n\ + The optional argument @var{class} specifies the return type and may be\n\ + either \"double\" or \"single\".\n\ + @seealso{isna}\n\ @end deftypefn") { return fill_matrix (args, lo_ieee_na_value (), diff -cNr octave-3.2.0/src/DLD-FUNCTIONS/cellfun.cc octave-3.2.2/src/DLD-FUNCTIONS/cellfun.cc *** octave-3.2.0/src/DLD-FUNCTIONS/cellfun.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/DLD-FUNCTIONS/cellfun.cc 2009-06-08 07:34:32.000000000 +0200 *************** *** 900,908 **** DEFUN_DLD (num2cell, args, , "-*- texinfo -*-\n\ ! @deftypefn {Loadable Function} {@var{c} =} num2cell (@var{m})\n\ @deftypefnx {Loadable Function} {@var{c} =} num2cell (@var{m}, @var{dim})\n\ ! Convert the matrix @var{m} into a cell array. If @var{dim} is defined, the\n\ value @var{c} is of dimension 1 in this dimension and the elements of\n\ @var{m} are placed in slices in @var{c}.\n\ @seealso{mat2cell}\n\ --- 900,908 ---- DEFUN_DLD (num2cell, args, , "-*- texinfo -*-\n\ ! @deftypefn {Loadable Function} {@var{c} =} num2cell (@var{m})\n\ @deftypefnx {Loadable Function} {@var{c} =} num2cell (@var{m}, @var{dim})\n\ ! Convert the matrix @var{m} to a cell array. If @var{dim} is defined, the\n\ value @var{c} is of dimension 1 in this dimension and the elements of\n\ @var{m} are placed in slices in @var{c}.\n\ @seealso{mat2cell}\n\ diff -cNr octave-3.2.0/src/DLD-FUNCTIONS/eig.cc octave-3.2.2/src/DLD-FUNCTIONS/eig.cc *** octave-3.2.0/src/DLD-FUNCTIONS/eig.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/DLD-FUNCTIONS/eig.cc 2009-06-08 07:34:32.000000000 +0200 *************** *** 36,42 **** DEFUN_DLD (eig, args, nargout, "-*- texinfo -*-\n\ ! @deftypefn {Loadable Function} {@var{lambda} =} eig (@var{a})\n\ @deftypefnx {Loadable Function} {@var{lambda} =} eig (@var{a}, @var{b})\n\ @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a})\n\ @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a}, @var{b})\n\ --- 36,42 ---- DEFUN_DLD (eig, args, nargout, "-*- texinfo -*-\n\ ! @deftypefn {Loadable Function} {@var{lambda} =} eig (@var{a})\n\ @deftypefnx {Loadable Function} {@var{lambda} =} eig (@var{a}, @var{b})\n\ @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a})\n\ @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a}, @var{b})\n\ *************** *** 47,52 **** --- 47,53 ---- Schur decomposition.\n\ \n\ The eigenvalues returned by @code{eig} are not ordered.\n\ + @seealso{eigs}\n\ @end deftypefn") { octave_value_list retval; diff -cNr octave-3.2.0/src/DLD-FUNCTIONS/find.cc octave-3.2.2/src/DLD-FUNCTIONS/find.cc *** octave-3.2.0/src/DLD-FUNCTIONS/find.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/DLD-FUNCTIONS/find.cc 2009-06-08 07:34:33.000000000 +0200 *************** *** 399,410 **** @end group\n\ @end example\n\ \n\ ! If two inputs are given, @var{n} indicates the number of elements to\n\ ! find from the beginning of the matrix or vector.\n\ \n\ If three inputs are given, @var{direction} should be one of \"first\" or\n\ ! \"last\" indicating that it should start counting found elements from the\n\ ! first or last element.\n\ \n\ Note that this function is particularly useful for sparse matrices, as\n\ it extracts the non-zero elements as vectors, which can then be used to\n\ --- 399,410 ---- @end group\n\ @end example\n\ \n\ ! If two inputs are given, @var{n} indicates the maximum number of\n\ ! elements to find from the beginning of the matrix or vector.\n\ \n\ If three inputs are given, @var{direction} should be one of \"first\" or\n\ ! \"last\", requesting only the first or last @var{n} indices, respectively.\n\ ! However, the indices are always returned in ascending order.\n\ \n\ Note that this function is particularly useful for sparse matrices, as\n\ it extracts the non-zero elements as vectors, which can then be used to\n\ *************** *** 434,445 **** octave_idx_type n_to_find = -1; if (nargin > 1) { ! n_to_find = args(1).int_value (); ! if (error_state) { ! error ("find: expecting second argument to be an integer"); return retval; } } // Direction to do the searching (1 == forward, -1 == reverse). --- 434,448 ---- octave_idx_type n_to_find = -1; if (nargin > 1) { ! double val = args(1).scalar_value (); ! ! if (error_state || (! xisinf (val) && (val < 0 || val != xround (val)))) { ! error ("find: expecting second argument to be a nonnegative integer"); return retval; } + else + n_to_find = val; } // Direction to do the searching (1 == forward, -1 == reverse). *************** *** 636,641 **** --- 639,650 ---- %! assert (j, jfull); %! assert (all (v == 1)); + %!assert (find ([2 0 1 0 5 0], 1), 1) + %!assert (find ([2 0 1 0 5 0], 2, "last"), [3, 5]) + + %!assert (find ([2 0 1 0 5 0], Inf), [1, 3, 5]) + %!assert (find ([2 0 1 0 5 0], Inf, "last"), [1, 3, 5]) + %!error find (); */ diff -cNr octave-3.2.0/src/DOCSTRINGS octave-3.2.2/src/DOCSTRINGS *** octave-3.2.0/src/DOCSTRINGS 2009-06-03 14:36:08.000000000 +0200 --- octave-3.2.2/src/DOCSTRINGS 2009-07-21 07:10:51.000000000 +0200 *************** *** 691,699 **** num2cell @c ./DLD-FUNCTIONS/cellfun.cc -*- texinfo -*- ! @deftypefn {Loadable Function} {@var{c} =} num2cell (@var{m}) @deftypefnx {Loadable Function} {@var{c} =} num2cell (@var{m}, @var{dim}) ! Convert the matrix @var{m} into a cell array. If @var{dim} is defined, the value @var{c} is of dimension 1 in this dimension and the elements of @var{m} are placed in slices in @var{c}. @seealso{mat2cell} --- 691,699 ---- num2cell @c ./DLD-FUNCTIONS/cellfun.cc -*- texinfo -*- ! @deftypefn {Loadable Function} {@var{c} =} num2cell (@var{m}) @deftypefnx {Loadable Function} {@var{c} =} num2cell (@var{m}, @var{dim}) ! Convert the matrix @var{m} to a cell array. If @var{dim} is defined, the value @var{c} is of dimension 1 in this dimension and the elements of @var{m} are placed in slices in @var{c}. @seealso{mat2cell} *************** *** 2120,2128 **** complex @c data.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {} complex (@var{val}) @deftypefnx {Built-in Function} {} complex (@var{re}, @var{im}) ! Convert @var{x} to a complex value. @end deftypefn isreal @c data.cc --- 2120,2139 ---- complex @c data.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {} complex (@var{x}) @deftypefnx {Built-in Function} {} complex (@var{re}, @var{im}) ! Return a complex result from real arguments. With 1 real argument @var{x}, ! return the complex result @code{@var{x} + 0i}. With 2 real arguments, ! return the complex result @code{@var{re} + @var{im}}. @code{complex} can ! often be more convenient than expressions such as @code{a + i*b}. ! For example: ! ! @example ! complex ([1, 2], [3, 4]) ! @result{} ! 1 + 3i 2 + 4i ! @end example ! @seealso{real, imag, iscomplex} @end deftypefn isreal @c data.cc *************** *** 2225,2230 **** --- 2236,2242 ---- arguments specify additional matrix dimensions. The optional argument @var{class} specifies the return type and may be either "double" or "single". + @seealso{isinf} @end deftypefn NaN @c data.cc *************** *** 2437,2448 **** NA @c data.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {} NA (@var{x}) @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m}) @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m}, @var{k}, @dots{}) @deftypefnx {Built-in Function} {} NA (@dots{}, @var{class}) ! Return a matrix or N-dimensional array whose elements are all equal to the special constant used to designate missing values. @end deftypefn false @c data.cc --- 2449,2473 ---- NA @c data.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {} NA ! @deftypefnx {Built-in Function} {} NA (@var{n}) @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m}) @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m}, @var{k}, @dots{}) @deftypefnx {Built-in Function} {} NA (@dots{}, @var{class}) ! Return a scalar, matrix, or N-dimensional array whose elements are all equal to the special constant used to designate missing values. + + Note that NA always compares not equal to NA (NA != NA). + To find NA values, use the @code{isna} function. + + When called with no arguments, return a scalar with the value @samp{NA}. + When called with a single argument, return a square matrix with the dimension + specified. When called with more than one scalar argument the first two + arguments are taken as the number of rows and columns and any further + arguments specify additional matrix dimensions. + The optional argument @var{class} specifies the return type and may be + either "double" or "single". + @seealso{isna} @end deftypefn false @c data.cc *************** *** 3388,3394 **** eig @c ./DLD-FUNCTIONS/eig.cc -*- texinfo -*- ! @deftypefn {Loadable Function} {@var{lambda} =} eig (@var{a}) @deftypefnx {Loadable Function} {@var{lambda} =} eig (@var{a}, @var{b}) @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a}) @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a}, @var{b}) --- 3413,3419 ---- eig @c ./DLD-FUNCTIONS/eig.cc -*- texinfo -*- ! @deftypefn {Loadable Function} {@var{lambda} =} eig (@var{a}) @deftypefnx {Loadable Function} {@var{lambda} =} eig (@var{a}, @var{b}) @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a}) @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a}, @var{b}) *************** *** 3399,3404 **** --- 3424,3430 ---- Schur decomposition. The eigenvalues returned by @code{eig} are not ordered. + @seealso{eigs} @end deftypefn eigs @c ./DLD-FUNCTIONS/eigs.cc *************** *** 4811,4822 **** @end group @end example ! If two inputs are given, @var{n} indicates the number of elements to ! find from the beginning of the matrix or vector. If three inputs are given, @var{direction} should be one of "first" or ! "last" indicating that it should start counting found elements from the ! first or last element. Note that this function is particularly useful for sparse matrices, as it extracts the non-zero elements as vectors, which can then be used to --- 4837,4848 ---- @end group @end example ! If two inputs are given, @var{n} indicates the maximum number of ! elements to find from the beginning of the matrix or vector. If three inputs are given, @var{direction} should be one of "first" or ! "last", requesting only the first or last @var{n} indices, respectively. ! However, the indices are always returned in ascending order. Note that this function is particularly useful for sparse matrices, as it extracts the non-zero elements as vectors, which can then be used to *************** *** 5201,5214 **** @c graphics.cc -*- texinfo -*- @deftypefn {Built-in Function} {} available_backends () ! Returns resgistered graphics backends. @end deftypefn drawnow @c graphics.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {} __go_drawnow__ () ! @deftypefnx {Built-in Function} {} __go_drawnow__ (@var{term}, @var{file}, @var{mono}, @var{debug_file}) ! Undocumented internal function. @end deftypefn addlistener @c graphics.cc --- 5227,5246 ---- @c graphics.cc -*- texinfo -*- @deftypefn {Built-in Function} {} available_backends () ! Return a cell array of registered graphics backends. @end deftypefn drawnow @c graphics.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {} drawnow () ! @deftypefnx {Built-in Function} {} drawnow ("expose") ! @deftypefnx {Built-in Function} {} drawnow (@var{term}, @var{file}, @var{mono}, @var{debug_file}) ! Update figure windows and their children. The event queue is flushed and ! any callbacks generated are executed. With the optional argument ! @code{"expose"}, only graphic objects are updated and no other events or ! callbacks are processed. ! The third calling form of @code{drawnow} is for debugging and is ! undocumented. @end deftypefn addlistener @c graphics.cc *************** *** 5558,5574 **** keyboard @c input.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {} keyboard (@var{prompt}) This function is normally used for simple debugging. When the @code{keyboard} function is executed, Octave prints a prompt and waits for user input. The input strings are then evaluated and the results are printed. This makes it possible to examine the values of variables ! within a function, and to assign new values to variables. No value is ! returned from the @code{keyboard} function, and it continues to prompt ! for input until the user types @samp{quit}, or @samp{exit}. ! If @code{keyboard} is invoked without any arguments, a default prompt of @samp{debug> } is used. @end deftypefn echo @c input.cc --- 5590,5608 ---- keyboard @c input.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {} keyboard () ! @deftypefnx {Built-in Function} {} keyboard (@var{prompt}) This function is normally used for simple debugging. When the @code{keyboard} function is executed, Octave prints a prompt and waits for user input. The input strings are then evaluated and the results are printed. This makes it possible to examine the values of variables ! within a function, and to assign new values if necessary. To leave the ! prompt and return to normal execution type @samp{return} or @samp{dbcont}. ! The @code{keyboard} function does not return an exit status. ! If @code{keyboard} is invoked without arguments, a default prompt of @samp{debug> } is used. + @seealso{dbcont, dbquit} @end deftypefn echo @c input.cc *************** *** 5912,5927 **** load @c load-save.cc -*- texinfo -*- ! @deffn {Command} load options file v1 v2 @dots{} Load the named variables @var{v1}, @var{v2}, @dots{}, from the file ! @var{file}. As with @code{save}, you may specify a list of variables ! and @code{load} will only extract those variables with names that ! match. For example, to restore the variables saved in the file ! @file{data}, use the command ! ! @example ! load data ! @end example If load is invoked using the functional form --- 5946,5961 ---- load @c load-save.cc -*- texinfo -*- ! @deffn {Command} load file ! @deffnx {Command} load options file ! @deffnx {Command} load options file v1 v2 @dots{} ! @deffnx {Command} S = load("options", "file", "v1", "v2", @dots{}) Load the named variables @var{v1}, @var{v2}, @dots{}, from the file ! @var{file}. If no variables are specified then all variables found in the ! file will be loaded. As with @code{save}, the list of variables to extract ! can be full names or use a pattern syntax. The format of the file is ! automatically detected but may be overridden by supplying the appropriate ! option. If load is invoked using the functional form *************** *** 5937,5945 **** global symbol with the same name already exists, it is loaded in the global symbol table. Also, if a variable is marked as global in a file and a local symbol exists, the local symbol is moved to the global ! symbol table and given the value from the file. Since it seems that ! both of these cases are likely to be the result of some sort of error, ! they will generate warnings. If invoked with a single output argument, Octave returns data instead of inserting variables in the symbol table. If the data file contains --- 5971,5977 ---- global symbol with the same name already exists, it is loaded in the global symbol table. Also, if a variable is marked as global in a file and a local symbol exists, the local symbol is moved to the global ! symbol table and given the value from the file. If invoked with a single output argument, Octave returns data instead of inserting variables in the symbol table. If the data file contains *************** *** 5949,5966 **** The @code{load} command can read data stored in Octave's text and binary formats, and @sc{matlab}'s binary format. If compiled with zlib ! support, it can load gzip-compressed files as well. It will automatically detect the type of file and do conversion from different floating point formats (currently only IEEE big and little endian, though other formats ! may added in the future). Valid options for @code{load} are listed in the following table. @table @code @item -force ! The @samp{-force} option is accepted but ignored for backward ! compatibility. Octave now overwrites variables currently in memory with ! the same name as those found in the file. @item -ascii Force Octave to assume the file contains columns of numbers in text format --- 5981,5998 ---- The @code{load} command can read data stored in Octave's text and binary formats, and @sc{matlab}'s binary format. If compiled with zlib ! support, it can also load gzip-compressed files. It will automatically detect the type of file and do conversion from different floating point formats (currently only IEEE big and little endian, though other formats ! may be added in the future). Valid options for @code{load} are listed in the following table. @table @code @item -force ! This option is accepted for backward compatibility but is ignored. ! Octave now overwrites variables currently in memory with ! those of the same name found in the file. @item -ascii Force Octave to assume the file contains columns of numbers in text format *************** *** 5971,5976 **** --- 6003,6020 ---- @item -binary Force Octave to assume the file is in Octave's binary format. + @item -hdf5 + Force Octave to assume the file is in HDF5 format. + (HDF5 is a free, portable binary format developed by the National + Center for Supercomputing Applications at the University of Illinois.) + Note that Octave can read HDF5 files not created by itself, but may + skip some datasets in formats that it cannot support. + + @item -import + This option is accepted for backward compatibility but is ignored. + Octave can now support multi-dimensional HDF data and automatically + modifies variable names if they are invalid Octave identifiers. + @item -mat @itemx -mat-binary @itemx -6 *************** *** 5980,6019 **** Force Octave to assume the file is in @sc{matlab}'s version 6 or 7 binary format. ! @item -V4 ! @itemx -v4 @itemx -4 ! @itemx -mat4-binary Force Octave to assume the file is in the binary format written by @sc{matlab} version 4. - @item -hdf5 - Force Octave to assume the file is in HDF5 format. - (HDF5 is a free, portable binary format developed by the National - Center for Supercomputing Applications at the University of Illinois.) - Note that Octave can read HDF5 files not created by itself, but may - skip some datasets in formats that it cannot support. - - @item -import - The @samp{-import} is accepted but ignored for backward compatibility. - Octave can now support multi-dimensional HDF data and automatically - modifies variable names if they are invalid Octave identifiers. - @item -text Force Octave to assume the file is in Octave's text format. @end table @end deffn save @c load-save.cc -*- texinfo -*- ! @deffn {Command} save options file @var{v1} @var{v2} @dots{} ! @deffnx {Command} save options file -struct @var{STR} @var{f1} @var{f2} @dots{} Save the named variables @var{v1}, @var{v2}, @dots{}, in the file ! @var{file}. The special filename @samp{-} may be used to write the ! output to your terminal. If no variable names are listed, Octave saves ! all the variables in the current scope. If the @code{-struct} modifier is used, fields @var{f1} @var{f2} @dots{} ! of the scalar structure @var{STR} are saved as if they were variables with corresponding names. Valid options for the @code{save} command are listed in the following table. Options that modify the output format override the format specified by --- 6024,6055 ---- Force Octave to assume the file is in @sc{matlab}'s version 6 or 7 binary format. ! @item -mat4-binary @itemx -4 ! @itemx -v4 ! @itemx -V4 Force Octave to assume the file is in the binary format written by @sc{matlab} version 4. @item -text Force Octave to assume the file is in Octave's text format. @end table + @seealso{save, dlmwrite, csvwrite, fwrite} @end deffn save @c load-save.cc -*- texinfo -*- ! @deffn {Command} save file ! @deffnx {Command} save options file ! @deffnx {Command} save options file @var{v1} @var{v2} @dots{} ! @deffnx {Command} save options file -struct @var{STRUCT} @var{f1} @var{f2} @dots{} Save the named variables @var{v1}, @var{v2}, @dots{}, in the file ! @var{file}. The special filename @samp{-} may be used to write ! output to the terminal. If no variable names are listed, Octave saves ! all the variables in the current scope. Otherwise, full variable names or ! pattern syntax can be used to specify the variables to save. If the @code{-struct} modifier is used, fields @var{f1} @var{f2} @dots{} ! of the scalar structure @var{STRUCT} are saved as if they were variables with corresponding names. Valid options for the @code{save} command are listed in the following table. Options that modify the output format override the format specified by *************** *** 6031,6044 **** @table @code @item -ascii ! Save a single matrix in a text file. @item -binary Save the data in Octave's binary data format. @item -float-binary Save the data in Octave's binary data format but only using single ! precision. You should use this format only if you know that all the values to be saved can be represented in single precision. @item -V7 --- 6067,6090 ---- @table @code @item -ascii ! Save a single matrix in a text file without header or any other information. @item -binary Save the data in Octave's binary data format. @item -float-binary Save the data in Octave's binary data format but only using single ! precision. Only use this format if you know that all the ! values to be saved can be represented in single precision. ! ! @item -hdf5 ! Save the data in HDF5 format. ! (HDF5 is a free, portable binary format developed by the National ! Center for Supercomputing Applications at the University of Illinois.) ! ! @item -float-hdf5 ! Save the data in HDF5 format but only using single precision. ! Only use this format if you know that all the values to be saved can be represented in single precision. @item -V7 *************** *** 6060,6074 **** @itemx -mat4-binary Save the data in the binary format written by @sc{matlab} version 4. ! @item -hdf5 ! Save the data in HDF5 format. ! (HDF5 is a free, portable binary format developed by the National ! Center for Supercomputing Applications at the University of Illinois.) ! ! @item -float-hdf5 ! Save the data in HDF5 format but only using single precision. ! You should use this format only if you know that all the ! values to be saved can be represented in single precision. @item -zip @itemx -z --- 6106,6113 ---- @itemx -mat4-binary Save the data in the binary format written by @sc{matlab} version 4. ! @item -text ! Save the data in Octave's text data format. (default). @item -zip @itemx -z *************** *** 6077,6083 **** convert the files for backward compatibility. @end table ! The list of variables to save may include wildcard patterns containing the following special characters: @table @code @item ? --- 6116,6122 ---- convert the files for backward compatibility. @end table ! The list of variables to save may use wildcard patterns containing the following special characters: @table @code @item ? *************** *** 6089,6107 **** @item [ @var{list} ] Match the list of characters specified by @var{list}. If the first character is @code{!} or @code{^}, match all characters except those ! specified by @var{list}. For example, the pattern @samp{[a-zA-Z]} will match all lower and upper case alphabetic characters. ! Wildcards may also be used in the field names specifications when using the @code{-struct} modifier (but not in the struct name itself). - @item -text - Save the data in Octave's text data format. @end table ! Except when using the @sc{matlab} binary data file format, saving global ! variables also saves the global status of the variable, so that if it is ! restored at a later time using @samp{load}, it will be restored as a global variable. The command --- 6128,6145 ---- @item [ @var{list} ] Match the list of characters specified by @var{list}. If the first character is @code{!} or @code{^}, match all characters except those ! specified by @var{list}. For example, the pattern @code{[a-zA-Z]} will match all lower and upper case alphabetic characters. ! Wildcards may also be used in the field name specifications when using the @code{-struct} modifier (but not in the struct name itself). @end table ! Except when using the @sc{matlab} binary data file format or the ! @samp{-ascii} format, saving global ! variables also saves the global status of the variable. If the variable ! is restored at a later time using @samp{load}, it will be restored as a global variable. The command *************** *** 6113,6118 **** --- 6151,6157 ---- @noindent saves the variable @samp{a} and all variables beginning with @samp{b} to the file @file{data} in Octave's binary format. + @seealso{load, default_save_options, dlmread, csvread, fread} @end deffn crash_dumps_octave_core @c load-save.cc *************** *** 6127,6138 **** default_save_options @c load-save.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {@var{val} =} default_save_options () @deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val}) Query or set the internal variable that specifies the default options for the @code{save} command, and defines the default format. ! Typical values include @code{"-ascii"}, @code{"-ascii -zip"}. ! The default value is @code{-ascii}. @seealso{save} @end deftypefn octave_core_file_limit --- 6166,6177 ---- default_save_options @c load-save.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {@var{val} =} default_save_options () @deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val}) Query or set the internal variable that specifies the default options for the @code{save} command, and defines the default format. ! Typical values include @code{"-ascii"}, @code{"-text -zip"}. ! The default value is @code{-text}. @seealso{save} @end deftypefn octave_core_file_limit *************** *** 6175,6181 **** save_header_format_string @c load-save.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {@var{val} =} save_header_format_string () @deftypefnx {Built-in Function} {@var{old_val} =} save_header_format_string (@var{new_val}) Query or set the internal variable that specifies the format string used for the comment line written at the beginning of --- 6214,6220 ---- save_header_format_string @c load-save.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {@var{val} =} save_header_format_string () @deftypefnx {Built-in Function} {@var{old_val} =} save_header_format_string (@var{new_val}) Query or set the internal variable that specifies the format string used for the comment line written at the beginning of *************** *** 6190,6196 **** @smallexample "# Created by Octave VERSION, %a %b %d %H:%M:%S %Y %Z " @end smallexample ! @seealso{strftime} @end deftypefn lookup @c ./DLD-FUNCTIONS/lookup.cc --- 6229,6235 ---- @smallexample "# Created by Octave VERSION, %a %b %d %H:%M:%S %Y %Z " @end smallexample ! @seealso{strftime, save} @end deftypefn lookup @c ./DLD-FUNCTIONS/lookup.cc *************** *** 6893,6898 **** --- 6932,6938 ---- @result{} [ 0, 0, 1, 0 ] @end group @end example + @seealso{isnan} @end deftypefn isnan @c mappers.cc *************** *** 6907,6912 **** --- 6947,6953 ---- @result{} [ 0, 0, 1, 1 ] @end group @end example + @seealso{isna} @end deftypefn isprint @c mappers.cc *************** *** 7736,7741 **** --- 7777,7783 ---- -*- texinfo -*- @deftypefn {Built-in Function} {} single (@var{x}) Convert @var{x} to single precision type. + @seealso{double} @end deftypefn int16 @c ov-int16.cc *************** *** 7831,7836 **** --- 7873,7879 ---- -*- texinfo -*- @deftypefn {Built-in Function} {} double (@var{x}) Convert @var{x} to double precision type. + @seealso{single} @end deftypefn struct @c ov-struct.cc *************** *** 8338,8385 **** format @c pr-output.cc -*- texinfo -*- ! @deffn {Command} format options ! Control the format of the output produced by @code{disp} and Octave's ! normal echoing mechanism. Valid options are listed in the following table. @table @code @item short ! Octave will try to print numbers with at ! least 5 significant figures within a field that is a maximum of 10 ! characters wide (not counting additional spacing that is added between ! columns of a matrix). If Octave is unable to format a matrix so that columns line up on the ! decimal point and all the numbers fit within the maximum field width, ! it switches to an @samp{e} format. @item long ! Octave will try to print numbers with at least 15 significant figures ! within a field that is a maximum of 20 characters wide (not counting ! additional spacing that is added between columns of a matrix). ! ! As will the @samp{short} format, Octave will switch to an @samp{e} ! format if it is unable to format a matrix so that columns line up on the ! decimal point and all the numbers fit within the maximum field width. ! ! @item long e ! @itemx short e ! The same as @samp{format long} or @samp{format short} but always display ! output with an @samp{e} format. For example, with the @samp{short e} ! format, @code{pi} is displayed as @code{3.14e+00}. ! ! @item long E ! @itemx short E ! The same as @samp{format long e} or @samp{format short e} but always ! display output with an uppercase @samp{E} format. For example, with ! the @samp{long E} format, @code{pi} is displayed as @code{3.14159265358979E+00}. ! @item long g ! @itemx short g ! Choose between normal @samp{long} (or @samp{short}) and ! @samp{long e} (or @samp{short e}) formats based on the magnitude ! of the number. For example, with the @samp{short g} format, @code{pi .^ [2; 4; 8; 16; 32]} is displayed as @example --- 8381,8439 ---- format @c pr-output.cc -*- texinfo -*- ! @deffn {Command} format ! @deffnx {Command} format options ! Reset or specify the format of the output produced by @code{disp} and ! Octave's normal echoing mechanism. This command only affects the display ! of numbers but not how they are stored or computed. To change the internal ! representation from the default double use one of the conversion functions ! such as @code{single}, @code{uint8}, @code{int64}, etc. ! ! By default, Octave displays 5 significant digits in a human readable form ! (option @samp{short} paired with @samp{loose} format for matrices). ! If @code{format} is invoked without any options, this default format ! is restored. ! ! Valid formats for floating point numbers are listed in the following table. @table @code @item short ! Fixed point format with 5 significant figures in a field that is a maximum ! of 10 characters wide. (default). If Octave is unable to format a matrix so that columns line up on the ! decimal point and all numbers fit within the maximum field width then ! it switches to an exponential @samp{e} format. @item long ! Fixed point format with 15 significant figures in a field that is a maximum ! of 20 characters wide. ! ! As with the @samp{short} format, Octave will switch to an exponential ! @samp{e} format if it is unable to format a matrix properly using the ! current format. ! ! @item short e ! @itemx long e ! Exponential format. The number to be represented is split between a mantissa ! and an exponent (power of 10). The mantissa has 5 significant digits in the ! short format and 15 digits in the long format. ! For example, with the @samp{short e} format, @code{pi} is displayed as ! @code{3.1416e+00}. ! ! @item short E ! @itemx long E ! Identical to @samp{short e} or @samp{long e} but displays an uppercase ! @samp{E} to indicate the exponent. ! For example, with the @samp{long E} format, @code{pi} is displayed as @code{3.14159265358979E+00}. ! ! @item short g ! @itemx long g ! Optimally choose between fixed point and exponential format based on ! the magnitude of the number. ! For example, with the @samp{short g} format, @code{pi .^ [2; 4; 8; 16; 32]} is displayed as @example *************** *** 8396,8435 **** @item long G @itemx short G ! The same as @samp{format long g} or @samp{format short g} but use an ! uppercase @samp{E} format. For example, with the @samp{short G} format, ! @code{pi .^ [2; 4; 8; 16; 32]} is displayed as ! ! @example ! @group ! ans = ! ! 9.8696 ! 97.409 ! 9488.5 ! 9.0032E+07 ! 8.1058E+15 ! @end group ! @end example @item free @itemx none Print output in free format, without trying to line up columns of matrices on the decimal point. This also causes complex numbers to be ! formatted like this @samp{(0.604194, 0.607088)} instead of like this ! @samp{0.60419 + 0.60709i}. ! @item bank ! Print in a fixed format with two places to the right of the decimal ! point. ! @item + @itemx + @var{chars} @itemx plus @itemx plus @var{chars} Print a @samp{+} symbol for nonzero matrix elements and a space for zero matrix elements. This format can be very useful for examining the ! structure of a large matrix. The optional argument @var{chars} specifies a list of 3 characters to use for printing values greater than zero, less than zero and equal to zero. --- 8450,8477 ---- @item long G @itemx short G ! Identical to @samp{short g} or @samp{long g} but displays an uppercase ! @samp{E} to indicate the exponent. @item free @itemx none Print output in free format, without trying to line up columns of matrices on the decimal point. This also causes complex numbers to be ! formatted as numeric pairs like this @samp{(0.60419, 0.60709)} instead ! of like this @samp{0.60419 + 0.60709i}. ! @end table ! The following formats affect all numeric output (floating point and ! integer types). ! @table @code ! @item + @itemx + @var{chars} @itemx plus @itemx plus @var{chars} Print a @samp{+} symbol for nonzero matrix elements and a space for zero matrix elements. This format can be very useful for examining the ! structure of a large sparse matrix. The optional argument @var{chars} specifies a list of 3 characters to use for printing values greater than zero, less than zero and equal to zero. *************** *** 8445,8456 **** @end group @end example ! @itemx native-hex ! Print the hexadecimal representation numbers as they are stored in memory. For example, on a workstation which stores 8 byte real values in IEEE format with the least significant byte first, the value of ! @code{pi} when printed in @code{hex} format is @code{400921fb54442d18}. ! This format only works for numeric values. @item hex The same as @code{native-hex}, but always print the most significant --- 8487,8501 ---- @end group @end example ! @item bank ! Print in a fixed format with two digits to the right of the decimal ! point. ! ! @item native-hex ! Print the hexadecimal representation of numbers as they are stored in memory. For example, on a workstation which stores 8 byte real values in IEEE format with the least significant byte first, the value of ! @code{pi} when printed in @code{native-hex} format is @code{400921fb54442d18}. @item hex The same as @code{native-hex}, but always print the most significant *************** *** 8467,8497 **** @end example (shown here in two 32 bit sections for typesetting purposes) when ! printed in bit format on a workstation which stores 8 byte real values ! in IEEE format with the least significant byte first. This format only ! works for numeric types. @item bit The same as @code{native-bit}, but always print the most significant bits first. ! @item compact ! Remove extra blank space around column number labels. ! @item loose ! Insert blank lines above and below column number labels (this is the ! default). @item rat ! Print a rational approximation. That is the values are approximated ! by one small integer divided by another. @end table ! By default, Octave will try to print numbers with at least 5 significant ! figures within a field that is a maximum of 10 characters wide. ! ! If Octave is unable to format a matrix so that columns line up on the ! decimal point and all the numbers fit within the maximum field width, ! it switches to an @samp{e} format. ! If @code{format} is invoked without any options, the default format ! state is restored. @end deffn fixed_point_format @c pr-output.cc --- 8512,8540 ---- @end example (shown here in two 32 bit sections for typesetting purposes) when ! printed in native-bit format on a workstation which stores 8 byte real values ! in IEEE format with the least significant byte first. @item bit The same as @code{native-bit}, but always print the most significant bits first. ! @item rat ! Print a rational approximation, i.e., values are approximated ! as the ratio of small integers. ! For example, with the @samp{rat} format, ! @code{pi} is displayed as @code{355/113}. @end table ! The following two options affect the display of all matrices. ! @table @code ! @item compact ! Remove extra blank space around column number labels producing more compact ! output with more data per page. ! @item loose ! Insert blank lines above and below column number labels to produce a more ! readable output with less data per page. (default). ! @end table @end deffn fixed_point_format @c pr-output.cc *************** *** 9766,9821 **** char @c strfns.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {} char (@var{x}) ! @deftypefnx {Built-in Function} {} char (@var{cell_array}) @deftypefnx {Built-in Function} {} char (@var{s1}, @var{s2}, @dots{}) Create a string array from one or more numeric matrices, character ! matrices or cell arrays. For numerical input, each element is converted ! to the corresponding ASCII character. The arguments (and elements of ! cell array(s)) are concatenated vertically. The returned values are padded with blanks as needed to make each row ! of the string array have the same length. Empty strings are not removed. For example, @example @group ! char ([97, 98, 99], "", @{"98", "99", 100@}, ["num", "bers"]) @result{} ["abc " ! " " ! "98 " ! "99 " ! "d " ! "numbers"] @end group @end example ! @end deftypefn strvcat @c strfns.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {} strvcat (@var{x}) ! @deftypefnx {Built-in Function} {} strvcat (@var{cell_array}) @deftypefnx {Built-in Function} {} strvcat (@var{s1}, @var{s2}, @dots{}) Create a character array from one or more numeric matrices, character ! matrices or cell arrays. For numerical input, each element is converted ! to the corresponding ASCII character. The arguments (and elements of ! cell array(s)) are concatenated vertically. The returned values are padded with blanks as needed to make each row of the string array have the same length. Unlike @code{char}, empty ! strings are removed. For example, @example @group ! strvcat ([97, 98, 99], "", @{"98", "99", 100@}, ["num", "bers"]) @result{} ["abc " ! "98 " ! "99 " ! "d " ! "numbers"] @end group @end example - @seealso{char, strcat, cstrcat} @end deftypefn ischar --- 9809,9878 ---- char @c strfns.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {} char (@var{x}) ! @deftypefnx {Built-in Function} {} char (@var{x}, @dots{}) @deftypefnx {Built-in Function} {} char (@var{s1}, @var{s2}, @dots{}) + @deftypefnx {Built-in Function} {} char (@var{cell_array}) Create a string array from one or more numeric matrices, character ! matrices, or cell arrays. Arguments are concatenated vertically. The returned values are padded with blanks as needed to make each row ! of the string array have the same length. Empty input strings are ! significant and will concatenated in the output. ! ! For numerical input, each element is converted ! to the corresponding ASCII character. A range error results if an input ! is outside the ASCII range (0-255). ! ! For cell arrays, each element is concatenated separately. Cell arrays converted through ! @code{char} can mostly be converted back with @code{cellstr}. For example, @example @group ! char ([97, 98, 99], "", @{"98", "99", 100@}, "str1", ["ha", "lf"]) @result{} ["abc " ! " " ! "98 " ! "99 " ! "d " ! "str1 " ! "half "] @end group @end example ! @seealso{strvcat, cellstr} @end deftypefn strvcat @c strfns.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {} strvcat (@var{x}) ! @deftypefnx {Built-in Function} {} strvcat (@var{x}, @dots{}) @deftypefnx {Built-in Function} {} strvcat (@var{s1}, @var{s2}, @dots{}) + @deftypefnx {Built-in Function} {} strvcat (@var{cell_array}) Create a character array from one or more numeric matrices, character ! matrices, or cell arrays. Arguments are concatenated vertically. The returned values are padded with blanks as needed to make each row of the string array have the same length. Unlike @code{char}, empty ! strings are removed and will not appear in the output. ! ! For numerical input, each element is converted ! to the corresponding ASCII character. A range error results if an input ! is outside the ASCII range (0-255). ! ! For cell arrays, each element is concatenated separately. Cell arrays converted through ! @code{strvcat} can mostly be converted back with @code{cellstr}. For example, @example @group ! strvcat ([97, 98, 99], "", @{"98", "99", 100@}, "str1", ["ha", "lf"]) @result{} ["abc " ! "98 " ! "99 " ! "d " ! "str1 " ! "half "] @end group @end example @seealso{char, strcat, cstrcat} @end deftypefn ischar *************** *** 11605,11641 **** who @c variables.cc -*- texinfo -*- ! @deffn {Command} who options pattern @dots{} ! @deffnx {Command} whos options pattern @dots{} ! List currently defined symbols matching the given patterns. The ! following are valid options. They may be shortened to one character but ! may not be combined. @table @code @item global ! List the variables in the global scope rather than the current scope. @item -regexp ! The patterns are considered as regular expressions and will be used ! for matching the variables to display. The same pattern syntax as for the @code{regexp} function is used. @item -file ! The following argument is treated as a filename, and the variables that ! are found within this file are listed. @end table ! Valid patterns are the same as described for the @code{clear} command ! above. If no patterns are supplied, all symbols from the given category ! are listed. By default, only user defined functions and variables ! visible in the local scope are displayed. ! ! The command @kbd{whos} is equivalent to @kbd{who -long}. ! @seealso{regexp} @end deffn whos @c variables.cc -*- texinfo -*- ! @deffn {Command} whos options pattern @dots{} ! See who. @end deffn mlock @c variables.cc --- 11662,11738 ---- who @c variables.cc -*- texinfo -*- ! @deffn {Command} who ! @deffnx {Command} who pattern @dots{} ! @deffnx {Command} who option pattern @dots{} ! @deffnx {Command} C = who("pattern", @dots{}) ! List currently defined variables matching the given patterns. Valid ! pattern syntax is the same as described for the @code{clear} command. ! If no patterns are supplied, all variables are listed. ! By default, only variables visible in the local scope are displayed. ! ! The following are valid options but may not be combined. @table @code @item global ! List variables in the global scope rather than the current scope. @item -regexp ! The patterns are considered to be regular expressions when matching the ! variables to display. The same pattern syntax accepted by the @code{regexp} function is used. @item -file ! The next argument is treated as a filename. All variables found within the ! specified file are listed. No patterns are accepted when reading variables ! from a file. @end table ! If called as a function, return a cell array of defined variable names ! matching the given patterns. ! @seealso{whos, regexp} @end deffn whos @c variables.cc -*- texinfo -*- ! @deffn {Command} whos ! @deffnx {Command} whos pattern @dots{} ! @deffnx {Command} whos option pattern @dots{} ! @deffnx {Command} S = whos("pattern", @dots{}) ! Provide detailed information on currently defined variables matching the ! given patterns. Options and pattern syntax are the same as for the ! @code{who} command. Extended information about each variable is ! summarized in a table with the following default entries. ! ! @table @asis ! @item Attr ! Attributes of the listed variable. Possible attributes are: ! @table @asis ! @item blank ! Variable in local scope ! @item @code{g} ! Variable with global scope ! @item @code{p} ! Persistent variable ! @end table ! @item Name ! The name of the variable. ! @item Size ! The logical size of the variable. A scalar is 1x1, a vector is 1xN or Nx1, ! a 2-D matrix is MxN. ! @item Bytes ! The amount of memory currently used to store the variable. ! @item Class ! The class of the variable. Examples include double, single, char, uint16, ! cell, and struct. ! @end table ! ! The table can be customized to display more or less information through ! the function @code{whos_line_format}. ! ! If @code{whos} is called as a function, return a struct array of defined ! variable names matching the given patterns. Fields in the structure ! describing each variable are: name, size, bytes, class, global, sparse, ! complex, nesting, persistent. ! @seealso{who, whos_line_format} @end deffn mlock @c variables.cc *************** *** 11728,11738 **** whos_line_format @c variables.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {@var{val} =} whos_line_format () @deftypefnx {Built-in Function} {@var{old_val} =} whos_line_format (@var{new_val}) ! Query or set the format string used by the @code{whos}. - The following escape sequences may be used in the format: @table @code @item %a Prints attributes of variables (g=global, p=persistent, --- 11825,11843 ---- whos_line_format @c variables.cc -*- texinfo -*- ! @deftypefn {Built-in Function} {@var{val} =} whos_line_format () @deftypefnx {Built-in Function} {@var{old_val} =} whos_line_format (@var{new_val}) ! Query or set the format string used by the command @code{whos}. ! ! A full format string is: ! ! @c Set example in small font to prevent overfull line ! @smallexample ! %[modifier][:width[:left-min[:balance]]]; ! @end smallexample ! ! The following command sequences are available: @table @code @item %a Prints attributes of variables (g=global, p=persistent, *************** *** 11751,11780 **** Prints type names of variables. @end table ! Every command may also have a modifier: @table @code @item l Left alignment. @item r ! Right alignment (this is the default). @item c ! Centered (may only be applied to command %s). @end table ! A command is composed like this: ! ! @c Set example in small font to prevent overfull line ! @smallexample ! %[modifier][:size_of_parameter[:center-specific[:balance]]]; ! @end smallexample ! ! Command and modifier is already explained. The @code{size_of_parameter} ! parameter tells how many columns the parameter will need for printing. ! The @code{center-specific} parameter may only be applied to command ! @samp{%s}. ! The @code{balance} parameter specifies the offset for printing ! the dimensions string. The default format is @code{" %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\n"}. @end deftypefn --- 11856,11884 ---- Prints type names of variables. @end table ! Every command may also have an alignment modifier: ! @table @code @item l Left alignment. @item r ! Right alignment (default). @item c ! Column-aligned (only applicable to command %s). @end table ! The @code{width} parameter is a positive integer specifying the minimum ! number of columns used for printing. No maximum is needed as the field will ! auto-expand as required. ! ! The parameters @code{left-min} and @code{balance} are only available when the ! column-aligned modifier is used with the command @samp{%s}. ! @code{balance} specifies the column number within the field width which will ! be aligned between entries. Numbering starts from 0 which indicates the ! leftmost column. @code{left-min} specifies the minimum field width to the ! left of the specified balance column. The default format is @code{" %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\n"}. + @seealso{whos} @end deftypefn diff -cNr octave-3.2.0/src/file-io.cc octave-3.2.2/src/file-io.cc *** octave-3.2.0/src/file-io.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/file-io.cc 2009-06-11 07:13:21.000000000 +0200 *************** *** 32,38 **** // sync_system (now merged with system) // async_system (now merged with system) ! // Extensively revised by John W. Eaton , // April 1996. #ifdef HAVE_CONFIG_H --- 32,38 ---- // sync_system (now merged with system) // async_system (now merged with system) ! // Extensively revised by John W. Eaton , // April 1996. #ifdef HAVE_CONFIG_H diff -cNr octave-3.2.0/src/graphics.cc octave-3.2.2/src/graphics.cc *** octave-3.2.0/src/graphics.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/graphics.cc 2009-06-09 06:33:11.000000000 +0200 *************** *** 709,715 **** error ("invalid value for color property \"%s\"", get_name ().c_str ()); } ! else if (val.is_real_matrix ()) { Matrix m = val.matrix_value (); --- 709,715 ---- error ("invalid value for color property \"%s\"", get_name ().c_str ()); } ! else if (val.is_numeric_type ()) { Matrix m = val.matrix_value (); *************** *** 4963,4969 **** DEFUN (available_backends, , , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} available_backends ()\n\ ! Returns resgistered graphics backends.\n\ @end deftypefn") { gh_manager::autolock guard; --- 4963,4969 ---- DEFUN (available_backends, , , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} available_backends ()\n\ ! Return a cell array of registered graphics backends.\n\ @end deftypefn") { gh_manager::autolock guard; *************** *** 4979,4987 **** DEFUN (drawnow, args, , "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {} __go_drawnow__ ()\n\ ! @deftypefnx {Built-in Function} {} __go_drawnow__ (@var{term}, @var{file}, @var{mono}, @var{debug_file})\n\ ! Undocumented internal function.\n\ @end deftypefn") { static int drawnow_executing = 0; --- 4979,4993 ---- DEFUN (drawnow, args, , "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {} drawnow ()\n\ ! @deftypefnx {Built-in Function} {} drawnow (\"expose\")\n\ ! @deftypefnx {Built-in Function} {} drawnow (@var{term}, @var{file}, @var{mono}, @var{debug_file})\n\ ! Update figure windows and their children. The event queue is flushed and\n\ ! any callbacks generated are executed. With the optional argument\n\ ! @code{\"expose\"}, only graphic objects are updated and no other events or\n\ ! callbacks are processed.\n\ ! The third calling form of @code{drawnow} is for debugging and is\n\ ! undocumented.\n\ @end deftypefn") { static int drawnow_executing = 0; diff -cNr octave-3.2.0/src/help.cc octave-3.2.2/src/help.cc *** octave-3.2.0/src/help.cc 2009-05-26 21:04:49.000000000 +0200 --- octave-3.2.2/src/help.cc 2009-07-02 13:43:47.000000000 +0200 *************** *** 821,853 **** octave_value val = symbol_table::find_function (name); ! if (val.is_defined ()) { ! octave_function *fcn = val.function_value (); ! if (fcn) ! { ! file = fcn->fcn_file_name (); ! ! if (file.empty ()) ! { ! if (fcn->is_user_function ()) ! type = "command-line function"; ! else ! type = "built-in function"; ! } ! else ! type = val.is_user_script () ! ? std::string ("script") : std::string ("function"); ! } } else { ! // We might find a file that contains only a doc string. ! file = load_path::find_fcn_file (name); } return file; } --- 821,867 ---- octave_value val = symbol_table::find_function (name); ! if (name.find_first_of ('.') == std::string::npos) { ! if (val.is_defined ()) ! { ! octave_function *fcn = val.function_value (); ! ! if (fcn) ! { ! file = fcn->fcn_file_name (); ! ! if (file.empty ()) ! { ! if (fcn->is_user_function ()) ! type = "command-line function"; ! else ! type = "built-in function"; ! } ! else ! type = val.is_user_script () ! ? std::string ("script") : std::string ("function"); ! } ! } ! else ! { ! // We might find a file that contains only a doc string. ! file = load_path::find_fcn_file (name); ! } } else { ! // File query. ! // For compatibility: "file." queries "file". ! if (name.size () > 1 && name[name.size () - 1] == '.') ! file = load_path::find_file (name.substr (0, name.size () - 1)); ! else ! file = load_path::find_file (name); } + return file; } diff -cNr octave-3.2.0/src/input.cc octave-3.2.2/src/input.cc *** octave-3.2.0/src/input.cc 2009-05-26 21:04:49.000000000 +0200 --- octave-3.2.2/src/input.cc 2009-06-08 07:34:31.000000000 +0200 *************** *** 930,946 **** DEFUN (keyboard, args, , "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {} keyboard (@var{prompt})\n\ This function is normally used for simple debugging. When the\n\ @code{keyboard} function is executed, Octave prints a prompt and waits\n\ for user input. The input strings are then evaluated and the results\n\ are printed. This makes it possible to examine the values of variables\n\ ! within a function, and to assign new values to variables. No value is\n\ ! returned from the @code{keyboard} function, and it continues to prompt\n\ ! for input until the user types @samp{quit}, or @samp{exit}.\n\ \n\ ! If @code{keyboard} is invoked without any arguments, a default prompt of\n\ @samp{debug> } is used.\n\ @end deftypefn") { octave_value_list retval; --- 930,948 ---- DEFUN (keyboard, args, , "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {} keyboard ()\n\ ! @deftypefnx {Built-in Function} {} keyboard (@var{prompt})\n\ This function is normally used for simple debugging. When the\n\ @code{keyboard} function is executed, Octave prints a prompt and waits\n\ for user input. The input strings are then evaluated and the results\n\ are printed. This makes it possible to examine the values of variables\n\ ! within a function, and to assign new values if necessary. To leave the\n\ ! prompt and return to normal execution type @samp{return} or @samp{dbcont}.\n\ ! The @code{keyboard} function does not return an exit status.\n\ \n\ ! If @code{keyboard} is invoked without arguments, a default prompt of\n\ @samp{debug> } is used.\n\ + @seealso{dbcont, dbquit}\n\ @end deftypefn") { octave_value_list retval; diff -cNr octave-3.2.0/src/lex.l octave-3.2.2/src/lex.l *** octave-3.2.0/src/lex.l 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/lex.l 2009-06-11 07:13:21.000000000 +0200 *************** *** 723,733 **** int id_tok = handle_identifier (); if (id_tok >= 0) ! { ! lexer_flags.looking_for_object_index = true; ! ! COUNT_TOK_AND_RETURN (id_tok); ! } } %{ --- 723,729 ---- int id_tok = handle_identifier (); if (id_tok >= 0) ! COUNT_TOK_AND_RETURN (id_tok); } %{ *************** *** 3104,3109 **** --- 3100,3106 ---- lexer_flags.quote_is_transpose = true; lexer_flags.convert_spaces_to_comma = true; + lexer_flags.looking_for_object_index = true; current_input_column += yyleng; *************** *** 3141,3146 **** --- 3138,3144 ---- current_input_column += yyleng; lexer_flags.quote_is_transpose = false; lexer_flags.convert_spaces_to_comma = true; + lexer_flags.looking_for_object_index = true; return FCN_HANDLE; } *************** *** 3156,3161 **** --- 3154,3160 ---- current_input_column += yyleng; lexer_flags.quote_is_transpose = false; lexer_flags.convert_spaces_to_comma = true; + lexer_flags.looking_for_object_index = false; } return kw_token; *************** *** 3234,3239 **** --- 3233,3241 ---- current_input_column += yyleng; + if (tok != "__end__") + lexer_flags.looking_for_object_index = true; + return NAME; } diff -cNr octave-3.2.0/src/load-path.cc octave-3.2.2/src/load-path.cc *** octave-3.2.0/src/load-path.cc 2009-06-02 07:22:16.000000000 +0200 --- octave-3.2.2/src/load-path.cc 2009-06-29 14:15:59.000000000 +0200 *************** *** 2024,2029 **** --- 2024,2032 ---- { std::list dir_elts = split_path (arg); + if (! append) + std::reverse (dir_elts.begin (), dir_elts.end ()); + for (std::list::const_iterator p = dir_elts.begin (); p != dir_elts.end (); p++) diff -cNr octave-3.2.0/src/load-save.cc octave-3.2.2/src/load-save.cc *** octave-3.2.0/src/load-save.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/load-save.cc 2009-06-08 07:34:32.000000000 +0200 *************** *** 544,559 **** DEFUN (load, args, nargout, "-*- texinfo -*-\n\ ! @deffn {Command} load options file v1 v2 @dots{}\n\ Load the named variables @var{v1}, @var{v2}, @dots{}, from the file\n\ ! @var{file}. As with @code{save}, you may specify a list of variables\n\ ! and @code{load} will only extract those variables with names that\n\ ! match. For example, to restore the variables saved in the file\n\ ! @file{data}, use the command\n\ ! \n\ ! @example\n\ ! load data\n\ ! @end example\n\ \n\ If load is invoked using the functional form\n\ \n\ --- 544,559 ---- DEFUN (load, args, nargout, "-*- texinfo -*-\n\ ! @deffn {Command} load file\n\ ! @deffnx {Command} load options file\n\ ! @deffnx {Command} load options file v1 v2 @dots{}\n\ ! @deffnx {Command} S = load(\"options\", \"file\", \"v1\", \"v2\", @dots{})\n\ Load the named variables @var{v1}, @var{v2}, @dots{}, from the file\n\ ! @var{file}. If no variables are specified then all variables found in the\n\ ! file will be loaded. As with @code{save}, the list of variables to extract\n\ ! can be full names or use a pattern syntax. The format of the file is\n\ ! automatically detected but may be overridden by supplying the appropriate\n\ ! option.\n\ \n\ If load is invoked using the functional form\n\ \n\ *************** *** 569,577 **** global symbol with the same name already exists, it is loaded in the\n\ global symbol table. Also, if a variable is marked as global in a file\n\ and a local symbol exists, the local symbol is moved to the global\n\ ! symbol table and given the value from the file. Since it seems that\n\ ! both of these cases are likely to be the result of some sort of error,\n\ ! they will generate warnings.\n\ \n\ If invoked with a single output argument, Octave returns data instead\n\ of inserting variables in the symbol table. If the data file contains\n\ --- 569,575 ---- global symbol with the same name already exists, it is loaded in the\n\ global symbol table. Also, if a variable is marked as global in a file\n\ and a local symbol exists, the local symbol is moved to the global\n\ ! symbol table and given the value from the file.\n\ \n\ If invoked with a single output argument, Octave returns data instead\n\ of inserting variables in the symbol table. If the data file contains\n\ *************** *** 581,598 **** \n\ The @code{load} command can read data stored in Octave's text and\n\ binary formats, and @sc{matlab}'s binary format. If compiled with zlib\n\ ! support, it can load gzip-compressed files as well. It will automatically\n\ detect the type of file and do conversion from different floating point\n\ formats (currently only IEEE big and little endian, though other formats\n\ ! may added in the future).\n\ \n\ Valid options for @code{load} are listed in the following table.\n\ \n\ @table @code\n\ @item -force\n\ ! The @samp{-force} option is accepted but ignored for backward\n\ ! compatibility. Octave now overwrites variables currently in memory with\n\ ! the same name as those found in the file.\n\ \n\ @item -ascii\n\ Force Octave to assume the file contains columns of numbers in text format\n\ --- 579,596 ---- \n\ The @code{load} command can read data stored in Octave's text and\n\ binary formats, and @sc{matlab}'s binary format. If compiled with zlib\n\ ! support, it can also load gzip-compressed files. It will automatically\n\ detect the type of file and do conversion from different floating point\n\ formats (currently only IEEE big and little endian, though other formats\n\ ! may be added in the future).\n\ \n\ Valid options for @code{load} are listed in the following table.\n\ \n\ @table @code\n\ @item -force\n\ ! This option is accepted for backward compatibility but is ignored.\n\ ! Octave now overwrites variables currently in memory with\n\ ! those of the same name found in the file.\n\ \n\ @item -ascii\n\ Force Octave to assume the file contains columns of numbers in text format\n\ *************** *** 603,624 **** @item -binary\n\ Force Octave to assume the file is in Octave's binary format.\n\ \n\ - @item -mat\n\ - @itemx -mat-binary\n\ - @itemx -6\n\ - @itemx -v6\n\ - @itemx -7\n\ - @itemx -v7\n\ - Force Octave to assume the file is in @sc{matlab}'s version 6 or 7 binary\n\ - format.\n\ - \n\ - @item -V4\n\ - @itemx -v4\n\ - @itemx -4\n\ - @itemx -mat4-binary\n\ - Force Octave to assume the file is in the binary format written by\n\ - @sc{matlab} version 4.\n\ - \n\ @item -hdf5\n\ Force Octave to assume the file is in HDF5 format.\n\ (HDF5 is a free, portable binary format developed by the National\n\ --- 601,606 ---- *************** *** 630,642 **** "\n\ @item -import\n\ ! The @samp{-import} is accepted but ignored for backward compatibility.\n\ Octave can now support multi-dimensional HDF data and automatically\n\ modifies variable names if they are invalid Octave identifiers.\n\ \n\ @item -text\n\ Force Octave to assume the file is in Octave's text format.\n\ @end table\n\ @end deffn") { octave_value_list retval; --- 612,641 ---- "\n\ @item -import\n\ ! This option is accepted for backward compatibility but is ignored.\n\ Octave can now support multi-dimensional HDF data and automatically\n\ modifies variable names if they are invalid Octave identifiers.\n\ \n\ + @item -mat\n\ + @itemx -mat-binary\n\ + @itemx -6\n\ + @itemx -v6\n\ + @itemx -7\n\ + @itemx -v7\n\ + Force Octave to assume the file is in @sc{matlab}'s version 6 or 7 binary\n\ + format.\n\ + \n\ + @item -mat4-binary\n\ + @itemx -4\n\ + @itemx -v4\n\ + @itemx -V4\n\ + Force Octave to assume the file is in the binary format written by\n\ + @sc{matlab} version 4.\n\ + \n\ @item -text\n\ Force Octave to assume the file is in Octave's text format.\n\ @end table\n\ + @seealso{save, dlmwrite, csvwrite, fwrite}\n\ @end deffn") { octave_value_list retval; *************** *** 1441,1454 **** DEFUN (save, args, , "-*- texinfo -*-\n\ ! @deffn {Command} save options file @var{v1} @var{v2} @dots{}\n\ ! @deffnx {Command} save options file -struct @var{STR} @var{f1} @var{f2} @dots{}\n\ Save the named variables @var{v1}, @var{v2}, @dots{}, in the file\n\ ! @var{file}. The special filename @samp{-} may be used to write the\n\ ! output to your terminal. If no variable names are listed, Octave saves\n\ ! all the variables in the current scope.\n\ If the @code{-struct} modifier is used, fields @var{f1} @var{f2} @dots{}\n\ ! of the scalar structure @var{STR} are saved as if they were variables\n\ with corresponding names.\n\ Valid options for the @code{save} command are listed in the following table.\n\ Options that modify the output format override the format specified by \n\ --- 1440,1456 ---- DEFUN (save, args, , "-*- texinfo -*-\n\ ! @deffn {Command} save file\n\ ! @deffnx {Command} save options file\n\ ! @deffnx {Command} save options file @var{v1} @var{v2} @dots{}\n\ ! @deffnx {Command} save options file -struct @var{STRUCT} @var{f1} @var{f2} @dots{}\n\ Save the named variables @var{v1}, @var{v2}, @dots{}, in the file\n\ ! @var{file}. The special filename @samp{-} may be used to write\n\ ! output to the terminal. If no variable names are listed, Octave saves\n\ ! all the variables in the current scope. Otherwise, full variable names or\n\ ! pattern syntax can be used to specify the variables to save.\n\ If the @code{-struct} modifier is used, fields @var{f1} @var{f2} @dots{}\n\ ! of the scalar structure @var{STRUCT} are saved as if they were variables\n\ with corresponding names.\n\ Valid options for the @code{save} command are listed in the following table.\n\ Options that modify the output format override the format specified by \n\ *************** *** 1466,1479 **** \n\ @table @code\n\ @item -ascii\n\ ! Save a single matrix in a text file.\n\ \n\ @item -binary\n\ Save the data in Octave's binary data format.\n\ \n\ @item -float-binary\n\ Save the data in Octave's binary data format but only using single\n\ ! precision. You should use this format only if you know that all the\n\ values to be saved can be represented in single precision.\n\ \n\ @item -V7\n\ --- 1468,1494 ---- \n\ @table @code\n\ @item -ascii\n\ ! Save a single matrix in a text file without header or any other information.\n\ \n\ @item -binary\n\ Save the data in Octave's binary data format.\n\ \n\ @item -float-binary\n\ Save the data in Octave's binary data format but only using single\n\ ! precision. Only use this format if you know that all the\n\ ! values to be saved can be represented in single precision.\n\ ! \n\ ! @item -hdf5\n\ ! Save the data in HDF5 format.\n\ ! (HDF5 is a free, portable binary format developed by the National\n\ ! Center for Supercomputing Applications at the University of Illinois.)\n" ! ! HAVE_HDF5_HELP_STRING ! ! "\n\ ! @item -float-hdf5\n\ ! Save the data in HDF5 format but only using single precision.\n\ ! Only use this format if you know that all the\n\ values to be saved can be represented in single precision.\n\ \n\ @item -V7\n\ *************** *** 1498,1515 **** @itemx -mat4-binary\n\ Save the data in the binary format written by @sc{matlab} version 4.\n\ \n\ ! @item -hdf5\n\ ! Save the data in HDF5 format.\n\ ! (HDF5 is a free, portable binary format developed by the National\n\ ! Center for Supercomputing Applications at the University of Illinois.)\n" ! ! HAVE_HDF5_HELP_STRING ! ! "\n\ ! @item -float-hdf5\n\ ! Save the data in HDF5 format but only using single precision.\n\ ! You should use this format only if you know that all the\n\ ! values to be saved can be represented in single precision.\n\ \n\ @item -zip\n\ @itemx -z\n\ --- 1513,1520 ---- @itemx -mat4-binary\n\ Save the data in the binary format written by @sc{matlab} version 4.\n\ \n\ ! @item -text\n\ ! Save the data in Octave's text data format. (default).\n\ \n\ @item -zip\n\ @itemx -z\n\ *************** *** 1521,1527 **** "@end table\n\ \n\ ! The list of variables to save may include wildcard patterns containing\n\ the following special characters:\n\ @table @code\n\ @item ?\n\ --- 1526,1532 ---- "@end table\n\ \n\ ! The list of variables to save may use wildcard patterns containing\n\ the following special characters:\n\ @table @code\n\ @item ?\n\ *************** *** 1533,1551 **** @item [ @var{list} ]\n\ Match the list of characters specified by @var{list}. If the first\n\ character is @code{!} or @code{^}, match all characters except those\n\ ! specified by @var{list}. For example, the pattern @samp{[a-zA-Z]} will\n\ match all lower and upper case alphabetic characters. \n\ \n\ ! Wildcards may also be used in the field names specifications when using\n\ the @code{-struct} modifier (but not in the struct name itself).\n\ \n\ - @item -text\n\ - Save the data in Octave's text data format.\n\ @end table\n\ \n\ ! Except when using the @sc{matlab} binary data file format, saving global\n\ ! variables also saves the global status of the variable, so that if it is\n\ ! restored at a later time using @samp{load}, it will be restored as a\n\ global variable.\n\ \n\ The command\n\ --- 1538,1555 ---- @item [ @var{list} ]\n\ Match the list of characters specified by @var{list}. If the first\n\ character is @code{!} or @code{^}, match all characters except those\n\ ! specified by @var{list}. For example, the pattern @code{[a-zA-Z]} will\n\ match all lower and upper case alphabetic characters. \n\ \n\ ! Wildcards may also be used in the field name specifications when using\n\ the @code{-struct} modifier (but not in the struct name itself).\n\ \n\ @end table\n\ \n\ ! Except when using the @sc{matlab} binary data file format or the\n\ ! @samp{-ascii} format, saving global\n\ ! variables also saves the global status of the variable. If the variable\n\ ! is restored at a later time using @samp{load}, it will be restored as a\n\ global variable.\n\ \n\ The command\n\ *************** *** 1557,1562 **** --- 1561,1567 ---- @noindent\n\ saves the variable @samp{a} and all variables beginning with @samp{b} to\n\ the file @file{data} in Octave's binary format.\n\ + @seealso{load, default_save_options, dlmread, csvread, fread}\n\ @end deffn") { octave_value_list retval; *************** *** 1750,1761 **** DEFUN (default_save_options, args, nargout, "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {@var{val} =} default_save_options ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val})\n\ Query or set the internal variable that specifies the default options\n\ for the @code{save} command, and defines the default format.\n\ ! Typical values include @code{\"-ascii\"}, @code{\"-ascii -zip\"}.\n\ ! The default value is @code{-ascii}.\n\ @seealso{save}\n\ @end deftypefn") { --- 1755,1766 ---- DEFUN (default_save_options, args, nargout, "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {@var{val} =} default_save_options ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val})\n\ Query or set the internal variable that specifies the default options\n\ for the @code{save} command, and defines the default format.\n\ ! Typical values include @code{\"-ascii\"}, @code{\"-text -zip\"}.\n\ ! The default value is @code{-text}.\n\ @seealso{save}\n\ @end deftypefn") { *************** *** 1810,1816 **** DEFUN (save_header_format_string, args, nargout, "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {@var{val} =} save_header_format_string ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} save_header_format_string (@var{new_val})\n\ Query or set the internal variable that specifies the format\n\ string used for the comment line written at the beginning of\n\ --- 1815,1821 ---- DEFUN (save_header_format_string, args, nargout, "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {@var{val} =} save_header_format_string ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} save_header_format_string (@var{new_val})\n\ Query or set the internal variable that specifies the format\n\ string used for the comment line written at the beginning of\n\ *************** *** 1825,1831 **** @smallexample\n\ \"# Created by Octave VERSION, %a %b %d %H:%M:%S %Y %Z \"\n\ @end smallexample\n\ ! @seealso{strftime}\n\ @end deftypefn") { return SET_INTERNAL_VARIABLE (save_header_format_string); --- 1830,1836 ---- @smallexample\n\ \"# Created by Octave VERSION, %a %b %d %H:%M:%S %Y %Z \"\n\ @end smallexample\n\ ! @seealso{strftime, save}\n\ @end deftypefn") { return SET_INTERNAL_VARIABLE (save_header_format_string); diff -cNr octave-3.2.0/src/ls-mat4.h octave-3.2.2/src/ls-mat4.h *** octave-3.2.0/src/ls-mat4.h 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/ls-mat4.h 2009-06-16 06:43:57.000000000 +0200 *************** *** 21,27 **** */ #if !defined (octave_ls_mat4_h) ! #define octave_ls_mat4 1 extern oct_mach_info::float_format mopt_digit_to_float_format (int mach); --- 21,27 ---- */ #if !defined (octave_ls_mat4_h) ! #define octave_ls_mat4_h 1 extern oct_mach_info::float_format mopt_digit_to_float_format (int mach); diff -cNr octave-3.2.0/src/mappers.cc octave-3.2.2/src/mappers.cc *** octave-3.2.0/src/mappers.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/mappers.cc 2009-06-08 07:34:32.000000000 +0200 *************** *** 1023,1028 **** --- 1023,1029 ---- @result{} [ 0, 0, 1, 0 ]\n\ @end group\n\ @end example\n\ + @seealso{isnan}\n\ @end deftypefn") { octave_value retval; *************** *** 1062,1067 **** --- 1063,1069 ---- @result{} [ 0, 0, 1, 1 ]\n\ @end group\n\ @end example\n\ + @seealso{isna}\n\ @end deftypefn") { octave_value retval; diff -cNr octave-3.2.0/src/mex.cc octave-3.2.2/src/mex.cc *** octave-3.2.0/src/mex.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/mex.cc 2009-06-18 07:09:18.000000000 +0200 *************** *** 498,508 **** void *get_data (void) const { ! void *retval = 0; ! if (is_char () ! || (is_numeric () && is_real_type () && ! is_range ())) ! retval = maybe_mark_foreign (val.mex_get_data ()); else request_mutation (); --- 498,507 ---- void *get_data (void) const { ! void *retval = val.mex_get_data (); ! if (retval) ! maybe_mark_foreign (retval); else request_mutation (); diff -cNr octave-3.2.0/src/octave.cc octave-3.2.2/src/octave.cc *** octave-3.2.0/src/octave.cc 2009-05-26 21:04:49.000000000 +0200 --- octave-3.2.2/src/octave.cc 2009-06-24 07:32:26.000000000 +0200 *************** *** 394,408 **** { eval_string (code, false, parse_status, 0); } - catch (octave_quit_exception e) - { - unwind_protect::run_frame ("execute_eval_option_code"); - clean_up_and_exit (e.status); - } catch (octave_interrupt_exception) { recover_from_exception (); octave_stdout << "\n"; } catch (std::bad_alloc) { --- 394,405 ---- { eval_string (code, false, parse_status, 0); } catch (octave_interrupt_exception) { recover_from_exception (); octave_stdout << "\n"; + if (quitting_gracefully) + clean_up_and_exit (exit_status); } catch (std::bad_alloc) { *************** *** 466,480 **** source_file (fname, context, verbose, require_file, "octave"); } - catch (octave_quit_exception e) - { - unwind_protect::run_frame ("execute_command_line_file"); - clean_up_and_exit (e.status); - } catch (octave_interrupt_exception) { recover_from_exception (); octave_stdout << "\n"; } catch (std::bad_alloc) { --- 463,474 ---- source_file (fname, context, verbose, require_file, "octave"); } catch (octave_interrupt_exception) { recover_from_exception (); octave_stdout << "\n"; + if (quitting_gracefully) + clean_up_and_exit (exit_status); } catch (std::bad_alloc) { *************** *** 777,786 **** atexit (do_octave_atexit); #endif // These can come after command line args since none of them set any // defaults that might be changed by command line options. ! initialize_command_input (); if (! inhibit_startup_message) std::cout << OCTAVE_STARTUP_MESSAGE "\n" << std::endl; --- 771,794 ---- atexit (do_octave_atexit); #endif + // Is input coming from a terminal? If so, we are probably + // interactive. + + interactive = (! embedded + && isatty (fileno (stdin)) && isatty (fileno (stdout))); + + if (! interactive && ! forced_line_editing) + line_editing = false; + + // Force default line editor if we don't want readline editing. + if (! line_editing) + command_editor::force_default_editor (); + // These can come after command line args since none of them set any // defaults that might be changed by command line options. ! if (line_editing) ! initialize_command_input (); if (! inhibit_startup_message) std::cout << OCTAVE_STARTUP_MESSAGE "\n" << std::endl; *************** *** 806,820 **** if (! inhibit_startup_message && reading_startup_message_printed) std::cout << std::endl; - // Is input coming from a terminal? If so, we are probably - // interactive. - - interactive = (! embedded - && isatty (fileno (stdin)) && isatty (fileno (stdout))); - - if (! interactive && ! forced_line_editing) - line_editing = false; - // If there is an extra argument, see if it names a file to read. // Additional arguments are taken as command line options for the // script. --- 814,819 ---- diff -cNr octave-3.2.0/src/oct-map.cc octave-3.2.2/src/oct-map.cc *** octave-3.2.0/src/oct-map.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/oct-map.cc 2009-06-25 06:36:42.000000000 +0200 *************** *** 64,72 **** --- 64,82 ---- retval.assign (key (pa), tmp); } + // Preserve order of keys. + retval.key_list = key_list; + return retval; } + /* + %!# test preservation of keys by squeeze + %!test + %! x(1,1,1,1).d = 10; x(3,5,1,7).a = "b"; x(2,4,1,7).f = 27; + %! assert (fieldnames (squeeze (x)), {"d"; "a"; "f"}); + */ + Octave_map Octave_map::permute (const Array& vec, bool inv) const { *************** *** 82,90 **** --- 92,110 ---- retval.assign (key (pa), tmp); } + // Preserve order of keys. + retval.key_list = key_list; + return retval; } + /* + %!# test preservation of key order by permute + %!test + %! x(1,1,1,1).d = 10; x(3,5,1,7).a = "b"; x(2,4,1,7).f = 27; + %! assert (fieldnames (permute (x, [3, 4, 1, 2])), {"d"; "a"; "f"}); + */ + Cell& Octave_map::contents (const std::string& k) { *************** *** 153,161 **** --- 173,193 ---- for (const_iterator p = begin (); p != end (); p++) retval.assign (key(p), Cell (contents(p).transpose ())); + // Preserve order of keys. + retval.key_list = key_list; + return retval; } + /* + %!# test preservation of key order by transpose + %!test + %! x(1,1).d = 10; x(3,5).a = "b"; x(2,4).f = 27; + %! assert (fieldnames (transpose (x)), {"d"; "a"; "f"}); + %! assert (fieldnames (x'), {"d"; "a"; "f"}); + %! assert (fieldnames (x.'), {"d"; "a"; "f"}); + */ + Octave_map Octave_map::reshape (const dim_vector& new_dims) const { *************** *** 167,172 **** --- 199,207 ---- retval.assign (key(p), contents(p).reshape (new_dims)); retval.dimensions = new_dims; + + // Preserve order of keys. + retval.key_list = key_list; } else retval = *this; *************** *** 174,179 **** --- 209,221 ---- return retval; } + /* + %!# test preservation of key order by reshape + %!test + %! x(1,1).d = 10; x(4,6).a = "b"; x(2,4).f = 27; + %! assert (fieldnames (reshape (x, 3, 8)), {"d"; "a"; "f"}); + */ + void Octave_map::resize (const dim_vector& dv, bool fill) { *************** *** 188,196 **** Cell tmp = contents(p); if (fill) ! tmp.resize(dv, Cell::resize_fill_value ()); else ! tmp.resize(dv); dimensions = dv; --- 230,238 ---- Cell tmp = contents(p); if (fill) ! tmp.resize (dv, Cell::resize_fill_value ()); else ! tmp.resize (dv); dimensions = dv; *************** *** 220,225 **** --- 262,270 ---- retval.assign (key(pa), contents(pa).insert (rb.contents(pb), ra_idx)); } + + // Preserve order of keys. + retval.key_list = key_list; } else { *************** *** 241,246 **** --- 286,299 ---- return retval; } + /* + %!# test preservation of key order by concatenation + %!test + %! x(1, 1).d = 10; x(4, 6).a = "b"; x(2, 4).f = 27; + %! y(1, 6).f = 11; y(1, 6).a = "c"; y(1, 6).d = 33; + %! assert (fieldnames ([x; y]), {"d"; "a"; "f"}); + */ + static bool keys_ok (const Octave_map& a, const Octave_map& b, string_vector& keys) { *************** *** 436,445 **** --- 489,501 ---- Octave_map::index (const octave_value_list& idx, bool resize_ok) const { Octave_map retval; + octave_idx_type n_idx = idx.length (); + if (n_idx > 0) { Array ra_idx (n_idx); + for (octave_idx_type i = 0; i < n_idx; i++) { ra_idx(i) = idx(i).index_vector (); *************** *** 451,458 **** { for (const_iterator p = begin (); p != end (); p++) { - Cell tmp = contents (p); tmp = tmp.ArrayN::index (ra_idx, resize_ok); if (error_state) --- 507,514 ---- { for (const_iterator p = begin (); p != end (); p++) { Cell tmp = contents (p); + tmp = tmp.ArrayN::index (ra_idx, resize_ok); if (error_state) *************** *** 472,477 **** --- 528,540 ---- } /* + %!# test preservation of key order by indexing + %!test + %! x(1, 1).d = 10; x(4, 6).a = "b"; x(2, 4).f = 27; + %! assert (fieldnames (x([1, 2], [2:5])), {"d"; "a"; "f"}); + */ + + /* ;;; Local Variables: *** ;;; mode: C++ *** ;;; End: *** diff -cNr octave-3.2.0/src/ov-base-diag.cc octave-3.2.2/src/ov-base-diag.cc *** octave-3.2.0/src/ov-base-diag.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/ov-base-diag.cc 2009-06-18 07:09:18.000000000 +0200 *************** *** 500,506 **** octave_base_diag::to_dense (void) const { if (! dense_cache.is_defined ()) ! dense_cache = MT (matrix); return dense_cache; } --- 500,506 ---- octave_base_diag::to_dense (void) const { if (! dense_cache.is_defined ()) ! dense_cache = MT (matrix); return dense_cache; } diff -cNr octave-3.2.0/src/ov-base-mat.h octave-3.2.2/src/ov-base-mat.h *** octave-3.2.0/src/ov-base-mat.h 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/ov-base-mat.h 2009-06-18 07:09:18.000000000 +0200 *************** *** 151,160 **** void print_info (std::ostream& os, const std::string& prefix) const; - // Unsafe. This function exists to support the MEX interface. - // You should not use it anywhere else. - void *mex_get_data (void) const { return matrix.mex_get_data (); } - protected: MT matrix; --- 151,156 ---- diff -cNr octave-3.2.0/src/ov-bool-mat.h octave-3.2.2/src/ov-bool-mat.h *** octave-3.2.0/src/ov-bool-mat.h 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/ov-bool-mat.h 2009-06-18 07:09:18.000000000 +0200 *************** *** 196,201 **** --- 196,205 ---- oct_mach_info::float_format flt_fmt) const { return os.write (matrix, block_size, output_type, skip, flt_fmt); } + // Unsafe. This function exists to support the MEX interface. + // You should not use it anywhere else. + void *mex_get_data (void) const { return matrix.mex_get_data (); } + mxArray *as_mxArray (void) const; // Mapper functions are converted to double for treatment diff -cNr octave-3.2.0/src/ov.cc octave-3.2.2/src/ov.cc *** octave-3.2.0/src/ov.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/ov.cc 2009-06-22 07:56:25.000000000 +0200 *************** *** 2712,2719 **** decode_subscripts ("subsasgn", args(1), type, idx); if (! error_state) ! retval = args(0).subsasgn (type, idx, args(2)); } else print_usage (); --- 2712,2723 ---- decode_subscripts ("subsasgn", args(1), type, idx); + octave_value arg0 = args(0); + + arg0.make_unique (); + if (! error_state) ! retval = arg0.subsasgn (type, idx, args(2)); } else print_usage (); diff -cNr octave-3.2.0/src/ov-cell.cc octave-3.2.2/src/ov-cell.cc *** octave-3.2.0/src/ov-cell.cc 2009-06-02 10:21:40.000000000 +0200 --- octave-3.2.2/src/ov-cell.cc 2009-06-22 09:00:44.000000000 +0200 *************** *** 29,34 **** --- 29,35 ---- #include #include #include + #include #include "Array-util.h" #include "byte-swap.h" *************** *** 487,497 **** tmp = tmp.sort (sidx, dim, mode); ! // We do it the hard way to auto-create the result's cache ! octave_cell *result = new octave_cell (Cell (tmp)); ! result->cellstr_cache = tmp; ! ! retval = result; } else error ("sort: only cell arrays of character strings may be sorted"); --- 488,495 ---- tmp = tmp.sort (sidx, dim, mode); ! // We already have the cache. ! retval = new octave_cell (tmp); } else error ("sort: only cell arrays of character strings may be sorted"); *************** *** 575,580 **** --- 573,580 ---- octave_idx_type max_len = 0; + std::queue strvec_queue; + for (octave_idx_type i = 0; i < nel; i++) { string_vector s = matrix(i).all_strings (); *************** *** 590,604 **** if (s_max_len > max_len) max_len = s_max_len; } ! retval.resize (n_elts); octave_idx_type k = 0; for (octave_idx_type i = 0; i < nel; i++) { ! string_vector s = matrix(i).all_strings (); octave_idx_type s_len = s.length (); --- 590,607 ---- if (s_max_len > max_len) max_len = s_max_len; + + strvec_queue.push (s); } ! retval = string_vector (n_elts); octave_idx_type k = 0; for (octave_idx_type i = 0; i < nel; i++) { ! const string_vector s = strvec_queue.front (); ! strvec_queue.pop (); octave_idx_type s_len = s.length (); diff -cNr octave-3.2.0/src/ov-flt-re-mat.cc octave-3.2.2/src/ov-flt-re-mat.cc *** octave-3.2.0/src/ov-flt-re-mat.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/ov-flt-re-mat.cc 2009-06-08 07:34:33.000000000 +0200 *************** *** 816,821 **** --- 816,822 ---- "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} single (@var{x})\n\ Convert @var{x} to single precision type.\n\ + @seealso{double}\n\ @end deftypefn") { // The OCTAVE_TYPE_CONV_BODY3 macro declares retval, so they go diff -cNr octave-3.2.0/src/ov-flt-re-mat.h octave-3.2.2/src/ov-flt-re-mat.h *** octave-3.2.0/src/ov-flt-re-mat.h 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/ov-flt-re-mat.h 2009-06-18 07:09:18.000000000 +0200 *************** *** 190,195 **** --- 190,199 ---- oct_mach_info::float_format flt_fmt) const { return os.write (matrix, block_size, output_type, skip, flt_fmt); } + // Unsafe. This function exists to support the MEX interface. + // You should not use it anywhere else. + void *mex_get_data (void) const { return matrix.mex_get_data (); } + mxArray *as_mxArray (void) const; octave_value erf (void) const; diff -cNr octave-3.2.0/src/ov-intx.h octave-3.2.2/src/ov-intx.h *** octave-3.2.0/src/ov-intx.h 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/ov-intx.h 2009-06-18 07:09:18.000000000 +0200 *************** *** 323,328 **** --- 323,332 ---- oct_mach_info::float_format flt_fmt) const { return os.write (matrix, block_size, output_type, skip, flt_fmt); } + // Unsafe. This function exists to support the MEX interface. + // You should not use it anywhere else. + void *mex_get_data (void) const { return matrix.mex_get_data (); } + mxArray *as_mxArray (void) const { mxArray *retval = new mxArray (OCTAVE_INT_MX_CLASS, dims (), mxREAL); diff -cNr octave-3.2.0/src/ov-re-mat.cc octave-3.2.2/src/ov-re-mat.cc *** octave-3.2.0/src/ov-re-mat.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/ov-re-mat.cc 2009-06-08 07:34:33.000000000 +0200 *************** *** 844,849 **** --- 844,850 ---- "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} double (@var{x})\n\ Convert @var{x} to double precision type.\n\ + @seealso{single}\n\ @end deftypefn") { // The OCTAVE_TYPE_CONV_BODY3 macro declares retval, so they go diff -cNr octave-3.2.0/src/ov-re-mat.h octave-3.2.2/src/ov-re-mat.h *** octave-3.2.0/src/ov-re-mat.h 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/ov-re-mat.h 2009-06-18 07:09:18.000000000 +0200 *************** *** 189,194 **** --- 189,198 ---- oct_mach_info::float_format flt_fmt) const { return os.write (matrix, block_size, output_type, skip, flt_fmt); } + // Unsafe. This function exists to support the MEX interface. + // You should not use it anywhere else. + void *mex_get_data (void) const { return matrix.mex_get_data (); } + mxArray *as_mxArray (void) const; octave_value erf (void) const; diff -cNr octave-3.2.0/src/ov-type-conv.h octave-3.2.2/src/ov-type-conv.h *** octave-3.2.0/src/ov-type-conv.h 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/ov-type-conv.h 2009-06-16 06:43:57.000000000 +0200 *************** *** 20,25 **** --- 20,28 ---- */ + #if !defined (octave_ov_type_conv_h) + #define octave_ov_type_conv_h 1 + static octave_value octave_type_conv_body (const octave_value &arg, const std::string& name, int t_result) *************** *** 103,108 **** --- 106,113 ---- OCTAVE_TYPE_CONV_BODY3 (NAME, octave_ ## NAME ## _matrix, \ octave_ ## NAME ## _scalar) + #endif + /* ;;; Local Variables: *** ;;; mode: C++ *** diff -cNr octave-3.2.0/src/pr-output.cc octave-3.2.2/src/pr-output.cc *** octave-3.2.0/src/pr-output.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/pr-output.cc 2009-07-02 06:31:30.000000000 +0200 *************** *** 271,276 **** --- 271,285 ---- double step = xround (flip); double nextn = n; double nextd = d; + + // Have we converged to 1/intmax ? + if (m > 100 || fabs (frac) < 1 / static_cast(INT_MAX)) + { + lastn = n; + lastd = d; + break; + } + frac = flip - step; n = n * step + lastn; d = d * step + lastd; *************** *** 295,308 **** break; s = buf.str(); - - // Have we converged to 1/intmax ? - if (m > 100 || fabs (frac) < 1 / static_cast(INT_MAX)) - { - lastn = n; - lastd = d; - break; - } } if (lastd < 0.) --- 304,309 ---- *************** *** 3540,3587 **** DEFUN (format, args, , "-*- texinfo -*-\n\ ! @deffn {Command} format options\n\ ! Control the format of the output produced by @code{disp} and Octave's\n\ ! normal echoing mechanism. Valid options are listed in the following\n\ table.\n\ \n\ @table @code\n\ @item short\n\ ! Octave will try to print numbers with at\n\ ! least 5 significant figures within a field that is a maximum of 10\n\ ! characters wide (not counting additional spacing that is added between\n\ ! columns of a matrix).\n\ \n\ If Octave is unable to format a matrix so that columns line up on the\n\ ! decimal point and all the numbers fit within the maximum field width,\n\ ! it switches to an @samp{e} format.\n\ \n\ @item long\n\ ! Octave will try to print numbers with at least 15 significant figures\n\ ! within a field that is a maximum of 20 characters wide (not counting\n\ ! additional spacing that is added between columns of a matrix).\n\ ! \n\ ! As will the @samp{short} format, Octave will switch to an @samp{e}\n\ ! format if it is unable to format a matrix so that columns line up on the\n\ ! decimal point and all the numbers fit within the maximum field width.\n\ ! \n\ ! @item long e\n\ ! @itemx short e\n\ ! The same as @samp{format long} or @samp{format short} but always display\n\ ! output with an @samp{e} format. For example, with the @samp{short e}\n\ ! format, @code{pi} is displayed as @code{3.14e+00}.\n\ ! \n\ ! @item long E\n\ ! @itemx short E\n\ ! The same as @samp{format long e} or @samp{format short e} but always\n\ ! display output with an uppercase @samp{E} format. For example, with\n\ ! the @samp{long E} format, @code{pi} is displayed as\n\ @code{3.14159265358979E+00}.\n\ ! @item long g\n\ ! @itemx short g\n\ ! Choose between normal @samp{long} (or @samp{short}) and\n\ ! @samp{long e} (or @samp{short e}) formats based on the magnitude\n\ ! of the number. For example, with the @samp{short g} format,\n\ @code{pi .^ [2; 4; 8; 16; 32]} is displayed as\n\ \n\ @example\n\ --- 3541,3599 ---- DEFUN (format, args, , "-*- texinfo -*-\n\ ! @deffn {Command} format\n\ ! @deffnx {Command} format options\n\ ! Reset or specify the format of the output produced by @code{disp} and\n\ ! Octave's normal echoing mechanism. This command only affects the display\n\ ! of numbers but not how they are stored or computed. To change the internal\n\ ! representation from the default double use one of the conversion functions\n\ ! such as @code{single}, @code{uint8}, @code{int64}, etc.\n\ ! \n\ ! By default, Octave displays 5 significant digits in a human readable form\n\ ! (option @samp{short} paired with @samp{loose} format for matrices).\n\ ! If @code{format} is invoked without any options, this default format\n\ ! is restored.\n\ ! \n\ ! Valid formats for floating point numbers are listed in the following\n\ table.\n\ \n\ @table @code\n\ @item short\n\ ! Fixed point format with 5 significant figures in a field that is a maximum\n\ ! of 10 characters wide. (default).\n\ \n\ If Octave is unable to format a matrix so that columns line up on the\n\ ! decimal point and all numbers fit within the maximum field width then\n\ ! it switches to an exponential @samp{e} format.\n\ \n\ @item long\n\ ! Fixed point format with 15 significant figures in a field that is a maximum\n\ ! of 20 characters wide.\n\ ! \n\ ! As with the @samp{short} format, Octave will switch to an exponential\n\ ! @samp{e} format if it is unable to format a matrix properly using the\n\ ! current format.\n\ ! \n\ ! @item short e\n\ ! @itemx long e\n\ ! Exponential format. The number to be represented is split between a mantissa\n\ ! and an exponent (power of 10). The mantissa has 5 significant digits in the\n\ ! short format and 15 digits in the long format.\n\ ! For example, with the @samp{short e} format, @code{pi} is displayed as\n\ ! @code{3.1416e+00}.\n\ ! \n\ ! @item short E\n\ ! @itemx long E\n\ ! Identical to @samp{short e} or @samp{long e} but displays an uppercase\n\ ! @samp{E} to indicate the exponent.\n\ ! For example, with the @samp{long E} format, @code{pi} is displayed as\n\ @code{3.14159265358979E+00}.\n\ ! \n\ ! @item short g\n\ ! @itemx long g\n\ ! Optimally choose between fixed point and exponential format based on\n\ ! the magnitude of the number.\n\ ! For example, with the @samp{short g} format,\n\ @code{pi .^ [2; 4; 8; 16; 32]} is displayed as\n\ \n\ @example\n\ *************** *** 3598,3637 **** \n\ @item long G\n\ @itemx short G\n\ ! The same as @samp{format long g} or @samp{format short g} but use an\n\ ! uppercase @samp{E} format. For example, with the @samp{short G} format,\n\ ! @code{pi .^ [2; 4; 8; 16; 32]} is displayed as\n\ ! \n\ ! @example\n\ ! @group\n\ ! ans =\n\ ! \n\ ! 9.8696\n\ ! 97.409\n\ ! 9488.5\n\ ! 9.0032E+07\n\ ! 8.1058E+15\n\ ! @end group\n\ ! @end example\n\ \n\ @item free\n\ @itemx none\n\ Print output in free format, without trying to line up columns of\n\ matrices on the decimal point. This also causes complex numbers to be\n\ ! formatted like this @samp{(0.604194, 0.607088)} instead of like this\n\ ! @samp{0.60419 + 0.60709i}.\n\ \n\ ! @item bank\n\ ! Print in a fixed format with two places to the right of the decimal\n\ ! point.\n\ \n\ ! @item +\n\ @itemx + @var{chars}\n\ @itemx plus\n\ @itemx plus @var{chars}\n\ Print a @samp{+} symbol for nonzero matrix elements and a space for zero\n\ matrix elements. This format can be very useful for examining the\n\ ! structure of a large matrix.\n\ \n\ The optional argument @var{chars} specifies a list of 3 characters to use\n\ for printing values greater than zero, less than zero and equal to zero.\n\ --- 3610,3637 ---- \n\ @item long G\n\ @itemx short G\n\ ! Identical to @samp{short g} or @samp{long g} but displays an uppercase\n\ ! @samp{E} to indicate the exponent.\n\ \n\ @item free\n\ @itemx none\n\ Print output in free format, without trying to line up columns of\n\ matrices on the decimal point. This also causes complex numbers to be\n\ ! formatted as numeric pairs like this @samp{(0.60419, 0.60709)} instead\n\ ! of like this @samp{0.60419 + 0.60709i}.\n\ ! @end table\n\ \n\ ! The following formats affect all numeric output (floating point and\n\ ! integer types).\n\ \n\ ! @table @code\n\ ! @item +\n\ @itemx + @var{chars}\n\ @itemx plus\n\ @itemx plus @var{chars}\n\ Print a @samp{+} symbol for nonzero matrix elements and a space for zero\n\ matrix elements. This format can be very useful for examining the\n\ ! structure of a large sparse matrix.\n\ \n\ The optional argument @var{chars} specifies a list of 3 characters to use\n\ for printing values greater than zero, less than zero and equal to zero.\n\ *************** *** 3647,3658 **** @end group\n\ @end example\n\ \n\ ! @itemx native-hex\n\ ! Print the hexadecimal representation numbers as they are stored in\n\ memory. For example, on a workstation which stores 8 byte real values\n\ in IEEE format with the least significant byte first, the value of\n\ ! @code{pi} when printed in @code{hex} format is @code{400921fb54442d18}.\n\ ! This format only works for numeric values.\n\ \n\ @item hex\n\ The same as @code{native-hex}, but always print the most significant\n\ --- 3647,3661 ---- @end group\n\ @end example\n\ \n\ ! @item bank\n\ ! Print in a fixed format with two digits to the right of the decimal\n\ ! point.\n\ ! \n\ ! @item native-hex\n\ ! Print the hexadecimal representation of numbers as they are stored in\n\ memory. For example, on a workstation which stores 8 byte real values\n\ in IEEE format with the least significant byte first, the value of\n\ ! @code{pi} when printed in @code{native-hex} format is @code{400921fb54442d18}.\n\ \n\ @item hex\n\ The same as @code{native-hex}, but always print the most significant\n\ *************** *** 3669,3699 **** @end example\n\ \n\ (shown here in two 32 bit sections for typesetting purposes) when\n\ ! printed in bit format on a workstation which stores 8 byte real values\n\ ! in IEEE format with the least significant byte first. This format only\n\ ! works for numeric types.\n\ @item bit\n\ The same as @code{native-bit}, but always print the most significant\n\ bits first.\n\ ! @item compact\n\ ! Remove extra blank space around column number labels.\n\ ! @item loose\n\ ! Insert blank lines above and below column number labels (this is the\n\ ! default).\n\ @item rat\n\ ! Print a rational approximation. That is the values are approximated\n\ ! by one small integer divided by another.\n\ @end table\n\ \n\ ! By default, Octave will try to print numbers with at least 5 significant\n\ ! figures within a field that is a maximum of 10 characters wide.\n\ \n\ ! If Octave is unable to format a matrix so that columns line up on the\n\ ! decimal point and all the numbers fit within the maximum field width,\n\ ! it switches to an @samp{e} format.\n\ ! \n\ ! If @code{format} is invoked without any options, the default format\n\ ! state is restored.\n\ @end deffn") { octave_value_list retval; --- 3672,3700 ---- @end example\n\ \n\ (shown here in two 32 bit sections for typesetting purposes) when\n\ ! printed in native-bit format on a workstation which stores 8 byte real values\n\ ! in IEEE format with the least significant byte first.\n\ @item bit\n\ The same as @code{native-bit}, but always print the most significant\n\ bits first.\n\ ! \n\ @item rat\n\ ! Print a rational approximation, i.e., values are approximated\n\ ! as the ratio of small integers.\n\ ! For example, with the @samp{rat} format,\n\ ! @code{pi} is displayed as @code{355/113}.\n\ @end table\n\ \n\ ! The following two options affect the display of all matrices.\n\ \n\ ! @table @code\n\ ! @item compact\n\ ! Remove extra blank space around column number labels producing more compact\n\ ! output with more data per page.\n\ ! @item loose\n\ ! Insert blank lines above and below column number labels to produce a more\n\ ! readable output with less data per page. (default).\n\ ! @end table\n\ @end deffn") { octave_value_list retval; diff -cNr octave-3.2.0/src/pt-assign.cc octave-3.2.2/src/pt-assign.cc *** octave-3.2.0/src/pt-assign.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/pt-assign.cc 2009-06-25 06:36:15.000000000 +0200 *************** *** 64,70 **** "PS2", "PS4", "__kluge_procbuf_delay__", - "ans", "automatic_replot", "beep_on_error", "completion_append_char", --- 64,69 ---- diff -cNr octave-3.2.0/src/pt-eval.cc octave-3.2.2/src/pt-eval.cc *** octave-3.2.0/src/pt-eval.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/pt-eval.cc 2009-07-20 12:10:40.000000000 +0200 *************** *** 904,914 **** --- 904,923 ---- } } + void restore_interrupt_state (void *ptr) + { + octave_interrupt_state = *(reinterpret_cast (ptr)); + } + static void do_unwind_protect_cleanup_code (void *ptr) { tree_statement_list *list = static_cast (ptr); + sig_atomic_t saved_octave_interrupt_state = octave_interrupt_state; + unwind_protect::add (restore_interrupt_state, &saved_octave_interrupt_state); + octave_interrupt_state = 0; + // We want to run the cleanup code without error_state being set, // but we need to restore its value, so that any errors encountered // in the first part of the unwind_protect are not completely *************** *** 917,925 **** unwind_protect_int (error_state); error_state = 0; - unwind_protect_int (octave_interrupt_state); - octave_interrupt_state = 0; - // Similarly, if we have seen a return or break statement, allow all // the cleanup code to run before returning or handling the break. // We don't have to worry about continue statements because they can --- 926,931 ---- *************** *** 980,985 **** --- 986,993 ---- unwind_protect::discard (); else unwind_protect::run (); + + unwind_protect::run (); } void diff -cNr octave-3.2.0/src/pt-fcn-handle.cc octave-3.2.2/src/pt-fcn-handle.cc *** octave-3.2.0/src/pt-fcn-handle.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/pt-fcn-handle.cc 2009-06-11 07:13:22.000000000 +0200 *************** *** 139,144 **** --- 139,148 ---- %!test %! assert ((f1 (3)) (10) == 7) %! + %!shared g + %! g = @(t) feval (@(x) t*x, 2); + %!assert (g(0.5) == 1) + %! %!shared f, g, h %! h = @(x) sin (x); %! g = @(f, x) h (x); *************** *** 159,168 **** return retval; } - #if 0 tree_expression * ! tree_anon_fcn_handle::dup (symbol_table::scope_id parent_scope, ! symbol_table::context_id parent_context) const { tree_parameter_list *param_list = parameter_list (); tree_parameter_list *ret_list = return_list (); --- 163,171 ---- return retval; } tree_expression * ! tree_anon_fcn_handle::dup (symbol_table::scope_id, ! symbol_table::context_id) const { tree_parameter_list *param_list = parameter_list (); tree_parameter_list *ret_list = return_list (); *************** *** 172,178 **** symbol_table::scope_id new_scope = symbol_table::dup_scope (this_scope); if (new_scope > 0) ! symbol_table::inherit (new_scope, parent_scope, parent_context); tree_anon_fcn_handle *new_afh = new tree_anon_fcn_handle (param_list ? param_list->dup (new_scope, 0) : 0, --- 175,182 ---- symbol_table::scope_id new_scope = symbol_table::dup_scope (this_scope); if (new_scope > 0) ! symbol_table::inherit (new_scope, symbol_table::current_scope (), ! symbol_table::current_context ()); tree_anon_fcn_handle *new_afh = new tree_anon_fcn_handle (param_list ? param_list->dup (new_scope, 0) : 0, *************** *** 184,239 **** return new_afh; } - #endif - - tree_expression * - tree_anon_fcn_handle::dup (symbol_table::scope_id, - symbol_table::context_id) const - { - // Instead of simply duplicating, transform to a tree_constant - // object that contains an octave_fcn_handle object with the symbol - // table of the referenced function primed with values from the - // current scope and context. - - tree_parameter_list *param_list = parameter_list (); - tree_parameter_list *ret_list = return_list (); - tree_statement_list *cmd_list = body (); - symbol_table::scope_id this_scope = scope (); - - symbol_table::scope_id new_scope = symbol_table::dup_scope (this_scope); - - if (new_scope > 0) - symbol_table::inherit (new_scope, symbol_table::current_scope (), - symbol_table::current_context ()); - - octave_user_function *uf - = new octave_user_function (new_scope, - param_list ? param_list->dup (new_scope, 0) : 0, - ret_list ? ret_list->dup (new_scope, 0) : 0, - cmd_list ? cmd_list->dup (new_scope, 0) : 0); - - octave_function *curr_fcn = octave_call_stack::current (); - - if (curr_fcn) - { - uf->stash_parent_fcn_name (curr_fcn->name ()); - - symbol_table::scope_id parent_scope = curr_fcn->parent_fcn_scope (); - - if (parent_scope < 0) - parent_scope = curr_fcn->scope (); - - uf->stash_parent_fcn_scope (parent_scope); - } - - uf->mark_as_inline_function (); - - octave_value ov_fcn (uf); - - octave_value fh (new octave_fcn_handle (ov_fcn, "@")); - - return new tree_constant (fh, line (), column ()); - } void tree_anon_fcn_handle::accept (tree_walker& tw) --- 188,193 ---- diff -cNr octave-3.2.0/src/pt-mat.cc octave-3.2.2/src/pt-mat.cc *** octave-3.2.0/src/pt-mat.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/pt-mat.cc 2009-06-25 06:36:24.000000000 +0200 *************** *** 68,81 **** all_sq_str (false), all_dq_str (false), some_str (false), all_real (false), all_cmplx (false), all_mt (true), any_sparse (false), any_class (false), ! class_nm (octave_base_value::static_class_name ()), ok (false) { } tm_row_const_rep (const tree_argument_list& row) : count (1), dv (0, 0), all_str (false), all_sq_str (false), some_str (false), all_real (false), all_cmplx (false), all_mt (true), any_sparse (false), any_class (false), ! class_nm (octave_base_value::static_class_name ()), ok (false) { init (row); } ~tm_row_const_rep (void) { } --- 68,81 ---- all_sq_str (false), all_dq_str (false), some_str (false), all_real (false), all_cmplx (false), all_mt (true), any_sparse (false), any_class (false), ! class_nm (), ok (false) { } tm_row_const_rep (const tree_argument_list& row) : count (1), dv (0, 0), all_str (false), all_sq_str (false), some_str (false), all_real (false), all_cmplx (false), all_mt (true), any_sparse (false), any_class (false), ! class_nm (), ok (false) { init (row); } ~tm_row_const_rep (void) { } *************** *** 195,202 **** if (c1 == c2) retval = c1; ! else if (c1 == retval) retval = c2; else { bool c1_is_int = (c1 == "int8" || c1 == "uint8" --- 195,204 ---- if (c1 == c2) retval = c1; ! else if (c1.empty ()) retval = c2; + else if (c2.empty ()) + retval = c1; else { bool c1_is_int = (c1 == "int8" || c1 == "uint8" *************** *** 448,454 **** : dv (0, 0), all_str (false), all_sq_str (false), all_dq_str (false), some_str (false), all_real (false), all_cmplx (false), all_mt (true), any_sparse (false), any_class (false), ! class_nm (octave_base_value::static_class_name ()), ok (false) { init (tm); } ~tm_const (void) { } --- 450,456 ---- : dv (0, 0), all_str (false), all_sq_str (false), all_dq_str (false), some_str (false), all_real (false), all_cmplx (false), all_mt (true), any_sparse (false), any_class (false), ! class_nm (), ok (false) { init (tm); } ~tm_const (void) { } diff -cNr octave-3.2.0/src/strfns.cc octave-3.2.2/src/strfns.cc *** octave-3.2.0/src/strfns.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/strfns.cc 2009-06-08 07:34:32.000000000 +0200 *************** *** 43,71 **** DEFUN (char, args, , "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {} char (@var{x})\n\ ! @deftypefnx {Built-in Function} {} char (@var{cell_array})\n\ @deftypefnx {Built-in Function} {} char (@var{s1}, @var{s2}, @dots{})\n\ Create a string array from one or more numeric matrices, character\n\ ! matrices or cell arrays. For numerical input, each element is converted\n\ ! to the corresponding ASCII character. The arguments (and elements of\n\ ! cell array(s)) are concatenated vertically.\n\ The returned values are padded with blanks as needed to make each row\n\ ! of the string array have the same length. Empty strings are not removed.\n\ For example,\n\ \n\ @example\n\ @group\n\ ! char ([97, 98, 99], \"\", @{\"98\", \"99\", 100@}, [\"num\", \"bers\"])\n\ @result{} [\"abc \"\n\ ! \" \"\n\ ! \"98 \"\n\ ! \"99 \"\n\ ! \"d \"\n\ ! \"numbers\"]\n\ @end group\n\ @end example\n\ ! \n\ @end deftypefn") { octave_value retval; --- 43,79 ---- DEFUN (char, args, , "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {} char (@var{x})\n\ ! @deftypefnx {Built-in Function} {} char (@var{x}, @dots{})\n\ @deftypefnx {Built-in Function} {} char (@var{s1}, @var{s2}, @dots{})\n\ + @deftypefnx {Built-in Function} {} char (@var{cell_array})\n\ Create a string array from one or more numeric matrices, character\n\ ! matrices, or cell arrays. Arguments are concatenated vertically.\n\ The returned values are padded with blanks as needed to make each row\n\ ! of the string array have the same length. Empty input strings are\n\ ! significant and will concatenated in the output.\n\ ! \n\ ! For numerical input, each element is converted\n\ ! to the corresponding ASCII character. A range error results if an input\n\ ! is outside the ASCII range (0-255).\n\ ! \n\ ! For cell arrays, each element is concatenated separately. Cell arrays converted through\n\ ! @code{char} can mostly be converted back with @code{cellstr}.\n\ For example,\n\ \n\ @example\n\ @group\n\ ! char ([97, 98, 99], \"\", @{\"98\", \"99\", 100@}, \"str1\", [\"ha\", \"lf\"])\n\ @result{} [\"abc \"\n\ ! \" \"\n\ ! \"98 \"\n\ ! \"99 \"\n\ ! \"d \"\n\ ! \"str1 \"\n\ ! \"half \"]\n\ @end group\n\ @end example\n\ ! @seealso{strvcat, cellstr}\n\ @end deftypefn") { octave_value retval; *************** *** 158,186 **** DEFUN (strvcat, args, , "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {} strvcat (@var{x})\n\ ! @deftypefnx {Built-in Function} {} strvcat (@var{cell_array})\n\ @deftypefnx {Built-in Function} {} strvcat (@var{s1}, @var{s2}, @dots{})\n\ Create a character array from one or more numeric matrices, character\n\ ! matrices or cell arrays. For numerical input, each element is converted\n\ ! to the corresponding ASCII character. The arguments (and elements of\n\ ! cell array(s)) are concatenated vertically.\n\ The returned values are padded with blanks as needed to make each row\n\ of the string array have the same length. Unlike @code{char}, empty\n\ ! strings are removed.\n\ For example,\n\ \n\ @example\n\ @group\n\ ! strvcat ([97, 98, 99], \"\", @{\"98\", \"99\", 100@}, [\"num\", \"bers\"])\n\ @result{} [\"abc \"\n\ ! \"98 \"\n\ ! \"99 \"\n\ ! \"d \"\n\ ! \"numbers\"]\n\ @end group\n\ @end example\n\ - \n\ @seealso{char, strcat, cstrcat}\n\ @end deftypefn") { --- 166,200 ---- DEFUN (strvcat, args, , "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {} strvcat (@var{x})\n\ ! @deftypefnx {Built-in Function} {} strvcat (@var{x}, @dots{})\n\ @deftypefnx {Built-in Function} {} strvcat (@var{s1}, @var{s2}, @dots{})\n\ + @deftypefnx {Built-in Function} {} strvcat (@var{cell_array})\n\ Create a character array from one or more numeric matrices, character\n\ ! matrices, or cell arrays. Arguments are concatenated vertically.\n\ The returned values are padded with blanks as needed to make each row\n\ of the string array have the same length. Unlike @code{char}, empty\n\ ! strings are removed and will not appear in the output.\n\ ! \n\ ! For numerical input, each element is converted\n\ ! to the corresponding ASCII character. A range error results if an input\n\ ! is outside the ASCII range (0-255).\n\ ! \n\ ! For cell arrays, each element is concatenated separately. Cell arrays converted through\n\ ! @code{strvcat} can mostly be converted back with @code{cellstr}.\n\ For example,\n\ \n\ @example\n\ @group\n\ ! strvcat ([97, 98, 99], \"\", @{\"98\", \"99\", 100@}, \"str1\", [\"ha\", \"lf\"])\n\ @result{} [\"abc \"\n\ ! \"98 \"\n\ ! \"99 \"\n\ ! \"d \"\n\ ! \"str1 \"\n\ ! \"half \"]\n\ @end group\n\ @end example\n\ @seealso{char, strcat, cstrcat}\n\ @end deftypefn") { diff -cNr octave-3.2.0/src/symtab.h octave-3.2.2/src/symtab.h *** octave-3.2.0/src/symtab.h 2009-05-26 21:04:49.000000000 +0200 --- octave-3.2.2/src/symtab.h 2009-06-30 09:03:57.000000000 +0200 *************** *** 939,949 **** instance = p->second; xcurrent_scope = scope; } } ! ! if (! error_state) ! xcurrent_context = context; } } --- 939,950 ---- instance = p->second; xcurrent_scope = scope; + + xcurrent_context = context; } } ! else ! xcurrent_context = context; } } *************** *** 1062,1069 **** scope_id scope = xcurrent_scope, context_id context = xcurrent_context) { - assert (xcurrent_context == 0); - symbol_table *inst = get_instance (scope); if (inst) --- 1063,1068 ---- *************** *** 2143,2157 **** symbol_record& sr = p->second; if (sr.is_global ()) ! { ! global_table_iterator q = global_table.find (name); ! if (q != global_table.end ()) ! global_table.erase (q); - sr.unmark_global (); - } - } } void do_clear_variable (const std::string& name) --- 2142,2155 ---- symbol_record& sr = p->second; if (sr.is_global ()) ! sr.unmark_global (); ! } ! global_table_iterator q = global_table.find (name); ! ! if (q != global_table.end ()) ! global_table.erase (q); } void do_clear_variable (const std::string& name) *************** *** 2170,2188 **** { symbol_record& sr = p->second; ! if (sr.is_global ()) ! { ! if (pattern.match (sr.name ())) ! { ! global_table_iterator q = global_table.find (sr.name ()); ! ! if (q != global_table.end ()) ! global_table.erase (q); ! sr.unmark_global (); ! } ! } } } void do_clear_variable_pattern (const std::string& pat) --- 2168,2185 ---- { symbol_record& sr = p->second; ! if (sr.is_global () && pattern.match (sr.name ())) ! sr.unmark_global (); ! } ! for (global_table_iterator q = global_table.begin (); ! q != global_table.end (); q++) ! { ! if (pattern.match (q->first)) ! global_table.erase (q); } + + } void do_clear_variable_pattern (const std::string& pat) diff -cNr octave-3.2.0/src/sysdep.cc octave-3.2.2/src/sysdep.cc *** octave-3.2.0/src/sysdep.cc 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/src/sysdep.cc 2009-07-02 06:31:30.000000000 +0200 *************** *** 392,398 **** s = save_term; } ! tcsetattr (tty_fd, TCSAFLUSH, &s); } #elif defined (HAVE_TERMIO_H) { --- 392,398 ---- s = save_term; } ! tcsetattr (tty_fd, wait ? TCSAFLUSH : TCSADRAIN, &s); } #elif defined (HAVE_TERMIO_H) { diff -cNr octave-3.2.0/src/toplev.cc octave-3.2.2/src/toplev.cc *** octave-3.2.0/src/toplev.cc 2009-05-26 21:04:49.000000000 +0200 --- octave-3.2.2/src/toplev.cc 2009-06-24 07:31:32.000000000 +0200 *************** *** 85,91 **** bool quit_allowed = true; // TRUE means we are exiting via the builtin exit or quit functions. ! static bool quitting_gracefully = false; // TRUE means we are ready to interpret commands, but not everything // is ready for interactive use. --- 85,93 ---- bool quit_allowed = true; // TRUE means we are exiting via the builtin exit or quit functions. ! bool quitting_gracefully = false; ! // This stores the exit status. ! int exit_status = 0; // TRUE means we are ready to interpret commands, but not everything // is ready for interactive use. *************** *** 613,627 **** unwind_protect::run_frame ("main_loop"); } - catch (octave_quit_exception e) - { - unwind_protect::run_all (); - clean_up_and_exit (e.status); - } catch (octave_interrupt_exception) { recover_from_exception (); ! octave_stdout << "\n"; } catch (octave_execution_exception) { --- 615,629 ---- unwind_protect::run_frame ("main_loop"); } catch (octave_interrupt_exception) { recover_from_exception (); ! octave_stdout << "\n"; ! if (quitting_gracefully) ! { ! clean_up_and_exit (exit_status); ! break; // If user has overriden the exit func. ! } } catch (octave_execution_exception) { *************** *** 671,680 **** error ("quit: not supported in embedded mode."); else if (nargout == 0) { - int exit_status = 0; - - quitting_gracefully = true; - if (args.length () > 0) { int tmp = args(0).nint_value (); --- 673,678 ---- *************** *** 683,689 **** exit_status = tmp; } ! throw octave_quit_exception (exit_status); } else error ("quit: invalid number of output arguments"); --- 681,696 ---- exit_status = tmp; } ! if (! error_state) ! { ! quitting_gracefully = true; ! ! // Simulate interrupt. ! ! octave_interrupt_state = -1; ! ! octave_throw_interrupt_exception (); ! } } else error ("quit: invalid number of output arguments"); *************** *** 984,990 **** reset_error_handler (); ! feval (fcn, octave_value_list (), 0); flush_octave_stdout (); } --- 991,1012 ---- reset_error_handler (); ! try ! { ! feval (fcn, octave_value_list (), 0); ! } ! catch (octave_interrupt_exception) ! { ! recover_from_exception (); ! } ! catch (octave_execution_exception) ! { ! recover_from_exception (); ! } ! catch (std::bad_alloc) ! { ! recover_from_exception (); ! } flush_octave_stdout (); } diff -cNr octave-3.2.0/src/toplev.h octave-3.2.2/src/toplev.h *** octave-3.2.0/src/toplev.h 2009-05-26 06:36:19.000000000 +0200 --- octave-3.2.2/src/toplev.h 2009-06-24 07:31:32.000000000 +0200 *************** *** 48,62 **** extern OCTINTERP_API bool quit_allowed; ! // quit is a lot like an interrupt, so we subclass it to simplify possible ! // handling. ! class octave_quit_exception ! : public octave_interrupt_exception ! { ! public: ! int status; ! octave_quit_exception (int s) : status (s) { } ! }; extern OCTINTERP_API void clean_up_and_exit (int); --- 48,56 ---- extern OCTINTERP_API bool quit_allowed; ! extern OCTINTERP_API bool quitting_gracefully; ! ! extern OCTINTERP_API int exit_status; extern OCTINTERP_API void clean_up_and_exit (int); diff -cNr octave-3.2.0/src/variables.cc octave-3.2.2/src/variables.cc *** octave-3.2.0/src/variables.cc 2009-05-26 21:04:49.000000000 +0200 --- octave-3.2.2/src/variables.cc 2009-06-09 06:33:11.000000000 +0200 *************** *** 409,415 **** if (! retval && var_ok && (type == "any" || type == "var") ! && (val.is_constant () || val.is_object ())) { retval = 1; } --- 409,416 ---- if (! retval && var_ok && (type == "any" || type == "var") ! && (val.is_constant () || val.is_object () ! || val.is_inline_function () || val.is_function_handle ())) { retval = 1; } *************** *** 1561,1591 **** DEFUN (who, args, nargout, "-*- texinfo -*-\n\ ! @deffn {Command} who options pattern @dots{}\n\ ! @deffnx {Command} whos options pattern @dots{}\n\ ! List currently defined symbols matching the given patterns. The\n\ ! following are valid options. They may be shortened to one character but\n\ ! may not be combined.\n\ \n\ @table @code\n\ @item global\n\ ! List the variables in the global scope rather than the current scope.\n\ @item -regexp\n\ ! The patterns are considered as regular expressions and will be used\n\ ! for matching the variables to display. The same pattern syntax as for\n\ the @code{regexp} function is used.\n\ @item -file\n\ ! The following argument is treated as a filename, and the variables that\n\ ! are found within this file are listed.\n\ @end table\n\ \n\ ! Valid patterns are the same as described for the @code{clear} command\n\ ! above. If no patterns are supplied, all symbols from the given category\n\ ! are listed. By default, only user defined functions and variables\n\ ! visible in the local scope are displayed.\n\ ! \n\ ! The command @kbd{whos} is equivalent to @kbd{who -long}.\n\ ! @seealso{regexp}\n\ @end deffn") { octave_value retval; --- 1562,1594 ---- DEFUN (who, args, nargout, "-*- texinfo -*-\n\ ! @deffn {Command} who\n\ ! @deffnx {Command} who pattern @dots{}\n\ ! @deffnx {Command} who option pattern @dots{}\n\ ! @deffnx {Command} C = who(\"pattern\", @dots{})\n\ ! List currently defined variables matching the given patterns. Valid\n\ ! pattern syntax is the same as described for the @code{clear} command.\n\ ! If no patterns are supplied, all variables are listed.\n\ ! By default, only variables visible in the local scope are displayed.\n\ ! \n\ ! The following are valid options but may not be combined.\n\ \n\ @table @code\n\ @item global\n\ ! List variables in the global scope rather than the current scope.\n\ @item -regexp\n\ ! The patterns are considered to be regular expressions when matching the\n\ ! variables to display. The same pattern syntax accepted by\n\ the @code{regexp} function is used.\n\ @item -file\n\ ! The next argument is treated as a filename. All variables found within the\n\ ! specified file are listed. No patterns are accepted when reading variables\n\ ! from a file.\n\ @end table\n\ \n\ ! If called as a function, return a cell array of defined variable names\n\ ! matching the given patterns.\n\ ! @seealso{whos, regexp}\n\ @end deffn") { octave_value retval; *************** *** 1607,1614 **** DEFUN (whos, args, nargout, "-*- texinfo -*-\n\ ! @deffn {Command} whos options pattern @dots{}\n\ ! See who.\n\ @end deffn") { octave_value retval; --- 1610,1655 ---- DEFUN (whos, args, nargout, "-*- texinfo -*-\n\ ! @deffn {Command} whos\n\ ! @deffnx {Command} whos pattern @dots{}\n\ ! @deffnx {Command} whos option pattern @dots{}\n\ ! @deffnx {Command} S = whos(\"pattern\", @dots{})\n\ ! Provide detailed information on currently defined variables matching the\n\ ! given patterns. Options and pattern syntax are the same as for the\n\ ! @code{who} command. Extended information about each variable is\n\ ! summarized in a table with the following default entries.\n\ ! \n\ ! @table @asis\n\ ! @item Attr\n\ ! Attributes of the listed variable. Possible attributes are:\n\ ! @table @asis\n\ ! @item blank\n\ ! Variable in local scope\n\ ! @item @code{g}\n\ ! Variable with global scope\n\ ! @item @code{p}\n\ ! Persistent variable\n\ ! @end table\n\ ! @item Name\n\ ! The name of the variable.\n\ ! @item Size\n\ ! The logical size of the variable. A scalar is 1x1, a vector is 1xN or Nx1,\n\ ! a 2-D matrix is MxN.\n\ ! @item Bytes\n\ ! The amount of memory currently used to store the variable.\n\ ! @item Class\n\ ! The class of the variable. Examples include double, single, char, uint16,\n\ ! cell, and struct.\n\ ! @end table\n\ ! \n\ ! The table can be customized to display more or less information through\n\ ! the function @code{whos_line_format}.\n\ ! \n\ ! If @code{whos} is called as a function, return a struct array of defined\n\ ! variable names matching the given patterns. Fields in the structure\n\ ! describing each variable are: name, size, bytes, class, global, sparse, \n\ ! complex, nesting, persistent.\n\ ! @seealso{who, whos_line_format}\n\ @end deffn") { octave_value retval; *************** *** 2099,2105 **** { if (argc == 1) { ! symbol_table::clear_variables (); } else { --- 2140,2147 ---- { if (argc == 1) { ! do_clear_globals (argv, argc, 1); ! do_clear_variables (argv, argc, 1); } else { *************** *** 2220,2230 **** DEFUN (whos_line_format, args, nargout, "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {@var{val} =} whos_line_format ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} whos_line_format (@var{new_val})\n\ ! Query or set the format string used by the @code{whos}.\n\ \n\ - The following escape sequences may be used in the format:\n\ @table @code\n\ @item %a\n\ Prints attributes of variables (g=global, p=persistent,\n\ --- 2262,2280 ---- DEFUN (whos_line_format, args, nargout, "-*- texinfo -*-\n\ ! @deftypefn {Built-in Function} {@var{val} =} whos_line_format ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} whos_line_format (@var{new_val})\n\ ! Query or set the format string used by the command @code{whos}.\n\ ! \n\ ! A full format string is:\n\ ! \n\ ! @c Set example in small font to prevent overfull line\n\ ! @smallexample\n\ ! %[modifier][:width[:left-min[:balance]]];\n\ ! @end smallexample\n\ ! \n\ ! The following command sequences are available:\n\ \n\ @table @code\n\ @item %a\n\ Prints attributes of variables (g=global, p=persistent,\n\ *************** *** 2243,2274 **** Prints type names of variables.\n\ @end table\n\ \n\ ! Every command may also have a modifier:\n\ @table @code\n\ @item l\n\ Left alignment.\n\ @item r\n\ ! Right alignment (this is the default).\n\ @item c\n\ ! Centered (may only be applied to command %s).\n\ @end table\n\ \n\ ! A command is composed like this:\n\ ! \n\ ! @c Set example in small font to prevent overfull line\n\ ! @smallexample\n\ ! %[modifier][:size_of_parameter[:center-specific[:balance]]];\n\ ! @end smallexample\n\ ! \n\ ! Command and modifier is already explained. The @code{size_of_parameter}\n\ ! parameter tells how many columns the parameter will need for printing.\n\ ! The @code{center-specific} parameter may only be applied to command\n\ ! @samp{%s}.\n\ ! The @code{balance} parameter specifies the offset for printing\n\ ! the dimensions string.\n\ \n\ The default format is\n\ @code{\" %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\\n\"}.\n\ @end deftypefn") { return SET_INTERNAL_VARIABLE (whos_line_format); --- 2293,2323 ---- Prints type names of variables.\n\ @end table\n\ \n\ ! Every command may also have an alignment modifier:\n\ ! \n\ @table @code\n\ @item l\n\ Left alignment.\n\ @item r\n\ ! Right alignment (default).\n\ @item c\n\ ! Column-aligned (only applicable to command %s).\n\ @end table\n\ \n\ ! The @code{width} parameter is a positive integer specifying the minimum\n\ ! number of columns used for printing. No maximum is needed as the field will\n\ ! auto-expand as required.\n\ ! \n\ ! The parameters @code{left-min} and @code{balance} are only available when the\n\ ! column-aligned modifier is used with the command @samp{%s}.\n\ ! @code{balance} specifies the column number within the field width which will\n\ ! be aligned between entries. Numbering starts from 0 which indicates the\n\ ! leftmost column. @code{left-min} specifies the minimum field width to the\n\ ! left of the specified balance column.\n\ \n\ The default format is\n\ @code{\" %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\\n\"}.\n\ + @seealso{whos}\n\ @end deftypefn") { return SET_INTERNAL_VARIABLE (whos_line_format); diff -cNr octave-3.2.0/src/version.h octave-3.2.2/src/version.h *** octave-3.2.0/src/version.h 2009-06-03 13:55:00.000000000 +0200 --- octave-3.2.2/src/version.h 2009-07-21 06:52:24.000000000 +0200 *************** *** 25,35 **** #if !defined (octave_version_h) #define octave_version_h 1 ! #define OCTAVE_VERSION "3.2.0" #define OCTAVE_API_VERSION "api-v37" ! #define OCTAVE_RELEASE_DATE "2009-06-03" #define OCTAVE_COPYRIGHT "Copyright (C) 2009 John W. Eaton and others." --- 25,35 ---- #if !defined (octave_version_h) #define octave_version_h 1 ! #define OCTAVE_VERSION "3.2.2" #define OCTAVE_API_VERSION "api-v37" ! #define OCTAVE_RELEASE_DATE "2009-07-21" #define OCTAVE_COPYRIGHT "Copyright (C) 2009 John W. Eaton and others." diff -cNr octave-3.2.0/test/ChangeLog octave-3.2.2/test/ChangeLog *** octave-3.2.0/test/ChangeLog 2009-06-03 14:32:51.000000000 +0200 --- octave-3.2.2/test/ChangeLog 2009-07-21 06:52:31.000000000 +0200 *************** *** 1,3 **** --- 1,11 ---- + 2009-07-21 Jaroslav Hajek + + Version 3.2.2 released. + + 2009-06-22 Jaroslav Hajek + + * test_null_assign.m: Fix test. + 2009-05-25 Jaroslav Hajek Version 3.2.0 released. diff -cNr octave-3.2.0/test/test_null_assign.m octave-3.2.2/test/test_null_assign.m *** octave-3.2.0/test/test_null_assign.m 2009-05-25 08:05:00.000000000 +0200 --- octave-3.2.2/test/test_null_assign.m 2009-06-22 07:56:25.000000000 +0200 *************** *** 57,63 **** % subsasgn should work the same way %!test ! %! a = ones (3); subsasgn (a, substruct ('()', {':',1:2}), []); assert (size (a), [3,1]) %!test %! a = ones (3); b = []; fail ("subsasgn (a, substruct ('()', {':',1:2}), b)", ".") --- 57,63 ---- % subsasgn should work the same way %!test ! %! a = ones (3); a = subsasgn (a, substruct ('()', {':',1:2}), []); assert (size (a), [3,1]) %!test %! a = ones (3); b = []; fail ("subsasgn (a, substruct ('()', {':',1:2}), b)", ".") diff -cNr octave-3.2.0/test/test_sparse.m octave-3.2.2/test/test_sparse.m *** octave-3.2.0/test/test_sparse.m 1970-01-01 01:00:00.000000000 +0100 --- octave-3.2.2/test/test_sparse.m 2009-06-26 13:21:45.000000000 +0200 *************** *** 0 **** --- 1,3070 ---- + ## THIS IS AN AUTOMATICALLY GENERATED FILE --- DO NOT EDIT --- + ## instead modify build_sparse_tests.sh to generate the tests that you want. + ## + ## test_sparse + ## + ## run preset sparse tests. All should pass. + function [passes,tests] = test_sparse + disp("writing test output to sptest.log"); + test("test_sparse","normal","sptest.log"); + endfunction + + + # ============================================================== + + + # ============================================================== + + + %!test # segfault test from edd@debian.org + %! n = 510; + %! sparse(kron((1:n)', ones(n,1)), kron(ones(n,1), (1:n)'), ones(n)); + + %% segfault tests from Fabian@isas-berlin.de + %% Note that the last four do not fail, but rather give a warning + %% of a singular matrix, which is consistent with the full matrix + %% behaviour. They are therefore disabled.. + %!testif HAVE_UMFPACK + %! assert(inv(sparse([1,1;1,1+i])),sparse([1-1i,1i;1i,-1i]),10*eps); + % !error inv( sparse( [1,1;1,1] ) ); + % !error inv( sparse( [0,0;0,1] ) ); + % !error inv( sparse( [0,0;0,1+i] ) ); + % !error inv( sparse( [0,0;0,0] ) ); + + %% error handling in constructor + %!error sparse(1,[2,3],[1,2,3]); + %!error sparse([1,1],[1,1],[1,2],3,3,"bogus"); + %!error sparse([1,3],[1,-4],[3,5],2,2); + %!error sparse([1,3],[1,-4],[3,5i],2,2); + %!error sparse(-1,-1,1); + + # ============================================================== + + %!shared bf + %!test bf=realmin; + %% Make sure newly introduced zeros get eaten + %!assert(nnz(sparse([bf,bf,1]).^realmax),1); + %!assert(nnz(sparse([1,bf,bf]).^realmax),1); + %!assert(nnz(sparse([bf,bf,bf]).^realmax),0); + + %!assert(nnz(sparse([bf;bf;1]).^realmax),1); + %!assert(nnz(sparse([1;bf;bf]).^realmax),1); + %!assert(nnz(sparse([0.5;bf;bf]).^realmax),0); + + %!assert(nnz(sparse([bf,bf,1])*realmin),1); + %!assert(nnz(sparse([1,bf,bf])*realmin),1); + %!assert(nnz(sparse([bf,bf,bf])*realmin),0); + + %!assert(nnz(sparse([bf;bf;1])*realmin),1); + %!assert(nnz(sparse([1;bf;bf])*realmin),1); + %!assert(nnz(sparse([bf;bf;bf])*realmin),0); + + %!test bf=realmin+realmin*1i; + %% Make sure newly introduced zeros get eaten + %!assert(nnz(sparse([bf,bf,1]).^realmax),1); + %!assert(nnz(sparse([1,bf,bf]).^realmax),1); + %!assert(nnz(sparse([bf,bf,bf]).^realmax),0); + + %!assert(nnz(sparse([bf;bf;1]).^realmax),1); + %!assert(nnz(sparse([1;bf;bf]).^realmax),1); + %!assert(nnz(sparse([0.5;bf;bf]).^realmax),0); + + %!assert(nnz(sparse([bf,bf,1])*realmin),1); + %!assert(nnz(sparse([1,bf,bf])*realmin),1); + %!assert(nnz(sparse([bf,bf,bf])*realmin),0); + + %!assert(nnz(sparse([bf;bf;1])*realmin),1); + %!assert(nnz(sparse([1;bf;bf])*realmin),1); + %!assert(nnz(sparse([bf;bf;bf])*realmin),0); + + %!assert(nnz(sparse([-1,realmin,realmin]).^1.5),1); + %!assert(nnz(sparse([-1,realmin,realmin,1]).^1.5),2); + + %!assert(nnz(sparse(1,1,0)),0); # Make sure scalar v==0 doesn't confuse matters + %!assert(nnz(sparse(eye(3))*0),0); + %!assert(nnz(sparse(eye(3))-sparse(eye(3))),0); + + %!test + %! wdbz = warning ("query", "Octave:divide-by-zero"); + %! warning ("off", "Octave:divide-by-zero"); + %! assert(full(sparse(eye(3))/0),full(eye(3)/0)); + %! warning (wdbz.state, "Octave:divide-by-zero"); + + + # ============================================================== + + %!shared as,af,bs,bf + %!test af=[1+1i,2-1i,0,0;0,0,0,3+2i;0,0,0,4]; + %!test bf=3; + %!test as=sparse(af); + %!test bs=bf; + %% Elementwise binary tests (uses as,af,bs,bf,scalar) + %!assert(as==bs,sparse(af==bf)) + %!assert(bf==as,sparse(bf==af)) + + %!assert(as!=bf,sparse(af!=bf)) + %!assert(bf!=as,sparse(bf!=af)) + + %!assert(as+bf,af+bf) + %!assert(bf+as,bf+af) + + %!assert(as-bf,af-bf) + %!assert(bf-as,bf-af) + + %!assert(as.*bf,sparse(af.*bf)) + %!assert(bf.*as,sparse(bf.*af)) + + %!assert(as./bf,sparse(af./bf),100*eps) + %!assert(bf.\as,sparse(bf.\af),100*eps) + + %!test + %! sv = as.^bf; + %! fv = af.^bf; + %! idx = find(af~=0); + %! assert(sv(:)(idx),sparse(fv(:)(idx)),100*eps) + + %% real values can be ordered (uses as,af) + %!assert(as<=bf,sparse(af<=bf)) + %!assert(bf<=as,sparse(bf<=af)) + + %!assert(as>=bf,sparse(af>=bf)) + %!assert(bf>=as,sparse(bf>=af)) + + %!assert(asbf,sparse(af>bf)) + %!assert(bf>as,sparse(bf>af)) + + %!test bf=bf+1i; + %!test bs=bf; + %% Elementwise binary tests (uses as,af,bs,bf,scalar) + %!assert(as==bs,sparse(af==bf)) + %!assert(bf==as,sparse(bf==af)) + + %!assert(as!=bf,sparse(af!=bf)) + %!assert(bf!=as,sparse(bf!=af)) + + %!assert(as+bf,af+bf) + %!assert(bf+as,bf+af) + + %!assert(as-bf,af-bf) + %!assert(bf-as,bf-af) + + %!assert(as.*bf,sparse(af.*bf)) + %!assert(bf.*as,sparse(bf.*af)) + + %!assert(as./bf,sparse(af./bf),100*eps) + %!assert(bf.\as,sparse(bf.\af),100*eps) + + %!test + %! sv = as.^bf; + %! fv = af.^bf; + %! idx = find(af~=0); + %! assert(sv(:)(idx),sparse(fv(:)(idx)),100*eps) + + + # ============================================================== + + %!test af=[1+1i,2-1i,0,0;0,0,0,3+2i;0,0,0,4]; + %!test bf=[0,1-1i,0,0;2+1i,0,0,0;3-1i,2+3i,0,0]; + %!test as=sparse(af); + %!test bs=sparse(bf); + %% Unary matrix tests (uses af,as) + %!assert(abs(as),sparse(abs(af))) + %!assert(acos(as),sparse(acos(af))) + %!assert(acosh(as),sparse(acosh(af))) + %!assert(angle(as),sparse(angle(af))) + %!assert(arg(as),sparse(arg(af))) + %!assert(asin(as),sparse(asin(af))) + %!assert(asinh(as),sparse(asinh(af))) + %!assert(atan(as),sparse(atan(af))) + %!assert(atanh(as),sparse(atanh(af))) + %!assert(ceil(as),sparse(ceil(af))) + %!assert(conj(as),sparse(conj(af))) + %!assert(cos(as),sparse(cos(af))) + %!assert(cosh(as),sparse(cosh(af))) + %!assert(exp(as),sparse(exp(af))) + %!assert(finite(as),sparse(finite(af))) + %!assert(fix(as),sparse(fix(af))) + %!assert(floor(as),sparse(floor(af))) + %!assert(imag(as),sparse(imag(af))) + %!assert(isinf(as),sparse(isinf(af))) + %!assert(isna(as),sparse(isna(af))) + %!assert(isnan(as),sparse(isnan(af))) + %!assert(log(as),sparse(log(af))) + %!assert(real(as),sparse(real(af))) + %!assert(round(as),sparse(round(af))) + %!assert(sign(as),sparse(sign(af))) + %!assert(sin(as),sparse(sin(af))) + %!assert(sinh(as),sparse(sinh(af))) + %!assert(sqrt(as),sparse(sqrt(af))) + %!assert(tan(as),sparse(tan(af))) + %!assert(tanh(as),sparse(tanh(af))) + %!assert(issparse(abs(as))&&isreal(abs(as))) + %!assert(issparse(real(as))&&isreal(real(as))) + %!assert(issparse(imag(as))&&isreal(imag(as))) + + %% Unary matrix tests (uses af,as) + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (1) + %! assert(erf(as),sparse(erf(af))) + %! else + %! assert(erf(as),erf(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (1) + %! assert(erfc(as),sparse(erfc(af))) + %! else + %! assert(erfc(as),erfc(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isalnum(as),sparse(isalnum(af))) + %! else + %! assert(isalnum(as),isalnum(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isalpha(as),sparse(isalpha(af))) + %! else + %! assert(isalpha(as),isalpha(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isascii(as),sparse(isascii(af))) + %! else + %! assert(isascii(as),isascii(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(iscntrl(as),sparse(iscntrl(af))) + %! else + %! assert(iscntrl(as),iscntrl(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isdigit(as),sparse(isdigit(af))) + %! else + %! assert(isdigit(as),isdigit(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isgraph(as),sparse(isgraph(af))) + %! else + %! assert(isgraph(as),isgraph(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(islower(as),sparse(islower(af))) + %! else + %! assert(islower(as),islower(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isprint(as),sparse(isprint(af))) + %! else + %! assert(isprint(as),isprint(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(ispunct(as),sparse(ispunct(af))) + %! else + %! assert(ispunct(as),ispunct(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isspace(as),sparse(isspace(af))) + %! else + %! assert(isspace(as),isspace(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isupper(as),sparse(isupper(af))) + %! else + %! assert(isupper(as),isupper(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isxdigit(as),sparse(isxdigit(af))) + %! else + %! assert(isxdigit(as),isxdigit(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + + %% These mapper functions always return a full matrix + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! assert(toascii(as),toascii(af)) + %! assert(tolower(as),tolower(af)) + %! assert(toupper(as),toupper(af)) + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %% Unary matrix tests (uses af,as) + %!assert(issparse(as)) + %!assert(!issparse(af)) + %!assert(!(issparse(af)&&iscomplex(af))) + %!assert(!(issparse(af)&&isreal(af))) + %!assert(sum(as),sparse(sum(af))) + %!assert(sum(as,1),sparse(sum(af,1))) + %!assert(sum(as,2),sparse(sum(af,2))) + %!assert(cumsum(as),sparse(cumsum(af))) + %!assert(cumsum(as,1),sparse(cumsum(af,1))) + %!assert(cumsum(as,2),sparse(cumsum(af,2))) + %!assert(sumsq(as),sparse(sumsq(af))) + %!assert(sumsq(as,1),sparse(sumsq(af,1))) + %!assert(sumsq(as,2),sparse(sumsq(af,2))) + %!assert(prod(as),sparse(prod(af))) + %!assert(prod(as,1),sparse(prod(af,1))) + %!assert(prod(as,2),sparse(prod(af,2))) + %!assert(cumprod(as),sparse(cumprod(af))) + %!assert(cumprod(as,1),sparse(cumprod(af,1))) + %!assert(cumprod(as,2),sparse(cumprod(af,2))) + + %!assert(min(as),sparse(min(af))) + %!assert(full(min(as(:))),min(af(:))) + %!assert(min(as,[],1),sparse(min(af,[],1))) + %!assert(min(as,[],2),sparse(min(af,[],2))) + %!assert(min(as,[],1),sparse(min(af,[],1))) + %!assert(min(as,0),sparse(min(af,0))) + %!assert(min(as,bs),sparse(min(af,bf))) + %!assert(max(as),sparse(max(af))) + %!assert(full(max(as(:))),max(af(:))) + %!assert(max(as,[],1),sparse(max(af,[],1))) + %!assert(max(as,[],2),sparse(max(af,[],2))) + %!assert(max(as,[],1),sparse(max(af,[],1))) + %!assert(max(as,0),sparse(max(af,0))) + %!assert(max(as,bs),sparse(max(af,bf))) + + %!assert(as==as) + %!assert(as==af) + %!assert(af==as) + %!test + %! [ii,jj,vv,nr,nc] = find(as); + %! assert(af,full(sparse(ii,jj,vv,nr,nc))); + %!assert(nnz(as),sum(af(:)!=0)) + %!assert(nnz(as),nnz(af)) + %!assert(issparse(as.')) + %!assert(issparse(as')) + %!assert(issparse(-as)) + %!assert(~as,sparse(~af)) + %!assert(as.', sparse(af.')); + %!assert(as', sparse(af')); + %!assert(-as, sparse(-af)); + %!assert(~as, sparse(~af)); + %!error [i,j]=size(af);as(i-1,j+1); + %!error [i,j]=size(af);as(i+1,j-1); + %!test + %! [Is,Js,Vs] = find(as); + %! [If,Jf,Vf] = find(af); + %! assert(Is,If); + %! assert(Js,Jf); + %! assert(Vs,Vf); + %!error as(0,1); + %!error as(1,0); + %!assert(find(as),find(af)) + %!test + %! [i,j,v] = find(as); + %! [m,n] = size(as); + %! x = sparse(i,j,v,m,n); + %! assert(x,as); + %!test + %! [i,j,v,m,n] = find(as); + %! x = sparse(i,j,v,m,n); + %! assert(x,as); + %!assert(issparse(horzcat(as,as))); + %!assert(issparse(vertcat(as,as))); + %!assert(issparse(cat(1,as,as))); + %!assert(issparse(cat(2,as,as))); + %!assert(issparse([as,as])); + %!assert(issparse([as;as])); + %!assert(horzcat(as,as), sparse([af,af])); + %!assert(vertcat(as,as), sparse([af;af])); + %!assert(horzcat(as,as,as), sparse([af,af,af])); + %!assert(vertcat(as,as,as), sparse([af;af;af])); + %!assert([as,as], sparse([af,af])); + %!assert([as;as], sparse([af;af])); + %!assert([as,as,as], sparse([af,af,af])); + %!assert([as;as;as], sparse([af;af;af])); + %!assert(cat(2,as,as), sparse([af,af])); + %!assert(cat(1,as,as), sparse([af;af])); + %!assert(cat(2,as,as,as), sparse([af,af,af])); + %!assert(cat(1,as,as,as), sparse([af;af;af])); + %!assert(issparse([as,af])); + %!assert(issparse([af,as])); + %!assert([as,af], sparse([af,af])); + %!assert([as;af], sparse([af;af])); + + %% Elementwise binary tests (uses as,af,bs,bf,scalar) + %!assert(as==bs,sparse(af==bf)) + %!assert(bf==as,sparse(bf==af)) + + %!assert(as!=bf,sparse(af!=bf)) + %!assert(bf!=as,sparse(bf!=af)) + + %!assert(as+bf,af+bf) + %!assert(bf+as,bf+af) + + %!assert(as-bf,af-bf) + %!assert(bf-as,bf-af) + + %!assert(as.*bf,sparse(af.*bf)) + %!assert(bf.*as,sparse(bf.*af)) + + %!assert(as./bf,sparse(af./bf),100*eps) + %!assert(bf.\as,sparse(bf.\af),100*eps) + + %!test + %! sv = as.^bf; + %! fv = af.^bf; + %! idx = find(af~=0); + %! assert(sv(:)(idx),sparse(fv(:)(idx)),100*eps) + + %!assert(as==bs,sparse(af==bf)) + %!assert(as!=bs,sparse(af!=bf)) + %!assert(as+bs,sparse(af+bf)) + %!assert(as-bs,sparse(af-bf)) + %!assert(as.*bs,sparse(af.*bf)) + %!xtest assert(as./bs,sparse(af./bf),100*eps); + %!test + %! sv = as.^bs; + %! fv = af.^bf; + %! idx = find(af~=0); + %! assert(sv(:)(idx),sparse(fv(:)(idx)),100*eps) + + %% Matrix-matrix operators (uses af,as,bs,bf) + %!assert(as*bf',af*bf') + %!assert(af*bs',af*bf') + %!assert(as*bs',sparse(af*bf')) + + %% Matrix diagonal tests (uses af,as,bf,bs) + %!assert(diag(as),sparse(diag(af))) + %!assert(diag(bs),sparse(diag(bf))) + %!assert(diag(as,1),sparse(diag(af,1))) + %!assert(diag(bs,1),sparse(diag(bf,1))) + %!assert(diag(as,-1),sparse(diag(af,-1))) + %!assert(diag(bs,-1),sparse(diag(bf,-1))) + %!assert(diag(as(:)),sparse(diag(af(:)))) + %!assert(diag(as(:),1),sparse(diag(af(:),1))) + %!assert(diag(as(:),-1),sparse(diag(af(:),-1))) + %!assert(diag(as(:)'),sparse(diag(af(:)'))) + %!assert(diag(as(:)',1),sparse(diag(af(:)',1))) + %!assert(diag(as(:)',-1),sparse(diag(af(:)',-1))) + %!assert(spdiags(as,[0,1]),[diag(af,0),diag(af,1)]) + %!test [tb,tc]=spdiags(as); + %! assert(spdiags(tb,tc,sparse(zeros(size(as)))),as) + %! assert(spdiags(tb,tc,size(as,1),size(as,2)),as) + + %% Matrix diagonal tests (uses af,as,bf,bs) + %!assert(reshape(as,1,prod(size(as))),sparse(reshape(af,1,prod(size(af))))) + %!assert(reshape(as,prod(size(as)),1),sparse(reshape(af,prod(size(af)),1))) + %!assert(reshape(as,fliplr(size(as))),sparse(reshape(af,fliplr(size(af))))) + %!assert(reshape(bs,1,prod(size(as))),sparse(reshape(bf,1,prod(size(af))))) + %!assert(reshape(bs,prod(size(as)),1),sparse(reshape(bf,prod(size(af)),1))) + %!assert(reshape(bs,fliplr(size(as))),sparse(reshape(bf,fliplr(size(af))))) + + %!testif HAVE_UMFPACK ;# permuted LU + %! [L,U] = lu(bs); + %! assert(L*U,bs,1e-10); + + %!testif HAVE_UMFPACK ;# simple LU + row permutations + %! [L,U,P] = lu(bs); + %! assert(P'*L*U,bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# simple LU + row/col permutations + %! [L,U,P,Q] = lu(bs); + %! assert(P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with vector permutations + %! [L,U,P,Q] = lu(bs,'vector'); + %! assert(L(P,:)*U(:,Q),bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with scaling + %! [L,U,P,Q,R] = lu(bs); + %! assert(R*P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + + # ============================================================== + + %!test # save ascii + %! savefile= tmpnam(); + %! as_save=as; save("-text",savefile,"bf","as_save","af"); + %! clear as_save; + %! load(savefile,"as_save"); + %! unlink(savefile); + %! assert(as_save,sparse(af)); + %!test # save binary + %! savefile= tmpnam(); + %! as_save=as; save("-binary",savefile,"bf","as_save","af"); + %! clear as_save; + %! load(savefile,"as_save"); + %! unlink(savefile); + %! assert(as_save,sparse(af)); + %!testif HAVE_HDF5 # save hdf5 + %! savefile= tmpnam(); + %! as_save=as; save("-hdf5",savefile,"bf","as_save","af"); + %! clear as_save; + %! load(savefile,"as_save"); + %! unlink(savefile); + %! assert(as_save,sparse(af)); + ## FIXME -- we should skip (or mark as an expected failure) the test for + ## saving sparse matrices to MAT files when using 64-bit indexing since + ## that is not implemented yet. + %!test # save matlab + %! savefile= tmpnam(); + %! as_save=as; save("-mat",savefile,"bf","as_save","af"); + %! clear as_save; + %! load(savefile,"as_save"); + %! unlink(savefile); + %! assert(as_save,sparse(af)); + + # ============================================================== + + %!test bf=real(bf); + %!test as=sparse(af); + %!test bs=sparse(bf); + %% Unary matrix tests (uses af,as) + %!assert(abs(as),sparse(abs(af))) + %!assert(acos(as),sparse(acos(af))) + %!assert(acosh(as),sparse(acosh(af))) + %!assert(angle(as),sparse(angle(af))) + %!assert(arg(as),sparse(arg(af))) + %!assert(asin(as),sparse(asin(af))) + %!assert(asinh(as),sparse(asinh(af))) + %!assert(atan(as),sparse(atan(af))) + %!assert(atanh(as),sparse(atanh(af))) + %!assert(ceil(as),sparse(ceil(af))) + %!assert(conj(as),sparse(conj(af))) + %!assert(cos(as),sparse(cos(af))) + %!assert(cosh(as),sparse(cosh(af))) + %!assert(exp(as),sparse(exp(af))) + %!assert(finite(as),sparse(finite(af))) + %!assert(fix(as),sparse(fix(af))) + %!assert(floor(as),sparse(floor(af))) + %!assert(imag(as),sparse(imag(af))) + %!assert(isinf(as),sparse(isinf(af))) + %!assert(isna(as),sparse(isna(af))) + %!assert(isnan(as),sparse(isnan(af))) + %!assert(log(as),sparse(log(af))) + %!assert(real(as),sparse(real(af))) + %!assert(round(as),sparse(round(af))) + %!assert(sign(as),sparse(sign(af))) + %!assert(sin(as),sparse(sin(af))) + %!assert(sinh(as),sparse(sinh(af))) + %!assert(sqrt(as),sparse(sqrt(af))) + %!assert(tan(as),sparse(tan(af))) + %!assert(tanh(as),sparse(tanh(af))) + %!assert(issparse(abs(as))&&isreal(abs(as))) + %!assert(issparse(real(as))&&isreal(real(as))) + %!assert(issparse(imag(as))&&isreal(imag(as))) + + %% Unary matrix tests (uses af,as) + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (1) + %! assert(erf(as),sparse(erf(af))) + %! else + %! assert(erf(as),erf(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (1) + %! assert(erfc(as),sparse(erfc(af))) + %! else + %! assert(erfc(as),erfc(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isalnum(as),sparse(isalnum(af))) + %! else + %! assert(isalnum(as),isalnum(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isalpha(as),sparse(isalpha(af))) + %! else + %! assert(isalpha(as),isalpha(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isascii(as),sparse(isascii(af))) + %! else + %! assert(isascii(as),isascii(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(iscntrl(as),sparse(iscntrl(af))) + %! else + %! assert(iscntrl(as),iscntrl(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isdigit(as),sparse(isdigit(af))) + %! else + %! assert(isdigit(as),isdigit(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isgraph(as),sparse(isgraph(af))) + %! else + %! assert(isgraph(as),isgraph(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(islower(as),sparse(islower(af))) + %! else + %! assert(islower(as),islower(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isprint(as),sparse(isprint(af))) + %! else + %! assert(isprint(as),isprint(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(ispunct(as),sparse(ispunct(af))) + %! else + %! assert(ispunct(as),ispunct(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isspace(as),sparse(isspace(af))) + %! else + %! assert(isspace(as),isspace(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isupper(as),sparse(isupper(af))) + %! else + %! assert(isupper(as),isupper(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isxdigit(as),sparse(isxdigit(af))) + %! else + %! assert(isxdigit(as),isxdigit(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + + %% These mapper functions always return a full matrix + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! assert(toascii(as),toascii(af)) + %! assert(tolower(as),tolower(af)) + %! assert(toupper(as),toupper(af)) + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %% Unary matrix tests (uses af,as) + %!assert(issparse(as)) + %!assert(!issparse(af)) + %!assert(!(issparse(af)&&iscomplex(af))) + %!assert(!(issparse(af)&&isreal(af))) + %!assert(sum(as),sparse(sum(af))) + %!assert(sum(as,1),sparse(sum(af,1))) + %!assert(sum(as,2),sparse(sum(af,2))) + %!assert(cumsum(as),sparse(cumsum(af))) + %!assert(cumsum(as,1),sparse(cumsum(af,1))) + %!assert(cumsum(as,2),sparse(cumsum(af,2))) + %!assert(sumsq(as),sparse(sumsq(af))) + %!assert(sumsq(as,1),sparse(sumsq(af,1))) + %!assert(sumsq(as,2),sparse(sumsq(af,2))) + %!assert(prod(as),sparse(prod(af))) + %!assert(prod(as,1),sparse(prod(af,1))) + %!assert(prod(as,2),sparse(prod(af,2))) + %!assert(cumprod(as),sparse(cumprod(af))) + %!assert(cumprod(as,1),sparse(cumprod(af,1))) + %!assert(cumprod(as,2),sparse(cumprod(af,2))) + + %!assert(min(as),sparse(min(af))) + %!assert(full(min(as(:))),min(af(:))) + %!assert(min(as,[],1),sparse(min(af,[],1))) + %!assert(min(as,[],2),sparse(min(af,[],2))) + %!assert(min(as,[],1),sparse(min(af,[],1))) + %!assert(min(as,0),sparse(min(af,0))) + %!assert(min(as,bs),sparse(min(af,bf))) + %!assert(max(as),sparse(max(af))) + %!assert(full(max(as(:))),max(af(:))) + %!assert(max(as,[],1),sparse(max(af,[],1))) + %!assert(max(as,[],2),sparse(max(af,[],2))) + %!assert(max(as,[],1),sparse(max(af,[],1))) + %!assert(max(as,0),sparse(max(af,0))) + %!assert(max(as,bs),sparse(max(af,bf))) + + %!assert(as==as) + %!assert(as==af) + %!assert(af==as) + %!test + %! [ii,jj,vv,nr,nc] = find(as); + %! assert(af,full(sparse(ii,jj,vv,nr,nc))); + %!assert(nnz(as),sum(af(:)!=0)) + %!assert(nnz(as),nnz(af)) + %!assert(issparse(as.')) + %!assert(issparse(as')) + %!assert(issparse(-as)) + %!assert(~as,sparse(~af)) + %!assert(as.', sparse(af.')); + %!assert(as', sparse(af')); + %!assert(-as, sparse(-af)); + %!assert(~as, sparse(~af)); + %!error [i,j]=size(af);as(i-1,j+1); + %!error [i,j]=size(af);as(i+1,j-1); + %!test + %! [Is,Js,Vs] = find(as); + %! [If,Jf,Vf] = find(af); + %! assert(Is,If); + %! assert(Js,Jf); + %! assert(Vs,Vf); + %!error as(0,1); + %!error as(1,0); + %!assert(find(as),find(af)) + %!test + %! [i,j,v] = find(as); + %! [m,n] = size(as); + %! x = sparse(i,j,v,m,n); + %! assert(x,as); + %!test + %! [i,j,v,m,n] = find(as); + %! x = sparse(i,j,v,m,n); + %! assert(x,as); + %!assert(issparse(horzcat(as,as))); + %!assert(issparse(vertcat(as,as))); + %!assert(issparse(cat(1,as,as))); + %!assert(issparse(cat(2,as,as))); + %!assert(issparse([as,as])); + %!assert(issparse([as;as])); + %!assert(horzcat(as,as), sparse([af,af])); + %!assert(vertcat(as,as), sparse([af;af])); + %!assert(horzcat(as,as,as), sparse([af,af,af])); + %!assert(vertcat(as,as,as), sparse([af;af;af])); + %!assert([as,as], sparse([af,af])); + %!assert([as;as], sparse([af;af])); + %!assert([as,as,as], sparse([af,af,af])); + %!assert([as;as;as], sparse([af;af;af])); + %!assert(cat(2,as,as), sparse([af,af])); + %!assert(cat(1,as,as), sparse([af;af])); + %!assert(cat(2,as,as,as), sparse([af,af,af])); + %!assert(cat(1,as,as,as), sparse([af;af;af])); + %!assert(issparse([as,af])); + %!assert(issparse([af,as])); + %!assert([as,af], sparse([af,af])); + %!assert([as;af], sparse([af;af])); + + %% Elementwise binary tests (uses as,af,bs,bf,scalar) + %!assert(as==bs,sparse(af==bf)) + %!assert(bf==as,sparse(bf==af)) + + %!assert(as!=bf,sparse(af!=bf)) + %!assert(bf!=as,sparse(bf!=af)) + + %!assert(as+bf,af+bf) + %!assert(bf+as,bf+af) + + %!assert(as-bf,af-bf) + %!assert(bf-as,bf-af) + + %!assert(as.*bf,sparse(af.*bf)) + %!assert(bf.*as,sparse(bf.*af)) + + %!assert(as./bf,sparse(af./bf),100*eps) + %!assert(bf.\as,sparse(bf.\af),100*eps) + + %!test + %! sv = as.^bf; + %! fv = af.^bf; + %! idx = find(af~=0); + %! assert(sv(:)(idx),sparse(fv(:)(idx)),100*eps) + + %!assert(as==bs,sparse(af==bf)) + %!assert(as!=bs,sparse(af!=bf)) + %!assert(as+bs,sparse(af+bf)) + %!assert(as-bs,sparse(af-bf)) + %!assert(as.*bs,sparse(af.*bf)) + %!xtest assert(as./bs,sparse(af./bf),100*eps); + %!test + %! sv = as.^bs; + %! fv = af.^bf; + %! idx = find(af~=0); + %! assert(sv(:)(idx),sparse(fv(:)(idx)),100*eps) + + %% Matrix-matrix operators (uses af,as,bs,bf) + %!assert(as*bf',af*bf') + %!assert(af*bs',af*bf') + %!assert(as*bs',sparse(af*bf')) + + %% Matrix diagonal tests (uses af,as,bf,bs) + %!assert(diag(as),sparse(diag(af))) + %!assert(diag(bs),sparse(diag(bf))) + %!assert(diag(as,1),sparse(diag(af,1))) + %!assert(diag(bs,1),sparse(diag(bf,1))) + %!assert(diag(as,-1),sparse(diag(af,-1))) + %!assert(diag(bs,-1),sparse(diag(bf,-1))) + %!assert(diag(as(:)),sparse(diag(af(:)))) + %!assert(diag(as(:),1),sparse(diag(af(:),1))) + %!assert(diag(as(:),-1),sparse(diag(af(:),-1))) + %!assert(diag(as(:)'),sparse(diag(af(:)'))) + %!assert(diag(as(:)',1),sparse(diag(af(:)',1))) + %!assert(diag(as(:)',-1),sparse(diag(af(:)',-1))) + %!assert(spdiags(as,[0,1]),[diag(af,0),diag(af,1)]) + %!test [tb,tc]=spdiags(as); + %! assert(spdiags(tb,tc,sparse(zeros(size(as)))),as) + %! assert(spdiags(tb,tc,size(as,1),size(as,2)),as) + + %% Matrix diagonal tests (uses af,as,bf,bs) + %!assert(reshape(as,1,prod(size(as))),sparse(reshape(af,1,prod(size(af))))) + %!assert(reshape(as,prod(size(as)),1),sparse(reshape(af,prod(size(af)),1))) + %!assert(reshape(as,fliplr(size(as))),sparse(reshape(af,fliplr(size(af))))) + %!assert(reshape(bs,1,prod(size(as))),sparse(reshape(bf,1,prod(size(af))))) + %!assert(reshape(bs,prod(size(as)),1),sparse(reshape(bf,prod(size(af)),1))) + %!assert(reshape(bs,fliplr(size(as))),sparse(reshape(bf,fliplr(size(af))))) + + %!testif HAVE_UMFPACK ;# permuted LU + %! [L,U] = lu(bs); + %! assert(L*U,bs,1e-10); + + %!testif HAVE_UMFPACK ;# simple LU + row permutations + %! [L,U,P] = lu(bs); + %! assert(P'*L*U,bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# simple LU + row/col permutations + %! [L,U,P,Q] = lu(bs); + %! assert(P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with vector permutations + %! [L,U,P,Q] = lu(bs,'vector'); + %! assert(L(P,:)*U(:,Q),bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with scaling + %! [L,U,P,Q,R] = lu(bs); + %! assert(R*P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + + # ============================================================== + + %!assert(as<=bs,sparse(af<=bf)) + %!assert(as>=bs,sparse(af>=bf)) + %!assert(asbs,sparse(af>bf)) + + # ============================================================== + + %!test af=real(af); + %!test as=sparse(af); + %!test bs=sparse(bf); + %% Unary matrix tests (uses af,as) + %!assert(abs(as),sparse(abs(af))) + %!assert(acos(as),sparse(acos(af))) + %!assert(acosh(as),sparse(acosh(af))) + %!assert(angle(as),sparse(angle(af))) + %!assert(arg(as),sparse(arg(af))) + %!assert(asin(as),sparse(asin(af))) + %!assert(asinh(as),sparse(asinh(af))) + %!assert(atan(as),sparse(atan(af))) + %!assert(atanh(as),sparse(atanh(af))) + %!assert(ceil(as),sparse(ceil(af))) + %!assert(conj(as),sparse(conj(af))) + %!assert(cos(as),sparse(cos(af))) + %!assert(cosh(as),sparse(cosh(af))) + %!assert(exp(as),sparse(exp(af))) + %!assert(finite(as),sparse(finite(af))) + %!assert(fix(as),sparse(fix(af))) + %!assert(floor(as),sparse(floor(af))) + %!assert(imag(as),sparse(imag(af))) + %!assert(isinf(as),sparse(isinf(af))) + %!assert(isna(as),sparse(isna(af))) + %!assert(isnan(as),sparse(isnan(af))) + %!assert(log(as),sparse(log(af))) + %!assert(real(as),sparse(real(af))) + %!assert(round(as),sparse(round(af))) + %!assert(sign(as),sparse(sign(af))) + %!assert(sin(as),sparse(sin(af))) + %!assert(sinh(as),sparse(sinh(af))) + %!assert(sqrt(as),sparse(sqrt(af))) + %!assert(tan(as),sparse(tan(af))) + %!assert(tanh(as),sparse(tanh(af))) + %!assert(issparse(abs(as))&&isreal(abs(as))) + %!assert(issparse(real(as))&&isreal(real(as))) + %!assert(issparse(imag(as))&&isreal(imag(as))) + + %% Unary matrix tests (uses af,as) + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (1) + %! assert(erf(as),sparse(erf(af))) + %! else + %! assert(erf(as),erf(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (1) + %! assert(erfc(as),sparse(erfc(af))) + %! else + %! assert(erfc(as),erfc(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isalnum(as),sparse(isalnum(af))) + %! else + %! assert(isalnum(as),isalnum(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isalpha(as),sparse(isalpha(af))) + %! else + %! assert(isalpha(as),isalpha(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isascii(as),sparse(isascii(af))) + %! else + %! assert(isascii(as),isascii(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(iscntrl(as),sparse(iscntrl(af))) + %! else + %! assert(iscntrl(as),iscntrl(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isdigit(as),sparse(isdigit(af))) + %! else + %! assert(isdigit(as),isdigit(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isgraph(as),sparse(isgraph(af))) + %! else + %! assert(isgraph(as),isgraph(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(islower(as),sparse(islower(af))) + %! else + %! assert(islower(as),islower(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isprint(as),sparse(isprint(af))) + %! else + %! assert(isprint(as),isprint(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(ispunct(as),sparse(ispunct(af))) + %! else + %! assert(ispunct(as),ispunct(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isspace(as),sparse(isspace(af))) + %! else + %! assert(isspace(as),isspace(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isupper(as),sparse(isupper(af))) + %! else + %! assert(isupper(as),isupper(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isxdigit(as),sparse(isxdigit(af))) + %! else + %! assert(isxdigit(as),isxdigit(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + + %% These mapper functions always return a full matrix + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! assert(toascii(as),toascii(af)) + %! assert(tolower(as),tolower(af)) + %! assert(toupper(as),toupper(af)) + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %% Unary matrix tests (uses af,as) + %!assert(issparse(as)) + %!assert(!issparse(af)) + %!assert(!(issparse(af)&&iscomplex(af))) + %!assert(!(issparse(af)&&isreal(af))) + %!assert(sum(as),sparse(sum(af))) + %!assert(sum(as,1),sparse(sum(af,1))) + %!assert(sum(as,2),sparse(sum(af,2))) + %!assert(cumsum(as),sparse(cumsum(af))) + %!assert(cumsum(as,1),sparse(cumsum(af,1))) + %!assert(cumsum(as,2),sparse(cumsum(af,2))) + %!assert(sumsq(as),sparse(sumsq(af))) + %!assert(sumsq(as,1),sparse(sumsq(af,1))) + %!assert(sumsq(as,2),sparse(sumsq(af,2))) + %!assert(prod(as),sparse(prod(af))) + %!assert(prod(as,1),sparse(prod(af,1))) + %!assert(prod(as,2),sparse(prod(af,2))) + %!assert(cumprod(as),sparse(cumprod(af))) + %!assert(cumprod(as,1),sparse(cumprod(af,1))) + %!assert(cumprod(as,2),sparse(cumprod(af,2))) + + %!assert(min(as),sparse(min(af))) + %!assert(full(min(as(:))),min(af(:))) + %!assert(min(as,[],1),sparse(min(af,[],1))) + %!assert(min(as,[],2),sparse(min(af,[],2))) + %!assert(min(as,[],1),sparse(min(af,[],1))) + %!assert(min(as,0),sparse(min(af,0))) + %!assert(min(as,bs),sparse(min(af,bf))) + %!assert(max(as),sparse(max(af))) + %!assert(full(max(as(:))),max(af(:))) + %!assert(max(as,[],1),sparse(max(af,[],1))) + %!assert(max(as,[],2),sparse(max(af,[],2))) + %!assert(max(as,[],1),sparse(max(af,[],1))) + %!assert(max(as,0),sparse(max(af,0))) + %!assert(max(as,bs),sparse(max(af,bf))) + + %!assert(as==as) + %!assert(as==af) + %!assert(af==as) + %!test + %! [ii,jj,vv,nr,nc] = find(as); + %! assert(af,full(sparse(ii,jj,vv,nr,nc))); + %!assert(nnz(as),sum(af(:)!=0)) + %!assert(nnz(as),nnz(af)) + %!assert(issparse(as.')) + %!assert(issparse(as')) + %!assert(issparse(-as)) + %!assert(~as,sparse(~af)) + %!assert(as.', sparse(af.')); + %!assert(as', sparse(af')); + %!assert(-as, sparse(-af)); + %!assert(~as, sparse(~af)); + %!error [i,j]=size(af);as(i-1,j+1); + %!error [i,j]=size(af);as(i+1,j-1); + %!test + %! [Is,Js,Vs] = find(as); + %! [If,Jf,Vf] = find(af); + %! assert(Is,If); + %! assert(Js,Jf); + %! assert(Vs,Vf); + %!error as(0,1); + %!error as(1,0); + %!assert(find(as),find(af)) + %!test + %! [i,j,v] = find(as); + %! [m,n] = size(as); + %! x = sparse(i,j,v,m,n); + %! assert(x,as); + %!test + %! [i,j,v,m,n] = find(as); + %! x = sparse(i,j,v,m,n); + %! assert(x,as); + %!assert(issparse(horzcat(as,as))); + %!assert(issparse(vertcat(as,as))); + %!assert(issparse(cat(1,as,as))); + %!assert(issparse(cat(2,as,as))); + %!assert(issparse([as,as])); + %!assert(issparse([as;as])); + %!assert(horzcat(as,as), sparse([af,af])); + %!assert(vertcat(as,as), sparse([af;af])); + %!assert(horzcat(as,as,as), sparse([af,af,af])); + %!assert(vertcat(as,as,as), sparse([af;af;af])); + %!assert([as,as], sparse([af,af])); + %!assert([as;as], sparse([af;af])); + %!assert([as,as,as], sparse([af,af,af])); + %!assert([as;as;as], sparse([af;af;af])); + %!assert(cat(2,as,as), sparse([af,af])); + %!assert(cat(1,as,as), sparse([af;af])); + %!assert(cat(2,as,as,as), sparse([af,af,af])); + %!assert(cat(1,as,as,as), sparse([af;af;af])); + %!assert(issparse([as,af])); + %!assert(issparse([af,as])); + %!assert([as,af], sparse([af,af])); + %!assert([as;af], sparse([af;af])); + + %% Elementwise binary tests (uses as,af,bs,bf,scalar) + %!assert(as==bs,sparse(af==bf)) + %!assert(bf==as,sparse(bf==af)) + + %!assert(as!=bf,sparse(af!=bf)) + %!assert(bf!=as,sparse(bf!=af)) + + %!assert(as+bf,af+bf) + %!assert(bf+as,bf+af) + + %!assert(as-bf,af-bf) + %!assert(bf-as,bf-af) + + %!assert(as.*bf,sparse(af.*bf)) + %!assert(bf.*as,sparse(bf.*af)) + + %!assert(as./bf,sparse(af./bf),100*eps) + %!assert(bf.\as,sparse(bf.\af),100*eps) + + %!test + %! sv = as.^bf; + %! fv = af.^bf; + %! idx = find(af~=0); + %! assert(sv(:)(idx),sparse(fv(:)(idx)),100*eps) + + %!assert(as==bs,sparse(af==bf)) + %!assert(as!=bs,sparse(af!=bf)) + %!assert(as+bs,sparse(af+bf)) + %!assert(as-bs,sparse(af-bf)) + %!assert(as.*bs,sparse(af.*bf)) + %!xtest assert(as./bs,sparse(af./bf),100*eps); + %!test + %! sv = as.^bs; + %! fv = af.^bf; + %! idx = find(af~=0); + %! assert(sv(:)(idx),sparse(fv(:)(idx)),100*eps) + + %% Matrix-matrix operators (uses af,as,bs,bf) + %!assert(as*bf',af*bf') + %!assert(af*bs',af*bf') + %!assert(as*bs',sparse(af*bf')) + + %% Matrix diagonal tests (uses af,as,bf,bs) + %!assert(diag(as),sparse(diag(af))) + %!assert(diag(bs),sparse(diag(bf))) + %!assert(diag(as,1),sparse(diag(af,1))) + %!assert(diag(bs,1),sparse(diag(bf,1))) + %!assert(diag(as,-1),sparse(diag(af,-1))) + %!assert(diag(bs,-1),sparse(diag(bf,-1))) + %!assert(diag(as(:)),sparse(diag(af(:)))) + %!assert(diag(as(:),1),sparse(diag(af(:),1))) + %!assert(diag(as(:),-1),sparse(diag(af(:),-1))) + %!assert(diag(as(:)'),sparse(diag(af(:)'))) + %!assert(diag(as(:)',1),sparse(diag(af(:)',1))) + %!assert(diag(as(:)',-1),sparse(diag(af(:)',-1))) + %!assert(spdiags(as,[0,1]),[diag(af,0),diag(af,1)]) + %!test [tb,tc]=spdiags(as); + %! assert(spdiags(tb,tc,sparse(zeros(size(as)))),as) + %! assert(spdiags(tb,tc,size(as,1),size(as,2)),as) + + %% Matrix diagonal tests (uses af,as,bf,bs) + %!assert(reshape(as,1,prod(size(as))),sparse(reshape(af,1,prod(size(af))))) + %!assert(reshape(as,prod(size(as)),1),sparse(reshape(af,prod(size(af)),1))) + %!assert(reshape(as,fliplr(size(as))),sparse(reshape(af,fliplr(size(af))))) + %!assert(reshape(bs,1,prod(size(as))),sparse(reshape(bf,1,prod(size(af))))) + %!assert(reshape(bs,prod(size(as)),1),sparse(reshape(bf,prod(size(af)),1))) + %!assert(reshape(bs,fliplr(size(as))),sparse(reshape(bf,fliplr(size(af))))) + + %!testif HAVE_UMFPACK ;# permuted LU + %! [L,U] = lu(bs); + %! assert(L*U,bs,1e-10); + + %!testif HAVE_UMFPACK ;# simple LU + row permutations + %! [L,U,P] = lu(bs); + %! assert(P'*L*U,bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# simple LU + row/col permutations + %! [L,U,P,Q] = lu(bs); + %! assert(P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with vector permutations + %! [L,U,P,Q] = lu(bs,'vector'); + %! assert(L(P,:)*U(:,Q),bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with scaling + %! [L,U,P,Q,R] = lu(bs); + %! assert(R*P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + + # ============================================================== + + %!test # save ascii + %! savefile= tmpnam(); + %! as_save=as; save("-text",savefile,"bf","as_save","af"); + %! clear as_save; + %! load(savefile,"as_save"); + %! unlink(savefile); + %! assert(as_save,sparse(af)); + %!test # save binary + %! savefile= tmpnam(); + %! as_save=as; save("-binary",savefile,"bf","as_save","af"); + %! clear as_save; + %! load(savefile,"as_save"); + %! unlink(savefile); + %! assert(as_save,sparse(af)); + %!testif HAVE_HDF5 # save hdf5 + %! savefile= tmpnam(); + %! as_save=as; save("-hdf5",savefile,"bf","as_save","af"); + %! clear as_save; + %! load(savefile,"as_save"); + %! unlink(savefile); + %! assert(as_save,sparse(af)); + ## FIXME -- we should skip (or mark as an expected failure) the test for + ## saving sparse matrices to MAT files when using 64-bit indexing since + ## that is not implemented yet. + %!test # save matlab + %! savefile= tmpnam(); + %! as_save=as; save("-mat",savefile,"bf","as_save","af"); + %! clear as_save; + %! load(savefile,"as_save"); + %! unlink(savefile); + %! assert(as_save,sparse(af)); + + # ============================================================== + + %!test bf=bf+1i*(bf~=0); + %!test as=sparse(af); + %!test bs=sparse(bf); + %% Unary matrix tests (uses af,as) + %!assert(abs(as),sparse(abs(af))) + %!assert(acos(as),sparse(acos(af))) + %!assert(acosh(as),sparse(acosh(af))) + %!assert(angle(as),sparse(angle(af))) + %!assert(arg(as),sparse(arg(af))) + %!assert(asin(as),sparse(asin(af))) + %!assert(asinh(as),sparse(asinh(af))) + %!assert(atan(as),sparse(atan(af))) + %!assert(atanh(as),sparse(atanh(af))) + %!assert(ceil(as),sparse(ceil(af))) + %!assert(conj(as),sparse(conj(af))) + %!assert(cos(as),sparse(cos(af))) + %!assert(cosh(as),sparse(cosh(af))) + %!assert(exp(as),sparse(exp(af))) + %!assert(finite(as),sparse(finite(af))) + %!assert(fix(as),sparse(fix(af))) + %!assert(floor(as),sparse(floor(af))) + %!assert(imag(as),sparse(imag(af))) + %!assert(isinf(as),sparse(isinf(af))) + %!assert(isna(as),sparse(isna(af))) + %!assert(isnan(as),sparse(isnan(af))) + %!assert(log(as),sparse(log(af))) + %!assert(real(as),sparse(real(af))) + %!assert(round(as),sparse(round(af))) + %!assert(sign(as),sparse(sign(af))) + %!assert(sin(as),sparse(sin(af))) + %!assert(sinh(as),sparse(sinh(af))) + %!assert(sqrt(as),sparse(sqrt(af))) + %!assert(tan(as),sparse(tan(af))) + %!assert(tanh(as),sparse(tanh(af))) + %!assert(issparse(abs(as))&&isreal(abs(as))) + %!assert(issparse(real(as))&&isreal(real(as))) + %!assert(issparse(imag(as))&&isreal(imag(as))) + + %% Unary matrix tests (uses af,as) + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (1) + %! assert(erf(as),sparse(erf(af))) + %! else + %! assert(erf(as),erf(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (1) + %! assert(erfc(as),sparse(erfc(af))) + %! else + %! assert(erfc(as),erfc(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isalnum(as),sparse(isalnum(af))) + %! else + %! assert(isalnum(as),isalnum(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isalpha(as),sparse(isalpha(af))) + %! else + %! assert(isalpha(as),isalpha(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isascii(as),sparse(isascii(af))) + %! else + %! assert(isascii(as),isascii(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(iscntrl(as),sparse(iscntrl(af))) + %! else + %! assert(iscntrl(as),iscntrl(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isdigit(as),sparse(isdigit(af))) + %! else + %! assert(isdigit(as),isdigit(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isgraph(as),sparse(isgraph(af))) + %! else + %! assert(isgraph(as),isgraph(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(islower(as),sparse(islower(af))) + %! else + %! assert(islower(as),islower(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isprint(as),sparse(isprint(af))) + %! else + %! assert(isprint(as),isprint(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(ispunct(as),sparse(ispunct(af))) + %! else + %! assert(ispunct(as),ispunct(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isspace(as),sparse(isspace(af))) + %! else + %! assert(isspace(as),isspace(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isupper(as),sparse(isupper(af))) + %! else + %! assert(isupper(as),isupper(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! if (0) + %! assert(isxdigit(as),sparse(isxdigit(af))) + %! else + %! assert(isxdigit(as),isxdigit(af)) + %! endif + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + + %% These mapper functions always return a full matrix + %!test + %! wn2s = warning ("query", "Octave:num-to-str"); + %! warning ("off", "Octave:num-to-str"); + %! if isreal(af) + %! assert(toascii(as),toascii(af)) + %! assert(tolower(as),tolower(af)) + %! assert(toupper(as),toupper(af)) + %! endif + %! warning (wn2s.state, "Octave:num-to-str"); + + %% Unary matrix tests (uses af,as) + %!assert(issparse(as)) + %!assert(!issparse(af)) + %!assert(!(issparse(af)&&iscomplex(af))) + %!assert(!(issparse(af)&&isreal(af))) + %!assert(sum(as),sparse(sum(af))) + %!assert(sum(as,1),sparse(sum(af,1))) + %!assert(sum(as,2),sparse(sum(af,2))) + %!assert(cumsum(as),sparse(cumsum(af))) + %!assert(cumsum(as,1),sparse(cumsum(af,1))) + %!assert(cumsum(as,2),sparse(cumsum(af,2))) + %!assert(sumsq(as),sparse(sumsq(af))) + %!assert(sumsq(as,1),sparse(sumsq(af,1))) + %!assert(sumsq(as,2),sparse(sumsq(af,2))) + %!assert(prod(as),sparse(prod(af))) + %!assert(prod(as,1),sparse(prod(af,1))) + %!assert(prod(as,2),sparse(prod(af,2))) + %!assert(cumprod(as),sparse(cumprod(af))) + %!assert(cumprod(as,1),sparse(cumprod(af,1))) + %!assert(cumprod(as,2),sparse(cumprod(af,2))) + + %!assert(min(as),sparse(min(af))) + %!assert(full(min(as(:))),min(af(:))) + %!assert(min(as,[],1),sparse(min(af,[],1))) + %!assert(min(as,[],2),sparse(min(af,[],2))) + %!assert(min(as,[],1),sparse(min(af,[],1))) + %!assert(min(as,0),sparse(min(af,0))) + %!assert(min(as,bs),sparse(min(af,bf))) + %!assert(max(as),sparse(max(af))) + %!assert(full(max(as(:))),max(af(:))) + %!assert(max(as,[],1),sparse(max(af,[],1))) + %!assert(max(as,[],2),sparse(max(af,[],2))) + %!assert(max(as,[],1),sparse(max(af,[],1))) + %!assert(max(as,0),sparse(max(af,0))) + %!assert(max(as,bs),sparse(max(af,bf))) + + %!assert(as==as) + %!assert(as==af) + %!assert(af==as) + %!test + %! [ii,jj,vv,nr,nc] = find(as); + %! assert(af,full(sparse(ii,jj,vv,nr,nc))); + %!assert(nnz(as),sum(af(:)!=0)) + %!assert(nnz(as),nnz(af)) + %!assert(issparse(as.')) + %!assert(issparse(as')) + %!assert(issparse(-as)) + %!assert(~as,sparse(~af)) + %!assert(as.', sparse(af.')); + %!assert(as', sparse(af')); + %!assert(-as, sparse(-af)); + %!assert(~as, sparse(~af)); + %!error [i,j]=size(af);as(i-1,j+1); + %!error [i,j]=size(af);as(i+1,j-1); + %!test + %! [Is,Js,Vs] = find(as); + %! [If,Jf,Vf] = find(af); + %! assert(Is,If); + %! assert(Js,Jf); + %! assert(Vs,Vf); + %!error as(0,1); + %!error as(1,0); + %!assert(find(as),find(af)) + %!test + %! [i,j,v] = find(as); + %! [m,n] = size(as); + %! x = sparse(i,j,v,m,n); + %! assert(x,as); + %!test + %! [i,j,v,m,n] = find(as); + %! x = sparse(i,j,v,m,n); + %! assert(x,as); + %!assert(issparse(horzcat(as,as))); + %!assert(issparse(vertcat(as,as))); + %!assert(issparse(cat(1,as,as))); + %!assert(issparse(cat(2,as,as))); + %!assert(issparse([as,as])); + %!assert(issparse([as;as])); + %!assert(horzcat(as,as), sparse([af,af])); + %!assert(vertcat(as,as), sparse([af;af])); + %!assert(horzcat(as,as,as), sparse([af,af,af])); + %!assert(vertcat(as,as,as), sparse([af;af;af])); + %!assert([as,as], sparse([af,af])); + %!assert([as;as], sparse([af;af])); + %!assert([as,as,as], sparse([af,af,af])); + %!assert([as;as;as], sparse([af;af;af])); + %!assert(cat(2,as,as), sparse([af,af])); + %!assert(cat(1,as,as), sparse([af;af])); + %!assert(cat(2,as,as,as), sparse([af,af,af])); + %!assert(cat(1,as,as,as), sparse([af;af;af])); + %!assert(issparse([as,af])); + %!assert(issparse([af,as])); + %!assert([as,af], sparse([af,af])); + %!assert([as;af], sparse([af;af])); + + %% Elementwise binary tests (uses as,af,bs,bf,scalar) + %!assert(as==bs,sparse(af==bf)) + %!assert(bf==as,sparse(bf==af)) + + %!assert(as!=bf,sparse(af!=bf)) + %!assert(bf!=as,sparse(bf!=af)) + + %!assert(as+bf,af+bf) + %!assert(bf+as,bf+af) + + %!assert(as-bf,af-bf) + %!assert(bf-as,bf-af) + + %!assert(as.*bf,sparse(af.*bf)) + %!assert(bf.*as,sparse(bf.*af)) + + %!assert(as./bf,sparse(af./bf),100*eps) + %!assert(bf.\as,sparse(bf.\af),100*eps) + + %!test + %! sv = as.^bf; + %! fv = af.^bf; + %! idx = find(af~=0); + %! assert(sv(:)(idx),sparse(fv(:)(idx)),100*eps) + + %!assert(as==bs,sparse(af==bf)) + %!assert(as!=bs,sparse(af!=bf)) + %!assert(as+bs,sparse(af+bf)) + %!assert(as-bs,sparse(af-bf)) + %!assert(as.*bs,sparse(af.*bf)) + %!xtest assert(as./bs,sparse(af./bf),100*eps); + %!test + %! sv = as.^bs; + %! fv = af.^bf; + %! idx = find(af~=0); + %! assert(sv(:)(idx),sparse(fv(:)(idx)),100*eps) + + %% Matrix-matrix operators (uses af,as,bs,bf) + %!assert(as*bf',af*bf') + %!assert(af*bs',af*bf') + %!assert(as*bs',sparse(af*bf')) + + %% Matrix diagonal tests (uses af,as,bf,bs) + %!assert(diag(as),sparse(diag(af))) + %!assert(diag(bs),sparse(diag(bf))) + %!assert(diag(as,1),sparse(diag(af,1))) + %!assert(diag(bs,1),sparse(diag(bf,1))) + %!assert(diag(as,-1),sparse(diag(af,-1))) + %!assert(diag(bs,-1),sparse(diag(bf,-1))) + %!assert(diag(as(:)),sparse(diag(af(:)))) + %!assert(diag(as(:),1),sparse(diag(af(:),1))) + %!assert(diag(as(:),-1),sparse(diag(af(:),-1))) + %!assert(diag(as(:)'),sparse(diag(af(:)'))) + %!assert(diag(as(:)',1),sparse(diag(af(:)',1))) + %!assert(diag(as(:)',-1),sparse(diag(af(:)',-1))) + %!assert(spdiags(as,[0,1]),[diag(af,0),diag(af,1)]) + %!test [tb,tc]=spdiags(as); + %! assert(spdiags(tb,tc,sparse(zeros(size(as)))),as) + %! assert(spdiags(tb,tc,size(as,1),size(as,2)),as) + + %% Matrix diagonal tests (uses af,as,bf,bs) + %!assert(reshape(as,1,prod(size(as))),sparse(reshape(af,1,prod(size(af))))) + %!assert(reshape(as,prod(size(as)),1),sparse(reshape(af,prod(size(af)),1))) + %!assert(reshape(as,fliplr(size(as))),sparse(reshape(af,fliplr(size(af))))) + %!assert(reshape(bs,1,prod(size(as))),sparse(reshape(bf,1,prod(size(af))))) + %!assert(reshape(bs,prod(size(as)),1),sparse(reshape(bf,prod(size(af)),1))) + %!assert(reshape(bs,fliplr(size(as))),sparse(reshape(bf,fliplr(size(af))))) + + %!testif HAVE_UMFPACK ;# permuted LU + %! [L,U] = lu(bs); + %! assert(L*U,bs,1e-10); + + %!testif HAVE_UMFPACK ;# simple LU + row permutations + %! [L,U,P] = lu(bs); + %! assert(P'*L*U,bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# simple LU + row/col permutations + %! [L,U,P,Q] = lu(bs); + %! assert(P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with vector permutations + %! [L,U,P,Q] = lu(bs,'vector'); + %! assert(L(P,:)*U(:,Q),bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with scaling + %! [L,U,P,Q,R] = lu(bs); + %! assert(R*P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + + # ============================================================== + + %!test af=[1+1i,2-1i,0,0;0,0,0,3+2i;0,0,0,4]; + %! as=sparse(af); + %!test bf=[0,1-1i,0,0;2+1i,0,0,0;3-1i,2+3i,0,0]; + %!test ;# invertible matrix + %! bf=af'*bf+max(abs([af(:);bf(:)]))*sparse(eye(columns(as))); + %! bs=sparse(bf); + + %% Matrix-matrix operators (uses af,as,bs,bf) + %!assert(as/bf,af/bf,100*eps) + %!assert(af/bs,af/bf,100*eps) + %!assert(as/bs,sparse(af/bf),100*eps) + %!assert(bs\af',bf\af',100*eps) + %!assert(bf\as',bf\af',100*eps) + %!assert(bs\as',sparse(bf\af'),100*eps) + + %!testif HAVE_UMFPACK + %! assert(det(bs+speye(size(bs))),det(bf+eye(size(bf))),100*eps*abs(det(bf+eye(size(bf))))) + + %!testif HAVE_UMFPACK + %! [l,u]=lu(sparse([1,1;1,1])); + %! assert(l*u,[1,1;1,1],10*eps); + + %!testif HAVE_UMFPACK + %! [l,u]=lu(sparse([1,1;1,1+i])); + %! assert(l,sparse([1,2,2],[1,1,2],1),10*eps); + %! assert(u,sparse([1,1,2],[1,2,2],[1,1,1i]),10*eps); + + %!testif HAVE_UMFPACK ;# permuted LU + %! [L,U] = lu(bs); + %! assert(L*U,bs,1e-10); + + %!testif HAVE_UMFPACK ;# simple LU + row permutations + %! [L,U,P] = lu(bs); + %! assert(P'*L*U,bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# simple LU + row/col permutations + %! [L,U,P,Q] = lu(bs); + %! assert(P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with vector permutations + %! [L,U,P,Q] = lu(bs,'vector'); + %! assert(L(P,:)*U(:,Q),bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with scaling + %! [L,U,P,Q,R] = lu(bs); + %! assert(R*P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# inverse + %! assert(inv(bs)*bs,sparse(eye(rows(bs))),1e-10); + + %!assert(bf\as',bf\af',100*eps); + %!assert(bs\af',bf\af',100*eps); + %!assert(bs\as',sparse(bf\af'),100*eps); + + + # ============================================================== + + %!test bf=real(bf); + %! bs=sparse(bf); + %% Matrix-matrix operators (uses af,as,bs,bf) + %!assert(as/bf,af/bf,100*eps) + %!assert(af/bs,af/bf,100*eps) + %!assert(as/bs,sparse(af/bf),100*eps) + %!assert(bs\af',bf\af',100*eps) + %!assert(bf\as',bf\af',100*eps) + %!assert(bs\as',sparse(bf\af'),100*eps) + + %!testif HAVE_UMFPACK + %! assert(det(bs+speye(size(bs))),det(bf+eye(size(bf))),100*eps*abs(det(bf+eye(size(bf))))) + + %!testif HAVE_UMFPACK + %! [l,u]=lu(sparse([1,1;1,1])); + %! assert(l*u,[1,1;1,1],10*eps); + + %!testif HAVE_UMFPACK + %! [l,u]=lu(sparse([1,1;1,1+i])); + %! assert(l,sparse([1,2,2],[1,1,2],1),10*eps); + %! assert(u,sparse([1,1,2],[1,2,2],[1,1,1i]),10*eps); + + %!testif HAVE_UMFPACK ;# permuted LU + %! [L,U] = lu(bs); + %! assert(L*U,bs,1e-10); + + %!testif HAVE_UMFPACK ;# simple LU + row permutations + %! [L,U,P] = lu(bs); + %! assert(P'*L*U,bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# simple LU + row/col permutations + %! [L,U,P,Q] = lu(bs); + %! assert(P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with vector permutations + %! [L,U,P,Q] = lu(bs,'vector'); + %! assert(L(P,:)*U(:,Q),bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with scaling + %! [L,U,P,Q,R] = lu(bs); + %! assert(R*P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# inverse + %! assert(inv(bs)*bs,sparse(eye(rows(bs))),1e-10); + + %!assert(bf\as',bf\af',100*eps); + %!assert(bs\af',bf\af',100*eps); + %!assert(bs\as',sparse(bf\af'),100*eps); + + + # ============================================================== + + %!test af=real(af); + %! as=sparse(af); + %% Matrix-matrix operators (uses af,as,bs,bf) + %!assert(as/bf,af/bf,100*eps) + %!assert(af/bs,af/bf,100*eps) + %!assert(as/bs,sparse(af/bf),100*eps) + %!assert(bs\af',bf\af',100*eps) + %!assert(bf\as',bf\af',100*eps) + %!assert(bs\as',sparse(bf\af'),100*eps) + + %!testif HAVE_UMFPACK + %! assert(det(bs+speye(size(bs))),det(bf+eye(size(bf))),100*eps*abs(det(bf+eye(size(bf))))) + + %!testif HAVE_UMFPACK + %! [l,u]=lu(sparse([1,1;1,1])); + %! assert(l*u,[1,1;1,1],10*eps); + + %!testif HAVE_UMFPACK + %! [l,u]=lu(sparse([1,1;1,1+i])); + %! assert(l,sparse([1,2,2],[1,1,2],1),10*eps); + %! assert(u,sparse([1,1,2],[1,2,2],[1,1,1i]),10*eps); + + %!testif HAVE_UMFPACK ;# permuted LU + %! [L,U] = lu(bs); + %! assert(L*U,bs,1e-10); + + %!testif HAVE_UMFPACK ;# simple LU + row permutations + %! [L,U,P] = lu(bs); + %! assert(P'*L*U,bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# simple LU + row/col permutations + %! [L,U,P,Q] = lu(bs); + %! assert(P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with vector permutations + %! [L,U,P,Q] = lu(bs,'vector'); + %! assert(L(P,:)*U(:,Q),bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with scaling + %! [L,U,P,Q,R] = lu(bs); + %! assert(R*P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# inverse + %! assert(inv(bs)*bs,sparse(eye(rows(bs))),1e-10); + + %!assert(bf\as',bf\af',100*eps); + %!assert(bs\af',bf\af',100*eps); + %!assert(bs\as',sparse(bf\af'),100*eps); + + + # ============================================================== + + %!test bf=bf+1i*(bf~=0); + %! bs=sparse(bf); + %% Matrix-matrix operators (uses af,as,bs,bf) + %!assert(as/bf,af/bf,100*eps) + %!assert(af/bs,af/bf,100*eps) + %!assert(as/bs,sparse(af/bf),100*eps) + %!assert(bs\af',bf\af',100*eps) + %!assert(bf\as',bf\af',100*eps) + %!assert(bs\as',sparse(bf\af'),100*eps) + + %!testif HAVE_UMFPACK + %! assert(det(bs+speye(size(bs))),det(bf+eye(size(bf))),100*eps*abs(det(bf+eye(size(bf))))) + + %!testif HAVE_UMFPACK + %! [l,u]=lu(sparse([1,1;1,1])); + %! assert(l*u,[1,1;1,1],10*eps); + + %!testif HAVE_UMFPACK + %! [l,u]=lu(sparse([1,1;1,1+i])); + %! assert(l,sparse([1,2,2],[1,1,2],1),10*eps); + %! assert(u,sparse([1,1,2],[1,2,2],[1,1,1i]),10*eps); + + %!testif HAVE_UMFPACK ;# permuted LU + %! [L,U] = lu(bs); + %! assert(L*U,bs,1e-10); + + %!testif HAVE_UMFPACK ;# simple LU + row permutations + %! [L,U,P] = lu(bs); + %! assert(P'*L*U,bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# simple LU + row/col permutations + %! [L,U,P,Q] = lu(bs); + %! assert(P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with vector permutations + %! [L,U,P,Q] = lu(bs,'vector'); + %! assert(L(P,:)*U(:,Q),bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# LU with scaling + %! [L,U,P,Q,R] = lu(bs); + %! assert(R*P'*L*U*Q',bs,1e-10); + %! # triangularity + %! [i,j,v]=find(L); + %! assert(i-j>=0); + %! [i,j,v]=find(U); + %! assert(j-i>=0); + + %!testif HAVE_UMFPACK ;# inverse + %! assert(inv(bs)*bs,sparse(eye(rows(bs))),1e-10); + + %!assert(bf\as',bf\af',100*eps); + %!assert(bs\af',bf\af',100*eps); + %!assert(bs\as',sparse(bf\af'),100*eps); + + + # ============================================================== + + %!test bf=[5,0,1+1i,0;0,5,0,1-2i;1-1i,0,5,0;0,1+2i,0,5]; + %! bs=sparse(bf); + %!testif HAVE_CHOLMOD + %! assert(chol(bs)'*chol(bs),bs,1e-10); + %!testif HAVE_CHOLMOD + %! assert(chol(bs,'lower')*chol(bs,'lower')',bs,1e-10); + %!testif HAVE_CHOLMOD + %! assert(chol(bs,'lower'),chol(bs)',1e-10); + + %!testif HAVE_CHOLMOD ;# Return Partial Cholesky factorization + %! [RS,PS] = chol(bs); + %! assert(RS'*RS,bs,1e-10); + %! assert(PS,0); + %! [LS,PS] = chol(bs,'lower'); + %! assert(LS*LS',bs,1e-10); + %! assert(PS,0); + + %!testif HAVE_CHOLMOD ;# Permuted Cholesky factorization + %! [RS,PS,QS] = chol(bs); + %! assert(RS'*RS,QS*bs*QS',1e-10); + %! assert(PS,0); + %! [LS,PS,QS] = chol(bs,'lower'); + %! assert(LS*LS',QS*bs*QS',1e-10); + %! assert(PS,0); + + + # ============================================================== + + %!test bf=real(bf); + %! bs=sparse(bf); + %!testif HAVE_CHOLMOD + %! assert(chol(bs)'*chol(bs),bs,1e-10); + %!testif HAVE_CHOLMOD + %! assert(chol(bs,'lower')*chol(bs,'lower')',bs,1e-10); + %!testif HAVE_CHOLMOD + %! assert(chol(bs,'lower'),chol(bs)',1e-10); + + %!testif HAVE_CHOLMOD ;# Return Partial Cholesky factorization + %! [RS,PS] = chol(bs); + %! assert(RS'*RS,bs,1e-10); + %! assert(PS,0); + %! [LS,PS] = chol(bs,'lower'); + %! assert(LS*LS',bs,1e-10); + %! assert(PS,0); + + %!testif HAVE_CHOLMOD ;# Permuted Cholesky factorization + %! [RS,PS,QS] = chol(bs); + %! assert(RS'*RS,QS*bs*QS',1e-10); + %! assert(PS,0); + %! [LS,PS,QS] = chol(bs,'lower'); + %! assert(LS*LS',QS*bs*QS',1e-10); + %! assert(PS,0); + + + # ============================================================== + + %!shared r,c,m,n,fsum,funiq + %!test + %! r=[1,1,2,1,2,3]; + %! c=[2,1,1,1,2,1]; + %! m=n=0; + %%Assembly tests + %!test + %! m=max([m;r(:)]); + %! n=max([n;c(:)]); + %! funiq=fsum=zeros(m,n); + %! funiq(r(:) + m*(c(:)-1) ) = ones(size(r(:))); + %! funiq = sparse(funiq); + %! for k=1:length(r), fsum(r(k),c(k)) += 1; end + %! fsum = sparse(fsum); + %!assert(sparse(r,c,1),sparse(fsum(1:max(r),1:max(c)))); + %!assert(sparse(r,c,1,"sum"),sparse(fsum(1:max(r),1:max(c)))); + %!assert(sparse(r,c,1,"unique"),sparse(funiq(1:max(r),1:max(c)))); + %!assert(sparse(r,c,1,m,n),sparse(fsum)); + %!assert(sparse(r,c,1,m,n,"sum"),sparse(fsum)); + %!assert(sparse(r,c,1,m,n,"unique"),sparse(funiq)); + + %!assert(sparse(r,c,1i),sparse(fsum(1:max(r),1:max(c))*1i)); + %!assert(sparse(r,c,1i,"sum"),sparse(fsum(1:max(r),1:max(c))*1i)); + %!assert(sparse(r,c,1i,"unique"),sparse(funiq(1:max(r),1:max(c))*1i)); + %!assert(sparse(r,c,1i,m,n),sparse(fsum*1i)); + %!assert(sparse(r,c,1i,m,n,"sum"),sparse(fsum*1i)); + %!assert(sparse(r,c,1i,m,n,"unique"),sparse(funiq*1i)); + + %!test + %! if (issparse(funiq)) + %! assert(sparse(full(1i*funiq)),sparse(1i*funiq)); + %! endif + + %!assert(sparse(full(funiq)),funiq); + + + + # ============================================================== + + %!shared ridx,cidx,idx,as,af + %!test + %! af=[1+1i,2-1i,0,0;0,0,0,3+2i;0,0,0,4]; + %! ridx=[1,3]; cidx=[2,3]; + %!assert (sparse(42)([1,1]),sparse([42,42])) + %!assert (sparse(42*1i)([1,1]),sparse([42,42].*1i)) + %!test as=sparse(af); + + %% Point tests + %!test idx=ridx(:)+rows(as)*(cidx(:)-1); + %!assert(sparse(as(idx)),sparse(af(idx))); + %!assert(as(idx),sparse(af(idx))); + %!assert(as(idx'),sparse(af(idx'))); + %!assert(as(flipud(idx(:))),sparse(af(flipud(idx(:))))) + %!assert(as([idx,idx]),sparse(af([idx,idx]))); + %!error(as(reshape([idx;idx],[1,length(idx),2]))); + + %% Slice tests + %!assert(as(ridx,cidx), sparse(af(ridx,cidx))) + %!assert(as(ridx,:), sparse(af(ridx,:))) + %!assert(as(:,cidx), sparse(af(:,cidx))) + %!assert(as(:,:), sparse(af(:,:))) + %!assert(as((size(as,1):-1:1),:),sparse(af((size(af,1):-1:1),:))) + %!assert(as(:,(size(as,2):-1:1)),sparse(af(:,(size(af,2):-1:1)))) + + %% Indexing tests + %!assert(full(as([1,1],:)), af([1,1],:)) + %!assert(full(as(:,[1,1])), af(:,[1,1])) + %!test + %! [i,j,v] = find (as); + %! assert (as(i(1),j(1))([1,1]), sparse([v(1),v(1)])) + + %% Assignment test + %!test + %! ts=as;ts(:,:)=ts(fliplr(1:size(as,1)),:); + %! tf=af;tf(:,:)=tf(fliplr(1:size(af,1)),:); + %! assert(ts,sparse(tf)); + %!test + %! ts=as;ts(fliplr(1:size(as,1)),:)=ts; + %! tf=af;tf(fliplr(1:size(af,1)),:)=tf; + %! assert(ts,sparse(tf)); + %!test + %! ts=as;ts(:,fliplr(1:size(as,2)))=ts; + %! tf=af;tf(:,fliplr(1:size(af,2)))=tf; + %! assert(ts,sparse(tf)); + %!test + %! ts(fliplr(1:size(as,1)))=as(:,1);tf(fliplr(1:size(af,1)))=af(:,1); + %! assert(ts,sparse(tf)); + + %% Deletion tests + %!test + %! ts=as;ts(1,:)=[];tf=af;tf(1,:)=[]; + %! assert(ts,sparse(tf)); + %!test + %! ts=as;ts(:,1)=[];tf=af;tf(:,1)=[]; + %! assert(ts,sparse(tf)); + + %% Test 'end' keyword + %!assert(full(as(end)), af(end)) + %!assert(full(as(1,end)), af(1,end)) + %!assert(full(as(end,1)), af(end,1)) + %!assert(full(as(end,end)), af(end,end)) + %!assert(as(2:end,2:end), sparse(af(2:end,2:end))) + %!assert(as(1:end-1,1:end-1), sparse(af(1:end-1,1:end-1))) + %!test af=real(af); + %!test as=sparse(af); + + %% Point tests + %!test idx=ridx(:)+rows(as)*(cidx(:)-1); + %!assert(sparse(as(idx)),sparse(af(idx))); + %!assert(as(idx),sparse(af(idx))); + %!assert(as(idx'),sparse(af(idx'))); + %!assert(as(flipud(idx(:))),sparse(af(flipud(idx(:))))) + %!assert(as([idx,idx]),sparse(af([idx,idx]))); + %!error(as(reshape([idx;idx],[1,length(idx),2]))); + + %% Slice tests + %!assert(as(ridx,cidx), sparse(af(ridx,cidx))) + %!assert(as(ridx,:), sparse(af(ridx,:))) + %!assert(as(:,cidx), sparse(af(:,cidx))) + %!assert(as(:,:), sparse(af(:,:))) + %!assert(as((size(as,1):-1:1),:),sparse(af((size(af,1):-1:1),:))) + %!assert(as(:,(size(as,2):-1:1)),sparse(af(:,(size(af,2):-1:1)))) + + %% Indexing tests + %!assert(full(as([1,1],:)), af([1,1],:)) + %!assert(full(as(:,[1,1])), af(:,[1,1])) + %!test + %! [i,j,v] = find (as); + %! assert (as(i(1),j(1))([1,1]), sparse([v(1),v(1)])) + + %% Assignment test + %!test + %! ts=as;ts(:,:)=ts(fliplr(1:size(as,1)),:); + %! tf=af;tf(:,:)=tf(fliplr(1:size(af,1)),:); + %! assert(ts,sparse(tf)); + %!test + %! ts=as;ts(fliplr(1:size(as,1)),:)=ts; + %! tf=af;tf(fliplr(1:size(af,1)),:)=tf; + %! assert(ts,sparse(tf)); + %!test + %! ts=as;ts(:,fliplr(1:size(as,2)))=ts; + %! tf=af;tf(:,fliplr(1:size(af,2)))=tf; + %! assert(ts,sparse(tf)); + %!test + %! ts(fliplr(1:size(as,1)))=as(:,1);tf(fliplr(1:size(af,1)))=af(:,1); + %! assert(ts,sparse(tf)); + + %% Deletion tests + %!test + %! ts=as;ts(1,:)=[];tf=af;tf(1,:)=[]; + %! assert(ts,sparse(tf)); + %!test + %! ts=as;ts(:,1)=[];tf=af;tf(:,1)=[]; + %! assert(ts,sparse(tf)); + + %% Test 'end' keyword + %!assert(full(as(end)), af(end)) + %!assert(full(as(1,end)), af(1,end)) + %!assert(full(as(end,1)), af(end,1)) + %!assert(full(as(end,end)), af(end,end)) + %!assert(as(2:end,2:end), sparse(af(2:end,2:end))) + %!assert(as(1:end-1,1:end-1), sparse(af(1:end-1,1:end-1))) + + # ============================================================== + + %!shared alpha,beta,df,pdf,lf,plf,uf,puf,bf,cf,bcf,tf,tcf,xf,ds,pds,ls,pls,us,pus,bs,cs,bcs,ts,tcs,xs + %!test alpha=1;beta=1; + %! n=8; + %! lf=diag(1:n);lf(n-1,1)=0.5*alpha;lf(n,2)=0.25*alpha;ls=sparse(lf); + %! uf=diag(1:n);uf(1,n-1)=2*alpha;uf(2,n)=alpha;us=sparse(uf); + %! ts=spdiags(ones(n,3),-1:1,n,n)+diag(1:n); tf = full(ts); + %! df = diag(1:n).* alpha; ds = sparse(df); + %! pdf = df(randperm(n),randperm(n)); pds = sparse(pdf); + %! plf = lf(randperm(n),randperm(n)); pls = sparse(plf); + %! puf = uf(randperm(n),randperm(n)); pus = sparse(puf); + %! bs = spdiags(repmat([1:n]',1,4),-2:1,n,n).*alpha; bf = full(bs); + %! cf = lf + lf'; cs = sparse(cf); + %! bcf = bf + bf'; bcs = sparse(bcf); + %! tcf = tf + tf'; tcs = sparse(tcf); + %! xf = diag(1:n) + fliplr(diag(1:n)).*beta; xs = sparse(xf); + %!assert(ds\xf,df\xf,1e-10); + %!assert(ds\xs,sparse(df\xf),1e-10); + %!assert(pds\xf,pdf\xf,1e-10); + %!assert(pds\xs,sparse(pdf\xf),1e-10); + %!assert(ls\xf,lf\xf,1e-10); + %!assert(sparse(ls\xs),sparse(lf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(pls\xf,plf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(pls\xs),sparse(plf\xf),1e-10); + %!assert(us\xf,uf\xf,1e-10); + %!assert(sparse(us\xs),sparse(uf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(pus\xf,puf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(pus\xs),sparse(puf\xf),1e-10); + %!assert(bs\xf,bf\xf,1e-10); + %!assert(sparse(bs\xs),sparse(bf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(cs\xf,cf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(cs\xs),sparse(cf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(bcs\xf,bcf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(bcs\xs),sparse(bcf\xf),1e-10); + %!assert(ts\xf,tf\xf,1e-10); + %!assert(sparse(ts\xs),sparse(tf\xf),1e-10); + %!assert(tcs\xf,tcf\xf,1e-10); + %!assert(sparse(tcs\xs),sparse(tcf\xf),1e-10); + + %% QR solver tests + + %!function f(a, sz, feps) + %! b = randn(sz); x = a \b; + %! assert (a * x, b, feps); + %! b = randn(sz)+1i*randn(sz); x = a \ b; + %! assert (a * x, b, feps); + %! b = sprandn(sz(1),sz(2),0.2); x = a \b; + %! assert (sparse(a * x), b, feps); + %! b = sprandn(sz(1),sz(2),0.2)+1i*sprandn(sz(1),sz(2),0.2); x = a \b; + %! assert (sparse(a * x), b, feps); + %!testif HAVE_CXSPARSE + %! a = alpha*sprandn(10,11,0.2)+speye(10,11); f(a,[10,2],1e-10); + %! ## Test this by forcing matrix_type, as can't get a certain + %! ## result for over-determined systems. + %! a = alpha*sprandn(10,10,0.2)+speye(10,10); matrix_type(a, "Singular"); + %! f(a,[10,2],1e-10); + + %% Rectanguar solver tests that don't use QR + + %!test + %! ds = alpha * spdiags([1:11]',0,10,11); + %! df = full(ds); + %! xf = beta * ones(10,2); + %! xs = speye(10,10); + %!assert(ds\xf,df\xf,100*eps) + %!assert(ds\xs,sparse(df\xs),100*eps) + %!test + %! pds = ds([2,1,3:10],:); + %! pdf = full(pds); + %!assert(pds\xf,pdf\xf,100*eps) + %!assert(pds\xs,sparse(pdf\xs),100*eps) + %!test + %! ds = alpha * spdiags([1:11]',0,11,10); + %! df = full(ds); + %! xf = beta * ones(11,2); + %! xs = speye(11,11); + %!assert(ds\xf,df\xf,100*eps) + %!assert(ds\xs,sparse(df\xs),100*eps) + %!test + %! pds = ds([2,1,3:11],:); + %! pdf = full(pds); + %!assert(pds\xf,pdf\xf,100*eps) + %!assert(pds\xs,sparse(pdf\xs),100*eps) + %!test + %! us = alpha*[[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]]; + %!testif HAVE_UMFPACK + %! assert(us*(us\xf),xf,100*eps) + %!testif HAVE_UMFPACK + %! assert(us*(us\xs),xs,100*eps) + %!test + %! pus = us(:,[2,1,3:12]); + %!testif HAVE_UMFPACK + %! assert(pus*(pus\xf),xf,100*eps) + %!testif HAVE_UMFPACK + %! assert(pus*(pus\xs),xs,100*eps) + %!test + %! us = alpha*[speye(11,9),[1;sparse(8,1);1;0]]; + %!testif HAVE_CXSPARSE + %! [c,r] = qr (us, xf); + %! assert(us\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (us, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(us\xs,r\c,100*eps) + %!test + %! pus = us(:,[1:8,10,9]); + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pus, xf); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pus\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pus, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pus\xs,r\c,100*eps) + %!test + %! ls = alpha*[speye(9,11);[1,sparse(1,8),1,0]]; + %! xf = beta * ones(10,2); + %! xs = speye(10,10); + %!assert(ls*(ls\xf),xf,100*eps) + %!assert(ls*(ls\xs),xs,100*eps) + %!test + %! pls = ls([1:8,10,9],:); + %!assert(pls*(pls\xf),xf,100*eps) + %!assert(pls*(pls\xs),xs,100*eps) + %!test + %! ls = alpha*[speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]; + %! xf = beta * ones(12,2); + %! xs = speye(12,12); + %!testif HAVE_CXSPARSE + %! [c,r] = qr (ls, xf); + %! assert(ls\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (ls, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(ls\xs,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! pls = ls(:,[1:8,10,9]); + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pls, xf); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pls\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pls, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pls\xs,r\c,100*eps) + + %!test alpha=1;beta=1i; + %! n=8; + %! lf=diag(1:n);lf(n-1,1)=0.5*alpha;lf(n,2)=0.25*alpha;ls=sparse(lf); + %! uf=diag(1:n);uf(1,n-1)=2*alpha;uf(2,n)=alpha;us=sparse(uf); + %! ts=spdiags(ones(n,3),-1:1,n,n)+diag(1:n); tf = full(ts); + %! df = diag(1:n).* alpha; ds = sparse(df); + %! pdf = df(randperm(n),randperm(n)); pds = sparse(pdf); + %! plf = lf(randperm(n),randperm(n)); pls = sparse(plf); + %! puf = uf(randperm(n),randperm(n)); pus = sparse(puf); + %! bs = spdiags(repmat([1:n]',1,4),-2:1,n,n).*alpha; bf = full(bs); + %! cf = lf + lf'; cs = sparse(cf); + %! bcf = bf + bf'; bcs = sparse(bcf); + %! tcf = tf + tf'; tcs = sparse(tcf); + %! xf = diag(1:n) + fliplr(diag(1:n)).*beta; xs = sparse(xf); + %!assert(ds\xf,df\xf,1e-10); + %!assert(ds\xs,sparse(df\xf),1e-10); + %!assert(pds\xf,pdf\xf,1e-10); + %!assert(pds\xs,sparse(pdf\xf),1e-10); + %!assert(ls\xf,lf\xf,1e-10); + %!assert(sparse(ls\xs),sparse(lf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(pls\xf,plf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(pls\xs),sparse(plf\xf),1e-10); + %!assert(us\xf,uf\xf,1e-10); + %!assert(sparse(us\xs),sparse(uf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(pus\xf,puf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(pus\xs),sparse(puf\xf),1e-10); + %!assert(bs\xf,bf\xf,1e-10); + %!assert(sparse(bs\xs),sparse(bf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(cs\xf,cf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(cs\xs),sparse(cf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(bcs\xf,bcf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(bcs\xs),sparse(bcf\xf),1e-10); + %!assert(ts\xf,tf\xf,1e-10); + %!assert(sparse(ts\xs),sparse(tf\xf),1e-10); + %!assert(tcs\xf,tcf\xf,1e-10); + %!assert(sparse(tcs\xs),sparse(tcf\xf),1e-10); + + %% QR solver tests + + %!function f(a, sz, feps) + %! b = randn(sz); x = a \b; + %! assert (a * x, b, feps); + %! b = randn(sz)+1i*randn(sz); x = a \ b; + %! assert (a * x, b, feps); + %! b = sprandn(sz(1),sz(2),0.2); x = a \b; + %! assert (sparse(a * x), b, feps); + %! b = sprandn(sz(1),sz(2),0.2)+1i*sprandn(sz(1),sz(2),0.2); x = a \b; + %! assert (sparse(a * x), b, feps); + %!testif HAVE_CXSPARSE + %! a = alpha*sprandn(10,11,0.2)+speye(10,11); f(a,[10,2],1e-10); + %! ## Test this by forcing matrix_type, as can't get a certain + %! ## result for over-determined systems. + %! a = alpha*sprandn(10,10,0.2)+speye(10,10); matrix_type(a, "Singular"); + %! f(a,[10,2],1e-10); + + %% Rectanguar solver tests that don't use QR + + %!test + %! ds = alpha * spdiags([1:11]',0,10,11); + %! df = full(ds); + %! xf = beta * ones(10,2); + %! xs = speye(10,10); + %!assert(ds\xf,df\xf,100*eps) + %!assert(ds\xs,sparse(df\xs),100*eps) + %!test + %! pds = ds([2,1,3:10],:); + %! pdf = full(pds); + %!assert(pds\xf,pdf\xf,100*eps) + %!assert(pds\xs,sparse(pdf\xs),100*eps) + %!test + %! ds = alpha * spdiags([1:11]',0,11,10); + %! df = full(ds); + %! xf = beta * ones(11,2); + %! xs = speye(11,11); + %!assert(ds\xf,df\xf,100*eps) + %!assert(ds\xs,sparse(df\xs),100*eps) + %!test + %! pds = ds([2,1,3:11],:); + %! pdf = full(pds); + %!assert(pds\xf,pdf\xf,100*eps) + %!assert(pds\xs,sparse(pdf\xs),100*eps) + %!test + %! us = alpha*[[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]]; + %!testif HAVE_UMFPACK + %! assert(us*(us\xf),xf,100*eps) + %!testif HAVE_UMFPACK + %! assert(us*(us\xs),xs,100*eps) + %!test + %! pus = us(:,[2,1,3:12]); + %!testif HAVE_UMFPACK + %! assert(pus*(pus\xf),xf,100*eps) + %!testif HAVE_UMFPACK + %! assert(pus*(pus\xs),xs,100*eps) + %!test + %! us = alpha*[speye(11,9),[1;sparse(8,1);1;0]]; + %!testif HAVE_CXSPARSE + %! [c,r] = qr (us, xf); + %! assert(us\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (us, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(us\xs,r\c,100*eps) + %!test + %! pus = us(:,[1:8,10,9]); + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pus, xf); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pus\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pus, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pus\xs,r\c,100*eps) + %!test + %! ls = alpha*[speye(9,11);[1,sparse(1,8),1,0]]; + %! xf = beta * ones(10,2); + %! xs = speye(10,10); + %!assert(ls*(ls\xf),xf,100*eps) + %!assert(ls*(ls\xs),xs,100*eps) + %!test + %! pls = ls([1:8,10,9],:); + %!assert(pls*(pls\xf),xf,100*eps) + %!assert(pls*(pls\xs),xs,100*eps) + %!test + %! ls = alpha*[speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]; + %! xf = beta * ones(12,2); + %! xs = speye(12,12); + %!testif HAVE_CXSPARSE + %! [c,r] = qr (ls, xf); + %! assert(ls\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (ls, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(ls\xs,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! pls = ls(:,[1:8,10,9]); + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pls, xf); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pls\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pls, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pls\xs,r\c,100*eps) + + %!test alpha=1i;beta=1; + %! n=8; + %! lf=diag(1:n);lf(n-1,1)=0.5*alpha;lf(n,2)=0.25*alpha;ls=sparse(lf); + %! uf=diag(1:n);uf(1,n-1)=2*alpha;uf(2,n)=alpha;us=sparse(uf); + %! ts=spdiags(ones(n,3),-1:1,n,n)+diag(1:n); tf = full(ts); + %! df = diag(1:n).* alpha; ds = sparse(df); + %! pdf = df(randperm(n),randperm(n)); pds = sparse(pdf); + %! plf = lf(randperm(n),randperm(n)); pls = sparse(plf); + %! puf = uf(randperm(n),randperm(n)); pus = sparse(puf); + %! bs = spdiags(repmat([1:n]',1,4),-2:1,n,n).*alpha; bf = full(bs); + %! cf = lf + lf'; cs = sparse(cf); + %! bcf = bf + bf'; bcs = sparse(bcf); + %! tcf = tf + tf'; tcs = sparse(tcf); + %! xf = diag(1:n) + fliplr(diag(1:n)).*beta; xs = sparse(xf); + %!assert(ds\xf,df\xf,1e-10); + %!assert(ds\xs,sparse(df\xf),1e-10); + %!assert(pds\xf,pdf\xf,1e-10); + %!assert(pds\xs,sparse(pdf\xf),1e-10); + %!assert(ls\xf,lf\xf,1e-10); + %!assert(sparse(ls\xs),sparse(lf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(pls\xf,plf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(pls\xs),sparse(plf\xf),1e-10); + %!assert(us\xf,uf\xf,1e-10); + %!assert(sparse(us\xs),sparse(uf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(pus\xf,puf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(pus\xs),sparse(puf\xf),1e-10); + %!assert(bs\xf,bf\xf,1e-10); + %!assert(sparse(bs\xs),sparse(bf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(cs\xf,cf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(cs\xs),sparse(cf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(bcs\xf,bcf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(bcs\xs),sparse(bcf\xf),1e-10); + %!assert(ts\xf,tf\xf,1e-10); + %!assert(sparse(ts\xs),sparse(tf\xf),1e-10); + %!assert(tcs\xf,tcf\xf,1e-10); + %!assert(sparse(tcs\xs),sparse(tcf\xf),1e-10); + + %% QR solver tests + + %!function f(a, sz, feps) + %! b = randn(sz); x = a \b; + %! assert (a * x, b, feps); + %! b = randn(sz)+1i*randn(sz); x = a \ b; + %! assert (a * x, b, feps); + %! b = sprandn(sz(1),sz(2),0.2); x = a \b; + %! assert (sparse(a * x), b, feps); + %! b = sprandn(sz(1),sz(2),0.2)+1i*sprandn(sz(1),sz(2),0.2); x = a \b; + %! assert (sparse(a * x), b, feps); + %!testif HAVE_CXSPARSE + %! a = alpha*sprandn(10,11,0.2)+speye(10,11); f(a,[10,2],1e-10); + %! ## Test this by forcing matrix_type, as can't get a certain + %! ## result for over-determined systems. + %! a = alpha*sprandn(10,10,0.2)+speye(10,10); matrix_type(a, "Singular"); + %! f(a,[10,2],1e-10); + + %% Rectanguar solver tests that don't use QR + + %!test + %! ds = alpha * spdiags([1:11]',0,10,11); + %! df = full(ds); + %! xf = beta * ones(10,2); + %! xs = speye(10,10); + %!assert(ds\xf,df\xf,100*eps) + %!assert(ds\xs,sparse(df\xs),100*eps) + %!test + %! pds = ds([2,1,3:10],:); + %! pdf = full(pds); + %!assert(pds\xf,pdf\xf,100*eps) + %!assert(pds\xs,sparse(pdf\xs),100*eps) + %!test + %! ds = alpha * spdiags([1:11]',0,11,10); + %! df = full(ds); + %! xf = beta * ones(11,2); + %! xs = speye(11,11); + %!assert(ds\xf,df\xf,100*eps) + %!assert(ds\xs,sparse(df\xs),100*eps) + %!test + %! pds = ds([2,1,3:11],:); + %! pdf = full(pds); + %!assert(pds\xf,pdf\xf,100*eps) + %!assert(pds\xs,sparse(pdf\xs),100*eps) + %!test + %! us = alpha*[[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]]; + %!testif HAVE_UMFPACK + %! assert(us*(us\xf),xf,100*eps) + %!testif HAVE_UMFPACK + %! assert(us*(us\xs),xs,100*eps) + %!test + %! pus = us(:,[2,1,3:12]); + %!testif HAVE_UMFPACK + %! assert(pus*(pus\xf),xf,100*eps) + %!testif HAVE_UMFPACK + %! assert(pus*(pus\xs),xs,100*eps) + %!test + %! us = alpha*[speye(11,9),[1;sparse(8,1);1;0]]; + %!testif HAVE_CXSPARSE + %! [c,r] = qr (us, xf); + %! assert(us\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (us, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(us\xs,r\c,100*eps) + %!test + %! pus = us(:,[1:8,10,9]); + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pus, xf); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pus\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pus, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pus\xs,r\c,100*eps) + %!test + %! ls = alpha*[speye(9,11);[1,sparse(1,8),1,0]]; + %! xf = beta * ones(10,2); + %! xs = speye(10,10); + %!assert(ls*(ls\xf),xf,100*eps) + %!assert(ls*(ls\xs),xs,100*eps) + %!test + %! pls = ls([1:8,10,9],:); + %!assert(pls*(pls\xf),xf,100*eps) + %!assert(pls*(pls\xs),xs,100*eps) + %!test + %! ls = alpha*[speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]; + %! xf = beta * ones(12,2); + %! xs = speye(12,12); + %!testif HAVE_CXSPARSE + %! [c,r] = qr (ls, xf); + %! assert(ls\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (ls, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(ls\xs,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! pls = ls(:,[1:8,10,9]); + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pls, xf); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pls\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pls, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pls\xs,r\c,100*eps) + + %!test alpha=1i;beta=1i; + %! n=8; + %! lf=diag(1:n);lf(n-1,1)=0.5*alpha;lf(n,2)=0.25*alpha;ls=sparse(lf); + %! uf=diag(1:n);uf(1,n-1)=2*alpha;uf(2,n)=alpha;us=sparse(uf); + %! ts=spdiags(ones(n,3),-1:1,n,n)+diag(1:n); tf = full(ts); + %! df = diag(1:n).* alpha; ds = sparse(df); + %! pdf = df(randperm(n),randperm(n)); pds = sparse(pdf); + %! plf = lf(randperm(n),randperm(n)); pls = sparse(plf); + %! puf = uf(randperm(n),randperm(n)); pus = sparse(puf); + %! bs = spdiags(repmat([1:n]',1,4),-2:1,n,n).*alpha; bf = full(bs); + %! cf = lf + lf'; cs = sparse(cf); + %! bcf = bf + bf'; bcs = sparse(bcf); + %! tcf = tf + tf'; tcs = sparse(tcf); + %! xf = diag(1:n) + fliplr(diag(1:n)).*beta; xs = sparse(xf); + %!assert(ds\xf,df\xf,1e-10); + %!assert(ds\xs,sparse(df\xf),1e-10); + %!assert(pds\xf,pdf\xf,1e-10); + %!assert(pds\xs,sparse(pdf\xf),1e-10); + %!assert(ls\xf,lf\xf,1e-10); + %!assert(sparse(ls\xs),sparse(lf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(pls\xf,plf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(pls\xs),sparse(plf\xf),1e-10); + %!assert(us\xf,uf\xf,1e-10); + %!assert(sparse(us\xs),sparse(uf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(pus\xf,puf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(pus\xs),sparse(puf\xf),1e-10); + %!assert(bs\xf,bf\xf,1e-10); + %!assert(sparse(bs\xs),sparse(bf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(cs\xf,cf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(cs\xs),sparse(cf\xf),1e-10); + %!testif HAVE_UMFPACK + %! assert(bcs\xf,bcf\xf,1e-10); + %!testif HAVE_UMFPACK + %! assert(sparse(bcs\xs),sparse(bcf\xf),1e-10); + %!assert(ts\xf,tf\xf,1e-10); + %!assert(sparse(ts\xs),sparse(tf\xf),1e-10); + %!assert(tcs\xf,tcf\xf,1e-10); + %!assert(sparse(tcs\xs),sparse(tcf\xf),1e-10); + + %% QR solver tests + + %!function f(a, sz, feps) + %! b = randn(sz); x = a \b; + %! assert (a * x, b, feps); + %! b = randn(sz)+1i*randn(sz); x = a \ b; + %! assert (a * x, b, feps); + %! b = sprandn(sz(1),sz(2),0.2); x = a \b; + %! assert (sparse(a * x), b, feps); + %! b = sprandn(sz(1),sz(2),0.2)+1i*sprandn(sz(1),sz(2),0.2); x = a \b; + %! assert (sparse(a * x), b, feps); + %!testif HAVE_CXSPARSE + %! a = alpha*sprandn(10,11,0.2)+speye(10,11); f(a,[10,2],1e-10); + %! ## Test this by forcing matrix_type, as can't get a certain + %! ## result for over-determined systems. + %! a = alpha*sprandn(10,10,0.2)+speye(10,10); matrix_type(a, "Singular"); + %! f(a,[10,2],1e-10); + + %% Rectanguar solver tests that don't use QR + + %!test + %! ds = alpha * spdiags([1:11]',0,10,11); + %! df = full(ds); + %! xf = beta * ones(10,2); + %! xs = speye(10,10); + %!assert(ds\xf,df\xf,100*eps) + %!assert(ds\xs,sparse(df\xs),100*eps) + %!test + %! pds = ds([2,1,3:10],:); + %! pdf = full(pds); + %!assert(pds\xf,pdf\xf,100*eps) + %!assert(pds\xs,sparse(pdf\xs),100*eps) + %!test + %! ds = alpha * spdiags([1:11]',0,11,10); + %! df = full(ds); + %! xf = beta * ones(11,2); + %! xs = speye(11,11); + %!assert(ds\xf,df\xf,100*eps) + %!assert(ds\xs,sparse(df\xs),100*eps) + %!test + %! pds = ds([2,1,3:11],:); + %! pdf = full(pds); + %!assert(pds\xf,pdf\xf,100*eps) + %!assert(pds\xs,sparse(pdf\xs),100*eps) + %!test + %! us = alpha*[[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]]; + %!testif HAVE_UMFPACK + %! assert(us*(us\xf),xf,100*eps) + %!testif HAVE_UMFPACK + %! assert(us*(us\xs),xs,100*eps) + %!test + %! pus = us(:,[2,1,3:12]); + %!testif HAVE_UMFPACK + %! assert(pus*(pus\xf),xf,100*eps) + %!testif HAVE_UMFPACK + %! assert(pus*(pus\xs),xs,100*eps) + %!test + %! us = alpha*[speye(11,9),[1;sparse(8,1);1;0]]; + %!testif HAVE_CXSPARSE + %! [c,r] = qr (us, xf); + %! assert(us\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (us, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(us\xs,r\c,100*eps) + %!test + %! pus = us(:,[1:8,10,9]); + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pus, xf); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pus\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pus, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pus\xs,r\c,100*eps) + %!test + %! ls = alpha*[speye(9,11);[1,sparse(1,8),1,0]]; + %! xf = beta * ones(10,2); + %! xs = speye(10,10); + %!assert(ls*(ls\xf),xf,100*eps) + %!assert(ls*(ls\xs),xs,100*eps) + %!test + %! pls = ls([1:8,10,9],:); + %!assert(pls*(pls\xf),xf,100*eps) + %!assert(pls*(pls\xs),xs,100*eps) + %!test + %! ls = alpha*[speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]; + %! xf = beta * ones(12,2); + %! xs = speye(12,12); + %!testif HAVE_CXSPARSE + %! [c,r] = qr (ls, xf); + %! assert(ls\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (ls, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(ls\xs,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! pls = ls(:,[1:8,10,9]); + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pls, xf); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pls\xf,r\c,100*eps) + %!testif HAVE_CXSPARSE + %! [c,r] = qr (pls, xs); + %! r = matrix_type(r,"Singular"); ## Force Matrix Type + %! assert(pls\xs,r\c,100*eps) + + + # ============================================================== + PATCH_EOF