changeset 6556:8810bbf321ce

[project @ 2007-04-20 18:39:40 by jwe]
author jwe
date Fri, 20 Apr 2007 18:39:41 +0000
parents 69e864d21c11
children 9883cb21e2aa
files doc/interpreter/basics.txi doc/interpreter/func.txi doc/interpreter/io.txi doc/interpreter/plot.txi doc/interpreter/strings.txi doc/interpreter/struct.txi src/ChangeLog src/DLD-FUNCTIONS/__gnuplot_raw__.l src/DLD-FUNCTIONS/sparse.cc src/data.cc src/toplev.cc
diffstat 11 files changed, 114 insertions(+), 114 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/basics.txi	Fri Apr 20 18:16:08 2007 +0000
+++ b/doc/interpreter/basics.txi	Fri Apr 20 18:39:41 2007 +0000
@@ -160,19 +160,30 @@
 @itemx --braindead
 @cindex @code{--traditional}
 @cindex @code{--braindead}
-Set initial values for user-preference variables to the following
-values for compatibility with @sc{Matlab}.
+For compatibility with @sc{Matlab}, set initial values for
+user-preferences to the following values
 
 @example
 @group
-  PS1                           = ">> "
-  PS2                           = ""
-  beep_on_error                 = true
-  crash_dumps_octave_core       = false
-  default_save_options          = "-mat-binary"
-  fixed_point_format            = true
-  page_screen_output            = false
-  print_empty_dimensions        = false
+  PS1                             = ">> "
+  PS2                             = ""
+  beep_on_error                   = true
+  crash_dumps_octave_core         = false
+  default_save_options            = "-mat-binary"
+  fixed_point_format              = true
+  history_timestamp_format_string = "%%-- %D %I:%M %p --%%"
+  page_screen_output              = false
+  print_empty_dimensions          = false
+@end group
+@end example
+
+@noindent
+and disable the following warnings
+@example
+@group
+  Octave:fopen-file-in-path
+  Octave:function-name-clash
+  Octave:load-file-in-path
 @end group
 @end example
 
--- a/doc/interpreter/func.txi	Fri Apr 20 18:16:08 2007 +0000
+++ b/doc/interpreter/func.txi	Fri Apr 20 18:39:41 2007 +0000
@@ -541,6 +541,8 @@
 @section Function Files
 @cindex function file
 
+@c FIXME need discussion of subfunctions here
+
 Except for simple one-shot programs, it is not practical to have to
 define all the functions you need each time you need them.  Instead, you
 will normally want to save them in a file so that you can easily edit
@@ -553,7 +555,7 @@
 When Octave encounters an identifier that is undefined, it first looks
 for variables or functions that are already compiled and currently
 listed in its symbol table.  If it fails to find a definition there, it
-searches a list of directories (the @deffn{path}) for files ending in
+searches a list of directories (the @dfn{path}) for files ending in
 @file{.m} that have the same base name as the undefined
 identifier.@footnote{The @samp{.m} suffix was chosen for compatibility
 with @sc{Matlab}.}  Once Octave finds a file with a name that matches,
@@ -624,6 +626,39 @@
 
 @DOCSTRING(dispatch)
 
+@menu
+* Subfunctions::
+@end menu
+
+@node Subfunctions
+@subsection Subfunctions
+
+A function file may contain secondary functions called
+@dfn{subfunctions}.  These secondary functions are only visible to the
+other functions in the same function file.  For example, a file
+@file{f.m} containing
+
+@example
+@group
+function f ()
+  printf ("in f, calling g\n");
+  g ()
+endfunction
+function g ()
+  printf ("in g, calling h\n");
+endfunction
+function h ()
+  printf ("in h\n")
+endfunction
+@end group
+@end example
+
+@noindent
+defines a main function @code{f} and two subfunctions.  The
+subfunctions @code{g} and @code{h} may only be called from the main
+function @code{f} or from the other subfunctions, but not from outside
+the file @file{f.m}.
+
 @node Script Files
 @section Script Files
 
@@ -955,7 +990,7 @@
 For example
 
 @example
-f = @sin;
+f = @@sin;
 @end example
 
 @noindent
@@ -967,7 +1002,7 @@
 @code{fsolve}.  For example
 
 @example
-f = @sin;
+f = @@sin;
 quad (f, 0, pi)
     @result 1.8391
 @end example
@@ -978,7 +1013,7 @@
 @samp{()}.  For example
 
 @example
-f = @sin;
+f = @@sin;
 feval (f, pi/4)
     @result 0.70711
 f (pi/4)
@@ -1116,7 +1151,7 @@
 Install external packages of functions in Octave.
 
 @item plot
-A set of functions that implement the @sc{Matlab}-like plotting functions.
+Functions for displaying and printing two- and three-dimensional graphs.
 
 @item polynomial
 Functions for manipulating polynomials.
--- a/doc/interpreter/io.txi	Fri Apr 20 18:16:08 2007 +0000
+++ b/doc/interpreter/io.txi	Fri Apr 20 18:39:41 2007 +0000
@@ -5,12 +5,6 @@
 @node Input and Output
 @chapter Input and Output
 
-There are two distinct classes of input and output functions.  The first
-set are modeled after the functions available in @sc{Matlab}.  The
-second set are modeled after the standard I/O library used by the C
-programming language and offer more flexibility and control over the
-output.
-
 When running interactively, Octave normally sends any output intended
 for your terminal that is more than one screen long to a paging program,
 such as @code{less} or @code{more}.  This avoids the problem of having a
--- a/doc/interpreter/plot.txi	Fri Apr 20 18:16:08 2007 +0000
+++ b/doc/interpreter/plot.txi	Fri Apr 20 18:39:41 2007 +0000
@@ -5,13 +5,8 @@
 @node Plotting
 @chapter Plotting
 
-All of Octave's plotting functions use @code{gnuplot} to handle the
-actual graphics. Most types of plots can be generated using the basic
-plotting functions, which are patterned after the equivalent functions
-in @sc{Matlab}.
-
 @menu
-* Two-Dimensional Plotting::    
+* Plotting::    
 * Specialized Two-Dimensional Plots::  
 * Three-Dimensional Plotting::  
 * Manipulating Existing Plots::
@@ -22,10 +17,10 @@
 * Interaction with gnuplot::    
 @end menu
 
-@node Two-Dimensional Plotting
-@section Two-Dimensional Plotting
+@node Plotting
+@section Plotting
 
-The @sc{Matlab}-style two-dimensional plotting commands are:
+The basic plotting commands are:
 
 @cindex plotting
 @cindex graphics
@@ -90,8 +85,6 @@
 
 @DOCSTRING(ndgrid)
 
-@DOCSTRING(meshdom)
-
 @DOCSTRING(view)
 
 @node Manipulating Existing Plots
--- a/doc/interpreter/strings.txi	Fri Apr 20 18:16:08 2007 +0000
+++ b/doc/interpreter/strings.txi	Fri Apr 20 18:39:41 2007 +0000
@@ -30,7 +30,7 @@
 
 @cindex escape sequence notation
 In double-quoted strings, the backslash character is used to introduce
-@deffn{escape sequences} that reresent other characters.  For example,
+@dfn{escape sequences} that reresent other characters.  For example,
 @samp{\n} embeds a newline character in a double-quoted string and
 @samp{\"} embeds a double quote character.
 
@@ -39,10 +39,12 @@
 Here is an example showing the difference
 
 @example
+@group
 toascii ("\n")
     @result 10
 toascii ('\n')
     @result [ 92 110 ]
+@end group
 @end example
 
 You may also insert a single quote character in a single-quoted string
@@ -50,7 +52,7 @@
 
 @example
 'I can''t escape'
-  @result I can't escape
+    @result I can't escape
 @end example
 
 Here is a table of all the escape sequences used in Octave.  They are
--- a/doc/interpreter/struct.txi	Fri Apr 20 18:16:08 2007 +0000
+++ b/doc/interpreter/struct.txi	Fri Apr 20 18:39:41 2007 +0000
@@ -2,6 +2,9 @@
 @c This is part of the Octave manual.
 @c For copying conditions, see the file gpl.texi.
 
+@c FIXME update for structure arrays
+@c FIXME need discussion of comma-separated lists somewhere
+
 @node Data Structures
 @chapter Data Structures
 @cindex structures
--- a/src/ChangeLog	Fri Apr 20 18:16:08 2007 +0000
+++ b/src/ChangeLog	Fri Apr 20 18:39:41 2007 +0000
@@ -1,5 +1,11 @@
 2007-04-20  John W. Eaton  <jwe@octave.org>
 
+	* DLD-FUNCTIONS/__gnuplot_raw__.l (deftypefn): 
+	(Vautomatic_replot): Delete static variable.
+	(Fautomatic_replot): Delete function.
+
+	* toplev.cc (Fcasesen): Delete obsolete function.
+
 	* DLD-FUNCTIONS/__gnuplot_raw__.l (gnuplot::makeplot): Check
 	whether caller is "splot", not "gsplot".
 
--- a/src/DLD-FUNCTIONS/__gnuplot_raw__.l	Fri Apr 20 18:16:08 2007 +0000
+++ b/src/DLD-FUNCTIONS/__gnuplot_raw__.l	Fri Apr 20 18:39:41 2007 +0000
@@ -273,10 +273,6 @@
 static std::string Vgnuplot_command_title = "t";
 static std::string Vgnuplot_command_end = "\n";
 
-// If TRUE, a replot command is issued automatically each time a plot
-// changes in some way.
-static bool Vautomatic_replot = true;
-
 // Check if the parser state is such that a plot keyword can occur.
 
 static bool
@@ -1552,18 +1548,6 @@
 // User-callable functions
 // -----------------------
 
-DEFUN_DLD (automatic_replot, args, nargout,
-  "-*- texinfo -*-\n\
-@deftypefn {Loadable Function} {@var{val} =} automatic_replot ()\n\
-@deftypefnx {Loadable Function} {@var{old_val} =} automatic_replot (@var{new_val})\n\
-Query or set the current automatic replot state.  Although it is fairly\n\
-inefficient, especially for large plots, automatic replotting is enabled\n\
-by default for compatibility with Matlab.\n\
-@end deftypefn")
-{
-  return SET_INTERNAL_VARIABLE (automatic_replot);
-}
-
 DEFUN_DLD (gnuplot_binary, args, nargout,
   "-*- texinfo -*-\n\
 @deftypefn {Loadable Function} {@var{val} =} gnuplot_binary ()\n\
--- a/src/DLD-FUNCTIONS/sparse.cc	Fri Apr 20 18:16:08 2007 +0000
+++ b/src/DLD-FUNCTIONS/sparse.cc	Fri Apr 20 18:39:41 2007 +0000
@@ -61,50 +61,46 @@
 
 DEFUN_DLD (sparse, args, ,
     "-*- texinfo -*-\n\
-@deftypefn {Loadable Function} {@var{sparse_val} =} sparse (@dots{})\n\
-SPARSE: create a sparse matrix\n\
-\n\
-sparse can be called in the following ways:\n\
+@deftypefn {Loadable Function} {@var{s} =} sparse (@var{a})\n\
+Create a sparse matrix from the full matrix @var{a}.\n\
+is forced back to a full matrix is resulting matrix is sparse\n\
 \n\
-@enumerate\n\
-@item @var{S} = sparse(@var{A})  where @var{A} is a full matrix\n\
-\n\
-@item @var{S} = sparse(@var{A},1)  where @var{A} is a full matrix, result\n\
+@deftypefnx {Loadable Function} {@var{s} =} sparse (@var{a}, 1)\n\
+Create a sparse matrix and convert it back to a full matrix.\n\
 is forced back to a full matrix is resulting matrix is sparse\n\
 \n\
-@item @var{S} = sparse(@var{i},@var{j},@var{s},@var{m},@var{n},@var{nzmax})  where\n\
-   @itemize @w \n\
-@var{i},@var{j}   are integer index vectors (1 x nnz) @* \n\
-@var{s}     is the vector of real or complex entries (1 x nnz) @* \n\
-@var{m},@var{n}   are the scalar dimentions of S @* \n\
-@var{nzmax} is ignored (here for compatability with Matlab) @* \n\
+@deftypefnx {Loadable Function} {@var{s} =} sparse (@var{i}, @var{j}, @var{sv}, @var{m}, @var{n}, @var{nzmax})\n\
+Create a sparse matrix given integer index vectors @var{i} and @var{j},\n\
+a 1-by-@code{nnz} vector of real of complex values @var{sv}, overall\n\
+dimensions @var{m} and @var{n} of the sparse matrix.  The argument\n\
+@code{nzmax} is ignored but accepted for compatability with @sc{Matlab}.\n\
 \n\
-        if multiple values are specified with the same @var{i},@var{j}\n\
-        position, the corresponding values in @var{s} will be added\n\
-   @end itemize\n\
+@strong{Note}: if multiple values are specified with the same\n\
+@var{i}, @var{j} indices, the corresponding values in @var{s} will\n\
+be added.\n\
+\n\
+@item The following usages are equivalent:\n\
 \n\
-@item The following usages are equivalent to (2) above:\n\
-   @itemize @w \n\
-@var{S} = sparse(@var{i},@var{j},@var{s},@var{m},@var{n})@*\n\
-@var{S} = sparse(@var{i},@var{j},@var{s},@var{m},@var{n},'summation')@*\n\
-@var{S} = sparse(@var{i},@var{j},@var{s},@var{m},@var{n},'sum')@*\n\
-   @end itemize\n\
-\n\
-@item @var{S} = sparse(@var{i},@var{j},@var{s},@var{m},@var{n},'unique')@*\n\
+@example\n\
+@group\n\
+s = sparse (i, j, s, m, n)\n\
+s = sparse (i, j, s, m, n, \"summation\")\n\
+s = sparse (i, j, s, m, n, \"sum\")\n\
+@end group\n\
+@end example\n\
 \n\
-   @itemize @w \n\
-same as (2) above, except that rather than adding,\n\
-if more than two values are specified for the same @var{i},@var{j}\n\
-position, then the last specified value will be kept\n\
-   @end itemize\n\
+@deftypefnx {Loadable Function} {@var{s} =} sparse (@var{i}, @var{j}, @var{s}, @var{m}, @var{n}, \"unique\")\n\
+Same as above, except that if more than two values are specified for the\n\
+same @var{i}, @var{j} indices, the last specified value will be used.\n\
 \n\
-@item @var{S}=  sparse(@var{i},@var{j},@var{sv})          uses @var{m}=max(@var{i}), @var{n}=max(@var{j})\n\
-\n\
-@item @var{S}=  sparse(@var{m},@var{n})            does sparse([],[],[],@var{m},@var{n},0)\n\
+@deftypefnx {Loadable Function} {@var{s} =} sparse (@var{i}, @var{j}, @var{sv})\n\
+Uses @code{@var{m} = max (@var{i})}, @code{@var{n} = max (@var{j})}\n\
 \n\
-@var{sv}, and @var{i} or @var{j} may be scalars, in\n\
-which case they are expanded to all have the same length\n\
-@end enumerate\n\
+@deftypefnx {Loadable Function} {@var{s} =} sparse (@var{m}, @var{n})\n\
+Equivalent to @code{sparse ([], [], [], @var{m}, @var{n}, 0)}\n\
+\n\
+If any of @var{sv}, @var{i} or @var{j} are scalars, they are expanded\n\
+to have a common size.\n\
 @seealso{full}\n\
 @end deftypefn")
 {
--- a/src/data.cc	Fri Apr 20 18:16:08 2007 +0000
+++ b/src/data.cc	Fri Apr 20 18:39:41 2007 +0000
@@ -930,7 +930,7 @@
 @deftypefn {Built-in Function} {} length (@var{a})\n\
 Return the `length' of the object @var{a}.  For matrix objects, the\n\
 length is the number of rows or columns, whichever is greater (this\n\
-odd definition is used for compatibility with Matlab).\n\
+odd definition is used for compatibility with @sc{Matlab}).\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -2252,8 +2252,9 @@
 val = zeros (n,m, \"uint8\")\n\
 @end example\n\
 \n\
-For compatibility with @sc{Matlab}, calling @code{eye} with no arguments\n\
-is equivalent to calling it with an argument of 1.\n\
+Calling @code{eye} with no arguments is equivalent to calling it\n\
+with an argument of 1.  This odd definition is for compatibility\n\
+with @sc{Matlab}.\n\
 @end deftypefn")
 {
   octave_value retval;
--- a/src/toplev.cc	Fri Apr 20 18:16:08 2007 +0000
+++ b/src/toplev.cc	Fri Apr 20 18:39:41 2007 +0000
@@ -295,31 +295,6 @@
   exit (retval == EOF ? 0 : retval);
 }
 
-DEFCMD (casesen, args, ,
-  "-*- texinfo -*-\n\
-@deffn {Command} casesen arg\n\
-Provided for compatibility with Matlab, but does nothing.\n\
-@end deffn")
-{
-  octave_value_list retval;
-
-  int argc = args.length () + 1;
-
-  string_vector argv = args.make_argv ("casesen");
-
-  if (error_state)
-    return retval;
-
-  if (argc == 1 || (argc > 1 && argv[1] == "off"))
-    warning ("casesen: sorry, Octave is always case sensitive");
-  else if (argc > 1 && argv[1] == "on")
-    ; // ok.
-  else
-    print_usage ();
-
-  return retval;
-}
-
 DEFUN (quit, args, nargout,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} exit (@var{status})\n\