Mercurial > hg > octave-nkf
changeset 19791:fe689210525c gui-release
maint: Periodic merge of stable to gui-release.
line wrap: on
line diff
--- a/Makefile.am +++ b/Makefile.am @@ -3,24 +3,24 @@ # Copyright (C) 1993-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. include build-aux/common.mk -## Avoid making multiple subdirs in parallel which can lead +## Avoid making multiple subdirs in parallel which can lead ## to a confusing error message stream .NOTPARALLEL:
--- a/build-aux/common.mk +++ b/build-aux/common.mk @@ -52,7 +52,7 @@ GPERF = @GPERF@ AR = @AR@ -ARFLAGS = @ARFLAGS@ +ARFLAGS = @ARFLAGS@ TEMPLATE_AR = @TEMPLATE_AR@ TEMPLATE_ARFLAGS = @TEMPLATE_ARFLAGS@ @@ -437,7 +437,7 @@ # Where to put object files that will by dynamically loaded. # This path usually includes the Octave version and configuration # name, so that multiple configurations for multiple versions of -# Octave may be installed at once. +# Octave may be installed at once. octfiledir = @octfiledir@ # Directories Octave should search for object files that will be
--- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. dnl -dnl Copyright (C) 1993-2013 John W. Eaton +dnl Copyright (C) 1993-2014 John W. Eaton ### ### This file is part of Octave. ###
--- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -3,17 +3,17 @@ # Copyright (C) 1993-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/doc/doxyhtml/Makefile.am +++ b/doc/doxyhtml/Makefile.am @@ -3,17 +3,17 @@ # Copyright (C) 1993-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/Makefile.am +++ b/doc/interpreter/Makefile.am @@ -3,17 +3,17 @@ # Copyright (C) 1993-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. @@ -26,7 +26,7 @@ TEXINPUTS := "$(PATH_SEPARATOR)$(srcdir)$(PATH_SEPARATOR)$(TEXINPUTS)$(PATH_SEPARATOR)" export TEXINPUTS -## Include custom texmf.cnf necessary to run @seealso macro +## Include custom texmf.cnf necessary to run @seealso macro TEXMFCNF := "..$(PATH_SEPARATOR)$(srcdir)/..$(PATH_SEPARATOR)$(TEXMFCNF)$(PATH_SEPARATOR)" export TEXMFCNF @@ -106,7 +106,7 @@ $(JAVA_IMAGES) ## FIXME: JAVA_IMAGES will eventually need to be added to the HTML build. -## It will require a different Makefile rule later because +## It will require a different Makefile rule later because ## JAVA_IMAGES live in a subdir rather than in the current directory. HTMLDIR_IMAGES = $(addprefix octave.html/, $(IMAGES_PNG)) @@ -195,7 +195,7 @@ ## the DVI and PDF builds are forced to run serially through a Makefile rule. octave.pdf: octave.dvi -# Prevent packaging of distribution unless all libraries +# Prevent packaging of distribution unless all libraries # necessary to create documentation are present dist-hook: @$(GREP) '#define HAVE_COLAMD 1' $(top_builddir)/config.h > /dev/null || { echo "Documentation creation requires missing COLAMD library. Cannot package distribution!" ; exit 1; } @@ -255,7 +255,7 @@ mv $@-t $@ [ -s $@ ] || rm -f $@ -spellcheck: $(SPELLCHECK_FILES) +spellcheck: $(SPELLCHECK_FILES) @if ls *.scheck >/dev/null 2>&1 ; then \ echo "Spellcheck failed"; \ echo "Review the following files:"; \
--- a/doc/interpreter/arith.txi +++ b/doc/interpreter/arith.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -21,7 +21,7 @@ Unless otherwise noted, all of the functions described in this chapter will work for real and complex scalar, vector, or matrix arguments. Functions -described as @dfn{mapping functions} apply the given operation individually to +described as @dfn{mapping functions} apply the given operation individually to each element when given a matrix argument. For example: @example
--- a/doc/interpreter/audio.txi +++ b/doc/interpreter/audio.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/basics.txi +++ b/doc/interpreter/basics.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -126,10 +126,10 @@ @item --image-path @var{path} @cindex @code{--image-path @var{path}} -Add path to the head of the search path for images. The value of -@var{path} specified on the command line will override any value of -@w{@env{OCTAVE_IMAGE_PATH}} found in the environment, but not any commands -in the system or user startup files that set the built-in variable +Add path to the head of the search path for images. The value of +@var{path} specified on the command line will override any value of +@w{@env{OCTAVE_IMAGE_PATH}} found in the environment, but not any commands +in the system or user startup files that set the built-in variable @w{@env{IMAGE_PATH}}. @item --info-file @var{filename} @@ -181,7 +181,7 @@ @item --no-init-path @cindex @code{--no-init-path} -Don't initialize the search path for function files to include default +Don't initialize the search path for function files to include default locations. @item --no-line-editing @@ -210,7 +210,7 @@ @itemx -p @var{path} @cindex @code{--path @var{path}} @cindex @code{-p @var{path}} -Add path to the head of the search path for function files. The +Add path to the head of the search path for function files. The value of @var{path} specified on the command line will override any value of @w{@env{OCTAVE_PATH}} found in the environment, but not any commands in the system or user startup files that set the internal load path through one @@ -292,7 +292,7 @@ @option{--persist} is also specified. @end table -Octave also includes several functions which return information +Octave also includes several functions which return information about the command line, including the number of arguments and all of the options. @@ -302,7 +302,7 @@ @DOCSTRING(program_invocation_name) -Here is an example of using these functions to reproduce the command +Here is an example of using these functions to reproduce the command line which invoked Octave. @example @@ -318,7 +318,7 @@ @noindent @xref{Indexing Cell Arrays}, for an explanation of how to retrieve objects -from cell arrays, and @ref{Defining Functions}, for information about the +from cell arrays, and @ref{Defining Functions}, for information about the variable @code{nargin}. @node Startup Files @@ -337,10 +337,10 @@ @cindex site startup file where @var{octave-home} is the directory in which Octave is installed (the default is @file{/usr/local}). -This file is provided so that changes to the default Octave environment +This file is provided so that changes to the default Octave environment can be made globally for all users at your site for all versions of Octave -you have installed. Care should be taken when making changes to this file -since all users of Octave at your site will be affected. The default file +you have installed. Care should be taken when making changes to this file +since all users of Octave at your site will be affected. The default file may be overridden by the environment variable @w{@env{OCTAVE_SITE_INITFILE}}. @item @var{octave-home}/share/octave/@var{version}/m/startup/octaverc @@ -357,7 +357,7 @@ @item ~/.octaverc @cindex personal startup file @cindex @code{~/.octaverc} -This file is used to make personal changes to the default +This file is used to make personal changes to the default Octave environment. @item .octaverc @@ -457,9 +457,9 @@ Octave uses the GNU Readline library to provide an extensive set of command-line editing and history features. Only the most common features are described in this manual. In addition, all of the editing -functions can be bound to different key strokes at the user's discretion. -This manual assumes no changes from the default Emacs bindings. See the GNU -Readline Library manual for more information on customizing Readline and +functions can be bound to different key strokes at the user's discretion. +This manual assumes no changes from the default Emacs bindings. See the GNU +Readline Library manual for more information on customizing Readline and for a complete feature list. To insert printing characters (letters, digits, symbols, etc.), simply @@ -472,7 +472,7 @@ and then press @key{a}. In the following sections, control characters such as @kbd{Control-a} are written as @kbd{C-a}. -Another set of command-line editing functions use Meta characters. To +Another set of command-line editing functions use Meta characters. To type @kbd{M-u}, hold down the @key{META} key and press @key{u}. Depending on the keyboard, the @key{META} key may be labeled @key{ALT} or even @key{WINDOWS}. If your terminal does not have a @key{META} key, you @@ -576,7 +576,7 @@ @item M-@key{DEL} Kill from the cursor to the start of the previous word, or if between -words, to the start of the previous word. +words, to the start of the previous word. @item C-w Kill from the cursor to the previous whitespace. This is different than @@ -705,7 +705,7 @@ the history as necessary. @end table -On most terminals, you can also use the up and down arrow keys in place +On most terminals, you can also use the up and down arrow keys in place of @kbd{C-p} and @kbd{C-n} to move through the history list. In addition to the keyboard commands for moving through the history @@ -904,13 +904,13 @@ @samp{x} was found to be undefined near line 1 and column 24 of some function or expression. For errors occurring within functions, lines are counted from the beginning of the file containing the function -definition. For errors occurring outside of an enclosing function, -the line number indicates the input line number, which is usually displayed +definition. For errors occurring outside of an enclosing function, +the line number indicates the input line number, which is usually displayed in the primary prompt string. -The second and third lines of the error message indicate that the error -occurred within the function @code{f}. If the function @code{f} had been -called from within another function, for example, @code{g}, the list of +The second and third lines of the error message indicate that the error +occurred within the function @code{f}. If the function @code{f} had been +called from within another function, for example, @code{g}, the list of errors would have ended with one more line: @example @@ -986,9 +986,9 @@ @file{~/.octaverc} file. @xref{Invoking Octave from the Command Line}. Note that some operating systems may place a limit on the number of -characters that are recognized after @samp{#!}. Also, the arguments -appearing in a @samp{#!} line are parsed differently by various -shells/systems. The majority of them group all the arguments together in one +characters that are recognized after @samp{#!}. Also, the arguments +appearing in a @samp{#!} line are parsed differently by various +shells/systems. The majority of them group all the arguments together in one string and pass it to the interpreter as a single argument. In this case, the following script: @@ -1009,7 +1009,7 @@ @noindent which will produce an error message. Unfortunately, it is -not possible for Octave to determine whether it has been called from the +not possible for Octave to determine whether it has been called from the command line or from a @samp{#!} script, so some care is needed when using the @samp{#!} mechanism. @@ -1039,7 +1039,7 @@ @cindex documenting Octave programs A @dfn{comment} is some text that is included in a program for the sake -of human readers, and which is NOT an executable part of the program. +of human readers, and which is NOT an executable part of the program. Comments can explain what the program does, and how it works. Nearly all programming languages have provisions for comments, because programs are typically hard to understand without them. @@ -1064,7 +1064,7 @@ @example @group function countdown - # Count down for main rocket engines + # Count down for main rocket engines disp (3); disp (2); disp (1); @@ -1080,14 +1080,14 @@ @cindex @samp{#@{} @cindex @samp{%@{} -Entire blocks of code can be commented by enclosing the code between -matching @samp{#@{} and @samp{#@}} or @samp{%@{} and @samp{%@}} markers. +Entire blocks of code can be commented by enclosing the code between +matching @samp{#@{} and @samp{#@}} or @samp{%@{} and @samp{%@}} markers. For example, @example @group function quick_countdown - # Count down for main rocket engines + # Count down for main rocket engines disp (3); #@{ disp (2); @@ -1152,5 +1152,5 @@ program at a later time. The @code{help} parser currently only recognizes single line comments -(@pxref{Single Line Comments}) and not block comments for the initial -help text. +(@pxref{Single Line Comments}) and not block comments for the initial +help text.
--- a/doc/interpreter/bugs.txi +++ b/doc/interpreter/bugs.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -226,7 +226,7 @@ @item The command arguments you gave Octave to execute that example and observe the bug. To guarantee you won't omit something important, -list all the options. +list all the options. If we were to try to guess the arguments, we would probably guess wrong and then we would not encounter the bug.
--- a/doc/interpreter/container.txi +++ b/doc/interpreter/container.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -260,7 +260,7 @@ 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: +the structure array, you can type its name: @example @group @@ -271,12 +271,12 @@ 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 variable like @code{@var{x}(1)}, which returns a structure with two fields: @example @@ -350,7 +350,7 @@ @example @group -in = struct ("call1", @{x, Inf, "last"@}, +in = struct ("call1", @{x, Inf, "last"@}, "call2", @{x, Inf, "first"@}) @result{} in = @{ @@ -450,7 +450,7 @@ @end example If the values passed to @code{struct} are a mix of scalar and cell -arrays, then the scalar arguments are expanded to create a +arrays, then the scalar arguments are expanded to create a structure array with a consistent dimension. For example: @example @@ -458,7 +458,7 @@ s = struct ("field1", @{1, "one"@}, "field2", @{2, "two"@}, "field3", 3); s.field1 - @result{} + @result{} ans = 1 ans = one @@ -645,7 +645,7 @@ 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. +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} @@ -706,7 +706,7 @@ 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 +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: @@ -717,7 +717,7 @@ @result{} ans = z c(2,3) - @result{} ans = + @result{} ans = @{ [1,1] = z @} @@ -757,18 +757,18 @@ c(:, [1, 3]) = 0; @end example -@noindent Here, the scalar @samp{0} is automatically promoted to +@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: +following command: @example @group c = @{1, 2, 3; 4, 5, 6@}; c([1, 2], :) = c([2, 1], :) - @result{} = + @result{} = @{ [1,1] = 4 [2,1] = 1 @@ -789,7 +789,7 @@ @example @group [c@{[1,2], :@}] = deal (c@{[2, 1], :@}) - @result{} = + @result{} = @{ [1,1] = 1 [2,1] = 4 @@ -852,7 +852,7 @@ 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: +converts a character array to a cell array of strings: @example @group @@ -891,7 +891,7 @@ 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 +@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 @@ -952,7 +952,7 @@ 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 +Arrays}). In the expressions @example @group @@ -993,7 +993,7 @@ @end example Similarly, it is possible to create a new cell array containing cell -elements selected with @code{@{@}}. By surrounding the list with +elements selected with @code{@{@}}. By surrounding the list with @samp{@{} and @samp{@}} a new cell array will be created, as the following example illustrates: @@ -1020,14 +1020,14 @@ @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 + @print{} GNU Octave is Free Software printf ("%s ", c@{:@}); - @print{} GNU Octave is Free Software + @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 +generated with @code{@{@}} can be assigned to. An example is @example @group @@ -1059,8 +1059,8 @@ @example @group -x = ceil (randn (10, 1)); -in = struct ("call1", @{x, 3, "last"@}, +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);
--- a/doc/interpreter/cp-idx.txi +++ b/doc/interpreter/cp-idx.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/data.txi +++ b/doc/interpreter/data.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/debug.txi +++ b/doc/interpreter/debug.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/diagperm.txi +++ b/doc/interpreter/diagperm.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -33,7 +33,7 @@ @section Creating and Manipulating Diagonal/Permutation Matrices A diagonal matrix is defined as a matrix that has zero entries outside the main -diagonal; that is, +diagonal; that is, @tex $D_{ij} = 0$ if $i \neq j$ @end tex @@ -46,14 +46,14 @@ A permutation matrix is defined as a square matrix that has a single element equal to unity in each row and each column; all other elements are zero. That -is, there exists a permutation (vector) +is, there exists a permutation (vector) @tex $p$ such that $P_{ij}=1$ if $j = p_i$ and -$P_{ij}=0$ otherwise. +$P_{ij}=0$ otherwise. @end tex @ifnottex -@code{p} such that @code{P(i,j) == 1} if @code{j == p(i)} and -@code{P(i,j) == 0} otherwise. +@code{p} such that @code{P(i,j) == 1} if @code{j == p(i)} and +@code{P(i,j) == 0} otherwise. @end ifnottex Octave provides special treatment of real and complex rectangular diagonal @@ -105,7 +105,7 @@ 0 0 3 0 0 0 0 0 0 -@end example +@end example @node Creating Permutation Matrices @subsection Creating Permutation Matrices @@ -123,11 +123,11 @@ will create a permutation matrix - a special matrix object. @example -eye (n) (q, :) +eye (n) (q, :) @end example @noindent -will also work (and create a row permutation matrix), as well as +will also work (and create a row permutation matrix), as well as @example eye (n) (q1, q2). @@ -231,7 +231,7 @@ Assume @var{D} is a diagonal matrix. If @var{M} is a full matrix, then @code{D*M} will scale the rows of @var{M}. That means, if @code{S = D*M}, then for each pair of indices -i,j it holds +i,j it holds @tex $$S_{ij} = D_{ii} M_{ij}$$ @end tex @@ -252,8 +252,8 @@ @end example @noindent -i.e., trailing @code{n-m} rows of @var{M} are ignored. If @code{m > n}, -then @code{D*M} is equivalent to +i.e., trailing @code{n-m} rows of @var{M} are ignored. If @code{m > n}, +then @code{D*M} is equivalent to @example [D(1:n,n) * M; zeros(m-n, columns (M))], @@ -271,7 +271,7 @@ a rectangular diagonal matrix is again a rectangular diagonal matrix with swapped dimensions, where each nonzero diagonal element is replaced by its reciprocal. -The matrix division algorithms do, in fact, use division rather than +The matrix division algorithms do, in fact, use division rather than multiplication by reciprocals for better numerical accuracy; otherwise, they honor the above definition. Note that a diagonal matrix is never truncated due to ill-conditioning; otherwise, it would not be of much use for scaling. This @@ -290,9 +290,9 @@ @example @group D1 + D2 -D1 - D2 -D1 * D2 -D1 / D2 +D1 - D2 +D1 * D2 +D1 / D2 D1 \ D2 @end group @end example @@ -304,7 +304,7 @@ Also, a diagonal matrix @var{D} can be multiplied or divided by a scalar, or raised to a scalar power if it is square, producing diagonal matrix result in -all cases. +all cases. A diagonal matrix can also be transposed or conjugate-transposed, giving the expected result. Extracting a leading submatrix of a diagonal matrix, i.e., @@ -332,7 +332,7 @@ If @var{P} is a permutation matrix and @var{M} a matrix, the expression @code{P*M} will permute the rows of @var{M}. Similarly, @code{M*P} will -yield a column permutation. +yield a column permutation. Matrix division @code{P\M} and @code{M/P} can be used to do inverse permutation. The previously described syntax for creating permutation matrices can actually @@ -395,7 +395,7 @@ when given a diagonal matrix, as well as @dfn{cond}. The following mapper functions can be applied to a diagonal matrix without converting it to a full one: -@dfn{abs}, @dfn{real}, @dfn{imag}, @dfn{conj}, @dfn{sqrt}. +@dfn{abs}, @dfn{real}, @dfn{imag}, @dfn{conj}, @dfn{sqrt}. A diagonal matrix can also be returned from the @dfn{balance} and @dfn{svd} functions. The @dfn{sparse} function will convert a diagonal matrix efficiently to a @@ -491,21 +491,21 @@ The contents of this section apply also to sparse matrices, discussed in the following chapter. (@pxref{Sparse Matrices}) -The IEEE floating point standard defines the result of the expressions @code{0*Inf} and +The IEEE floating point standard defines the result of the expressions @code{0*Inf} and @code{0*NaN} as @code{NaN}. This is widely agreed to be a good compromise. Numerical software dealing with structured and sparse matrices (including Octave) however, almost always makes a distinction between a "numerical zero" -and an "assumed zero". +and an "assumed zero". A "numerical zero" is a zero value occurring in a place where any floating-point value could occur. It is normally stored somewhere in memory as an explicit -value. +value. An "assumed zero", on the contrary, is a zero matrix element implied by the matrix structure (diagonal, triangular) or a sparsity pattern; its value is usually not stored explicitly anywhere, but is implied by the underlying data structure. -The primary distinction is that an assumed zero, when multiplied +The primary distinction is that an assumed zero, when multiplied by any number, or divided by any nonzero number, yields *always* a zero, even when, e.g., multiplied by @code{Inf} or divided by @code{NaN}.
--- a/doc/interpreter/diffeq.txi +++ b/doc/interpreter/diffeq.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/doccheck/README +++ b/doc/interpreter/doccheck/README @@ -3,7 +3,7 @@ doccheck directory ################################################################################ This directory contains scripts and data for validating Octave's Texinfo -documentation. These scripts are internal developer tools for ensuring +documentation. These scripts are internal developer tools for ensuring consistent documentation formats and avoiding misspellings. The scripts provide 3 services: @@ -12,7 +12,7 @@ specific to Octave. 2) A grammarchecker designed from scratch in Perl to ensure a common format - for Octave documentation and to make use of as many features of Texinfo as + for Octave documentation and to make use of as many features of Texinfo as possible. 3) A list of undocumented functions, i.e, those missing an @DOCSTRING reference @@ -48,7 +48,7 @@ vi misspellings .... Review misspellings and identify where to correct the source (.m, .cc, .txi) - The original source file is marked with a comment: + The original source file is marked with a comment: @c FUNCTION_NAME SRC_DIR/SRC_FILE @@ -85,7 +85,7 @@ UNDOCUMENTED FUNCTIONS: From the doc/interpreter/ directory, type 'make undocumented_list'. -This will produce the undocumented_list file with the undocumented functions. +This will produce the undocumented_list file with the undocumented functions. Functions which don't require an @DOCSTRING reference can be added to the list of exceptions at the bottom of the mk_undocumented_list script. This is often
--- a/doc/interpreter/doccheck/spellcheck +++ b/doc/interpreter/doccheck/spellcheck @@ -3,7 +3,7 @@ ################################################################################ # File : spellcheck # Purpose: Spellcheck a single Texinfo file -# written in Perl, rather than the shell, to be more portable to OS +# written in Perl, rather than the shell, to be more portable to OS # without good command lines such as Windows. # Usage : spellcheck FILENAME.texi ################################################################################
--- a/doc/interpreter/emacs.txi +++ b/doc/interpreter/emacs.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -117,7 +117,7 @@ @item TAB Indents current Octave line based on its contents and on previous -lines (@code{indent-according-to-mode}). +lines (@code{indent-according-to-mode}). @item ; Insert an ``electric'' semicolon (@code{octave-electric-semi}). If @@ -138,7 +138,7 @@ @item M-TAB Perform completion on Octave symbol preceding point, comparing that symbol against Octave's reserved words and built-in variables -(@code{octave-complete-symbol}). +(@code{octave-complete-symbol}). @item M-C-a Move backward to the beginning of a function @@ -253,7 +253,7 @@ The variable @code{octave-help-files} is a list of files to search through and defaults to @qcode{'("octave")}. If there is also an Octave Local Guide with corresponding info file, say, @file{octave-LG}, you can -have @code{octave-help} search both files by +have @code{octave-help} search both files by @lisp (setq octave-help-files '("octave" "octave-LG")) @end lisp @@ -269,7 +269,7 @@ newline and indents it. This is particularly inconvenient for users with keyboards which do not have a special @key{LFD} key at all; in such cases, it is typically more convenient to use @key{RET} as the @key{LFD} -key (rather than typing @kbd{C-j}). +key (rather than typing @kbd{C-j}). You can make @key{RET} do this by adding @lisp @@ -316,7 +316,7 @@ @item octave-continuation-offset Extra indentation applied to Octave continuation lines. -Default is 4. +Default is 4. @item octave-continuation-string String used for Octave continuation lines. @@ -375,7 +375,7 @@ @appendixsec Running Octave from Within Emacs The package @file{octave} provides commands for running an inferior -Octave process in a special Emacs buffer. Use +Octave process in a special Emacs buffer. Use @lisp M-x run-octave @end lisp
--- a/doc/interpreter/errors.txi +++ b/doc/interpreter/errors.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -110,14 +110,14 @@ f () @print{} error: Invalid call to f. Correct usage is: -@print{} +@print{} @print{} -- Function File: f (ARG1) -@print{} -@print{} +@print{} +@print{} @print{} Additional help for built-in functions and operators is @print{} available in the online version of the manual. Use the command @print{} `doc <topic>' to search the manual index. -@print{} +@print{} @print{} Help and information about Octave is also available on the WWW @print{} at http://www.octave.org and via the help@@octave.org @print{} mailing list. @@ -266,8 +266,8 @@ @subsection Recovering From Errors Octave provides several ways of recovering from errors. There are -@code{try}/@code{catch} blocks, -@code{unwind_protect}/@code{unwind_protect_cleanup} blocks, +@code{try}/@code{catch} blocks, +@code{unwind_protect}/@code{unwind_protect_cleanup} blocks, and finally the @code{onCleanup} command. The @code{onCleanup} command associates an ordinary Octave variable (the @@ -372,7 +372,7 @@ @example @group -warning ("example:non-negative-variable", +warning ("example:non-negative-variable", "'a' must be non-negative. Setting 'a' to zero."); @end group @end example @@ -383,7 +383,7 @@ @example @group warning ("off", "example:non-negative-variable"); -warning ("example:non-negative-variable", +warning ("example:non-negative-variable", "'a' must be non-negative. Setting 'a' to zero."); @end group @end example
--- a/doc/interpreter/eval.txi +++ b/doc/interpreter/eval.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -40,7 +40,7 @@ The @code{feval} function allows you to call a function from a string containing its name. This is useful when writing a function that needs to call user-supplied functions. The @code{feval} function takes the name -of the function to call as its first argument, and the remaining +of the function to call as its first argument, and the remaining arguments are given to the function. The following example is a simple-minded function using @code{feval}
--- a/doc/interpreter/expr.txi +++ b/doc/interpreter/expr.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -119,8 +119,8 @@ a = [1, 2, 3, 4]; a(1:end/2) # first half of a => [1, 2] -a(end + 1) = 5; # append element -a(end) = []; # delete element +a(end + 1) = 5; # append element +a(end) = []; # delete element a(1:2:end) # odd elements of a => [1, 3] a(2:2:end) # even elements of a => [2, 4] a(end:-1:1) # reversal of a => [4, 3, 2 , 1] @@ -772,7 +772,7 @@ @example @group - abs (@var{z1}) < abs (@var{z2}) + abs (@var{z1}) < abs (@var{z2}) || (abs (@var{z1}) == abs (@var{z2}) && arg (@var{z1}) < arg (@var{z2})) @end group @end example @@ -1008,7 +1008,7 @@ operands for the operator @samp{&}. @sc{matlab} has special behavior that allows the operators @samp{&} and -@samp{|} to short-circuit when used in the truth expression for @code{if} and +@samp{|} to short-circuit when used in the truth expression for @code{if} and @code{while} statements. The Octave parser may be instructed to behave in the same manner, but its use is strongly discouraged. @@ -1164,7 +1164,7 @@ @end example @noindent -is equivalent to +is equivalent to @example @group
--- a/doc/interpreter/external.txi +++ b/doc/interpreter/external.txi @@ -7,12 +7,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -129,7 +129,7 @@ * Input Parameter Checking in Oct-Files:: * Exception and Error Handling in Oct-Files:: * Documentation and Test of Oct-Files:: -@c * Application Programming Interface for Oct-Files:: +@c * Application Programming Interface for Oct-Files:: @end menu @node Getting Started with Oct-Files @@ -155,7 +155,7 @@ @end group @end example -The first critical line is @code{#include <octave/oct.h>} which +The first critical line is @code{#include <octave/oct.h>} which makes available most of the definitions necessary for a C++ oct-file. Note that @file{octave/oct.h} is a C++ header and cannot be directly @code{#include}'ed in a C source file, nor any other language. @@ -739,7 +739,7 @@ @end group @end example -@noindent +@noindent is perfectly valid. However, it is a very bad idea because as each new element is added to the sparse matrix the matrix needs to request more space and reallocate memory. This is an expensive operation, that will @@ -749,7 +749,7 @@ occupies more memory than strictly needed. It is not always possible to know the number of non-zero elements prior -to filling a matrix. For this reason the additional unused storage of +to filling a matrix. For this reason the additional unused storage of a sparse matrix can be removed after its creation with the @code{maybe_compress} function. In addition, @code{maybe_compress} can deallocate the unused storage, but it can also remove zero elements @@ -870,7 +870,7 @@ octave_value_list retval; SparseMatrix sm = args(0).sparse_matrix_value (); -SparseComplexMatrix scm = +SparseComplexMatrix scm = args(1).sparse_complex_matrix_value (); SparseBoolMatrix sbm = args(2).sparse_bool_matrix_value (); @dots{} @@ -1214,7 +1214,7 @@ @example @group -DEFUN_DLD (do_what_i_want, args, nargout, +DEFUN_DLD (do_what_i_want, args, nargout, "-*- texinfo -*-\n\ @@deftypefn @{Function File@} @{@} do_what_i_say (@@var@{n@})\n\ A function that does what the user actually wants rather\n\ @@ -1256,7 +1256,7 @@ @c @node Application Programming Interface for Oct-Files @c @subsection Application Programming Interface for Oct-Files -@c +@c @c WRITE ME, using Coda section 1.3 as a starting point. @node Mex-Files @@ -1283,7 +1283,7 @@ * Structures with Mex-Files:: * Sparse Matrices with Mex-Files:: * Calling Other Functions in Mex-Files:: -@c * Application Programming Interface for Mex-Files:: +@c * Application Programming Interface for Mex-Files:: @end menu @node Getting Started with Mex-Files @@ -1565,11 +1565,11 @@ @example @group -mxArray *mxCreateStructArray (int ndims, int *dims, - int num_keys, +mxArray *mxCreateStructArray (int ndims, int *dims, + int num_keys, const char **keys); -mxArray *mxCreateStructMatrix (int rows, int cols, - int num_keys, +mxArray *mxCreateStructMatrix (int rows, int cols, + int num_keys, const char **keys); @end group @end example @@ -1582,11 +1582,11 @@ @group mxArray *mxGetField (const mxArray *ptr, mwIndex index, const char *key); -mxArray *mxGetFieldByNumber (const mxArray *ptr, +mxArray *mxGetFieldByNumber (const mxArray *ptr, mwIndex index, int key_num); -void mxSetField (mxArray *ptr, mwIndex index, +void mxSetField (mxArray *ptr, mwIndex index, const char *key, mxArray *val); -void mxSetFieldByNumber (mxArray *ptr, mwIndex index, +void mxSetFieldByNumber (mxArray *ptr, mwIndex index, int key_num, mxArray *val); @end group @end example @@ -1607,7 +1607,7 @@ An example of the behavior of this function within Octave is then @example -a(1).f1 = "f11"; a(1).f2 = "f12"; +a(1).f1 = "f11"; a(1).f2 = "f12"; a(2).f1 = "f21"; a(2).f2 = "f22"; b = mystruct (a); @result{} field f1(0) = f11 @@ -1725,7 +1725,7 @@ @c @node Application Programming Interface for Mex-Files @c @subsection Application Programming Interface for Mex-Files -@c +@c @c WRITE ME, refer to mex.h and mexproto.h @node Standalone Programs @@ -1780,12 +1780,12 @@ @end group @end example -It is worth noting that, if only built-in functions are to be called from -a C++ standalone program, then it does not need to initialize the -interpreter to do so. The general rule is that, for a built-in +It is worth noting that, if only built-in functions are to be called from +a C++ standalone program, then it does not need to initialize the +interpreter to do so. The general rule is that, for a built-in function named @code{function_name} in the interpreter, there will be -a C++ function named @code{Ffunction_name} (note the prepended capital -@code{F}) accessible in the C++ API@. The declarations for all built-in +a C++ function named @code{Ffunction_name} (note the prepended capital +@code{F}) accessible in the C++ API@. The declarations for all built-in functions are collected in the header file @code{builtin-defun-decls.h}. This feature should be used with care as the list of built-in functions can change. No guarantees can be made that a function that is currently built in @@ -1803,7 +1803,7 @@ @example @group $ mkoctfile --link-stand-alone standalonebuiltin.cc -o standalonebuiltin -$ ./standalonebuiltin +$ ./standalonebuiltin This is a matrix: 11 12 21 22
--- a/doc/interpreter/fn-idx.txi +++ b/doc/interpreter/fn-idx.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/func.txi +++ b/doc/interpreter/func.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -470,7 +470,7 @@ This implementation handles any number of input arguments, but it's also a very simple solution to the problem. -A slightly more complex example of @code{varargin} is a function +A slightly more complex example of @code{varargin} is a function @code{print_arguments} that prints all input arguments. Such a function can be defined like this @@ -779,7 +779,7 @@ @noindent After this the directory @samp{~/Octave} will be searched for functions. - + @DOCSTRING(addpath) @DOCSTRING(genpath) @@ -858,8 +858,8 @@ @noindent Then if the path to @code{func1} is @code{<directory>/func1.m}, and if -@code{func2} is found in the directory @code{<directory>/private/func2.m}, -then @code{func2} is only available for use of the functions, like +@code{func2} is found in the directory @code{<directory>/private/func2.m}, +then @code{func2} is only available for use of the functions, like @code{func1}, that are found in @code{<directory>}. @node Nested Functions @@ -1019,7 +1019,7 @@ Functions can be overloaded to work with different input arguments. For example, the operator '+' has been overloaded in Octave to work with single, double, uint8, int32, and many other arguments. The preferred way to overload -functions is through classes and object oriented programming +functions is through classes and object oriented programming (@pxref{Function Overloading}). Occasionally, however, one needs to undo user overloading and call the default function associated with a specific type. The @code{builtin} function exists for this purpose. @@ -1122,11 +1122,11 @@ A subfunction with the required function name in the given scope. @item Private function -A function defined within a private directory of the directory +A function defined within a private directory of the directory which contains the current function. @item Class constructor -A function that constuctors a user class as defined in chapter +A function that constuctors a user class as defined in chapter @ref{Object Oriented Programming}. @item Class method @@ -1168,7 +1168,7 @@ Even though a script file may not begin with the @code{function} keyword, it is possible to define more than one function in a single -script file and load (but not execute) all of them at once. To do +script file and load (but not execute) all of them at once. To do this, the first token in the file (ignoring comments and other white space) must be something other than @code{function}. If you have no other statements to evaluate, you can use a statement that has no @@ -1261,7 +1261,7 @@ It can be very convenient store a function in a variable so that it can be passed to a different function. For example, a function that -performs numerical minimization needs access to the function that +performs numerical minimization needs access to the function that should be minimized. @menu @@ -1414,7 +1414,7 @@ @end example @noindent -is equivalent to +is equivalent to @example my_command ("hello", "world")
--- a/doc/interpreter/geometry.txi +++ b/doc/interpreter/geometry.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -19,12 +19,12 @@ @node Geometry @chapter Geometry -Much of the geometry code in Octave is based on the Qhull -library@footnote{Barber, C.B., Dobkin, D.P., and Huhdanpaa, H.T., -@cite{The Quickhull Algorithm for Convex Hulls}, ACM Trans. on Mathematical -Software, 22(4):469--483, Dec 1996, @url{http://www.qhull.org}}. -Some of the documentation for Qhull, particularly for the options that -can be passed to @code{delaunay}, @code{voronoi} and @code{convhull}, +Much of the geometry code in Octave is based on the Qhull +library@footnote{Barber, C.B., Dobkin, D.P., and Huhdanpaa, H.T., +@cite{The Quickhull Algorithm for Convex Hulls}, ACM Trans. on Mathematical +Software, 22(4):469--483, Dec 1996, @url{http://www.qhull.org}}. +Some of the documentation for Qhull, particularly for the options that +can be passed to @code{delaunay}, @code{voronoi} and @code{convhull}, etc., is relevant to Octave users. @menu @@ -46,15 +46,15 @@ In general there are only three points on the circumference of any circum-circle. However, in some cases, and in particular for the case of a regular grid, 4 or more points can be on a single -circum-circle. In this case the Delaunay triangulation is not unique. +circum-circle. In this case the Delaunay triangulation is not unique. @DOCSTRING(delaunay) The 3- and N-dimensional extension of the Delaunay triangulation are -given by @code{delaunay3} and @code{delaunayn} respectively. +given by @code{delaunay3} and @code{delaunayn} respectively. @code{delaunay3} returns a set of tetrahedra that satisfy the Delaunay circum-circle criteria. Similarly, @code{delaunayn} returns the -N-dimensional simplex satisfying the Delaunay circum-circle criteria. +N-dimensional simplex satisfying the Delaunay circum-circle criteria. The N-dimensional extension of a triangulation is called a tessellation. @DOCSTRING(delaunay3) @@ -288,7 +288,7 @@ than any other point in @var{s}. The Voronoi diagram is related to the Delaunay triangulation of a set of points, in that the vertexes of the Voronoi tessellation are the centers of the circum-circles of the -simplices of the Delaunay tessellation. +simplices of the Delaunay tessellation. @DOCSTRING(voronoi) @@ -328,7 +328,7 @@ @DOCSTRING(polyarea) -An example of the use of @code{polyarea} might be +An example of the use of @code{polyarea} might be @example @group @@ -445,7 +445,7 @@ @noindent that interpolates from a random scattering of points, to a uniform -grid. +grid. @ifnotinfo The output of the above can be seen in @ref{fig:griddata}.
--- a/doc/interpreter/geometryimages.m +++ b/doc/interpreter/geometryimages.m @@ -105,7 +105,7 @@ y = yy(tri); m = (y(1:end-1) - y(2:end)) ./ (x(1:end-1) - x(2:end)); xc = (prod(m) .* (y(1) - y(end)) + m(end)*(x(1)+x(2)) - m(1)*(x(2)+x(3))) ... - ./ (2 * (m(end) - m(1))); + ./ (2 * (m(end) - m(1))); yc = - (xc - (x(2) + x(3))./2) ./ m(end) + (y(2) + y(3)) / 2; c = [xc, yc]; r = sqrt ((xc - x(1)).^2 + (yc - y(1)).^2);
--- a/doc/interpreter/gpl.txi +++ b/doc/interpreter/gpl.txi @@ -223,7 +223,7 @@ conditions: @enumerate a -@item +@item The work must carry prominent notices stating that you modified it, and giving a relevant date. @@ -671,7 +671,7 @@ the ``copyright'' line and a pointer to where the full notice is found. @smallexample -@var{one line to give the program's name and a brief idea of what it does.} +@var{one line to give the program's name and a brief idea of what it does.} Copyright (C) @var{year} @var{name of author} This program is free software: you can redistribute it and/or modify @@ -694,7 +694,7 @@ notice like this when it starts in an interactive mode: @smallexample -@var{program} Copyright (C) @var{year} @var{name of author} +@var{program} Copyright (C) @var{year} @var{name of author} This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}. This is free software, and you are welcome to redistribute it under certain conditions; type @samp{show c} for details.
--- a/doc/interpreter/grammar.txi +++ b/doc/interpreter/grammar.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/gui.txi +++ b/doc/interpreter/gui.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/image.txi +++ b/doc/interpreter/image.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -223,7 +223,7 @@ If gnuplot is being used to display images it is possible to plot on top of images. Since an image is a matrix it is indexed by row and -column values. The plotting system is, however, based on the +column values. The plotting system is, however, based on the traditional @math{(x, y)} system. To minimize the difference between the two systems Octave places the origin of the coordinate system in the point corresponding to the pixel at @math{(1, 1)}. So, to plot @@ -231,7 +231,7 @@ simply call @code{plot} with the column values as the first argument and the row values as the second. As an example the following code generates an image with random intensities between 0 and 1, and shows -the image with red circles over pixels with an intensity above +the image with red circles over pixels with an intensity above @math{0.99}. @example @@ -249,7 +249,7 @@ @section Color Conversion Octave supports conversion from the RGB color system to NTSC and HSV -and vice versa. +and vice versa. @DOCSTRING(rgb2hsv)
--- a/doc/interpreter/install.txi +++ b/doc/interpreter/install.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -287,7 +287,7 @@ @item Qhull Computational geometry library (@url{http://www.qhull.org}). Qhull is -required to provide the functions @code{convhull}, @code{convhulln}, +required to provide the functions @code{convhull}, @code{convhulln}, @code{delaunay}, @code{delaunay3}, @code{delaunayn}, @code{voronoi}, and @code{voronoin}. @@ -482,8 +482,8 @@ @end table -See the file @file{INSTALL} for more general information about the -command line options used by configure. That file also contains +See the file @file{INSTALL} for more general information about the +command line options used by configure. That file also contains instructions for compiling in a directory other than the one where the source is located. @@ -605,7 +605,7 @@ @example @group double: 16GB -single: 8GB +single: 8GB uint64, int64: 16GB uint32, int32: 8GB uint16, int16: 4GB @@ -766,7 +766,7 @@ You must ensure that all Fortran sources except those in the @file{liboctave/cruft/ranlib} directory are compiled such that INTEGERS are 8-bytes wide. If you are using gfortran, the configure script should -automatically set the Makefile variable @w{@env{F77_INTEGER_8_FLAG}} to +automatically set the Makefile variable @w{@env{F77_INTEGER_8_FLAG}} to @option{-fdefault-integer-8}. If you are using another compiler, you must set this variable yourself. You should NOT set this flag in @env{FFLAGS}, otherwise the files in @file{liboctave/cruft/ranlib} will be @@ -848,10 +848,10 @@ @end example @noindent -rather than +rather than @example -options MATH_EMULATE +options MATH_EMULATE @end example @noindent @@ -874,7 +874,7 @@ @example @group -warning: ANSI C++ prohibits conversion from `(int)' +warning: ANSI C++ prohibits conversion from `(int)' to `(@dots{})' @end group @end example @@ -953,7 +953,7 @@ @example @group -/usr/tmp/cc007458.s:unknown:Undefined local +/usr/tmp/cc007458.s:unknown:Undefined local symbol LBB7656 /usr/tmp/cc007458.s:unknown:Undefined local symbol LBE7656
--- a/doc/interpreter/interp.txi +++ b/doc/interpreter/interp.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -71,13 +71,13 @@ @float Figure,fig:interpderiv1 @center @image{interpderiv1,4in} -@caption{Comparison of @qcode{"pchip"} and @qcode{"spline"} interpolation methods for a +@caption{Comparison of @qcode{"pchip"} and @qcode{"spline"} interpolation methods for a step function} @end float @float Figure,fig:interpderiv2 @center @image{interpderiv2,4in} -@caption{Comparison of the second derivative of the @qcode{"pchip"} and @qcode{"spline"} +@caption{Comparison of the second derivative of the @qcode{"pchip"} and @qcode{"spline"} interpolation methods for a step function} @end float @end ifnotinfo
--- a/doc/interpreter/interpimages.m +++ b/doc/interpreter/interpimages.m @@ -74,7 +74,7 @@ legend ("spline", "pchip"); print ([nm "." typ], d_typ); endif - hide_output (); + hide_output (); endfunction function set_print_size ()
--- a/doc/interpreter/intro.txi +++ b/doc/interpreter/intro.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -21,7 +21,7 @@ @cindex introduction GNU Octave is a high-level language, primarily intended for numerical -computations. It is typically used for such problems as solving +computations. It is typically used for such problems as solving linear and nonlinear equations, numerical linear algebra, statistical analysis, and for performing other numerical experiments. It may also be used as a batch-oriented language for automated data processing. @@ -31,13 +31,13 @@ (version 3.8, released in late 2013) also provides, by default, a graphical user interface. -GNU Octave is freely redistributable software. You may redistribute +GNU Octave is freely redistributable software. You may redistribute it and/or modify it under the terms of the GNU General Public License -as published by the Free Software Foundation. The GPL is included in +as published by the Free Software Foundation. The GPL is included in this manual, @pxref{Copying}. -This manual provides comprehensive documentation on how to install, -run, use, and extend GNU Octave. Additional chapters describe how +This manual provides comprehensive documentation on how to install, +run, use, and extend GNU Octave. Additional chapters describe how to report bugs and help contribute code. This document corresponds to Octave version @value{VERSION}. @@ -57,7 +57,7 @@ an initial message and then a prompt indicating it is ready to accept input. If you have chosen the traditional command-line interface only the command prompt appears. In any case, you can immediately begin -typing Octave commands. +typing Octave commands. If you get into trouble, you can usually interrupt Octave by typing @kbd{Control-C} (written @kbd{C-c} for short). @kbd{C-c} gets @@ -86,12 +86,12 @@ @subsection Elementary Calculations -Octave can easily be used for basic numerical calculations. Octave -knows about arithmetic operations (+,-,*,/), exponentiation (^), -natural logarithms/exponents (log, exp), and the trigonometric -functions (sin, cos, @dots{}). Moreover, Octave calculations work -on real or imaginary numbers (i,j). In addition, some mathematical -constants such as the base of the natural logarithm (e) and the ratio +Octave can easily be used for basic numerical calculations. Octave +knows about arithmetic operations (+,-,*,/), exponentiation (^), +natural logarithms/exponents (log, exp), and the trigonometric +functions (sin, cos, @dots{}). Moreover, Octave calculations work +on real or imaginary numbers (i,j). In addition, some mathematical +constants such as the base of the natural logarithm (e) and the ratio of a circle's circumference to its diameter (pi) are pre-defined. @noindent @@ -109,7 +109,7 @@ @noindent type the following which will evaluate to @code{-1} within the -tolerance of the calculation. +tolerance of the calculation. @example octave:1> exp (i*pi) @@ -117,7 +117,7 @@ @subsection Creating a Matrix -Vectors and matrices are the basic building blocks for numerical analysis. +Vectors and matrices are the basic building blocks for numerical analysis. To create a new matrix and store it in a variable so that you can refer to it later, type the command @@ -126,9 +126,9 @@ @end example @noindent -Octave will respond by printing the matrix in neatly aligned columns. -Octave uses a comma or space to separate entries in a row, and a -semicolon or carriage return to separate one row from the next. +Octave will respond by printing the matrix in neatly aligned columns. +Octave uses a comma or space to separate entries in a row, and a +semicolon or carriage return to separate one row from the next. Ending a command with a semicolon tells Octave not to print the result of the command. For example, @@ -141,7 +141,7 @@ value between zero and one. To display the value of a variable, simply type the name of the -variable at the prompt. For example, to display the value stored in the +variable at the prompt. For example, to display the value stored in the matrix @code{B}, type the command @example @@ -202,8 +202,8 @@ If the coefficient matrix is singular, Octave will print a warning message and compute a minimum norm solution. -A simple example comes from chemistry and the need to obtain balanced -chemical equations. Consider the burning of hydrogen and oxygen to +A simple example comes from chemistry and the need to obtain balanced +chemical equations. Consider the burning of hydrogen and oxygen to produce water. @tex $$ {\rm H_{2}} + {\rm O_{2}} \rightarrow {\rm H_{2}O} $$ @@ -216,9 +216,9 @@ @end ifnottex @noindent -The equation above is not accurate. The Law of Conservation of Mass requires -that the number of molecules of each type balance on the left- and right-hand -sides of the equation. Writing the variable overall reaction with +The equation above is not accurate. The Law of Conservation of Mass requires +that the number of molecules of each type balance on the left- and right-hand +sides of the equation. Writing the variable overall reaction with individual equations for hydrogen and oxygen one finds: @tex \vbox{ @@ -294,7 +294,7 @@ @example @group -octave:1> function xdot = f (x, t) +octave:1> function xdot = f (x, t) > > r = 0.25; > k = 1.4; @@ -441,9 +441,9 @@ Examples of Octave code appear in this font or form: @code{svd (a)}. Names that represent variables or function arguments appear in this font or form: @var{first-number}. Commands that you type at the -shell prompt appear in this font or form: @samp{octave --no-init-file}. -Commands that you type at the Octave prompt sometimes appear in this font -or form: @kbd{foo --bar --baz}. Specific keys on your keyboard appear +shell prompt appear in this font or form: @samp{octave --no-init-file}. +Commands that you type at the Octave prompt sometimes appear in this font +or form: @kbd{foo --bar --baz}. Specific keys on your keyboard appear in this font or form: @key{ANY}. @node Evaluation Notation @@ -508,9 +508,9 @@ @cindex printing notation Many of the examples in this manual print text when they are -evaluated. In this manual the printed text resulting from an example -is indicated by @samp{@print{}}. The value that is returned by -evaluating the expression is displayed with @samp{@result{}} +evaluated. In this manual the printed text resulting from an example +is indicated by @samp{@print{}}. The value that is returned by +evaluating the expression is displayed with @samp{@result{}} (@code{1} in the next example) and follows on a separate line. @example @@ -540,7 +540,7 @@ @subsection Format of Descriptions @cindex description format -Functions and commands are described in this manual in a +Functions and commands are described in this manual in a uniform format. The first line of a description contains the name of the item followed by its arguments, if any. @ifnottex
--- a/doc/interpreter/io.txi +++ b/doc/interpreter/io.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -169,7 +169,7 @@ load myfile.mat A @print{} A = - @print{} + @print{} @print{} 1 2 3 @print{} 4 5 6 @print{} 7 8 9 @@ -517,12 +517,12 @@ initial @samp{%} character followed in sequence by: @itemize @bullet -@item +@item Zero or more @dfn{flag characters} that modify the normal behavior of the conversion specification. @cindex flag character (@code{printf}) -@item +@item An optional decimal integer specifying the @dfn{minimum field width}. If the normal conversion produces fewer characters than this, the field is padded with spaces to the specified width. This is a @emph{minimum} @@ -538,7 +538,7 @@ @samp{-} flag (see below) and to use the absolute value as the field width. -@item +@item An optional @dfn{precision} to specify the number of digits to be written for the numeric conversions. If the precision is specified, it consists of a period (@samp{.}) followed optionally by a decimal integer @@ -559,7 +559,7 @@ A character that specifies the conversion to be applied. @end itemize -The exact options that are permitted and how they are interpreted vary +The exact options that are permitted and how they are interpreted vary between the different conversion specifiers. See the descriptions of the individual conversions for information about the particular options that they use. @@ -746,7 +746,7 @@ This section describes miscellaneous conversions for @code{printf}. -The @samp{%c} conversion prints a single character. The @samp{-} +The @samp{%c} conversion prints a single character. The @samp{-} flag can be used to specify left-justification in the field, but no other flags are defined, and no precision or type modifier can be given. For example: @@ -869,7 +869,7 @@ A character that specifies the conversion to be applied. @end itemize -The exact options that are permitted and how they are interpreted vary +The exact options that are permitted and how they are interpreted vary between the different conversion specifiers. See the descriptions of the individual conversions for information about the particular options that they allow. @@ -957,7 +957,7 @@ @subsection String Input Conversions This section describes the @code{scanf} input conversions for reading -string and character values: @samp{%s} and @samp{%c}. +string and character values: @samp{%s} and @samp{%c}. The @samp{%c} conversion is the simplest: it matches a fixed number of characters, always. The maximum field with says how many characters to
--- a/doc/interpreter/java.txi +++ b/doc/interpreter/java.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -234,9 +234,9 @@ @example @group -%% +%% %% Return: true if the environment is Octave. -%% +%% function retval = isOctave persistent cacheval; % speeds up repeated calls @@ -300,7 +300,7 @@ on a 'per user' basis. @item Finally, Octave looks for a next occurrence of file -@file{javaclasspath.txt} in the m-files directory where Octave Java functions +@file{javaclasspath.txt} in the m-files directory where Octave Java functions live. This is where @file{javaclasspath.m} resides, usually something like @file{@w{@env{OCTAVE_HOME}}/share/octave/@w{@env{OCTAVE_VERSION}}/m/java/}. You can find this directory by executing the command
--- a/doc/interpreter/linalg.txi +++ b/doc/interpreter/linalg.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -70,7 +70,7 @@ attempt Cholesky@tie{}factorization using the @sc{lapack} xPOTRF function. @item If the Cholesky@tie{}factorization failed or the matrix is not -Hermitian with a real positive diagonal, and the matrix is square, factorize +Hermitian with a real positive diagonal, and the matrix is square, factorize using the @sc{lapack} xGETRF function. @item If the matrix is not square, or any of the previous solvers flags
--- a/doc/interpreter/macros.texi +++ b/doc/interpreter/macros.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -25,7 +25,7 @@ @end macro @c The following macro works around the Info/plain text expansion of @code{XXX} -@c which is `XXX'. This looks particularly bad when the macro body is +@c which is `XXX'. This looks particularly bad when the macro body is @c single or double-quoted text, such as a property value `"position"' @ifinfo @rmacro qcode{arg} @@ -46,7 +46,7 @@ @c Implementation Note: @c For TeX, @vskip produces a nice separation. @c For Texinfo, '@sp 1' should work, but in practice produces ugly results -@c for HTML. We use a simple blank line to produce the correct behavior. +@c for HTML. We use a simple blank line to produce the correct behavior. @macro seealso {args} @iftex
--- a/doc/interpreter/matrix.txi +++ b/doc/interpreter/matrix.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/munge-texi.pl +++ b/doc/interpreter/munge-texi.pl @@ -23,8 +23,8 @@ # Validate DOCSTRING file format die "invalid doc file format\n" if (! /$doc_delim/o); - - do + + do { s/\s*$//; # strip EOL character(s) $symbol = substr ($_,1); @@ -71,8 +71,8 @@ $fname = "$top_srcdir/examples/$1"; print '@verbatim',"\n"; open (EXAMPFH, $fname) or die "unable to open example file $fname\n"; - while (<EXAMPFH>) - { + while (<EXAMPFH>) + { print $_; print "\n" if (eof and substr ($_, -1) ne "\n"); } @@ -88,12 +88,12 @@ ################################################################################ -# Subroutines +# Subroutines ################################################################################ sub extract_docstring { my ($docstring, $arg_list, $func_list, $repl, $rest_of_line); - + while (defined ($_ = <DOCFH>) and ! /$doc_delim/o) { # expand any @seealso references @@ -103,7 +103,7 @@ while (! /}/m) { $_ .= <DOCFH>; } ($arg_list, $rest_of_line) = m'^@seealso{(.*)}(.*)?'s; - + $func_list = $arg_list; $func_list =~ s/\s+//gs; $repl = ""; @@ -112,7 +112,7 @@ $func =~ s/^@/@@/; # Texinfo uses @@ to produce '@' $repl .= "\@ref{XREF$func,,$func}, "; } - substr($repl,-2) = ""; # Remove last ', ' + substr($repl,-2) = ""; # Remove last ', ' $_ = "\@seealso{$repl}$rest_of_line"; }
--- a/doc/interpreter/nonlin.txi +++ b/doc/interpreter/nonlin.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -115,7 +115,7 @@ When no Jacobian is supplied (as in the example above) it is approximated numerically. This requires more function evaluations, and hence is -less efficient. In the example above we could compute the Jacobian +less efficient. In the example above we could compute the Jacobian analytically as @iftex
--- a/doc/interpreter/numbers.txi +++ b/doc/interpreter/numbers.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -468,7 +468,7 @@ @example @group sngl = single (rand (2, 2)) - @result{} sngl = + @result{} sngl = 0.37569 0.92982 0.11962 0.50876 class (sngl) @@ -747,7 +747,7 @@ and their returned data types are @multitable @columnfractions .2 .3 .3 .2 -@headitem @tab Mixed Operation @tab Result @tab +@headitem @tab Mixed Operation @tab Result @tab @item @tab double OP single @tab single @tab @item @tab double OP integer @tab integer @tab @item @tab double OP char @tab double @tab @@ -782,7 +782,7 @@ @end example @noindent -where @code{x} remains of the double precision type. +where @code{x} remains of the double precision type. @node Predicates for Numeric Objects @section Predicates for Numeric Objects
--- a/doc/interpreter/obsolete.txi +++ b/doc/interpreter/obsolete.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/octave-config.1 +++ b/doc/interpreter/octave-config.1 @@ -71,7 +71,7 @@ .RE .TP .B \-v\fR,\fB \-\-version -Display the version number of +Display the version number of .BR octave (1). .TP \fB\-h\fP, \fB\-?\fP, \fB\-\-help\fP @@ -79,7 +79,7 @@ .SH AUTHOR John W. Eaton <jwe@octave.org> -This manual page was contributed by Dirk Eddelbuettel <edd@debian.org> +This manual page was contributed by Dirk Eddelbuettel <edd@debian.org> for the Debian GNU/Linux distribution but may be used by others. .SH "SEE ALSO" octave (1).
--- a/doc/interpreter/octave.texi +++ b/doc/interpreter/octave.texi @@ -6,12 +6,12 @@ % under the terms of the GNU General Public License as published by the % Free Software Foundation; either version 3 of the License, or (at % your option) any later version. -% +% % Octave is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License % for more details. -% +% % You should have received a copy of the GNU General Public License % along with Octave; see the file COPYING. If not, see % <http://www.gnu.org/licenses/>. @@ -100,8 +100,8 @@ @c this is a spacer column @tab @sp 8 -@titlefont{Free Your Numbers} -@end multitable +@titlefont{Free Your Numbers} +@end multitable @author John W. Eaton @author David Bateman @author S@o{}ren Hauberg @@ -183,8 +183,8 @@ * Object Oriented Programming:: * GUI Development:: * System Utilities:: -* Java Interface:: -* Packages:: +* Java Interface:: +* Packages:: * External Code Interface:: * Test and Demo Functions:: * Tips and Standards:: @@ -946,7 +946,7 @@ @c @include amuse.texi @c ------------------------------------------------------------------------ -@c Appendices start here. +@c Appendices start here. @include external.texi @include testfun.texi @@ -960,7 +960,7 @@ @include gpl.texi @c ------------------------------------------------------------------------ -@c Indices start here. +@c Indices start here. @include cp-idx.texi @c @include vr-idx.texi
--- a/doc/interpreter/oop.txi +++ b/doc/interpreter/oop.txi @@ -7,12 +7,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -182,7 +182,7 @@ Note that in the display method, it makes sense to start the method with the line @code{fprintf ("%s =", inputname (1))} to be consistent with the rest of Octave and print the variable name to be displayed -when displaying the class. +when displaying the class. To be consistent with the Octave graphic handle classes, a class should also define the @code{get} and @code{set} methods. The @@ -196,7 +196,7 @@ @noindent Similarly, the @code{set} method should taken as its first argument an -object to modify, and then take property/value pairs to be modified. +object to modify, and then take property/value pairs to be modified. @example @EXAMPLEFILE(@polynomial/set.m) @@ -257,13 +257,13 @@ @node Defining Indexing And Indexed Assignment @subsection Defining Indexing And Indexed Assignment -Objects can be indexed with parentheses, either like +Objects can be indexed with parentheses, either like @code{@var{a} (@var{idx})} or like @code{@var{a} @{@var{idx}@}}, or even like @code{@var{a} (@var{idx}).@var{field}}. However, it is up to the user to decide what this indexing actually means. In the case of our polynomial -class @code{@var{p} (@var{n})} might mean either the coefficient of the -@var{n}-th power of the polynomial, or it might be the evaluation of the -polynomial at @var{n}. The meaning of this subscripted referencing is +class @code{@var{p} (@var{n})} might mean either the coefficient of the +@var{n}-th power of the polynomial, or it might be the evaluation of the +polynomial at @var{n}. The meaning of this subscripted referencing is determined by the @code{subsref} method. @DOCSTRING(subsref) @@ -277,7 +277,7 @@ @EXAMPLEFILE(@polynomial/subsref.m) @end example -The equivalent functionality for subscripted assignments uses the +The equivalent functionality for subscripted assignments uses the @code{subsasgn} method. @DOCSTRING(subsasgn) @@ -290,7 +290,7 @@ usually by forwarding it again to @code{subsref} or @code{subsasgn}. If you wish to use the @code{end} keyword in subscripted expressions -of an object, then the user needs to define the @code{end} method for +of an object, then the user needs to define the @code{end} method for the class. For example, the @code{end} method for our polynomial class might look like @@ -302,7 +302,7 @@ @noindent which is a fairly generic @code{end} method that has a behavior similar to -the @code{end} keyword for Octave Array classes. It can then be used as +the @code{end} keyword for Octave Array classes. It can then be used as follows: @example @@ -326,7 +326,7 @@ @node Indexed Assignment Optimization @subsection Indexed Assignment Optimization -Octave's ubiquitous lazily-copied pass-by-value semantics implies +Octave's ubiquitous lazily-copied pass-by-value semantics implies a problem for performance of user-defined subsasgn methods. Imagine a call to subsasgn: @@ -350,7 +350,7 @@ @end example The problem is that on entry to the subsasgn method, @code{x} is still -referenced from the caller's scope, which means that the method will +referenced from the caller's scope, which means that the method will first need to unshare (copy) @code{x} and @code{x.myfield} before performing the assignment. Upon completing the call, unless an error occurs, the result is immediately assigned to @code{x} in the caller's scope, @@ -436,8 +436,8 @@ of the roots of the polynomial. Functions that are of particular interest to be overloaded are the class -conversion functions such as @code{double}. Overloading these functions -allows the @code{cast} function to work with the user class and can aid +conversion functions such as @code{double}. Overloading these functions +allows the @code{cast} function to work with the user class and can aid in the use of methods of other classes with the user class. An example @code{double} function for our polynomial class might look like. @@ -486,7 +486,7 @@ @cindex unary minus @c Need at least one plaintext sentence here between the @node and @float -@c table below or the two will overlap due to a bug in Texinfo. +@c table below or the two will overlap due to a bug in Texinfo. @c This is not our fault; this *is* a ridiculous kluge. The following table shows, for each built-in numerical operation, the corresponding function name to use when providing an overloaded method for a @@ -520,10 +520,10 @@ @tex \vskip 6pt -{\hbox to \hsize {\hfill\vbox{\offinterlineskip \tabskip=0pt +{\hbox to \hsize {\hfill\vbox{\offinterlineskip \tabskip=0pt \halign{ \vrule height2.0ex depth1.ex width 0.6pt #\tabskip=0.3em & -# \hfil & \vrule # & # \hfil & \vrule # & # \hfil & # \vrule +# \hfil & \vrule # & # \hfil & \vrule # & # \hfil & # \vrule width 0.6pt \tabskip=0pt\cr \noalign{\hrule height 0.6pt} & Operation && Method && Description &\cr @@ -641,7 +641,7 @@ @end example Note that user classes always have higher precedence than built-in -Octave types. So in fact marking our polynomial class higher than the +Octave types. So in fact marking our polynomial class higher than the @qcode{"double"} class is in fact not necessary. When faced with two objects that have the same precedence, Octave will use the @@ -730,7 +730,7 @@ octave:4> isa (f,"polynomial") ans = 1 octave:5> struct (f) -ans = +ans = @{ polynomial = 0.333333 + 0.333333 * X + 0.333333 * X ^ 2 @}
--- a/doc/interpreter/op-idx.txi +++ b/doc/interpreter/op-idx.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/optim.txi +++ b/doc/interpreter/optim.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/package.txi +++ b/doc/interpreter/package.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -113,8 +113,8 @@ @section Using Packages By default installed packages are not available from the Octave prompt, -but it is possible to control this using the @code{pkg load} and -@code{pkg unload} commands. The functions from a package can be +but it is possible to control this using the @code{pkg load} and +@code{pkg unload} commands. The functions from a package can be added to the Octave path by typing @example @@ -138,8 +138,8 @@ On UNIX-like systems it is possible to make both per-user and 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 +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 @@ -247,7 +247,7 @@ An optional file that includes commands that are run when the package is removed from the users path. Note that @w{@code{PKG_DEL}} directives in the source code of the package will also be added to this file by the -Octave package manager. +Octave package manager. @xref{PKG_ADD and PKG_DEL Directives}, for details on @w{@code{PKG_DEL}} directives. @@ -324,7 +324,7 @@ Lines starting with @samp{#} are comments. @item -Lines starting with a blank character are continuations from the +Lines starting with a blank character are continuations from the previous line. @item @@ -421,7 +421,7 @@ @item BuildRequires These are the external build dependencies of the package and are not checked by the package manager. This is here as a hint to the -distribution packager. They follow the same conventions as the +distribution packager. They follow the same conventions as the @code{Depends} keyword. Note that in general, packaging systems such as @code{rpm} or @code{deb} and autoprobe the install dependencies from the build dependencies, and therefore the often a @@ -431,7 +431,7 @@ @end table @noindent -The developer is free to add additional arguments to the +The developer is free to add additional arguments to the @file{DESCRIPTION} file for their own purposes. One further detail to aid the packager is that the @code{SystemRequirements} and @code{BuildRequires} keywords can have a distribution dependent section, @@ -445,7 +445,7 @@ @noindent where the first package name will be used as a default and if the RPMs are built on a Mandriva distribution, then the second package -name will be used instead. +name will be used instead. @node The INDEX File @subsection The INDEX File @@ -485,7 +485,7 @@ @end example If you wish to refer to a function that users might expect -to find in your package but is not there, providing a work around or +to find in your package but is not there, providing a work around or pointing out that the function is available elsewhere, you can use: @example @@ -493,7 +493,7 @@ @end example @noindent -This workaround description will not appear when listing functions in the +This workaround description will not appear when listing functions in the package with @code{pkg describe} but they will be published in the HTML documentation online. Workaround descriptions can use any HTML markup, but
--- a/doc/interpreter/plot.txi +++ b/doc/interpreter/plot.txi @@ -860,7 +860,7 @@ && $\backslash$leftrightarrow && $\leftrightarrow$ && $\backslash$uparrow && $\uparrow$ &\cr & $\backslash$downarrow && $\downarrow$ -&& && +&& && && && &\cr} \vskip12pt \symtable{Openings and Closings} {#} @@ -873,7 +873,7 @@ \vskip12pt \symtable{Alternate Names} {#} {& \hbox to \cola{$\backslash$neq} && $\neq$ -&& \hbox to \colb{} && +&& \hbox to \colb{} && && \hbox to \colc{} && &\cr} \vskip12pt \symtable{Other (not in Appendix F Tables)} {#} @@ -881,7 +881,7 @@ && \hbox to \colb{$\backslash$0} && $\oslash$ && \hbox to \colc{$\backslash$copyright} && $\copyright$ &\cr & $\backslash$deg && $^\circ$ -&& && +&& && && && &\cr} \vskip12pt \hskip36pt Table 15.1: Available special characters in \TeX\ mode (cont.)
--- a/doc/interpreter/poly.txi +++ b/doc/interpreter/poly.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/preface.txi +++ b/doc/interpreter/preface.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -57,8 +57,8 @@ easily. Everyone is encouraged to share this software with others under the -terms of the GNU General Public License (@pxref{Copying}). You are -also encouraged to help make Octave more useful by writing and +terms of the GNU General Public License (@pxref{Copying}). You are +also encouraged to help make Octave more useful by writing and contributing additional functions for it, and by reporting any problems you may have. @@ -153,7 +153,7 @@ @cindex Citations In view of the many contributions made by numerous developers over many years -it is common courtesy to cite Octave in publications when it has been used +it is common courtesy to cite Octave in publications when it has been used during the course of research or the preparation of figures. The @code{citation} function can automatically generate a recommended citation text for Octave or any of its packages. See the help text below on how to @@ -169,7 +169,7 @@ There are a number of ways that you can contribute to help make Octave a better system. Perhaps the most important way to contribute is to write high-quality code for solving new problems, and to make your code freely -available for others to use. @xref{Contributing Guidelines}, for detailed +available for others to use. @xref{Contributing Guidelines}, for detailed information on contributing new code. If you find Octave useful, consider providing additional funding to @@ -205,12 +205,12 @@ @cindex distribution of Octave Octave is @dfn{free} software. This means that everyone is free to -use it and free to redistribute it on certain conditions. Octave +use it and free to redistribute it on certain conditions. Octave is not, however, in the public domain. It is copyrighted and there are -restrictions on its distribution, but the restrictions are designed to -ensure that others will have the same freedom to use and redistribute -Octave that you have. The precise conditions can be found in the -GNU General Public License that comes with Octave and that also appears +restrictions on its distribution, but the restrictions are designed to +ensure that others will have the same freedom to use and redistribute +Octave that you have. The precise conditions can be found in the +GNU General Public License that comes with Octave and that also appears in @ref{Copying}. To download a copy of Octave, please visit
--- a/doc/interpreter/quad.txi +++ b/doc/interpreter/quad.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -169,7 +169,7 @@ which to perform an integration. This can occur when collecting data in an experiment. The @code{trapz} function can integrate these values as shown in the following example where "data" has been collected on the cosine function -over the range [0, pi/2). +over the range [0, pi/2). @example @group @@ -181,7 +181,7 @@ @end example The answer is reasonably close to the exact value of 1. Ordinary quadrature -is sensitive to the characteristics of the integrand. Empirical integration +is sensitive to the characteristics of the integrand. Empirical integration depends not just on the integrand, but also on the particular points chosen to represent the function. Repeating the example above with the sine function over the range [0, pi/2) produces far inferior results.
--- a/doc/interpreter/set.txi +++ b/doc/interpreter/set.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/signal.txi +++ b/doc/interpreter/signal.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/interpreter/sparse.txi +++ b/doc/interpreter/sparse.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -39,7 +39,7 @@ The size of mathematical problems that can be treated at any particular time is generally limited by the available computing resources. Both, the speed of the computer and its available memory place limitation on -the problem size. +the problem size. There are many classes of mathematical problems which give rise to matrices, where a large number of the elements are zero. In this case @@ -68,8 +68,8 @@ It is not strictly speaking necessary for the user to understand how sparse matrices are stored. However, such an understanding will help to get an understanding of the size of sparse matrices. Understanding -the storage technique is also necessary for those users wishing to -create their own oct-files. +the storage technique is also necessary for those users wishing to +create their own oct-files. There are many different means of storing sparse matrix data. What all of the methods have in common is that they attempt to reduce the complexity @@ -79,12 +79,12 @@ for sparse matrix computation", 1994, @url{http://www-users.cs.umn.edu/~saad/software/SPARSKIT/paper.ps}}. With full matrices, knowledge of the point of an element of the matrix -within the matrix is implied by its position in the computers memory. +within the matrix is implied by its position in the computers memory. However, this is not the case for sparse matrices, and so the positions -of the non-zero elements of the matrix must equally be stored. +of the non-zero elements of the matrix must equally be stored. An obvious way to do this is by storing the elements of the matrix as -triplets, with two elements being their position in the array +triplets, with two elements being their position in the array (rows and column) and the third being the data itself. This is conceptually easy to grasp, but requires more storage than is strictly needed. @@ -109,7 +109,7 @@ @group for (j = 0; j < nc; j++) for (i = cidx(j); i < cidx(j+1); i++) - printf ("non-zero element (%i,%i) is %d\n", + printf ("non-zero element (%i,%i) is %d\n", ridx(i), j, data(i)); @end group @end example @@ -149,9 +149,9 @@ @end example Note that this is the representation of these elements with the first row -and column assumed to start at zero, while in Octave itself the row and -column indexing starts at one. Thus the number of elements in the -@var{i}-th column is given by @code{@var{cidx} (@var{i} + 1) - +and column assumed to start at zero, while in Octave itself the row and +column indexing starts at one. Thus the number of elements in the +@var{i}-th column is given by @code{@var{cidx} (@var{i} + 1) - @var{cidx} (@var{i})}. Although Octave uses a compressed column format, it should be noted @@ -162,7 +162,7 @@ column major ordering, and so sparse matrices are equally stored in this manner. -A further constraint on the sparse matrix storage used by Octave is that +A further constraint on the sparse matrix storage used by Octave is that all elements in the rows are stored in increasing order of their row index, which makes certain operations faster. However, it imposes the need to sort the elements on the creation of sparse matrices. Having @@ -181,7 +181,7 @@ @dfn{speye}, @dfn{sprand}, @dfn{diag}, etc. @item Constructed from matrices or vectors -The function @dfn{sparse} allows a sparse matrix to be constructed from +The function @dfn{sparse} allows a sparse matrix to be constructed from three vectors representing the row, column and data. Alternatively, the function @dfn{spconvert} uses a three column matrix format to allow easy importation of data from elsewhere. @@ -210,7 +210,7 @@ Other functions of interest that directly create sparse matrices, are @dfn{diag} or its generalization @dfn{spdiags}, that can take the -definition of the diagonals of the matrix and create the sparse matrix +definition of the diagonals of the matrix and create the sparse matrix that corresponds to this. For example, @example @@ -233,7 +233,7 @@ @DOCSTRING(sprandsym) -The recommended way for the user to create a sparse matrix, is to create +The recommended way for the user to create a sparse matrix, is to create two vectors containing the row and column index of the data and a third vector of the same size containing the data to be stored. For example, @@ -259,7 +259,7 @@ The function @dfn{spconvert} takes a three or four column real matrix. The first two columns represent the row and column index respectively and the third and four columns, the real and imaginary parts of the sparse -matrix. The matrix can contain zero elements and the elements can be +matrix. The matrix can contain zero elements and the elements can be sorted in any order. Adding zero elements is a convenient way to define the size of the sparse matrix. For example: @@ -290,8 +290,8 @@ It should be noted, that due to the way that the Octave assignment functions are written that the assignment will reallocate -the memory used by the sparse matrix at each iteration of the above loop. -Therefore the @dfn{spalloc} function ignores the @var{nz} argument and +the memory used by the sparse matrix at each iteration of the above loop. +Therefore the @dfn{spalloc} function ignores the @var{nz} argument and does not pre-assign the memory for the matrix. Therefore, it is vitally important that code using to above structure should be vectorized as much as possible to minimize the number of assignments and reduce the @@ -350,7 +350,7 @@ @example @group a = tril (sprandn (1024, 1024, 0.02), -1) ... - + speye (1024); + + speye (1024); matrix_type (a); ans = Lower @end group @@ -410,7 +410,7 @@ which creates an adjacency matrix @code{A} where node 1 is connected to nodes 2 and 6, node 2 with nodes 1 and 3, etc. The coordinates of the nodes are given in the n-by-2 matrix @code{xy}. -@ifset htmltex +@ifset htmltex @xref{fig:gplot}. @float Figure,fig:gplot @@ -454,7 +454,7 @@ matrices. There is no difference in calling convention when using an overloaded function with a sparse matrix, however, there is also no access to potentially sparse-specific features. At any time the sparse matrix specific -version of a function can be used by explicitly calling its function name. +version of a function can be used by explicitly calling its function name. The table below lists all of the sparse functions of Octave. Note that the names of the specific sparse forms of the functions are typically the same as @@ -465,7 +465,7 @@ @table @asis @item Generate sparse matrices: - @dfn{spalloc}, @dfn{spdiags}, @dfn{speye}, @dfn{sprand}, + @dfn{spalloc}, @dfn{spdiags}, @dfn{speye}, @dfn{sprand}, @dfn{sprandn}, @dfn{sprandsym} @item Sparse matrix conversion: @@ -476,7 +476,7 @@ @dfn{spfun}, @dfn{spones}, @dfn{spy} @item Graph Theory: - @dfn{etree}, @dfn{etreeplot}, @dfn{gplot}, + @dfn{etree}, @dfn{etreeplot}, @dfn{gplot}, @dfn{treeplot} @c @dfn{treelayout} @@ -490,7 +490,7 @@ @item Iterative techniques: @dfn{luinc}, @dfn{pcg}, @dfn{pcr} -@c @dfn{bicg}, @dfn{bicgstab}, @dfn{cholinc}, @dfn{cgs}, @dfn{gmres}, +@c @dfn{bicg}, @dfn{bicgstab}, @dfn{cholinc}, @dfn{cgs}, @dfn{gmres}, @c @dfn{lsqr}, @dfn{minres}, @dfn{qmr}, @dfn{symmlq} @item Miscellaneous: @@ -506,14 +506,14 @@ @node Return Types of Operators and Functions @subsubsection Return Types of Operators and Functions -The two basic reasons to use sparse matrices are to reduce the memory +The two basic reasons to use sparse matrices are to reduce the memory usage and to not have to do calculations on zero elements. The two are closely related in that the computation time on a sparse matrix operator or function is roughly linear with the number of non-zero elements. -Therefore, there is a certain density of non-zero elements of a matrix +Therefore, there is a certain density of non-zero elements of a matrix where it no longer makes sense to store it as a sparse matrix, but rather -as a full matrix. For this reason operators and functions that have a +as a full matrix. For this reason operators and functions that have a high probability of returning a full matrix will always return one. For example adding a scalar constant to a sparse matrix will almost always make it a full matrix, and so the example, @@ -528,7 +528,7 @@ @end example @noindent -returns a full matrix as can be seen. +returns a full matrix as can be seen. Additionally, if @code{sparse_auto_mutate} is true, all sparse functions @@ -537,19 +537,19 @@ equivalent. Therefore @code{speye (2) * 1} will return a full matrix as the memory used is smaller for the full version than the sparse version. -As all of the mixed operators and functions between full and sparse +As all of the mixed operators and functions between full and sparse matrices exist, in general this does not cause any problems. However, one area where it does cause a problem is where a sparse matrix is promoted to a full matrix, where subsequent operations would resparsify the matrix. Such cases are rare, but can be artificially created, for example @code{(fliplr (speye (3)) + speye (3)) - speye (3)} gives a full -matrix when it should give a sparse one. In general, where such cases +matrix when it should give a sparse one. In general, where such cases occur, they impose only a small memory penalty. There is however one known case where this behavior of Octave's sparse matrices will cause a problem. That is in the handling of the @dfn{diag} function. Whether @dfn{diag} returns a sparse or full matrix -depending on the type of its input arguments. So +depending on the type of its input arguments. So @example a = diag (sparse ([1,2,3]), -1); @@ -557,8 +557,8 @@ @noindent should return a sparse matrix. To ensure this actually happens, the -@dfn{sparse} function, and other functions based on it like @dfn{speye}, -always returns a sparse matrix, even if the memory used will be larger +@dfn{sparse} function, and other functions based on it like @dfn{speye}, +always returns a sparse matrix, even if the memory used will be larger than its full representation. @DOCSTRING(sparse_auto_mutate) @@ -573,7 +573,7 @@ same manner as there full counterparts. However, there are certain differences and especially differences with other products sparse implementations. -First, the @qcode{"./"} and @qcode{".^"} operators must be used with care. +First, the @qcode{"./"} and @qcode{".^"} operators must be used with care. Consider what the examples @example @@ -592,19 +592,19 @@ will give. The first example of @var{s} raised to the power of 2 causes no problems. However @var{s} raised element-wise to itself involves a large number of terms @code{0 .^ 0} which is 1. There @code{@var{s} .^ -@var{s}} is a full matrix. +@var{s}} is a full matrix. Likewise @code{@var{s} .^ -2} involves terms like @code{0 .^ -2} which is infinity, and so @code{@var{s} .^ -2} is equally a full matrix. -For the "./" operator @code{@var{s} ./ 2} has no problems, but +For the "./" operator @code{@var{s} ./ 2} has no problems, but @code{2 ./ @var{s}} involves a large number of infinity terms as well and is equally a full matrix. The case of @code{@var{s} ./ @var{s}} involves terms like @code{0 ./ 0} which is a @code{NaN} and so this is equally a full matrix with the zero elements of @var{s} filled with @code{NaN} values. -The above behavior is consistent with full matrices, but is not +The above behavior is consistent with full matrices, but is not consistent with sparse implementations in other products. A particular problem of sparse matrices comes about due to the fact that @@ -622,9 +622,9 @@ Inf Inf @end group @end example - + To correct this behavior would mean that zero elements with a negative -sign-bit would need to be stored in the matrix to ensure that their +sign-bit would need to be stored in the matrix to ensure that their sign-bit was respected. This is not done at this time, for reasons of efficiency, and so the user is warned that calculations where the sign-bit of zero is important must not be done using sparse matrices. @@ -645,7 +645,7 @@ the reordering functions @dfn{colperm} and @dfn{randperm} are also available. -@xref{fig:simplematrix}, for an example of the structure of a simple +@xref{fig:simplematrix}, for an example of the structure of a simple positive definite matrix. @float Figure,fig:simplematrix @@ -655,10 +655,10 @@ The standard Cholesky@tie{}factorization of this matrix can be obtained by the same command that would be used for a full -matrix. This can be visualized with the command +matrix. This can be visualized with the command @code{r = chol (A); spy (r);}. @xref{fig:simplechol}. -The original matrix had +The original matrix had @ifinfo @ifnothtml 43 @@ -678,13 +678,13 @@ @end ifset with only half of the symmetric matrix being stored. This is a significant level of fill in, and although not an issue -for such a small test case, can represents a large overhead +for such a small test case, can represents a large overhead in working with other sparse matrices. The appropriate sparsity preserving permutation of the original matrix is given by @dfn{symamd} and the factorization using this reordering can be visualized using the command @code{q = symamd (A); -r = chol (A(q,q)); spy (r)}. This gives +r = chol (A(q,q)); spy (r)}. This gives @ifinfo @ifnothtml 29 @@ -738,7 +738,7 @@ @node Sparse Linear Algebra @section Linear Algebra on Sparse Matrices -Octave includes a polymorphic solver for sparse matrices, where +Octave includes a polymorphic solver for sparse matrices, where the exact solver used to factorize the matrix, depends on the properties of the sparse matrix itself. Generally, the cost of determining the matrix type is small relative to the cost of factorizing the matrix itself, but in any @@ -757,7 +757,7 @@ than that given by @code{spparms ("bandden")} continue, else goto 4. @enumerate a -@item If the matrix is tridiagonal and the right-hand side is not sparse +@item If the matrix is tridiagonal and the right-hand side is not sparse continue, else goto 3b. @enumerate @@ -765,7 +765,7 @@ Cholesky@tie{}factorization using @sc{lapack} xPTSV. @item If the above failed or the matrix is not Hermitian with a positive - real diagonal use Gaussian elimination with pivoting using + real diagonal use Gaussian elimination with pivoting using @sc{lapack} xGTSV, and goto 8. @end enumerate @@ -773,7 +773,7 @@ Cholesky@tie{}factorization using @sc{lapack} xPBTRF. @item if the above failed or the matrix is not Hermitian with a positive - real diagonal use Gaussian elimination with pivoting using + real diagonal use Gaussian elimination with pivoting using @sc{lapack} xGBTRF, and goto 8. @end enumerate @@ -781,14 +781,14 @@ or backward substitution, and goto 8 @item If the matrix is an upper triangular matrix with column permutations -or lower triangular matrix with row permutations, perform a sparse forward +or lower triangular matrix with row permutations, perform a sparse forward or backward substitution, and goto 8 @item If the matrix is square, Hermitian with a real positive diagonal, attempt sparse Cholesky@tie{}factorization using @sc{cholmod}. @item If the sparse Cholesky@tie{}factorization failed or the matrix is not -Hermitian with a real positive diagonal, and the matrix is square, factorize +Hermitian with a real positive diagonal, and the matrix is square, factorize using @sc{umfpack}. @item If the matrix is not square, or any of the previous solvers flags @@ -885,7 +885,7 @@ In order to motivate this application, we consider the boundary value Laplace equation. This system can model scalar potential fields, such -as heat or electrical potential. Given a medium +as heat or electrical potential. Given a medium @tex $\Omega$ with boundary $\partial\Omega$. At all points on the $\partial\Omega$ the boundary conditions are known, and we wish to calculate the potential in @@ -903,17 +903,17 @@ In a thermal model, we want to calculate the temperature in @tex -$\Omega$ +$\Omega$ @end tex @ifnottex Omega @end ifnottex and know the boundary temperature (Dirichlet condition) or heat flux (from which we can calculate the Neumann condition -by dividing by the thermal conductivity at the boundary). Similarly, +by dividing by the thermal conductivity at the boundary). Similarly, in an electrical model, we want to calculate the voltage in @tex -$\Omega$ +$\Omega$ @end tex @ifnottex Omega @@ -924,27 +924,27 @@ to be electrically isolated; this is a Neumann boundary condition with the current equal to zero. -The simplest finite element models will divide +The simplest finite element models will divide @tex -$\Omega$ +$\Omega$ @end tex @ifnottex Omega @end ifnottex into simplexes (triangles in 2D, pyramids in 3D). @ifset htmltex -We take as a 3-D example a cylindrical liquid filled tank with a small -non-conductive ball from the EIDORS project@footnote{EIDORS - Electrical -Impedance Tomography and Diffuse optical Tomography Reconstruction Software +We take as a 3-D example a cylindrical liquid filled tank with a small +non-conductive ball from the EIDORS project@footnote{EIDORS - Electrical +Impedance Tomography and Diffuse optical Tomography Reconstruction Software @url{http://eidors3d.sourceforge.net}}. This is model is designed to reflect an application of electrical impedance tomography, where current patterns are applied to such a tank in order to image the internal conductivity -distribution. In order to describe the FEM geometry, we have a matrix of +distribution. In order to describe the FEM geometry, we have a matrix of vertices @code{nodes} and simplices @code{elems}. @end ifset The following example creates a simple rectangular 2-D electrically -conductive medium with 10 V and 20 V imposed on opposite sides +conductive medium with 10 V and 20 V imposed on opposite sides (Dirichlet boundary conditions). All other edges are electrically isolated. @@ -961,7 +961,7 @@ widx = (idx-1)*h; elems = [elems; ... widx+[(1:h-1);(2:h);h+(1:h-1)]'; ... - widx+[(2:h);h+(2:h);h+(1:h-1)]' ]; + widx+[(2:h);h+(2:h);h+(1:h-1)]' ]; endfor E = size (elems,1); # No. of simplices @@ -986,10 +986,10 @@ @end group @end example -Using a first order FEM, we approximate the electrical conductivity -distribution in +Using a first order FEM, we approximate the electrical conductivity +distribution in @tex -$\Omega$ +$\Omega$ @end tex @ifnottex Omega @@ -997,8 +997,8 @@ as constant on each simplex (represented by the vector @code{conductivity}). Based on the finite element geometry, we first calculate a system (or stiffness) matrix for each simplex (represented as 3-by-3 elements on the -diagonal of the element-wise system matrix @code{SE}. Based on @code{SE} -and a N-by-DE connectivity matrix @code{C}, representing the connections +diagonal of the element-wise system matrix @code{SE}. Based on @code{SE} +and a N-by-DE connectivity matrix @code{C}, representing the connections between simplices and vertices, the global connectivity matrix @code{S} is calculated. @@ -1018,7 +1018,7 @@ Sdata = zeros (D*E,D); dfact = factorial (D-1); for j = 1:E - a = inv ([ones(D,1), ... + a = inv ([ones(D,1), ... nodes(elems(j,:), :)]); const = conductivity(j) * 2 / ... dfact / abs (det (a)); @@ -1031,31 +1031,31 @@ S = C'* SE *C; @end example -The system matrix acts like the conductivity +The system matrix acts like the conductivity @tex -$S$ +$S$ @end tex @ifnottex @code{S} @end ifnottex -in Ohm's law +in Ohm's law @tex -$SV = I$. +$SV = I$. @end tex @ifnottex @code{S * V = I}. @end ifnottex -Based on the Dirichlet and Neumann boundary conditions, we are able to -solve for the voltages at each vertex @code{V}. +Based on the Dirichlet and Neumann boundary conditions, we are able to +solve for the voltages at each vertex @code{V}. @example ## Dirichlet boundary conditions - D_nodes = [1:5, 51:55]; - D_value = [10*ones(1,5), 20*ones(1,5)]; + D_nodes = [1:5, 51:55]; + D_value = [10*ones(1,5), 20*ones(1,5)]; V = zeros (N,1); V(D_nodes) = D_value; - idx = 1:N; # vertices without Dirichlet + idx = 1:N; # vertices without Dirichlet # boundary condns idx(D_nodes) = []; @@ -1072,7 +1072,7 @@ S(idx,D_nodes) * V(D_nodes)); @end example -Finally, in order to display the solution, we show each solved voltage +Finally, in order to display the solution, we show each solved voltage value in the z-axis for each simplex vertex. @ifset htmltex @xref{fig:femmodel}. @@ -1084,7 +1084,7 @@ xelems = reshape (nodes(elemx, 1), 4, E); yelems = reshape (nodes(elemx, 2), 4, E); velems = reshape (V(elemx), 4, E); - plot3 (xelems,yelems,velems,"k"); + plot3 (xelems,yelems,velems,"k"); print "grid.eps"; @end group @end example @@ -1093,7 +1093,7 @@ @ifset htmltex @float Figure,fig:femmodel @center @image{grid,4in} -@caption{Example finite element model the showing triangular elements. +@caption{Example finite element model the showing triangular elements. The height of each vertex corresponds to the solution value.} @end float @end ifset
--- a/doc/interpreter/sparseimages.m +++ b/doc/interpreter/sparseimages.m @@ -192,8 +192,8 @@ elems = []; for idx = 1 : w-1 widx = (idx-1)*h; - elems = [elems; widx+[(1:h-1);(2:h);h+(1:h-1)]']; - elems = [elems; widx+[(2:h);h+(2:h);h+(1:h-1)]']; + elems = [elems; widx+[(1:h-1);(2:h);h+(1:h-1)]']; + elems = [elems; widx+[(2:h);h+(2:h);h+(1:h-1)]']; endfor E = size (elems,1); # No. of elements @@ -209,9 +209,9 @@ conductivity = [1*ones(1,16), 2*ones(1,48), 1*ones(1,16)]; ## Dirichlet boundary conditions - D_nodes = [1:5, 51:55]; - D_value = [10*ones(1,5), 20*ones(1,5)]; - + D_nodes = [1:5, 51:55]; + D_value = [10*ones(1,5), 20*ones(1,5)]; + ## Neumann boundary conditions ## Note that N_value must be normalized by the boundary ## length and element conductivity
--- a/doc/interpreter/splineimages.m +++ b/doc/interpreter/splineimages.m @@ -155,7 +155,7 @@ ylim ([-2 2]); print ([nm "." typ], d_typ); endif - hide_output (); + hide_output (); endfunction function set_print_size ()
--- a/doc/interpreter/stats.txi +++ b/doc/interpreter/stats.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -20,7 +20,7 @@ @chapter Statistics Octave has support for various statistical methods. This includes -basic descriptive statistics, probability distributions, statistical tests, +basic descriptive statistics, probability distributions, statistical tests, random number generation, and much more. The functions that analyze data all assume that multi-dimensional data @@ -42,8 +42,8 @@ It should be noted that the statistics functions don't test for data containing NaN, NA, or Inf. These values need to be detected and dealt -with explicitly. See @ref{XREFisnan,,isnan}, @ref{XREFisna,,isna}, -@ref{XREFisinf,,isinf}, @ref{XREFisfinite,,isfinite}. +with explicitly. See @ref{XREFisnan,,isnan}, @ref{XREFisna,,isna}, +@ref{XREFisinf,,isinf}, @ref{XREFisfinite,,isfinite}. @menu * Descriptive Statistics:: @@ -58,9 +58,9 @@ @node Descriptive Statistics @section Descriptive Statistics -One principal goal of descriptive statistics is to represent the essence of a +One principal goal of descriptive statistics is to represent the essence of a large data set concisely. Octave provides the mean, median, and mode functions -which all summarize a data set with just a single number corresponding to +which all summarize a data set with just a single number corresponding to the central tendency of the data. @DOCSTRING(mean) @@ -109,7 +109,7 @@ @section Basic Statistical Functions Octave supports various helpful statistical functions. Many are useful as -initial steps to prepare a data set for further analysis. Others provide +initial steps to prepare a data set for further analysis. Others provide different measures from those of the basic descriptive statistics. @DOCSTRING(center) @@ -184,12 +184,12 @@ (PDF), the Cumulative Distribution function (CDF), and the quantile (the inverse of the CDF) for a large number of distributions. -The following table summarizes the supported distributions (in +The following table summarizes the supported distributions (in alphabetical order). @tex \vskip 6pt -{\hbox to \hsize {\hfill\vbox{\offinterlineskip \tabskip=0pt +{\hbox to \hsize {\hfill\vbox{\offinterlineskip \tabskip=0pt \halign{ \vrule height2.0ex depth1.ex width 0.6pt #\tabskip=0.3em & # \hfil & \vrule # & # \hfil & \vrule # & # \hfil & \vrule # & # \hfil & @@ -467,7 +467,7 @@ @tex \vskip 6pt -{\hbox to \hsize {\hfill\vbox{\offinterlineskip \tabskip=0pt +{\hbox to \hsize {\hfill\vbox{\offinterlineskip \tabskip=0pt \halign{ \vrule height2.0ex depth1.ex width 0.6pt #\tabskip=0.3em & # \hfil & \vrule # & # \hfil & # \vrule width 0.6pt \tabskip=0pt\cr @@ -591,7 +591,7 @@ @tex \vskip 6pt -{\hbox to \hsize {\hfill\vbox{\offinterlineskip \tabskip=0pt +{\hbox to \hsize {\hfill\vbox{\offinterlineskip \tabskip=0pt \halign{ \vrule height2.0ex depth1.ex width 0.6pt #\tabskip=0.3em & # \hfil & \vrule # & # \hfil & # \vrule width 0.6pt \tabskip=0pt\cr
--- a/doc/interpreter/stmt.txi +++ b/doc/interpreter/stmt.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -465,7 +465,7 @@ condition in an @code{if} statement, the condition in a @code{do-until} statement is considered true if its value is non-zero, and false if its value is zero. If the value of the conditional expression in a -@code{do-until} statement is a vector or a matrix, it is considered +@code{do-until} statement is a vector or a matrix, it is considered true only if it is non-empty and @emph{all} of the elements are non-zero. Octave's @code{do-until} statement looks like this: @@ -568,7 +568,7 @@ for i = @{1,"two";"three",4@} i endfor -@end group +@end group @end example @noindent @@ -584,7 +584,7 @@ for i = c i endfor -@end group +@end group @end example @noindent @@ -640,10 +640,10 @@ @print{} val = 1 @print{} key = b @print{} val = - @print{} + @print{} @print{} 1 2 @print{} 3 4 - @print{} + @print{} @print{} key = c @print{} val = string @end group @@ -771,7 +771,7 @@ @cindex @code{end_unwind_protect} Octave supports a limited form of exception handling modeled after the -unwind-protect form of Lisp. +unwind-protect form of Lisp. The general form of an @code{unwind_protect} block looks like this: @@ -787,7 +787,7 @@ @noindent where @var{body} and @var{cleanup} are both optional and may contain any -Octave expressions or commands. The statements in @var{cleanup} are +Octave expressions or commands. The statements in @var{cleanup} are guaranteed to be executed regardless of how control exits @var{body}. This is useful to protect temporary changes to global variables from
--- a/doc/interpreter/strings.txi +++ b/doc/interpreter/strings.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -43,8 +43,8 @@ it is best to use double-quote marks to denote strings. Strings can be concatenated using the notation for defining matrices. For -example, the expression - +example, the expression + @example [ "foo" , "bar" , "baz" ] @end example @@ -82,7 +82,7 @@ @end example Here is a table of all the escape sequences used in Octave (within -double quoted strings). They are the same as those used in the C +double quoted strings). They are the same as those used in the C programming language. @table @code @@ -287,7 +287,7 @@ @group char ("orange", "green", "", "red") @result{} orange - green + green red @end group @@ -295,8 +295,8 @@ @group strvcat ("orange", "green", "", "red") @result{} orange - green - red + green + red @end group @end example @@ -308,10 +308,10 @@ @example @group char (@{"red", "green", "", "blue"@}) - @result{} red + @result{} red green - blue + blue @end group @group @@ -416,7 +416,7 @@ quote = ... "First things first, but not necessarily in that order"; quote( quote == " " ) = "_" -@result{} quote = +@result{} quote = First_things_first,_but_not_necessarily_in_that_order @end group @end example
--- a/doc/interpreter/system.txi +++ b/doc/interpreter/system.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -365,7 +365,7 @@ @DOCSTRING(WEXITSTATUS) @DOCSTRING(WIFCONTINUED) - + @DOCSTRING(WIFSIGNALED) @DOCSTRING(WIFSTOPPED) @@ -375,7 +375,7 @@ @DOCSTRING(WNOHANG) @DOCSTRING(WSTOPSIG) - + @DOCSTRING(WTERMSIG) @DOCSTRING(WUNTRACED)
--- a/doc/interpreter/testfun.txi +++ b/doc/interpreter/testfun.txi @@ -7,12 +7,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -45,7 +45,7 @@ @code{test}, @code{function}, or @code{assert} immediately following @samp{%!}. A block is defined by indentation as in Python. Lines beginning with @samp{%!<whitespace>} are part of the preceeding block. - + For example: @example @@ -198,10 +198,10 @@ @end group @end example -Note that all previous variables and values are lost when a new +Note that all previous variables and values are lost when a new shared block is declared. -Remember that @code{%!function} begins a new block and that +Remember that @code{%!function} begins a new block and that @code{%!endfunction} ends this block. Be aware that until a new block is started, lines starting with @samp{%!<space>} will be discarded as comments. The following is nearly identical to the example above, but does nothing. @@ -219,9 +219,9 @@ Because there is a space after @samp{%!} the @code{assert} statement does not begin a new block and this line is treated as a comment. -Error and warning blocks are like test blocks, but they only succeed +Error and warning blocks are like test blocks, but they only succeed if the code generates an error. You can check the text of the error -is correct using an optional regular expression @code{<pattern>}. +is correct using an optional regular expression @code{<pattern>}. For example: @example @@ -246,7 +246,7 @@ It is important to automate the tests as much as possible, however some tests require user interaction. These can be isolated into -demo blocks, which if you are in batch mode, are only run when +demo blocks, which if you are in batch mode, are only run when called with @code{demo} or the @code{verbose} option to @code{test}. The code is displayed before it is executed. For example, @@ -269,7 +269,7 @@ plot (@var{t}, @var{x}); # you should now see a sine wave in your figure window -Press <enter> to continue: +Press <enter> to continue: @end group @end example
--- a/doc/interpreter/tips.txi +++ b/doc/interpreter/tips.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -123,7 +123,7 @@ ## Octave is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public ## License as published by the Free Software Foundation; -## either version 3 of the License, or (at your option) any +## either version 3 of the License, or (at your option) any ## later version. ## ## Octave is distributed in the hope that it will be useful, @@ -284,7 +284,7 @@ However, rather than simply filling the entire documentation string, you can make it much more readable by choosing line breaks with care. Use blank lines between topics if the documentation string is long. - + @item @strong{Do not} indent subsequent lines of a documentation string so that the text is lined up in the source code with the text of the first @@ -349,7 +349,7 @@ -*- texinfo -*- @@deftypefn @{Function File@} @{@@var@{ret@} =@} fn (@dots{}) @@cindex index term -Help text in Texinfo format. Code samples should be marked +Help text in Texinfo format. Code samples should be marked like @@code@{sample of code@} and variables should be marked as @@var@{variable@}. @@seealso@{fn2, fn3@} @@ -374,7 +374,7 @@ This generates an index entry, and can be useful when the function is included as part of a larger piece of documentation. It is ignored within Octave's help viewer. Only one index term may appear per line -but multiple @@cindex lines are valid if the function should be +but multiple @@cindex lines are valid if the function should be filed under different terms. @item @@var@{variable@} @@ -567,7 +567,7 @@ which demonstrates most of the concepts discussed above. @iftex This documentation string renders as -@c Note: use the actual output of info below, rather than try and +@c Note: use the actual output of info below, rather than try and @c reproduce it here to prevent it looking different from how it would @c appear with info.
--- a/doc/interpreter/var.txi +++ b/doc/interpreter/var.txi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -315,7 +315,7 @@ str = "A random string"; who -variables @print{} *** local user variables: - @print{} + @print{} @print{} __nargin__ str @end group @end example
--- a/doc/interpreter/vectorize.txi +++ b/doc/interpreter/vectorize.txi @@ -557,7 +557,7 @@ a matrix variable is used multiple times as an index, checking the indices (and internal conversion to integers) is only done once. -@item Be aware of lazy copies (copy-on-write). +@item Be aware of lazy copies (copy-on-write). @cindex copy-on-write @cindex COW @cindex memory management
--- a/doc/liboctave/Makefile.am +++ b/doc/liboctave/Makefile.am @@ -3,17 +3,17 @@ # Copyright (C) 1996-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/array.texi +++ b/doc/liboctave/array.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -21,7 +21,7 @@ @cindex arrays @menu -* Constructors and Assignment:: +* Constructors and Assignment:: @end menu @node Constructors and Assignment, , Arrays, Arrays
--- a/doc/liboctave/bugs.texi +++ b/doc/liboctave/bugs.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/cp-idx.texi +++ b/doc/liboctave/cp-idx.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/dae.texi +++ b/doc/liboctave/dae.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/diffeq.texi +++ b/doc/liboctave/diffeq.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/error.texi +++ b/doc/liboctave/error.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/factor.texi +++ b/doc/liboctave/factor.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/fn-idx.texi +++ b/doc/liboctave/fn-idx.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/gpl.texi +++ b/doc/liboctave/gpl.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -240,7 +240,7 @@ conditions: @enumerate a -@item +@item The work must carry prominent notices stating that you modified it, and giving a relevant date. @@ -688,7 +688,7 @@ the ``copyright'' line and a pointer to where the full notice is found. @smallexample -@var{one line to give the program's name and a brief idea of what it does.} +@var{one line to give the program's name and a brief idea of what it does.} Copyright (C) @var{year} @var{name of author} This program is free software: you can redistribute it and/or modify @@ -711,7 +711,7 @@ notice like this when it starts in an interactive mode: @smallexample -@var{program} Copyright (C) @var{year} @var{name of author} +@var{program} Copyright (C) @var{year} @var{name of author} This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}. This is free software, and you are welcome to redistribute it under certain conditions; type @samp{show c} for details.
--- a/doc/liboctave/install.texi +++ b/doc/liboctave/install.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/intro.texi +++ b/doc/liboctave/intro.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/liboctave.texi +++ b/doc/liboctave/liboctave.texi @@ -6,12 +6,12 @@ % under the terms of the GNU General Public License as published by the % Free Software Foundation; either version 3 of the License, or (at % your option) any later version. -% +% % Octave is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License % for more details. -% +% % You should have received a copy of the GNU General Public License % along with Octave; see the file COPYING. If not, see % <http://www.gnu.org/licenses/>. @@ -118,24 +118,24 @@ @c ------------------------------------------------------------------------ @menu -* Acknowledgements:: -* Copying:: -* Introduction:: -* Arrays:: -* Matrix and Vector Operations:: -* Matrix Factorizations:: -* Ranges:: -* Nonlinear Functions:: -* Nonlinear Equations:: -* Optimization:: -* Quadrature:: -* Ordinary Differential Equations:: -* Differential Algebraic Equations:: -* Error Handling:: -* Installation:: -* Bugs:: -* Concept Index:: -* Function Index:: +* Acknowledgements:: +* Copying:: +* Introduction:: +* Arrays:: +* Matrix and Vector Operations:: +* Matrix Factorizations:: +* Ranges:: +* Nonlinear Functions:: +* Nonlinear Equations:: +* Optimization:: +* Quadrature:: +* Ordinary Differential Equations:: +* Differential Algebraic Equations:: +* Error Handling:: +* Installation:: +* Bugs:: +* Concept Index:: +* Function Index:: --- The Detailed Node Listing --- @@ -145,20 +145,20 @@ Arrays -* Constructors and Assignment:: +* Constructors and Assignment:: Optimization -* Objective Functions:: -* Bounds:: -* Linear Constraints:: -* Nonlinear Constraints:: -* Quadratic Programming:: -* Nonlinear Programming:: +* Objective Functions:: +* Bounds:: +* Linear Constraints:: +* Nonlinear Constraints:: +* Quadratic Programming:: +* Nonlinear Programming:: Quadrature -* Collocation Weights:: +* Collocation Weights:: @end menu @c ------------------------------------------------------------------------
--- a/doc/liboctave/matvec.texi +++ b/doc/liboctave/matvec.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/nleqn.texi +++ b/doc/liboctave/nleqn.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/nlfunc.texi +++ b/doc/liboctave/nlfunc.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/ode.texi +++ b/doc/liboctave/ode.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/optim.texi +++ b/doc/liboctave/optim.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -21,12 +21,12 @@ @cindex optimization @menu -* Objective Functions:: -* Bounds:: -* Linear Constraints:: -* Nonlinear Constraints:: -* Quadratic Programming:: -* Nonlinear Programming:: +* Objective Functions:: +* Bounds:: +* Linear Constraints:: +* Nonlinear Constraints:: +* Quadratic Programming:: +* Nonlinear Programming:: @end menu @node Objective Functions, Bounds, Optimization, Optimization
--- a/doc/liboctave/preface.texi +++ b/doc/liboctave/preface.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/liboctave/quad.texi +++ b/doc/liboctave/quad.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>. @@ -74,7 +74,7 @@ @end deftypefn @menu -* Collocation Weights:: +* Collocation Weights:: @end menu @node Collocation Weights, , Quadrature, Quadrature
--- a/doc/liboctave/range.texi +++ b/doc/liboctave/range.texi @@ -6,12 +6,12 @@ @c under the terms of the GNU General Public License as published by the @c Free Software Foundation; either version 3 of the License, or (at @c your option) any later version. -@c +@c @c Octave is distributed in the hope that it will be useful, but WITHOUT @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License @c for more details. -@c +@c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c <http://www.gnu.org/licenses/>.
--- a/doc/refcard/Makefile.am +++ b/doc/refcard/Makefile.am @@ -3,17 +3,17 @@ # Copyright (C) 1996-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. @@ -24,7 +24,7 @@ refcard.tex \ refcard-a4.tex \ refcard-legal.tex \ - refcard-letter.tex + refcard-letter.tex FORMATTED = \ refcard-a4.dvi \
--- a/doc/refcard/refcard.tex +++ b/doc/refcard/refcard.tex @@ -577,7 +577,7 @@ global {\it var1} ...&Declare variables global.\cr global {\it var1} = {\it val}&Declare variable global. Set initial value.\cr persistent {\it var1}&Declare a variable as static to a function.\cr -persistent {\it var1} = {\it val}&Declare a variable as static to a +persistent {\it var1} = {\it val}&Declare a variable as static to a function and set its initial value.\cr \omit\hfill\vbox{\rm\vskip0.25ex Global variables may be accessed inside the body of a function @@ -643,16 +643,16 @@ {\it x} > {\it y}&true if {\it x\/} is greater than {\it y}\cr {\it x} != {\it y}&true if {\it x\/} is not equal to {\it y}\cr {\it x} \& {\it y}&true if both {\it x\/} and {\it y\/} are true\cr -{\it x} | {\it y}&true if at least one of {\it x\/} or {\it y\/} is true\cr +{\it x} | {\it y}&true if at least one of {\it x\/} or {\it y\/} is true\cr ! {\it bool}&true if {\it bool\/} is false\cr \endsec \sec Short-circuit Boolean Operators; \omit \vbox{\rm\vskip0.75ex - Operators evaluate left-to-right. Operands are only evaluated if - necessary, stopping once overall truth value can be determined. - Operands are converted to scalars using the {\tt all} - function.\vskip0.75ex}\span\cr + Operators evaluate left-to-right. Operands are only evaluated if + necessary, stopping once overall truth value can be determined. + Operands are converted to scalars using the {\tt all} + function.\vskip0.75ex}\span\cr {\it x} \&\& {\it y}&true if both {\it x\/} and {\it y\/} are true\cr {\it x} || {\it y}&true if at least one of {\it x\/} or {\it y\/} is true\cr \endsec @@ -800,14 +800,14 @@ ones ({\it n}, {\it m})&create {\it n\/} by {\it m\/} matrix of ones\cr zeros ({\it n}, {\it m})&create {\it n\/} by {\it m\/} matrix of zeros\cr rand ({\it n}, {\it m})&create {\it n\/} by {\it m\/} matrix of random - values\cr + values\cr \endsec % sin ({\it a}) cos({\it a}) tan({\it a})&trigonometric functions\cr % asin ({\it a}) acos({\it a}) atan({\it a})&inverse trigonometric functions\cr % sinh ({\it a}) cosh({\it a}) tanh({\it a})&hyperbolic trig functions\cr % asinh ({\it a}) acosh({\it a}) atanh({\it a})&inverse hyperbolic trig -% functions\cr\cr +% functions\cr\cr \sec Linear Algebra; chol ({\it a})&Cholesky factorization\cr @@ -979,7 +979,7 @@ % For AUCTeX: % -% Local Variables: +% Local Variables: % mode: tex % TeX-master: t -% End: +% End:
--- a/etc/HACKING +++ b/etc/HACKING @@ -82,12 +82,12 @@ If you have a copy of gnulib in some directory apart from the Octave source tree, then pass the name of the directory containing gnulib-tool -to the bootstrap script using the option: +to the bootstrap script using the option: --gnulib-srcdir=DIRNAME If you have downloaded gnulib directly, DIRNAME will be the directory where -gnulib was unpacked. If you have installed gnulib using a package +gnulib was unpacked. If you have installed gnulib using a package manager, DIRNAME is likely to be /usr/bin or /usr/local/bin(where the gnulib-tool script resides). @@ -206,7 +206,7 @@ operators code for operators that act on base classes (such as Array) system OS-related functions - + util utility and miscellaneous functions libinterp -- the interpreter itself plus lots of infrastructure @@ -337,7 +337,7 @@ John W. Eaton jwe@octave.org -Last updated: Tue, 29 Oct 2013 11:42:47 PDT +Last updated: Tue, 29 Oct 2013 11:42:47 PDT
--- a/etc/NEWS.1 +++ b/etc/NEWS.1 @@ -247,7 +247,7 @@ * The Matlab-style plotting commands have been improved. They now accept line-style arguments, multiple x-y pairs, and other plot option flags. For example, - + plot (x, y, "@12", x, y2, x, y3, "4", x, y4, "+") results in a plot with @@ -298,7 +298,7 @@ given set of patterns. * New functions for manipulating polynomials - + compan -- companion matrix corresponding to polynomial coefficients conv -- convolve two vectors deconv -- deconvolve two vectors @@ -631,7 +631,7 @@ in the middle of defining a loop or if statement. * On AIX systems, Back off on indexing DiagArray via Proxy class to - avoid gcc (or possibly AIX assembler?) bug. + avoid gcc (or possibly AIX assembler?) bug. * Various other bug and portability fixes. @@ -915,7 +915,7 @@ used to set Octave's idea of the location of the info file. It will override any value of OCTAVE_INFO_FILE found in the environment, but not any INFO_FILE="filename" commands found in - the system or user startup files. + the system or user startup files. * Octave's Info reader will now recognize gzipped files that have names ending in `.gz'. @@ -1043,12 +1043,12 @@ with the empty matrix symbol, `[]'. For example: octave:13> zeros (3, 0) - ans = + ans = [](3x0) The new variable `print_empty_dimensions' controls this behavior. - + See also Carl de Boor, An Empty Exercise, SIGNUM, Volume 25, pages 2--6, 1990, or C. N. Nett and W. M. Haddad, A System-Theoretic Appropriate Realization of the Empty Matrix @@ -1101,7 +1101,7 @@ operation is intended from the context surrounding an operator. For example: - -- In the command + -- In the command [ 1 - 1 ] @@ -1174,7 +1174,7 @@ stderr -- file number corresponding to the standard error stream. The following may be used as the final (optional) argument for - fseek: + fseek: SEEK_SET -- set position relative to the beginning of the file. SEEK_CUR -- set position relative to the current position. @@ -1365,7 +1365,7 @@ * New functions: - eval -- evaluate a string as a sequence of Octave commands. + eval -- evaluate a string as a sequence of Octave commands. input -- print a prompt and get user input. Summary of changes for version 0.67: @@ -1409,7 +1409,7 @@ * Empty matrices can be used in conditionals, but they always evaluate to `false'. With propagate_empty_matrices = 'true', both - of the following expressions print 0: + of the following expressions print 0: if [], 1, else 0, end if ~[], 1, else 0, end @@ -1447,7 +1447,7 @@ * The reshape function works again. - * Octave now converts input like `3.2i' or `3 I' or `2.3e5 j' to be + * Octave now converts input like `3.2i' or `3 I' or `2.3e5 j' to be complex constants directly, rather than requiring an expression like `3.3 * i' to be evaluated. @@ -1465,7 +1465,7 @@ ------------------------------------ * The C-like formatted print functions printf, fprintf, and sprintf - finally work. + finally work. Summary of changes for version 0.56: ------------------------------------ @@ -1526,7 +1526,7 @@ * Name completion works for function and variable names currently in the symbol tables. Coming soon: completion for names of functions - defined in script files but not yet compiled. + defined in script files but not yet compiled. * The initial value of do_fortran_indexing is now false, and the initial value of prefer_column_vectors is now true. Swap the @@ -1541,7 +1541,7 @@ definition will reappear if they are cleared. * The symbol tables are now implemented with hash tables for faster - searching. + searching. * A small amount of help is now available for most built-in operators, keywords and functions. Coming soon: help for script
--- a/etc/NEWS.2 +++ b/etc/NEWS.2 @@ -20,7 +20,7 @@ ;; We have the old custom-library, hack around it! (defmacro defgroup (&rest args) nil) - (defmacro defcustom (var value doc &rest args) + (defmacro defcustom (var value doc &rest args) (` (defvar (, var) (, value) (, doc)))))) * When `format +' is in effect, Octave uses the following symbols to @@ -49,7 +49,7 @@ Instead it is left as specified. Its default value is now ":", which tells Octave to search the default path, and the new built-in variable DEFAULT_LOADPATH contains the default list of - directories to search. + directories to search. * The function file_in_path no longer does any special processing of its PATH argument. To search LOADPATH for files, it is now @@ -291,7 +291,7 @@ prop_test_2 -- compare two proportions run_test -- run test for independence sign_test -- sign test - t_test -- student's one-sample t test + t_test -- student's one-sample t test t_test_2 -- student's two-sample t test t_test_regression -- test one linear hypothesis in linear regression model @@ -313,7 +313,7 @@ * The mkoctfile script now accepts -DDEF options and passes them on to the C and C++ compilers. - * Running `make check' should work now before you run `make install', + * Running `make check' should work now before you run `make install', even if you build a copy of Octave that depends on shared versions of the Octave libraries. @@ -346,7 +346,7 @@ * tmpnam now takes two optional arguments, DIR, and PREFIX. For example, tmpnam ("/foo", "bar-") returns a file name like "/foo/bar-10773baa". If DIR is omitted or empty, the value of the - environment variable TMPDIR, or /tmp is used. If PREFIX is + environment variable TMPDIR, or /tmp is used. If PREFIX is omitted, "oct-" is used. * The built-in variable `PWD' has been removed. If you need to get @@ -402,10 +402,10 @@ stdout << x; ( [1] = - + 1 2 3 4 - + [2] = 1 [3] = foo ) @@ -752,7 +752,7 @@ * The svd() function no longer computes the left and right singular matrices unnecessarily. This can significantly improve - performance for large matrices if you are just looking for the + performance for large matrices if you are just looking for the singular values. * The filter() function is now a built-in function. @@ -907,7 +907,7 @@ element NAME; otherwise returns 0. struct_elements (S) -- returns the names of all elements - of structure S in an array of strings. + of structure S in an array of strings. * New io/subprocess functions:
--- a/etc/NEWS.3 +++ b/etc/NEWS.3 @@ -1712,7 +1712,7 @@ ** For compatibility with Matlab, gamcdf, gaminv, gampdf, gamrnd, - expcdf, expinv, exppdf and exprnd have been modified to compute + expcdf, expinv, exppdf and exprnd have been modified to compute the distributions using the standard scale factor rather than one over the scale factor.
--- a/etc/OLD-ChangeLogs/ChangeLog +++ b/etc/OLD-ChangeLogs/ChangeLog @@ -411,7 +411,7 @@ 2010-11-10 John W. Eaton <jwe@octave.org> - * configure.ac (AH_BOTTOM): Eliminate special case for __DECCXX: + * configure.ac (AH_BOTTOM): Eliminate special case for __DECCXX: 2010-11-10 John W. Eaton <jwe@octave.org>
--- a/etc/OLD-ChangeLogs/doc-ChangeLog +++ b/etc/OLD-ChangeLogs/doc-ChangeLog @@ -133,7 +133,7 @@ 2011-03-19 Rik <octave@nomad.inbox5.com> - * interpreter/oop.txi: Add optimize_subsasgn_calls function to + * interpreter/oop.txi: Add optimize_subsasgn_calls function to documentation. 2011-03-19 Rik <octave@nomad.inbox5.com> @@ -182,7 +182,7 @@ 2011-03-18 Rik <octave@nomad.inbox5.com> - * interpreter/basics.txi: Add gen_doc_cache, get_help_text, + * interpreter/basics.txi: Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation. 2011-03-17 Rik <octave@nomad.inbox5.com> @@ -215,8 +215,8 @@ 2011-03-02 Rik <octave@nomad.inbox5.com> - * interpreter/stats.txi: Correctly refer to discrete uniform - distribution in documentation. + * interpreter/stats.txi: Correctly refer to discrete uniform + distribution in documentation. 2011-03-01 Jordi Gutiérrez Hermoso <jordigh@gmail.com>
--- a/etc/OLD-ChangeLogs/scripts-ChangeLog +++ b/etc/OLD-ChangeLogs/scripts-ChangeLog @@ -50,7 +50,7 @@ 2011-04-12 Marco Caliari <marco.caliari@univr.it> * general/quadgk.m: Fix problem with -Inf bound on integral (bug - #33055). + #33055). 2011-04-11 Ben Abbott <bpabbott@mac.com> @@ -126,7 +126,7 @@ 2011-04-02 Rik <octave@nomad.inbox5.com> - * statistics/base/prctile.m, statistics/base/quantile.m: Improve + * statistics/base/prctile.m, statistics/base/quantile.m: Improve docstrings. 2011-03-31 Rik <octave@nomad.inbox5.com> @@ -336,7 +336,7 @@ * plot/subplot.m: Document using INDEX as a vector. -2011-02-24 Robert T. Short <rtshort@ieee.org> +2011-02-24 Robert T. Short <rtshort@ieee.org> * polynomial/polyval.m: Properly evaluate constant polynomials.
--- a/etc/OLD-ChangeLogs/src-ChangeLog +++ b/etc/OLD-ChangeLogs/src-ChangeLog @@ -286,7 +286,7 @@ axes::properties::update_dataaspectratiomode, axes::properties::update_plotboxaspectratio, axes::properties::update_plotboxaspectratiomode): - Replace update_transform hooks with sync_positions. + Replace update_transform hooks with sync_positions. 2011-02-13 Konstantinos Poulios <logari81@googlemail.com> @@ -611,7 +611,7 @@ 2011-01-27 Kai Habel <kai.habel@gmx.de> * DLD-FUNCTIONS/__init_fltk__.cc (__fltk_uigetfile__): Remove here. - * DLD-FUNCTIONS/__fltk_uigetfile__.cc: New file. + * DLD-FUNCTIONS/__fltk_uigetfile__.cc: New file. * DLD-FUNCTIONS/module-files: Add __fltk_uigetfile__.cc. Bug #32190. @@ -679,7 +679,7 @@ 2011-01-25 Rik <octave@nomad.inbox5.com> - * DLD-FUNCTIONS/config-module.awk: Use automake variable for + * DLD-FUNCTIONS/config-module.awk: Use automake variable for portability. * Makefile.am (uninstall-oct): Use GNU Make features for portability @@ -1393,7 +1393,7 @@ 2010-12-25 Rik <octave@nomad.inbox5.com> * DLD-FUNCTIONS/str2double.cc: Fix bug in converting "numberi" strings - such as "2i". Add ability to process special value "NA". Rewrite + such as "2i". Add ability to process special value "NA". Rewrite docstring. 2010-12-25 Rik <octave@nomad.inbox5.com> @@ -1426,7 +1426,7 @@ 2010-12-17 Rik <octave@nomad.inbox5.com> - * oct-parse.yy (builtin): Remove seealso reference to deprecated + * oct-parse.yy (builtin): Remove seealso reference to deprecated function dispatch. 2010-12-17 Konstantinos Poulios <logari81@googlemail.com>
--- a/etc/OLD-ChangeLogs/test-ChangeLog +++ b/etc/OLD-ChangeLogs/test-ChangeLog @@ -1,6 +1,6 @@ 2011-04-11 Rik <octave@nomad.inbox5.com> - * fntests.m: Remove deprecated and private functions from list of + * fntests.m: Remove deprecated and private functions from list of functions requiring tests. Count functions with %!demo blocks as having tests.
--- a/etc/PROJECTS +++ b/etc/PROJECTS @@ -1,8 +1,8 @@ Octave PROJECTS =============== -A list of proposed projects is maintained at: - +A list of proposed projects is maintained at: + http://wiki.octave.org/Projects If you start working steadily on a project, please let
--- a/etc/README.Cygwin +++ b/etc/README.Cygwin @@ -1,13 +1,13 @@ Starting with version 3.0.1, Octave is once again part of the normal -net distribution of Cygwin, available from http://www.cygwin.com. +net distribution of Cygwin, available from http://www.cygwin.com. It is possible to build Octave from source on Windows systems with Cygwin, but with the old gcc-3.4.4-3 compiler there are some performance problems related to the way C++ exception handling is implemented. -This is a known problem with a long history and it is STRONGLY +This is a known problem with a long history and it is STRONGLY encouraged to use gcc-4.3.2-1 or later. -Current binary versions are built with gcc-4.5.3-3. +Current binary versions are built with gcc-4.5.3-3. ------- SUGGESTED CONFIGURATION --------------------------- @@ -17,31 +17,31 @@ configure --enable-shared \ --enable-float-truncate \ - CC=gcc-4 F77=gfortran-4 CXX=g++-4 CPP=cpp-4 + CC=gcc-4 F77=gfortran-4 CXX=g++-4 CPP=cpp-4 lt_cv_deplibs_check_method=pass_all \ - LDFLAGS=-Wl,-no-undefined + LDFLAGS=-Wl,-no-undefined "--enable-float-truncate" is needed for the following bug: http://thread.gmane.org/gmane.comp.gnu.octave.bugs/12361/focus=12404 Without it, one of the quadgk test will fail as -"a=a" could be false due to truncation problems with -complex numbers. +"a=a" could be false due to truncation problems with +complex numbers. "lt_cv_deplibs_check_method=pass_all" is needed to bypass incorrect libtool detection of system capabilities and to allow shared libs building. -"LDFLAGS=-Wl,-no-undefined" is better than previous +"LDFLAGS=-Wl,-no-undefined" is better than previous "LDFLAGS=-no-undefined" as gcc-4 is now complaining about unknown command and the "undefined" is for the linker. -The additional patch used for 3.4.3-3 package can also be +The additional patch used for 3.4.3-3 package can also be needed for 3.6.x (see below). ------- SUGGESTION FOR FORK ISSUE -------------------------- -The build process can fails in building images for documentation -due to fork issue of the octave dll just built. In such case +The build process can fails in building images for documentation +due to fork issue of the octave dll just built. In such case I suggest to rebase the built dll's with: $ find build_tree -name "*.dll" > rebase_list @@ -51,9 +51,9 @@ $ rebaseall -s 'dll|so|oct' -T /full_path/rebase_list After rebasing the "make" should be able to complete the -creation of the images and the documentation. +creation of the images and the documentation. ------------------------------------------------------- +------------------------------------------------------ Octave-3.4.3-3 package was built using: @@ -62,9 +62,9 @@ --enable-float-truncate \ F77=gfortran-4 \ lt_cv_deplibs_check_method=pass_all \ - LDFLAGS=-no-undefined + LDFLAGS=-no-undefined -plus and additional patch to solve a specific cygwin +plus and additional patch to solve a specific cygwin fltk print issue, see: https://savannah.gnu.org/bugs/?31641
--- a/etc/README.MacOS +++ b/etc/README.MacOS @@ -28,7 +28,7 @@ ftp://alpha.gnu.org/gnu/octave Links to the stable releases, snap shots, and instructions for obtaining -the current development sources using mercurial can be found on Octave's +the current development sources using mercurial can be found on Octave's web-site below. http://www.octave.org/download.html @@ -63,7 +63,7 @@ * As of MacOS 10.6.6, the 64-bit BLAS routines that are part of Apple's vecLib (framework accelerate) are not functioning correctly. As a work around, an - alternative BLAS/LAPACK library, such as ATLAS, must be used. A bug report + alternative BLAS/LAPACK library, such as ATLAS, must be used. A bug report has been filed with Apple. http://bugreport.apple.com @@ -203,7 +203,7 @@ 3.0.x. These instructions will allow the developers sources to be build and run, but will not permit Octave to be installed in the usual Fink way. -TODO - When a Fink package is developed for Octave 3.4.x, modify these +TODO - When a Fink package is developed for Octave 3.4.x, modify these instructions to model the MacPorts section. @@ -219,7 +219,7 @@ fftw3 (>= 3.1.1) fftw3-shlibs (>= 3.1.1) flex >= 2.5.30 - fltk-aqua-shlibs + fltk-aqua-shlibs glpk-dev glpk-shlibs gnuplot (>= 4.2.6) @@ -231,14 +231,14 @@ libcurl4-shlibs libncurses5 libncurses5-shlibs - libtool >= 2.2.2 + libtool >= 2.2.2 ncurses pcre pcre-shlibs qhull qrupdate [1] readline5 - readline5-shlibs + readline5-shlibs sed suitesparse (= 3.1.0-1 ) @@ -406,7 +406,7 @@ make check -"make install" should not be run as it will bypass the macports package +"make install" should not be run as it will bypass the macports package management. To run Octave, type the command below from the root of the mercurial archive.
--- a/etc/README.MinGW +++ b/etc/README.MinGW @@ -18,8 +18,8 @@ We strongly encourage experienced users to build Octave from the testing and development snapshots to try the latest features of Octave. -A good tutorial on building Octave for version 3.2 is available from -http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/admin/Windows/mingw32/HOWTO.txt +A good tutorial on building Octave for version 3.2 is available from +http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/admin/Windows/mingw32/HOWTO.txt Additional information beyond the tutorial is summarized below. @@ -36,8 +36,8 @@ The latest GCC (GNU Complier Collection) for MinGW is gcc-4.5.0. Earlier versions are not recommended for building Octave 3.4.xx. - The latest Msys, MinGW, and GCC tools can be downloaded from - http://sourceforge.net/projects/mingw/files/ + The latest Msys, MinGW, and GCC tools can be downloaded from + http://sourceforge.net/projects/mingw/files/ (Compiling for 64-bit binaries requires mingw-64 toolkits. This has not been tested.) @@ -46,7 +46,7 @@ ---------------------- External program dependencies - + * gnuplot (you can build this with the shell script mentioned in Howto.txt) * MikTeX * ghostscript @@ -73,7 +73,7 @@ ---------------------- The source for testing snapshots can be downloaded from the official Octave - web site. http://www.octave.org/download.html + web site. http://www.octave.org/download.html The very latest development code is also available via anonymous access to a read-only Mercurial archive. The method of download is described on the web @@ -84,13 +84,13 @@ ---------------------- Building from source can be carried out using the script described in - Howto.txt. - + Howto.txt. + When using GCC-4.5.0, remove flags for shared libstdc++ because a shared build is already the default. - When running './configure', you must add '--enable-float-truncate' option. - Please see the following thread for more information: + When running './configure', you must add '--enable-float-truncate' option. + Please see the following thread for more information: http://thread.gmane.org/gmane.comp.gnu.octave.bugs/12361/focus=12404 To build development sources from the Mercurial repository you must run @@ -102,7 +102,7 @@ tmacchant@yahoo.co.jp Benjamin Lindner -bjmldn@gmail.com +bjmldn@gmail.com Last updated: Sat Jan 22 17:29:12 PST 2011
--- a/etc/README.gnuplot +++ b/etc/README.gnuplot @@ -3,7 +3,7 @@ In versions prior to 4.2.6 it is not possible to use the mouse to zoom in on plots. This is a limitation of earlier versions of gnuplot, which are -unable to zoom when the data it plots is not stored in a file. +unable to zoom when the data it plots is not stored in a file. John W. Eaton
--- a/etc/gdbinit +++ b/etc/gdbinit @@ -9,9 +9,9 @@ ## Display a dim-vector object. define display-dims - echo ndims: \ + echo ndims: \ output $arg0.rep[-1] - echo \ndims: \ + echo \ndims: \ output *$arg0.rep@$arg0.rep[-1] echo \n dont-repeat @@ -26,13 +26,13 @@ ## Display a dense array object. define display-dense-array - echo array object: \ + echo array object: \ output $arg0 echo \ndimensions:\n display-dims $arg0.dimensions - echo \nrep = \ + echo \nrep = \ output *$arg0.rep - echo \nrep.data = \ + echo \nrep.data = \ output *$arg0.rep.data@$arg0.rep.len echo \n dont-repeat @@ -50,19 +50,19 @@ ## Display a sparse array object. define display-sparse-array - echo sparse object: \ + echo sparse object: \ output $arg0 - echo \ndimensions.rep[0] = \ + echo \ndimensions.rep[0] = \ display-dims $arg0.dimensions - echo \ndimensions.rep[1] = \ + echo \ndimensions.rep[1] = \ output $arg0.dimensions.rep[1] - echo \nrep = \ + echo \nrep = \ output *$arg0.rep - echo \nrep.d = \ + echo \nrep.d = \ output *$arg0.rep.d@$arg0.rep.nzmx - echo \nrep.r = \ + echo \nrep.r = \ output *$arg0.rep.r@$arg0.rep.nzmx - echo \nrep.c = \ + echo \nrep.c = \ output *$arg0.rep.c@($arg0.rep.ncols+1) echo \n dont-repeat @@ -78,7 +78,7 @@ ############################################################ -## Display Octave debugging stack +## Display Octave debugging stack define show-octave-dbstack call show_octave_dbstack ()
--- a/etc/icons/Makefile.am +++ b/etc/icons/Makefile.am @@ -3,17 +3,17 @@ # Copyright (C) 2012-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/examples/@polynomial/end.m +++ b/examples/@polynomial/end.m @@ -3,7 +3,7 @@ if (num_indices != 1) error ("polynomial object may only have one index") endif - + r = length (obj.poly) - 1; endfunction
--- a/examples/@polynomial/subsasgn.m +++ b/examples/@polynomial/subsasgn.m @@ -10,7 +10,7 @@ else if (length (s) == 1) if (isnumeric (ind{1})) - p.poly(ind{1}+1) = val; + p.poly(ind{1}+1) = val; else p.poly(ind{1}) = val; endif
--- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -3,24 +3,24 @@ # Copyright (C) 1996-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. include $(top_srcdir)/build-aux/common.mk -EXTRA_DIST = +EXTRA_DIST = FCN_FILE_DIRS =
--- a/examples/standalonebuiltin.cc +++ b/examples/standalonebuiltin.cc @@ -12,7 +12,7 @@ for (octave_idx_type j = 0; j < n; j++) a_matrix(i,j) = (i + 1) * 10 + (j + 1); - std::cout << "This is a matrix:" << std::endl + std::cout << "This is a matrix:" << std::endl << a_matrix << std::endl; octave_value_list in; @@ -21,8 +21,8 @@ octave_value_list out = Fnorm (in, 1); double norm_of_the_matrix = out(0).double_value (); - std::cout << "This is the norm of the matrix:" << std::endl + std::cout << "This is the norm of the matrix:" << std::endl << norm_of_the_matrix << std::endl; - + return 0; }
--- a/libgui/Makefile.am +++ b/libgui/Makefile.am @@ -59,7 +59,7 @@ ## liboctgui merely collects a bunch of compiled convenience libraries. ## It has no source code itself. -liboctgui_la_SOURCES = +liboctgui_la_SOURCES = include link-deps.mk
--- a/libgui/qterminal/libqterminal/README +++ b/libgui/qterminal/libqterminal/README @@ -1,7 +1,7 @@ lib.pro is a *.pro-file for qmake -It produces static lib (libqtermwidget.a) only. +It produces static lib (libqtermwidget.a) only. For creating shared lib (*.so) uncomment "dll" in "CONFIG" line in *.pro-file -Library was tested both with HAVE_POSIX_OPENPT and HAVE_GETPT precompiler directives, -defined in "DEFINES" line. You should select variant which would be correct for your system. \ No newline at end of file +Library was tested both with HAVE_POSIX_OPENPT and HAVE_GETPT precompiler directives, +defined in "DEFINES" line. You should select variant which would be correct for your system.
--- a/libgui/qterminal/libqterminal/unix/BlockArray.cpp +++ b/libgui/qterminal/libqterminal/unix/BlockArray.cpp @@ -117,7 +117,7 @@ qDebug() << "BlockArray::at() i > index\n"; return 0; } - + // if (index - i >= length) { // kDebug(1211) << "BlockArray::at() index - i >= length\n"; // return 0;
--- a/libgui/qterminal/libqterminal/unix/BlockArray.h +++ b/libgui/qterminal/libqterminal/unix/BlockArray.h @@ -1,7 +1,7 @@ /* This file is part of Konsole, an X terminal. Copyright (C) 2000, 2013 by Stephan Kulow <coolo@kde.org> - + Rewritten for QT4 by e_k <e_k at users.sourceforge.net>, Copyright (C)2008 This program is free software; you can redistribute it and/or modify
--- a/libgui/qterminal/libqterminal/unix/Character.h +++ b/libgui/qterminal/libqterminal/unix/Character.h @@ -1,6 +1,6 @@ /* This file is part of Konsole, KDE's terminal. - + Copyright (C) 2007, 2013 by Robert Knight <robertknight@gmail.com> Copyright (C) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> @@ -55,7 +55,7 @@ class Character { public: - /** + /** * Constructs a new character. * * @param _c The unicode character value of this character. @@ -73,25 +73,25 @@ { /** The unicode character value for this character. */ quint16 character; - /** + /** * Experimental addition which allows a single Character instance to contain more than * one unicode character. * * charSequence is a hash code which can be used to look up the unicode * character sequence in the ExtendedCharTable used to create the sequence. */ - quint16 charSequence; + quint16 charSequence; }; /** A combination of RENDITION flags which specify options for drawing the character. */ quint8 rendition; /** The foreground color used to draw this character. */ - CharacterColor foregroundColor; + CharacterColor foregroundColor; /** The color used to draw this character's background. */ CharacterColor backgroundColor; - /** + /** * Returns true if this character has a transparent background when * it is drawn with the specified @p palette. */ @@ -99,11 +99,11 @@ /** * Returns true if this character should always be drawn in bold when * it is drawn with the specified @p palette, independent of whether - * or not the character has the RE_BOLD rendition flag. + * or not the character has the RE_BOLD rendition flag. */ bool isBold(const ColorEntry* base) const; - - /** + + /** * Compares two characters and returns true if they have the same unicode character value, * rendition and colors. */ @@ -116,26 +116,26 @@ }; inline bool operator == (const Character& a, const Character& b) -{ - return a.character == b.character && - a.rendition == b.rendition && - a.foregroundColor == b.foregroundColor && +{ + return a.character == b.character && + a.rendition == b.rendition && + a.foregroundColor == b.foregroundColor && a.backgroundColor == b.backgroundColor; } inline bool operator != (const Character& a, const Character& b) { - return a.character != b.character || - a.rendition != b.rendition || - a.foregroundColor != b.foregroundColor || + return a.character != b.character || + a.rendition != b.rendition || + a.foregroundColor != b.foregroundColor || a.backgroundColor != b.backgroundColor; } inline bool Character::isTransparent(const ColorEntry* base) const { - return ((backgroundColor._colorSpace == COLOR_SPACE_DEFAULT) && + return ((backgroundColor._colorSpace == COLOR_SPACE_DEFAULT) && base[backgroundColor._u+0+(backgroundColor._v?BASE_COLORS:0)].transparent) - || ((backgroundColor._colorSpace == COLOR_SPACE_SYSTEM) && + || ((backgroundColor._colorSpace == COLOR_SPACE_SYSTEM) && base[backgroundColor._u+2+(backgroundColor._v?BASE_COLORS:0)].transparent); } @@ -180,7 +180,7 @@ * which was added to the table using createExtendedChar(). * * @param hash The hash key returned by createExtendedChar() - * @param length This variable is set to the length of the + * @param length This variable is set to the length of the * character sequence. * * @return A unicode character sequence of size @p length. @@ -192,7 +192,7 @@ private: // calculates the hash key of a sequence of unicode points of size 'length' ushort extendedCharHash(ushort* unicodePoints , ushort length) const; - // tests whether the entry in the table specified by 'hash' matches the + // tests whether the entry in the table specified by 'hash' matches the // character sequence 'unicodePoints' of size 'length' bool extendedCharMatch(ushort hash , ushort* unicodePoints , ushort length) const; // internal, maps hash keys to character sequence buffers. The first ushort
--- a/libgui/qterminal/libqterminal/unix/CharacterColor.h +++ b/libgui/qterminal/libqterminal/unix/CharacterColor.h @@ -1,6 +1,6 @@ /* This file is part of Konsole, KDE's terminal. - + Copyright (C) 2007, 2013 by Robert Knight <robertknight@gmail.com> Copyright (C) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> @@ -28,14 +28,14 @@ // Qt #include <QColor> -/** - * An entry in a terminal display's color palette. +/** + * An entry in a terminal display's color palette. * * A color palette is an array of 16 ColorEntry instances which map * system color indexes (from 0 to 15) into actual colors. * * Each entry can be set as bold, in which case any text - * drawn using the color should be drawn in bold. + * drawn using the color should be drawn in bold. * * Each entry can also be transparent, in which case the terminal * display should avoid drawing the background for any characters @@ -44,7 +44,7 @@ class ColorEntry { public: - /** + /** * Constructs a new color palette entry. * * @param c The color value for this entry. @@ -56,24 +56,24 @@ /** * Constructs a new color palette entry with an undefined color, and * with the transparent and bold flags set to false. - */ - ColorEntry() : transparent(false), bold(false) {} - + */ + ColorEntry() : transparent(false), bold(false) {} + /** * Sets the color, transparency and boldness of this color to those of @p rhs. - */ - void operator=(const ColorEntry& rhs) - { - color = rhs.color; - transparent = rhs.transparent; - bold = rhs.bold; + */ + void operator=(const ColorEntry& rhs) + { + color = rhs.color; + transparent = rhs.transparent; + bold = rhs.bold; } /** The color value of this entry for display. */ QColor color; - /** - * If true character backgrounds using this color should be transparent. + /** + * If true character backgrounds using this color should be transparent. * This is not applicable when the color is used to render text. */ bool transparent; @@ -81,7 +81,7 @@ * If true characters drawn using this color should be bold. * This is not applicable when the color is used to draw a character's background. */ - bool bold; + bool bold; }; @@ -146,15 +146,15 @@ public: /** Constructs a new CharacterColor whoose color and color space are undefined. */ - CharacterColor() - : _colorSpace(COLOR_SPACE_UNDEFINED), - _u(0), - _v(0), - _w(0) + CharacterColor() + : _colorSpace(COLOR_SPACE_UNDEFINED), + _u(0), + _v(0), + _w(0) {} - /** - * Constructs a new CharacterColor using the specified @p colorSpace and with + /** + * Constructs a new CharacterColor using the specified @p colorSpace and with * color value @p co * * The meaning of @p co depends on the @p colorSpace used. @@ -163,10 +163,10 @@ * * TODO : Add documentation about available color spaces. */ - CharacterColor(quint8 colorSpace, int co) - : _colorSpace(colorSpace), - _u(0), - _v(0), + CharacterColor(quint8 colorSpace, int co) + : _colorSpace(colorSpace), + _u(0), + _v(0), _w(0) { switch (colorSpace) @@ -178,7 +178,7 @@ _u = co & 7; _v = (co >> 3) & 1; break; - case COLOR_SPACE_256: + case COLOR_SPACE_256: _u = co & 255; break; case COLOR_SPACE_RGB: @@ -191,32 +191,32 @@ } } - /** + /** * Returns true if this character color entry is valid. */ - bool isValid() + bool isValid() { return _colorSpace != COLOR_SPACE_UNDEFINED; } - - /** + + /** * Toggles the value of this color between a normal system color and the corresponding intensive * system color. - * + * * This is only applicable if the color is using the COLOR_SPACE_DEFAULT or COLOR_SPACE_SYSTEM * color spaces. */ void toggleIntensive(); - /** + /** * Returns the color within the specified color @palette * * The @p palette is only used if this color is one of the 16 system colors, otherwise * it is ignored. */ QColor color(const ColorEntry* palette) const; - - /** + + /** * Compares two colors and returns true if they represent the same color value and * use the same color space. */ @@ -230,14 +230,14 @@ private: quint8 _colorSpace; - // bytes storing the character color - quint8 _u; - quint8 _v; - quint8 _w; + // bytes storing the character color + quint8 _u; + quint8 _v; + quint8 _w; }; inline bool operator == (const CharacterColor& a, const CharacterColor& b) -{ +{ return a._colorSpace == b._colorSpace && a._u == b._u && a._v == b._v && @@ -259,7 +259,7 @@ if (u < 216) return QColor(255*((u/36)%6)/5, 255*((u/ 6)%6)/5, 255*((u/ 1)%6)/5); u -= 216; - + // 232..255: gray, leaving out black and white int gray = u*10+8; return QColor(gray,gray,gray); }
--- a/libgui/qterminal/libqterminal/unix/Emulation.cpp +++ b/libgui/qterminal/libqterminal/unix/Emulation.cpp @@ -1,7 +1,7 @@ /* This file is part of Konsole, an X terminal. - Copyright (C) 2007, 2013 Robert Knight <robertknight@gmail.com> + Copyright (C) 2007, 2013 Robert Knight <robertknight@gmail.com> Copyright (C) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> Copyright (C) 1996, 2013 by Matthias Ettrich <ettrich@kde.org> @@ -64,9 +64,9 @@ QObject::connect(&_bulkTimer1, SIGNAL(timeout()), this, SLOT(showBulk()) ); QObject::connect(&_bulkTimer2, SIGNAL(timeout()), this, SLOT(showBulk()) ); - + // listen for mouse status changes - connect( this , SIGNAL(programUsesMouseChanged(bool)) , + connect( this , SIGNAL(programUsesMouseChanged(bool)) , SLOT(usesMouseChanged(bool)) ); } @@ -118,7 +118,7 @@ { Screen *old = _currentScreen; _currentScreen = _screen[n&1]; - if (_currentScreen != old) + if (_currentScreen != old) { old->setBusySelecting(false); @@ -218,7 +218,7 @@ void Emulation::sendKeyEvent( QKeyEvent* ev ) { emit stateSet(NOTIFYNORMAL); - + if (!ev->text().isEmpty()) { // A block of text // Note that the text is proper unicode. @@ -263,9 +263,9 @@ // Selection --------------------------------------------------------------- -- -void Emulation::writeToStream( TerminalCharacterDecoder* _decoder , +void Emulation::writeToStream( TerminalCharacterDecoder* _decoder , int startLine , - int endLine) + int endLine) { _currentScreen->writeToStream(_decoder,startLine,endLine); } @@ -342,17 +342,17 @@ { ushort* entry = extendedCharTable[hash]; - // compare given length with stored sequence length ( given as the first ushort in the - // stored buffer ) - if ( entry == 0 || entry[0] != length ) + // compare given length with stored sequence length ( given as the first ushort in the + // stored buffer ) + if ( entry == 0 || entry[0] != length ) return false; // if the lengths match, each character must be checked. the stored buffer starts at // entry[1] for ( int i = 0 ; i < length ; i++ ) { if ( entry[i+1] != unicodePoints[i] ) - return false; - } + return false; + } return true; } ushort ExtendedCharTable::createExtendedChar(ushort* unicodePoints , ushort length) @@ -365,7 +365,7 @@ { if ( extendedCharMatch(hash,unicodePoints,length) ) { - // this sequence already has an entry in the table, + // this sequence already has an entry in the table, // return its hash return hash; } @@ -375,16 +375,16 @@ // points then try next hash hash++; } - } + } - + // add the new sequence to the table and // return that index ushort* buffer = new ushort[length+1]; buffer[0] = length; for ( int i = 0 ; i < length ; i++ ) - buffer[i+1] = unicodePoints[i]; - + buffer[i+1] = unicodePoints[i]; + extendedCharTable.insert(hash,buffer); return hash;
--- a/libgui/qterminal/libqterminal/unix/Emulation.h +++ b/libgui/qterminal/libqterminal/unix/Emulation.h @@ -1,6 +1,6 @@ /* This file is part of Konsole, an X terminal. - + Copyright (C) 2007, 2013 by Robert Knight <robertknight@gmail.com> Copyright (C) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> @@ -28,7 +28,7 @@ // System #include <stdio.h> -// Qt +// Qt #include <QKeyEvent> #include <QtCore/QTextCodec> @@ -41,56 +41,56 @@ class ScreenWindow; class TerminalCharacterDecoder; -/** - * This enum describes the available states which +/** + * This enum describes the available states which * the terminal emulation may be set to. * - * These are the values used by Emulation::stateChanged() + * These are the values used by Emulation::stateChanged() */ -enum -{ +enum +{ /** The emulation is currently receiving user input. */ - NOTIFYNORMAL=0, - /** + NOTIFYNORMAL=0, + /** * The terminal program has triggered a bell event * to get the user's attention. */ - NOTIFYBELL=1, - /** - * The emulation is currently receiving data from its + NOTIFYBELL=1, + /** + * The emulation is currently receiving data from its * terminal input. */ NOTIFYACTIVITY=2, - // unused here? - NOTIFYSILENCE=3 + // unused here? + NOTIFYSILENCE=3 }; /** * Base class for terminal emulation back-ends. * - * The back-end is responsible for decoding an incoming character stream and + * The back-end is responsible for decoding an incoming character stream and * producing an output image of characters. * * When input from the terminal is received, the receiveData() slot should be called with - * the data which has arrived. The emulation will process the data and update the + * the data which has arrived. The emulation will process the data and update the * screen image accordingly. The codec used to decode the incoming character stream - * into the unicode characters used internally can be specified using setCodec() + * into the unicode characters used internally can be specified using setCodec() * - * The size of the screen image can be specified by calling setImageSize() with the + * The size of the screen image can be specified by calling setImageSize() with the * desired number of lines and columns. When new lines are added, old content - * is moved into a history store, which can be set by calling setHistory(). + * is moved into a history store, which can be set by calling setHistory(). * - * The screen image can be accessed by creating a ScreenWindow onto this emulation - * by calling createWindow(). Screen windows provide access to a section of the - * output. Each screen window covers the same number of lines and columns as the + * The screen image can be accessed by creating a ScreenWindow onto this emulation + * by calling createWindow(). Screen windows provide access to a section of the + * output. Each screen window covers the same number of lines and columns as the * image size returned by imageSize(). The screen window can be moved up and down - * and provides transparent access to both the current on-screen image and the + * and provides transparent access to both the current on-screen image and the * previous output. The screen windows emit an outputChanged signal * when the section of the image they are looking at changes. * Graphical views can then render the contents of a screen window, listening for notifications - * of output changes from the screen window which they are associated with and updating - * accordingly. + * of output changes from the screen window which they are associated with and updating + * accordingly. * * The emulation also is also responsible for converting input from the connected views such * as keypresses and mouse activity into a character string which can be sent @@ -103,9 +103,9 @@ * character sequences. The name of the key bindings set used can be specified using * setKeyBindings() * - * The emulation maintains certain state information which changes depending on the - * input received. The emulation can be reset back to its starting state by calling - * reset(). + * The emulation maintains certain state information which changes depending on the + * input received. The emulation can be reset back to its starting state by calling + * reset(). * * The emulation also maintains an activity state, which specifies whether * terminal is currently active ( when data is received ), normal @@ -116,12 +116,12 @@ * a 'bell' event in different ways. */ class Emulation : public QObject -{ +{ Q_OBJECT public: - - /** Constructs a new terminal emulation */ + + /** Constructs a new terminal emulation */ Emulation(); ~Emulation(); @@ -137,16 +137,16 @@ /** * Returns the total number of lines, including those stored in the history. - */ + */ int lineCount(); - - /** + + /** * Sets the history store used by this emulation. When new lines * are added to the output, older lines at the top of the screen are transferred to a history - * store. + * store. * - * The number of lines which are kept and the storage location depend on the + * The number of lines which are kept and the storage location depend on the * type of store. */ void setHistory(const HistoryType&); @@ -155,48 +155,48 @@ /** Clears the history scroll. */ void clearHistory(); - /** - * Copies the output history from @p startLine to @p endLine + /** + * Copies the output history from @p startLine to @p endLine * into @p stream, using @p decoder to convert the terminal - * characters into text. + * characters into text. * - * @param decoder A decoder which converts lines of terminal characters with + * @param decoder A decoder which converts lines of terminal characters with * appearance attributes into output text. PlainTextDecoder is the most commonly * used decoder. * @param startLine The first */ virtual void writeToStream(TerminalCharacterDecoder* decoder,int startLine,int endLine); - - + + /** Returns the codec used to decode incoming characters. See setCodec() */ const QTextCodec* codec() { return _codec; } /** Sets the codec used to decode incoming characters. */ void setCodec(const QTextCodec*); - /** - * Convenience method. + /** + * Convenience method. * Returns true if the current codec used to decode incoming * characters is UTF-8 */ bool utf8() { Q_ASSERT(_codec); return _codec->mibEnum() == 106; } - + /** TODO Document me */ virtual char getErase() const; - /** + /** * Sets the key bindings used to key events * ( received through sendKeyEvent() ) into character * streams to send to the terminal. */ void setKeyBindings(const QString& name); - /** + /** * Returns the name of the emulation's current key bindings. * See setKeyBindings() */ QString keyBindings(); - /** + /** * Copies the current image into the history and clears the screen. */ virtual void clearEntireScreen() =0; @@ -204,7 +204,7 @@ /** Resets the state of the terminal. */ virtual void reset() =0; - /** + /** * Returns true if the active terminal program wants * mouse input events. * @@ -213,42 +213,42 @@ */ bool programUsesMouse() const; -public slots: +public slots: /** Change the size of the emulation's image */ virtual void setImageSize(int lines, int columns); - - /** + + /** * Interprets a sequence of characters and sends the result to the terminal. * This is equivalent to calling sendKeyEvent() for each character in @p text in succession. */ virtual void sendText(const QString& text) = 0; - /** + /** * Interprets a key press event and emits the sendData() signal with - * the resulting character stream. + * the resulting character stream. */ virtual void sendKeyEvent(QKeyEvent*); - - /** + + /** * Converts information about a mouse event into an xterm-compatible escape * sequence and emits the character sequence via sendData() */ virtual void sendMouseEvent(int buttons, int column, int line, int eventType); - + /** - * Sends a string of characters to the foreground terminal process. + * Sends a string of characters to the foreground terminal process. * - * @param string The characters to send. + * @param string The characters to send. * @param length Length of @p string or if set to a negative value, @p string will * be treated as a null-terminated string and its length will be determined automatically. */ virtual void sendString(const char* string, int length = -1) = 0; - /** + /** * Processes an incoming stream of characters. receiveData() decodes the incoming * character buffer using the current codec(), and then calls receiveChar() for - * each unicode character in the resulting buffer. + * each unicode character in the resulting buffer. * * receiveData() also starts a timer which causes the outputChanged() signal * to be emitted when it expires. The timer allows multiple updates in quick @@ -261,8 +261,8 @@ signals: - /** - * Emitted when a buffer of data is ready to send to the + /** + * Emitted when a buffer of data is ready to send to the * standard input of the terminal. * * @param data The buffer of data ready to be sent @@ -270,20 +270,20 @@ */ void sendData(const char* data,int len); - /** + /** * Requests that sending of input to the emulation * from the terminal process be suspended or resumed. * - * @param suspend If true, requests that sending of - * input from the terminal process' stdout be + * @param suspend If true, requests that sending of + * input from the terminal process' stdout be * suspended. Otherwise requests that sending of - * input be resumed. + * input be resumed. */ void lockPtyRequest(bool suspend); /** * Requests that the pty used by the terminal process - * be set to UTF 8 mode. + * be set to UTF 8 mode. * * TODO: More documentation */ @@ -308,7 +308,7 @@ */ void changeTabTextColorRequest(int color); - /** + /** * This is emitted when the program running in the shell indicates whether or * not it is interested in mouse events. * @@ -317,7 +317,7 @@ */ void programUsesMouseChanged(bool usesMouse); - /** + /** * Emitted when the contents of the screen image change. * The emulation buffers the updates from successive image changes, * and only emits outputChanged() at sensible intervals when @@ -327,14 +327,14 @@ * created with createWindow() to listen for this signal. * * ScreenWindow objects created using createWindow() will emit their - * own outputChanged() signal in response to this signal. + * own outputChanged() signal in response to this signal. */ void outputChanged(); /** - * Emitted when the program running in the terminal wishes to update the + * Emitted when the program running in the terminal wishes to update the * session's title. This also allows terminal programs to customize other - * aspects of the terminal emulation display. + * aspects of the terminal emulation display. * * This signal is emitted when the escape sequence "\033]ARG;VALUE\007" * is received in the input string, where ARG is a number specifying what @@ -342,7 +342,7 @@ * * TODO: The name of this method is not very accurate since this method * is used to perform a whole range of tasks besides just setting - * the user-title of the session. + * the user-title of the session. * * @param title Specifies what to change. * <ul> @@ -351,16 +351,16 @@ * <li>2 - Set session title to @p newTitle</li> * <li>11 - Set the session's default background color to @p newTitle, * where @p newTitle can be an HTML-style string (#RRGGBB) or a named - * color (eg 'red', 'blue'). + * color (eg 'red', 'blue'). * See http://doc.trolltech.com/4.2/qcolor.html#setNamedColor for more * details. * </li> * <li>31 - Supposedly treats @p newTitle as a URL and opens it (NOT IMPLEMENTED)</li> - * <li>32 - Sets the icon associated with the session. @p newTitle is the name + * <li>32 - Sets the icon associated with the session. @p newTitle is the name * of the icon to use, which can be the name of any icon in the current KDE icon * theme (eg: 'konsole', 'kate', 'folder_home')</li> * </ul> - * @param newTitle Specifies the new title + * @param newTitle Specifies the new title */ void titleChanged(int title,const QString& newTitle); @@ -371,9 +371,9 @@ */ void imageSizeChanged(int lineCount , int columnCount); - /** + /** * Emitted when the terminal program requests to change various properties - * of the terminal display. + * of the terminal display. * * A profile change command occurs when a special escape sequence, followed * by a string containing a series of name and value pairs is received. @@ -387,21 +387,21 @@ protected: virtual void setMode (int mode) = 0; virtual void resetMode(int mode) = 0; - - /** + + /** * Processes an incoming character. See receiveData() - * @p ch A unicode character code. + * @p ch A unicode character code. */ virtual void receiveChar(int ch); - /** + /** * Sets the active screen. The terminal has two screens, primary and alternate. * The primary screen is used by default. When certain interactive programs such * as Vim are run, they trigger a switch to the alternate screen. * * @param index 0 to switch to the primary screen, or 1 to switch to the alternate screen */ - void setScreen(int index); + void setScreen(int index); enum EmulationCodec { @@ -412,17 +412,17 @@ QList<ScreenWindow*> _windows; - - Screen* _currentScreen; // pointer to the screen which is currently active, + + Screen* _currentScreen; // pointer to the screen which is currently active, // this is one of the elements in the screen[] array Screen* _screen[2]; // 0 = primary screen ( used by most programs, including the shell // scrollbars are enabled in this mode ) // 1 = alternate ( used by vi , emacs etc. // scrollbars are not enabled in this mode ) - - - //decodes an incoming C-style character stream into a unicode QString using + + + //decodes an incoming C-style character stream into a unicode QString using //the current text codec. (this allows for rendering of non-ASCII characters in text files etc.) const QTextCodec* _codec; QTextDecoder* _decoder; @@ -430,18 +430,18 @@ const KeyboardTranslator* _keyTranslator; // the keyboard layout protected slots: - /** + /** * Schedules an update of attached views. * Repeated calls to bufferedUpdate() in close succession will result in only a single update, - * much like the Qt buffered update of widgets. + * much like the Qt buffered update of widgets. */ void bufferedUpdate(); -private slots: +private slots: // triggered by timer, causes the emulation to send an updated screen image to each // view - void showBulk(); + void showBulk(); void usesMouseChanged(bool usesMouse); @@ -450,7 +450,7 @@ bool _usesMouse; QTimer _bulkTimer1; QTimer _bulkTimer2; - + }; #endif // ifndef EMULATION_H
--- a/libgui/qterminal/libqterminal/unix/Filter.cpp +++ b/libgui/qterminal/libqterminal/unix/Filter.cpp @@ -40,7 +40,7 @@ FilterChain::~FilterChain() { QMutableListIterator<Filter*> iter(*this); - + while ( iter.hasNext() ) { Filter* filter = iter.next(); @@ -136,7 +136,7 @@ PlainTextDecoder decoder; decoder.setTrailingWhitespace(false); - + //qDebug("%s %d", __FILE__, __LINE__); // setup new shared buffers for the filters to process on QString* newBuffer = new QString(); @@ -163,7 +163,7 @@ // being treated as part of a link that occurs at the start of the next line // // the downside is that links which are spread over more than one line are not - // highlighted. + // highlighted. // // TODO - Use the "line wrapped" attribute associated with lines in a // terminal image to avoid adding this imaginary character for wrapped @@ -221,10 +221,10 @@ nextLine = _linePositions->value(i+1); } - // kDebug() << "pos - " << position << " line pos(" << i<< ") " << _linePositions->value(i) << + // kDebug() << "pos - " << position << " line pos(" << i<< ") " << _linePositions->value(i) << // " next = " << nextLine << " buffer len = " << _buffer->length(); - if ( _linePositions->value(i) <= position && position < nextLine ) + if ( _linePositions->value(i) <= position && position < nextLine ) { startLine = i; startColumn = position - _linePositions->value(i); @@ -232,7 +232,7 @@ } } } - + /*void Filter::addLine(const QString& text) { @@ -254,7 +254,7 @@ for (int line = spot->startLine() ; line <= spot->endLine() ; line++) { _hotspots.insert(line,spot); - } + } } QList<Filter::HotSpot*> Filter::hotSpots() const { @@ -272,12 +272,12 @@ while (spotIter.hasNext()) { HotSpot* spot = spotIter.next(); - + if ( spot->startLine() == line && spot->startColumn() > column ) continue; if ( spot->endLine() == line && spot->endColumn() < column ) continue; - + return spot; } @@ -348,7 +348,7 @@ return _capturedTexts; } -void RegExpFilter::setRegExp(const QRegExp& regExp) +void RegExpFilter::setRegExp(const QRegExp& regExp) { _searchText = regExp; } @@ -385,9 +385,9 @@ int startColumn = 0; int endColumn = 0; - + //kDebug() << "pos from " << pos << " to " << pos + _searchText.matchedLength(); - + getLineColumn(pos,startLine,startColumn); getLineColumn(pos + _searchText.matchedLength(),endLine,endColumn); @@ -398,13 +398,13 @@ endLine,endColumn); spot->setCapturedTexts(_searchText.capturedTexts()); - addHotSpot( spot ); + addHotSpot( spot ); pos += _searchText.matchedLength(); // if matchedLength == 0, the program will get stuck in an infinite loop Q_ASSERT( _searchText.matchedLength() > 0 ); } - } + } } RegExpFilter::HotSpot* RegExpFilter::newHotSpot(int startLine,int startColumn, @@ -432,16 +432,16 @@ const UrlType kind = urlType(); if ( kind == StandardUrl ) - return QString(); + return QString(); else if ( kind == Email ) - return QString(); + return QString(); else return QString(); } UrlFilter::HotSpot::UrlType UrlFilter::HotSpot::urlType() const { QString url = capturedTexts().first(); - + if ( FullUrlRegExp.exactMatch(url) ) return StandardUrl; else if ( EmailAddressRegExp.exactMatch(url) ) @@ -476,23 +476,23 @@ { url.prepend("http://"); } - } + } else if ( kind == Email ) { url.prepend("mailto:"); } - + // new KRun(url,QApplication::activeWindow()); } } -// Note: Altering these regular expressions can have a major effect on the performance of the filters +// Note: Altering these regular expressions can have a major effect on the performance of the filters // used for finding URLs in the text, especially if they are very general and could match very long // pieces of text. // Please be careful when altering them. //regexp matches: -// full url: +// full url: // protocolname:// or www. followed by anything other than whitespaces, <, >, ' or ", and ends before whitespaces, <, >, ', ", ], !, comma and dot const QRegExp UrlFilter::FullUrlRegExp("(www\\.(?!\\.)|[a-z][a-z0-9+.-]*://)[^\\s<>'\"]+[^!,\\.\\s<>'\"\\]]"); // email address: @@ -549,7 +549,7 @@ list << openAction; list << copyAction; - return list; + return list; } //#include "moc_Filter.cpp"
--- a/libgui/qterminal/libqterminal/unix/Filter.h +++ b/libgui/qterminal/libqterminal/unix/Filter.h @@ -43,7 +43,7 @@ * activate() method should be called. Depending on the type of hotspot this will trigger a suitable response. * * For example, if a hotspot represents a URL then a suitable action would be opening that URL in a web browser. - * Hotspots may have more than one action, in which case the list of actions can be obtained using the + * Hotspots may have more than one action, in which case the list of actions can be obtained using the * actions() method. * * Different subclasses of filter will return different types of hotspot. @@ -63,13 +63,13 @@ * activate() method should be called. Depending on the type of hotspot this will trigger a suitable response. * * For example, if a hotspot represents a URL then a suitable action would be opening that URL in a web browser. - * Hotspots may have more than one action, in which case the list of actions can be obtained using the - * actions() method. These actions may then be displayed in a popup menu or toolbar for example. + * Hotspots may have more than one action, in which case the list of actions can be obtained using the + * actions() method. These actions may then be displayed in a popup menu or toolbar for example. */ class HotSpot { public: - /** + /** * Constructs a new hotspot which covers the area from (@p startLine,@p startColumn) to (@p endLine,@p endColumn) * in a block of text. */ @@ -84,7 +84,7 @@ Link, // this hotspot represents a marker Marker - }; + }; /** Returns the line when the hotspot area starts */ int startLine() const; @@ -94,31 +94,31 @@ int startColumn() const; /** Returns the column on endLine() where the hotspot area ends */ int endColumn() const; - /** + /** * Returns the type of the hotspot. This is usually used as a hint for views on how to represent * the hotspot graphically. eg. Link hotspots are typically underlined when the user mouses over them */ Type type() const; - /** - * Causes the an action associated with a hotspot to be triggered. + /** + * Causes the an action associated with a hotspot to be triggered. * * @param object The object which caused the hotspot to be triggered. This is * typically null ( in which case the default action should be performed ) or * one of the objects from the actions() list. In which case the associated - * action should be performed. + * action should be performed. */ - virtual void activate(QObject* object = 0) = 0; - /** - * Returns a list of actions associated with the hotspot which can be used in a - * menu or toolbar + virtual void activate(QObject* object = 0) = 0; + /** + * Returns a list of actions associated with the hotspot which can be used in a + * menu or toolbar */ virtual QList<QAction*> actions(); - /** + /** * Returns the text of a tooltip to be shown when the mouse moves over the hotspot, or * an empty string if there is no tooltip associated with this hotspot. * - * The default implementation returns an empty string. + * The default implementation returns an empty string. */ virtual QString tooltip() const; @@ -132,7 +132,7 @@ int _endLine; int _endColumn; Type _type; - + }; /** Constructs a new filter. */ @@ -142,9 +142,9 @@ /** Causes the filter to process the block of text currently in its internal buffer */ virtual void process() = 0; - /** + /** * Empties the filters internal buffer and resets the line count back to 0. - * All hotspots are deleted. + * All hotspots are deleted. */ void reset(); @@ -160,7 +160,7 @@ /** Returns the list of hotspots identified by the filter which occur on a given line */ QList<HotSpot*> hotSpotsAtLine(int line) const; - /** + /** * TODO: Document me */ void setBuffer(const QString* buffer , const QList<int>* linePositions); @@ -176,22 +176,22 @@ private: QMultiHash<int,HotSpot*> _hotspots; QList<HotSpot*> _hotspotList; - + const QList<int>* _linePositions; const QString* _buffer; }; -/** - * A filter which searches for sections of text matching a regular expression and creates a new RegExpFilter::HotSpot +/** + * A filter which searches for sections of text matching a regular expression and creates a new RegExpFilter::HotSpot * instance for them. * * Subclasses can reimplement newHotSpot() to return custom hotspot types when matches for the regular expression - * are found. + * are found. */ class RegExpFilter : public Filter { public: - /** + /** * Type of hotspot created by RegExpFilter. The capturedTexts() method can be used to find the text * matched by the filter's regular expression. */ @@ -212,26 +212,26 @@ /** Constructs a new regular expression filter */ RegExpFilter(); - /** - * Sets the regular expression which the filter searches for in blocks of text. + /** + * Sets the regular expression which the filter searches for in blocks of text. * * Regular expressions which match the empty string are treated as not matching - * anything. + * anything. */ void setRegExp(const QRegExp& text); /** Returns the regular expression which the filter searches for in blocks of text */ QRegExp regExp() const; - /** - * Reimplemented to search the filter's text buffer for text matching regExp() + /** + * Reimplemented to search the filter's text buffer for text matching regExp() * * If regexp matches the empty string, then process() will return immediately - * without finding results. + * without finding results. */ virtual void process(); protected: - /** + /** * Called when a match for the regular expression is encountered. Subclasses should reimplement this * to return custom hotspot types */ @@ -245,14 +245,14 @@ class FilterObject; /** A filter which matches URLs in blocks of text */ -class UrlFilter : public RegExpFilter +class UrlFilter : public RegExpFilter { public: - /** - * Hotspot type created by UrlFilter instances. The activate() method opens a web browser + /** + * Hotspot type created by UrlFilter instances. The activate() method opens a web browser * at the given URL when called. */ - class HotSpot : public RegExpFilter::HotSpot + class HotSpot : public RegExpFilter::HotSpot { public: HotSpot(int startLine,int startColumn,int endLine,int endColumn); @@ -260,7 +260,7 @@ virtual QList<QAction*> actions(); - /** + /** * Open a web browser at the current URL. The url itself can be determined using * the capturedTexts() method. */ @@ -285,12 +285,12 @@ virtual RegExpFilter::HotSpot* newHotSpot(int,int,int,int); private: - + static const QRegExp FullUrlRegExp; static const QRegExp EmailAddressRegExp; // combined OR of FullUrlRegExp and EmailAddressRegExp - static const QRegExp CompleteUrlRegExp; + static const QRegExp CompleteUrlRegExp; }; class FilterObject : public QObject @@ -304,11 +304,11 @@ Filter::HotSpot* _filter; }; -/** - * A chain which allows a group of filters to be processed as one. +/** + * A chain which allows a group of filters to be processed as one. * The chain owns the filters added to it and deletes them when the chain itself is destroyed. * - * Use addFilter() to add a new filter to the chain. + * Use addFilter() to add a new filter to the chain. * When new text to be filtered arrives, use addLine() to add each additional * line of text which needs to be processed and then after adding the last line, use * process() to cause each filter in the chain to process the text. @@ -338,12 +338,12 @@ /** Resets each filter in the chain */ void reset(); /** - * Processes each filter in the chain + * Processes each filter in the chain */ void process(); /** Sets the buffer for each filter in the chain to process. */ - void setBuffer(const QString* buffer , const QList<int>* linePositions); + void setBuffer(const QString* buffer , const QList<int>* linePositions); /** Returns the first hotspot which occurs at @p line, @p column or 0 if no hotspot was found */ Filter::HotSpot* hotSpotAt(int line , int column) const; @@ -369,7 +369,7 @@ * @param columns The number of columns in the terminal image */ void setImage(const Character* const image , int lines , int columns, - const QVector<LineProperty>& lineProperties); + const QVector<LineProperty>& lineProperties); private: QString* _buffer;
--- a/libgui/qterminal/libqterminal/unix/History.cpp +++ b/libgui/qterminal/libqterminal/unix/History.cpp @@ -87,7 +87,7 @@ fileMap(0) { if (tmpFile.open()) - { + { tmpFile.setAutoRemove(true); ion = tmpFile.handle(); } @@ -111,7 +111,7 @@ //if mmap'ing fails, fall back to the read-lseek combination if ( fileMap == MAP_FAILED ) { - readWriteBalance = 0; + readWriteBalance = 0; fileMap = 0; qDebug() << ": mmap'ing history failed. errno = " << errno; } @@ -146,8 +146,8 @@ void HistoryFile::get(unsigned char* bytes, int len, int loc) { - //count number of get() calls vs. number of add() calls. - //If there are many more get() calls compared with add() + //count number of get() calls vs. number of add() calls. + //If there are many more get() calls compared with add() //calls (decided by using MAP_THRESHOLD) then mmap the log //file to improve performance. readWriteBalance--; @@ -196,7 +196,7 @@ // History Scroll File ////////////////////////////////////// -/* +/* The history scroll makes a Row(Row(Cell)) from two history buffers. The index buffer contains start of line positions which refere to the cells @@ -216,7 +216,7 @@ HistoryScrollFile::~HistoryScrollFile() { } - + int HistoryScrollFile::getLines() { return index.len() / sizeof(int); @@ -241,7 +241,7 @@ { if (lineno <= 0) return 0; if (lineno <= getLines()) - { + { if (!index.isMapped()) index.map(); @@ -340,7 +340,7 @@ bool HistoryScrollBuffer::isWrappedLine(int lineNumber) { Q_ASSERT( lineNumber >= 0 && lineNumber < _maxLineCount ); - + if (lineNumber < _usedLines) { //kDebug() << "Line" << lineNumber << "wrapped is" << _wrappedLine[bufferIndex(lineNumber)]; @@ -356,12 +356,12 @@ Q_ASSERT( lineNumber < _maxLineCount ); - if (lineNumber >= _usedLines) + if (lineNumber >= _usedLines) { memset(buffer, 0, count * sizeof(Character)); return; } - + const HistoryLine& line = _historyBuffer[bufferIndex(lineNumber)]; //kDebug() << "startCol " << startColumn; @@ -369,7 +369,7 @@ //kDebug() << "count " << count; Q_ASSERT( startColumn <= line.size() - count ); - + memcpy(buffer, line.constData() + startColumn , count * sizeof(Character)); } @@ -377,12 +377,12 @@ { HistoryLine* oldBuffer = _historyBuffer; HistoryLine* newBuffer = new HistoryLine[lineCount]; - + for ( int i = 0 ; i < qMin(_usedLines,(int)lineCount) ; i++ ) { newBuffer[i] = oldBuffer[bufferIndex(i)]; } - + _usedLines = qMin(_usedLines,(int)lineCount); _maxLineCount = lineCount; _head = ( _usedLines == _maxLineCount ) ? 0 : _usedLines-1; @@ -404,7 +404,7 @@ return (_head+lineNumber+1) % _maxLineCount; } else - { + { return lineNumber; } } @@ -502,7 +502,7 @@ void HistoryScrollBlockArray::addCells(const Character a[], int count) { Block *b = m_blockArray.lastBlock(); - + if (!b) return; // put cells in block's data @@ -660,7 +660,7 @@ HistoryScroll* HistoryTypeFile::scroll(HistoryScroll *old) const { - if (dynamic_cast<HistoryFile *>(old)) + if (dynamic_cast<HistoryFile *>(old)) return old; // Unchanged. HistoryScroll *newScroll = new HistoryScrollFile(m_fileName); @@ -687,7 +687,7 @@ } delete old; - return newScroll; + return newScroll; } int HistoryTypeFile::maximumLineCount() const
--- a/libgui/qterminal/libqterminal/unix/History.h +++ b/libgui/qterminal/libqterminal/unix/History.h @@ -58,7 +58,7 @@ //pointer to start of mmap'ed file data, or 0 if the file is not mmap'ed char* fileMap; - + //incremented whenver 'add' is called and decremented whenever //'get' is called. //this is used to detect when a large number of lines are being read and processed from the history @@ -167,7 +167,7 @@ void setMaxNbLines(unsigned int nbLines); unsigned int maxNbLines() { return _maxLineCount; } - + private: int bufferIndex(int lineNumber); @@ -175,9 +175,9 @@ HistoryLine* _historyBuffer; QBitArray _wrappedLine; int _maxLineCount; - int _usedLines; + int _usedLines; int _head; - + //QVector<histline*> m_histBuffer; //QBitArray m_wrappedLine; //unsigned int m_maxNbLines; @@ -255,7 +255,7 @@ /** * Returns true if the history is enabled ( can store lines of output ) - * or false otherwise. + * or false otherwise. */ virtual bool isEnabled() const = 0; /** @@ -286,7 +286,7 @@ { public: HistoryTypeBlockArray(size_t size); - + virtual bool isEnabled() const; virtual int maximumLineCount() const; @@ -317,7 +317,7 @@ { public: HistoryTypeBuffer(unsigned int nbLines); - + virtual bool isEnabled() const; virtual int maximumLineCount() const;
--- a/libgui/qterminal/libqterminal/unix/KeyboardTranslator.cpp +++ b/libgui/qterminal/libqterminal/unix/KeyboardTranslator.cpp @@ -40,7 +40,7 @@ // individual keys to be redefined from some preferences menu. //and this is default now translator - default.keytab from original Konsole -const char* KeyboardTranslatorManager::defaultTranslatorText = +const char* KeyboardTranslatorManager::defaultTranslatorText = #if defined (Q_OS_MAC) #include "ExtendedDefaultTranslatorMac.h" #else @@ -117,10 +117,10 @@ qDebug() << "Saving translator to" << path; QFile destination(path); - + if (!destination.open(QIODevice::WriteOnly | QIODevice::Text)) { - qWarning() << "Unable to save keyboard translation:" + qWarning() << "Unable to save keyboard translation:" << destination.errorString(); return false; @@ -144,8 +144,8 @@ { const QString& path = findTranslatorPath(name); - QFile source(path); - + QFile source(path); + if (name.isEmpty() || !source.open(QIODevice::ReadOnly | QIODevice::Text)) return 0; @@ -168,7 +168,7 @@ KeyboardTranslator* translator = new KeyboardTranslator(name); KeyboardTranslatorReader reader(source); translator->setDescription( reader.description() ); - + while ( reader.hasNextEntry() ) { translator->addEntry(reader.nextEntry()); } @@ -223,7 +223,7 @@ // KeySequence begins with the name of the key ( taken from the Qt::Key enum ) // and is followed by the keyboard modifiers and state flags ( with + or - in front // of each modifier or flag to indicate whether it is required ). All keyboard modifiers -// and flags are optional, if a particular modifier or state is not specified it is +// and flags are optional, if a particular modifier or state is not specified it is // assumed not to be a part of the sequence. The key sequence may contain whitespace // // eg: "key Up+Shift : scrollLineUp" @@ -250,7 +250,7 @@ readNext(); } -void KeyboardTranslatorReader::readNext() +void KeyboardTranslatorReader::readNext() { // find next entry while ( !_source->atEnd() ) @@ -270,7 +270,7 @@ modifiers, modifierMask, flags, - flagMask); + flagMask); KeyboardTranslator::Command command = KeyboardTranslator::NoCommand; QByteArray text; @@ -302,12 +302,12 @@ return; } - } + } _hasNext = false; } -bool KeyboardTranslatorReader::parseAsCommand(const QString& text,KeyboardTranslator::Command& command) +bool KeyboardTranslatorReader::parseAsCommand(const QString& text,KeyboardTranslator::Command& command) { if ( text.compare("erase",Qt::CaseInsensitive) == 0 ) command = KeyboardTranslator::EraseCommand; @@ -334,7 +334,7 @@ KeyboardTranslator::States& flags, KeyboardTranslator::States& flagMask) { - bool isWanted = true; + bool isWanted = true; bool endOfItem = false; QString buffer; @@ -383,13 +383,13 @@ buffer.clear(); } - // check if this is a wanted / not-wanted flag and update the + // check if this is a wanted / not-wanted flag and update the // state ready for the next item if ( ch == '+' ) isWanted = true; else if ( ch == '-' ) isWanted = false; - } + } modifiers = tempModifiers; modifierMask = tempModifierMask; @@ -464,7 +464,7 @@ { return _hasNext; } -KeyboardTranslator::Entry KeyboardTranslatorReader::createEntry( const QString& condition , +KeyboardTranslator::Entry KeyboardTranslatorReader::createEntry( const QString& condition , const QString& result ) { QString entryString("keyboard \"temporary\"\nkey "); @@ -494,7 +494,7 @@ return entry; } -KeyboardTranslator::Entry KeyboardTranslatorReader::nextEntry() +KeyboardTranslator::Entry KeyboardTranslatorReader::nextEntry() { Q_ASSERT( _hasNext ); @@ -546,14 +546,14 @@ { // capturedTexts()[2] is a command Token commandToken = { Token::Command , key.capturedTexts()[2] }; - list << commandToken; - } + list << commandToken; + } else { // capturedTexts()[3] is the output string Token outputToken = { Token::OutputText , key.capturedTexts()[3] }; list << outputToken; - } + } } else { @@ -563,7 +563,7 @@ return list; } -QList<QString> KeyboardTranslatorManager::allTranslators() +QList<QString> KeyboardTranslatorManager::allTranslators() { if ( !_haveLoadedAll ) { @@ -594,14 +594,14 @@ _text == rhs._text; } -bool KeyboardTranslator::Entry::matches(int keyCode , +bool KeyboardTranslator::Entry::matches(int keyCode , Qt::KeyboardModifiers modifiers, States state) const { if ( _keyCode != keyCode ) return false; - if ( (modifiers & _modifierMask) != (_modifiers & _modifierMask) ) + if ( (modifiers & _modifierMask) != (_modifiers & _modifierMask) ) return false; // if modifiers is non-zero, the 'any modifier' state is implicit @@ -611,7 +611,7 @@ if ( (state & _stateMask) != (_state & _stateMask) ) return false; - // special handling for the 'Any Modifier' state, which checks for the presence of + // special handling for the 'Any Modifier' state, which checks for the presence of // any or no modifiers. In this context, the 'keypad' modifier does not count. bool anyModifiersSet = modifiers != 0 && modifiers != Qt::KeypadModifier; if ( _stateMask & KeyboardTranslator::AnyModifierState ) @@ -653,7 +653,7 @@ if ( replacement == 'x' ) { - result.replace(i,1,"\\x"+QByteArray(1,ch).toInt(0, 16)); + result.replace(i,1,"\\x"+QByteArray(1,ch).toInt(0, 16)); } else if ( replacement != 0 ) { result.remove(i,1); @@ -714,7 +714,7 @@ result.replace(i,charsToRemove,replacement); } } - + return result; } @@ -787,7 +787,7 @@ insertModifier( result , Qt::ShiftModifier ); insertModifier( result , Qt::ControlModifier ); insertModifier( result , Qt::AltModifier ); - insertModifier( result , Qt::MetaModifier ); + insertModifier( result , Qt::MetaModifier ); // add states insertState( result , KeyboardTranslator::AlternateScreenState ); @@ -804,7 +804,7 @@ { } -void KeyboardTranslator::setDescription(const QString& description) +void KeyboardTranslator::setDescription(const QString& description) { _description = description; } @@ -846,7 +846,7 @@ if ( _entries.contains(keyCode) ) { QList<Entry> entriesForKey = _entries.values(keyCode); - + QListIterator<Entry> iter(entriesForKey); while (iter.hasNext()) @@ -862,7 +862,7 @@ { return Entry(); } - + } void KeyboardTranslatorManager::addTranslator(KeyboardTranslator* translator) { @@ -881,7 +881,7 @@ if ( QFile::remove(path) ) { _translators.remove(name); - return true; + return true; } else {
--- a/libgui/qterminal/libqterminal/unix/KeyboardTranslator.h +++ b/libgui/qterminal/libqterminal/unix/KeyboardTranslator.h @@ -110,7 +110,7 @@ class QIODevice; class QTextStream; -/** +/** * A convertor which maps between key sequences pressed by the user and the * character strings which should be sent to the terminal and commands * which should be invoked when those character sequences are pressed. @@ -126,7 +126,7 @@ class KeyboardTranslator { public: - /** + /** * The meaning of a particular key sequence may depend upon the state which * the terminal emulation is in. Therefore findEntry() may return a different * Entry depending upon the state flags supplied. @@ -142,7 +142,7 @@ * TODO More documentation */ NewLineState = 1, - /** + /** * Indicates that the terminal is in 'Ansi' mode. * TODO: More documentation */ @@ -153,10 +153,10 @@ CursorKeysState = 4, /** * Indicates that the alternate screen ( typically used by interactive programs - * such as screen or vim ) is active + * such as screen or vim ) is active */ AlternateScreenState = 8, - /** Indicates that any of the modifier keys is active. */ + /** Indicates that any of the modifier keys is active. */ AnyModifierState = 16 }; Q_DECLARE_FLAGS(States,State) @@ -193,14 +193,14 @@ class Entry { public: - /** + /** * Constructs a new entry for a keyboard translator. */ Entry(); - /** + /** * Returns true if this entry is null. - * This is true for newly constructed entries which have no properties set. + * This is true for newly constructed entries which have no properties set. */ bool isNull() const; @@ -209,15 +209,15 @@ /** Sets the command associated with this entry. */ void setCommand(Command command); - /** - * Returns the character sequence associated with this entry, optionally replacing + /** + * Returns the character sequence associated with this entry, optionally replacing * wildcard '*' characters with numbers to indicate the keyboard modifiers being pressed. * * TODO: The numbers used to replace '*' characters are taken from the Konsole/KDE 3 code. - * Document them. + * Document them. * * @param expandWildCards Specifies whether wild cards (occurrences of the '*' character) in - * the entry should be replaced with a number to indicate the modifier keys being pressed. + * the entry should be replaced with a number to indicate the modifier keys being pressed. * * @param modifiers The keyboard modifiers being pressed. */ @@ -227,7 +227,7 @@ /** Sets the character sequence associated with this entry */ void setText(const QByteArray& text); - /** + /** * Returns the character sequence associated with this entry, * with any non-printable characters replaced with escape sequences. * @@ -244,13 +244,13 @@ /** Sets the character code associated with this entry */ void setKeyCode(int keyCode); - /** - * Returns a bitwise-OR of the enabled keyboard modifiers associated with this entry. + /** + * Returns a bitwise-OR of the enabled keyboard modifiers associated with this entry. * If a modifier is set in modifierMask() but not in modifiers(), this means that the entry * only matches when that modifier is NOT pressed. * * If a modifier is not set in modifierMask() then the entry matches whether the modifier - * is pressed or not. + * is pressed or not. */ Qt::KeyboardModifiers modifiers() const; @@ -262,13 +262,13 @@ /** See modifierMask() and modifiers() */ void setModifierMask( Qt::KeyboardModifiers modifiers ); - /** - * Returns a bitwise-OR of the enabled state flags associated with this entry. - * If flag is set in stateMask() but not in state(), this means that the entry only + /** + * Returns a bitwise-OR of the enabled state flags associated with this entry. + * If flag is set in stateMask() but not in state(), this means that the entry only * matches when the terminal is NOT in that state. * * If a state is not set in stateMask() then the entry matches whether the terminal - * is in that state or not. + * is in that state or not. */ States state() const; @@ -280,13 +280,13 @@ /** See stateMask() */ void setStateMask( States mask ); - /** - * Returns the key code and modifiers associated with this entry + /** + * Returns the key code and modifiers associated with this entry * as a QKeySequence */ //QKeySequence keySequence() const; - /** + /** * Returns this entry's conditions ( ie. its key code, modifier and state criteria ) * as a string. */ @@ -302,16 +302,16 @@ QString resultToString(bool expandWildCards = false, Qt::KeyboardModifiers modifiers = Qt::NoModifier) const; - /** + /** * Returns true if this entry matches the given key sequence, specified * as a combination of @p keyCode , @p modifiers and @p state. */ - bool matches( int keyCode , - Qt::KeyboardModifiers modifiers , + bool matches( int keyCode , + Qt::KeyboardModifiers modifiers , States flags ) const; bool operator==(const Entry& rhs) const; - + private: void insertModifier( QString& item , int modifier ) const; void insertState( QString& item , int state ) const; @@ -329,7 +329,7 @@ /** Constructs a new keyboard translator with the given @p name */ KeyboardTranslator(const QString& name); - + //KeyboardTranslator(const KeyboardTranslator& other); /** Returns the name of this keyboard translator */ @@ -347,7 +347,7 @@ /** * Looks for an entry in this keyboard translator which matches the given * key code, keyboard modifiers and state flags. - * + * * Returns the matching entry if found or a null Entry otherwise ( ie. * entry.isNull() will return true ) * @@ -355,11 +355,11 @@ * @param modifiers A combination of modifiers * @param state Optional flags which specify the current state of the terminal */ - Entry findEntry(int keyCode , - Qt::KeyboardModifiers modifiers , + Entry findEntry(int keyCode , + Qt::KeyboardModifiers modifiers , States state = NoState) const; - /** + /** * Adds an entry to this keyboard translator's table. Entries can be looked up according * to their key sequence using findEntry() */ @@ -390,8 +390,8 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(KeyboardTranslator::States) Q_DECLARE_OPERATORS_FOR_FLAGS(KeyboardTranslator::Commands) -/** - * Parses the contents of a Keyboard Translator (.keytab) file and +/** + * Parses the contents of a Keyboard Translator (.keytab) file and * returns the entries found in it. * * Usage example: @@ -411,7 +411,7 @@ * if ( !reader.parseError() ) * { * // parsing succeeded, do something with the translator - * } + * } * else * { * // parsing failed @@ -424,18 +424,18 @@ /** Constructs a new reader which parses the given @p source */ KeyboardTranslatorReader( QIODevice* source ); - /** - * Returns the description text. - * TODO: More documentation + /** + * Returns the description text. + * TODO: More documentation */ QString description() const; /** Returns true if there is another entry in the source stream */ bool hasNextEntry(); /** Returns the next entry found in the source stream */ - KeyboardTranslator::Entry nextEntry(); + KeyboardTranslator::Entry nextEntry(); - /** + /** * Returns true if an error occurred whilst parsing the input or * false if no error occurred. */ @@ -445,7 +445,7 @@ * Parses a condition and result string for a translator entry * and produces a keyboard translator entry. * - * The condition and result strings are in the same format as in + * The condition and result strings are in the same format as in */ static KeyboardTranslator::Entry createEntry( const QString& condition , const QString& result ); @@ -466,7 +466,7 @@ }; QList<Token> tokenize(const QString&); void readNext(); - bool decodeSequence(const QString& , + bool decodeSequence(const QString& , int& keyCode, Qt::KeyboardModifiers& modifiers, Qt::KeyboardModifiers& modifierMask, @@ -488,23 +488,23 @@ class KeyboardTranslatorWriter { public: - /** + /** * Constructs a new writer which saves data into @p destination. * The caller is responsible for closing the device when writing is complete. */ KeyboardTranslatorWriter(QIODevice* destination); ~KeyboardTranslatorWriter(); - /** - * Writes the header for the keyboard translator. - * @param description Description of the keyboard translator. + /** + * Writes the header for the keyboard translator. + * @param description Description of the keyboard translator. */ void writeHeader( const QString& description ); /** Writes a translator entry. */ - void writeEntry( const KeyboardTranslator::Entry& entry ); + void writeEntry( const KeyboardTranslator::Entry& entry ); private: - QIODevice* _destination; + QIODevice* _destination; QTextStream* _writer; }; @@ -515,7 +515,7 @@ class KeyboardTranslatorManager { public: - /** + /** * Constructs a new KeyboardTranslatorManager and loads the list of * available keyboard translations. * @@ -526,7 +526,7 @@ ~KeyboardTranslatorManager(); /** - * Adds a new translator. If a translator with the same name + * Adds a new translator. If a translator with the same name * already exists, it will be replaced by the new translator. * * TODO: More documentation. @@ -543,18 +543,18 @@ /** Returns the default translator for Konsole. */ const KeyboardTranslator* defaultTranslator(); - /** + /** * Returns the keyboard translator with the given name or 0 if no translator * with that name exists. * * The first time that a translator with a particular name is requested, - * the on-disk .keyboard file is loaded and parsed. + * the on-disk .keyboard file is loaded and parsed. */ const KeyboardTranslator* findTranslator(const QString& name); /** * Returns a list of the names of available keyboard translators. * - * The first time this is called, a search for available + * The first time this is called, a search for available * translators is started. */ QList<QString> allTranslators(); @@ -564,15 +564,15 @@ private: static const char* defaultTranslatorText; - + void findTranslators(); // locate the available translators - KeyboardTranslator* loadTranslator(const QString& name); // loads the translator + KeyboardTranslator* loadTranslator(const QString& name); // loads the translator // with the given name KeyboardTranslator* loadTranslator(QIODevice* device,const QString& name); bool saveTranslator(const KeyboardTranslator* translator); QString findTranslatorPath(const QString& name); - + QHash<QString,KeyboardTranslator*> _translators; // maps translator-name -> KeyboardTranslator // instance bool _haveLoadedAll; @@ -581,15 +581,15 @@ inline int KeyboardTranslator::Entry::keyCode() const { return _keyCode; } inline void KeyboardTranslator::Entry::setKeyCode(int keyCode) { _keyCode = keyCode; } -inline void KeyboardTranslator::Entry::setModifiers( Qt::KeyboardModifiers modifier ) -{ +inline void KeyboardTranslator::Entry::setModifiers( Qt::KeyboardModifiers modifier ) +{ _modifiers = modifier; } inline Qt::KeyboardModifiers KeyboardTranslator::Entry::modifiers() const { return _modifiers; } -inline void KeyboardTranslator::Entry::setModifierMask( Qt::KeyboardModifiers mask ) -{ - _modifierMask = mask; +inline void KeyboardTranslator::Entry::setModifierMask( Qt::KeyboardModifiers mask ) +{ + _modifierMask = mask; } inline Qt::KeyboardModifiers KeyboardTranslator::Entry::modifierMask() const { return _modifierMask; } @@ -599,23 +599,23 @@ } inline void KeyboardTranslator::Entry::setCommand( Command command ) -{ - _command = command; +{ + _command = command; } inline KeyboardTranslator::Command KeyboardTranslator::Entry::command() const { return _command; } inline void KeyboardTranslator::Entry::setText( const QByteArray& text ) -{ +{ _text = unescape(text); } inline int oneOrZero(int value) { return value ? 1 : 0; } -inline QByteArray KeyboardTranslator::Entry::text(bool expandWildCards,Qt::KeyboardModifiers modifiers) const +inline QByteArray KeyboardTranslator::Entry::text(bool expandWildCards,Qt::KeyboardModifiers modifiers) const { QByteArray expandedText = _text; - + if (expandWildCards) { int modifierValue = 1; @@ -623,25 +623,25 @@ modifierValue += oneOrZero(modifiers & Qt::AltModifier) << 1; modifierValue += oneOrZero(modifiers & Qt::ControlModifier) << 2; - for (int i=0;i<_text.length();i++) + for (int i=0;i<_text.length();i++) { if (expandedText[i] == '*') expandedText[i] = '0' + modifierValue; } } - return expandedText; + return expandedText; } inline void KeyboardTranslator::Entry::setState( States state ) -{ - _state = state; +{ + _state = state; } inline KeyboardTranslator::States KeyboardTranslator::Entry::state() const { return _state; } inline void KeyboardTranslator::Entry::setStateMask( States stateMask ) -{ - _stateMask = stateMask; +{ + _stateMask = stateMask; } inline KeyboardTranslator::States KeyboardTranslator::Entry::stateMask() const { return _stateMask; }
--- a/libgui/qterminal/libqterminal/unix/LineFont.h +++ b/libgui/qterminal/libqterminal/unix/LineFont.h @@ -2,20 +2,20 @@ // You probably do not want to hand-edit this! static const quint32 LineChars[] = { - 0x00007c00, 0x000fffe0, 0x00421084, 0x00e739ce, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00427000, 0x004e7380, 0x00e77800, 0x00ef7bc0, - 0x00421c00, 0x00439ce0, 0x00e73c00, 0x00e7bde0, 0x00007084, 0x000e7384, 0x000079ce, 0x000f7bce, - 0x00001c84, 0x00039ce4, 0x00003dce, 0x0007bdee, 0x00427084, 0x004e7384, 0x004279ce, 0x00e77884, - 0x00e779ce, 0x004f7bce, 0x00ef7bc4, 0x00ef7bce, 0x00421c84, 0x00439ce4, 0x00423dce, 0x00e73c84, - 0x00e73dce, 0x0047bdee, 0x00e7bde4, 0x00e7bdee, 0x00427c00, 0x0043fce0, 0x004e7f80, 0x004fffe0, - 0x004fffe0, 0x00e7fde0, 0x006f7fc0, 0x00efffe0, 0x00007c84, 0x0003fce4, 0x000e7f84, 0x000fffe4, - 0x00007dce, 0x0007fdee, 0x000f7fce, 0x000fffee, 0x00427c84, 0x0043fce4, 0x004e7f84, 0x004fffe4, - 0x00427dce, 0x00e77c84, 0x00e77dce, 0x0047fdee, 0x004e7fce, 0x00e7fde4, 0x00ef7f84, 0x004fffee, - 0x00efffe4, 0x00e7fdee, 0x00ef7fce, 0x00efffee, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x000f83e0, 0x00a5294a, 0x004e1380, 0x00a57800, 0x00ad0bc0, 0x004390e0, 0x00a53c00, 0x00a5a1e0, - 0x000e1384, 0x0000794a, 0x000f0b4a, 0x000390e4, 0x00003d4a, 0x0007a16a, 0x004e1384, 0x00a5694a, - 0x00ad2b4a, 0x004390e4, 0x00a52d4a, 0x00a5a16a, 0x004f83e0, 0x00a57c00, 0x00ad83e0, 0x000f83e4, - 0x00007d4a, 0x000f836a, 0x004f93e4, 0x00a57d4a, 0x00ad836a, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001c00, 0x00001084, 0x00007000, 0x00421000, + 0x00007c00, 0x000fffe0, 0x00421084, 0x00e739ce, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00427000, 0x004e7380, 0x00e77800, 0x00ef7bc0, + 0x00421c00, 0x00439ce0, 0x00e73c00, 0x00e7bde0, 0x00007084, 0x000e7384, 0x000079ce, 0x000f7bce, + 0x00001c84, 0x00039ce4, 0x00003dce, 0x0007bdee, 0x00427084, 0x004e7384, 0x004279ce, 0x00e77884, + 0x00e779ce, 0x004f7bce, 0x00ef7bc4, 0x00ef7bce, 0x00421c84, 0x00439ce4, 0x00423dce, 0x00e73c84, + 0x00e73dce, 0x0047bdee, 0x00e7bde4, 0x00e7bdee, 0x00427c00, 0x0043fce0, 0x004e7f80, 0x004fffe0, + 0x004fffe0, 0x00e7fde0, 0x006f7fc0, 0x00efffe0, 0x00007c84, 0x0003fce4, 0x000e7f84, 0x000fffe4, + 0x00007dce, 0x0007fdee, 0x000f7fce, 0x000fffee, 0x00427c84, 0x0043fce4, 0x004e7f84, 0x004fffe4, + 0x00427dce, 0x00e77c84, 0x00e77dce, 0x0047fdee, 0x004e7fce, 0x00e7fde4, 0x00ef7f84, 0x004fffee, + 0x00efffe4, 0x00e7fdee, 0x00ef7fce, 0x00efffee, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x000f83e0, 0x00a5294a, 0x004e1380, 0x00a57800, 0x00ad0bc0, 0x004390e0, 0x00a53c00, 0x00a5a1e0, + 0x000e1384, 0x0000794a, 0x000f0b4a, 0x000390e4, 0x00003d4a, 0x0007a16a, 0x004e1384, 0x00a5694a, + 0x00ad2b4a, 0x004390e4, 0x00a52d4a, 0x00a5a16a, 0x004f83e0, 0x00a57c00, 0x00ad83e0, 0x000f83e4, + 0x00007d4a, 0x000f836a, 0x004f93e4, 0x00a57d4a, 0x00ad836a, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001c00, 0x00001084, 0x00007000, 0x00421000, 0x00039ce0, 0x000039ce, 0x000e7380, 0x00e73800, 0x000e7f80, 0x00e73884, 0x0003fce0, 0x004239ce };
--- a/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp +++ b/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp @@ -151,8 +151,8 @@ // FIXME -- not sure how to make these work properly given the way the // Unix terminal handles colors. -void QUnixTerminalImpl::setBackgroundColor (const QColor& color) - { +void QUnixTerminalImpl::setBackgroundColor (const QColor& color) + { ColorEntry cols[TABLE_COLORS]; const ColorEntry * curr_cols = m_terminalView->colorTable();
--- a/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.h +++ b/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.h @@ -5,18 +5,18 @@ modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. - + You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - + #ifndef Q_UNIXTERMINALIMPL #define Q_UNIXTERMINALIMPL @@ -37,7 +37,7 @@ QUnixTerminalImpl(QWidget *parent = 0); virtual ~QUnixTerminalImpl(); - void setTerminalFont(const QFont &font); + void setTerminalFont(const QFont &font); void setSize(int h, int v); void sendText(const QString& text); @@ -57,7 +57,7 @@ protected: void showEvent(QShowEvent *); - virtual void resizeEvent(QResizeEvent *); + virtual void resizeEvent(QResizeEvent *); private: void initialize();
--- a/libgui/qterminal/libqterminal/unix/Screen.cpp +++ b/libgui/qterminal/libqterminal/unix/Screen.cpp @@ -45,10 +45,10 @@ //Macro to convert x,y position on screen to position within an image. // -//Originally the image was stored as one large contiguous block of +//Originally the image was stored as one large contiguous block of //memory, so a position within the image could be represented as an //offset from the beginning of the block. For efficiency reasons this -//is no longer the case. +//is no longer the case. //Many internal parts of this class still use this representation for parameters and so on, //notably moveImage() and clearImage(). //This macro converts from an X,Y position into an image offset. @@ -249,14 +249,14 @@ Q_ASSERT( n >= 0 ); // always delete at least one char - if (n == 0) - n = 1; + if (n == 0) + n = 1; // if cursor is beyond the end of the line there is nothing to do if ( cuX >= screenLines[cuY].count() ) return; - if ( cuX+n >= screenLines[cuY].count() ) + if ( cuX+n >= screenLines[cuY].count() ) n = screenLines[cuY].count() - 1 - cuX; Q_ASSERT( n >= 0 ); @@ -391,20 +391,20 @@ } // create new screen lines and copy from old to new - + ImageLine* newScreenLines = new ImageLine[new_lines+1]; for (int i=0; i < qMin(lines-1,new_lines+1) ;i++) newScreenLines[i]=screenLines[i]; for (int i=lines;(i > 0) && (i<new_lines+1);i++) newScreenLines[i].resize( new_columns ); - + lineProperties.resize(new_lines+1); for (int i=lines;(i > 0) && (i<new_lines+1);i++) lineProperties[i] = LINE_DEFAULT; clearSelection(); - - delete[] screenLines; + + delete[] screenLines; screenLines = newScreenLines; lines = new_lines; @@ -461,11 +461,11 @@ */ void Screen::reverseRendition(Character& p) const -{ - CharacterColor f = p.foregroundColor; +{ + CharacterColor f = p.foregroundColor; CharacterColor b = p.backgroundColor; - p.foregroundColor = b; + p.foregroundColor = b; p.backgroundColor = f; //p->r &= ~RE_TRANSPARENT; } @@ -476,14 +476,14 @@ //into the image[] array which holds the characters and their appearance properties. //- The old version below filtered out all attributes other than underline and blink at this stage, //so that they would not be copied into the image[] array and hence would not be visible by TerminalDisplay - //which actually paints the screen using the information from the image[] array. + //which actually paints the screen using the information from the image[] array. //I don't know why it did this, but I'm fairly sure it was the wrong thing to do. The net result //was that bold text wasn't printed in bold by Konsole. ef_re = cu_re; - + //OLD VERSION: //ef_re = cu_re & (RE_UNDERLINE | RE_BLINK); - + if (cu_re & RE_REVERSE) { ef_fg = cu_bg; @@ -494,7 +494,7 @@ ef_fg = cu_fg; ef_bg = cu_bg; } - + if (cu_re & RE_BOLD) ef_fg.toggleIntensive(); } @@ -513,24 +513,24 @@ { Q_ASSERT( startLine >= 0 && count > 0 && startLine + count <= hist->getLines() ); - for (int line = startLine; line < startLine + count; line++) + for (int line = startLine; line < startLine + count; line++) { const int length = qMin(columns,hist->getLineLen(line)); const int destLineOffset = (line-startLine)*columns; hist->getCells(line,0,length,dest + destLineOffset); - for (int column = length; column < columns; column++) + for (int column = length; column < columns; column++) dest[destLineOffset+column] = defaultChar; - + // invert selected text if (sel_begin !=-1) { for (int column = 0; column < columns; column++) { - if (isSelected(column,line)) + if (isSelected(column,line)) { - reverseRendition(dest[destLineOffset + column]); + reverseRendition(dest[destLineOffset + column]); } } } @@ -547,15 +547,15 @@ int destLineStartIndex = (line-startLine)*columns; for (int column = 0; column < columns; column++) - { - int srcIndex = srcLineStartIndex + column; + { + int srcIndex = srcLineStartIndex + column; int destIndex = destLineStartIndex + column; dest[destIndex] = screenLines[srcIndex/columns].value(srcIndex%columns,defaultChar); // invert selected text if (sel_begin != -1 && isSelected(column,line + hist->getLines())) - reverseRendition(dest[destIndex]); + reverseRendition(dest[destIndex]); } } @@ -563,12 +563,12 @@ void Screen::getImage( Character* dest, int size, int startLine, int endLine ) const { - Q_ASSERT( startLine >= 0 ); + Q_ASSERT( startLine >= 0 ); Q_ASSERT( endLine >= startLine && endLine < hist->getLines() + lines ); const int mergedLines = endLine - startLine + 1; - Q_ASSERT( size >= mergedLines * columns ); + Q_ASSERT( size >= mergedLines * columns ); Q_UNUSED( size ); const int linesInHistoryBuffer = qBound(0,hist->getLines()-startLine,mergedLines); @@ -576,7 +576,7 @@ // copy lines from history buffer if (linesInHistoryBuffer > 0) { - copyFromHistory(dest,startLine,linesInHistoryBuffer); + copyFromHistory(dest,startLine,linesInHistoryBuffer); } // copy lines from screen buffer @@ -585,10 +585,10 @@ startLine + linesInHistoryBuffer - hist->getLines(), linesInScreenBuffer); } - + // invert display when in screen mode if (getMode(MODE_Screen)) - { + { for (int i = 0; i < mergedLines*columns; i++) reverseRendition(dest[i]); // for reverse display } @@ -601,7 +601,7 @@ QVector<LineProperty> Screen::getLineProperties( int startLine , int endLine ) const { - Q_ASSERT( startLine >= 0 ); + Q_ASSERT( startLine >= 0 ); Q_ASSERT( endLine >= startLine && endLine < hist->getLines() + lines ); const int mergedLines = endLine-startLine+1; @@ -612,7 +612,7 @@ int index = 0; // copy properties for lines in history - for (int line = startLine; line < startLine + linesInHistory; line++) + for (int line = startLine; line < startLine + linesInHistory; line++) { //TODO Support for line properties other than wrapped lines if (hist->isWrappedLine(line)) @@ -621,7 +621,7 @@ } index++; } - + // copy properties for lines in screen buffer const int firstScreenLine = startLine + linesInHistory - hist->getLines(); for (int line = firstScreenLine; line < firstScreenLine+linesInScreen; line++) @@ -803,10 +803,10 @@ while(w) { i++; - + if ( screenLines[cuY].size() < cuX + i + 1 ) screenLines[cuY].resize(cuX+i+1); - + Character& ch = screenLines[cuY][cuX + i]; ch.character = 0; ch.foregroundColor = ef_fg; @@ -824,7 +824,7 @@ /* if (lastPos == -1) return; - + QChar c(image[lastPos].character); compose.prepend(c); //compose.compose(); ### FIXME! @@ -896,7 +896,7 @@ { //kDebug() << "Screen::scrollDown( from: " << from << " , n: " << n << ")"; - + _scrolledLines += n; //FIXME: make sure `tmargin', `bmargin', `from', `n' is in bounds. @@ -966,7 +966,7 @@ */ void Screen::clearImage(int loca, int loce, char c) -{ +{ int scr_TL=loc(0,hist->getLines()); //FIXME: check positions @@ -980,7 +980,7 @@ int bottomLine = loce/columns; Character clearCh(c,cu_fg,cu_bg,DEFAULT_RENDITION); - + //if the character being used to clear the area is the same as the //default character, the affected lines can simply be shrunk. bool isDefaultCh = (clearCh == Character()); @@ -1011,7 +1011,7 @@ } /*! move image between (including) `sourceBegin' and `sourceEnd' to 'dest'. - + The 'dest', 'sourceBegin' and 'sourceEnd' parameters can be generated using the loc(column,line) macro. @@ -1024,17 +1024,17 @@ void Screen::moveImage(int dest, int sourceBegin, int sourceEnd) { - //kDebug() << "moving image from (" << (sourceBegin/columns) + //kDebug() << "moving image from (" << (sourceBegin/columns) // << "," << (sourceEnd/columns) << ") to " << // (dest/columns); Q_ASSERT( sourceBegin <= sourceEnd ); - + int lines=(sourceEnd-sourceBegin)/columns; //move screen image and line properties: - //the source and destination areas of the image may overlap, - //so it matters that we do the copy in the right order - + //the source and destination areas of the image may overlap, + //so it matters that we do the copy in the right order - //forwards if dest < sourceBegin or backwards otherwise. //(search the web for 'memmove implementation' for details) if (dest < sourceBegin) @@ -1061,7 +1061,7 @@ if ((lastPos < 0) || (lastPos >= (lines*columns))) lastPos = -1; } - + // Adjust selection to follow scroll. if (sel_begin != -1) { @@ -1169,9 +1169,9 @@ { cu_fg = CharacterColor(space, color); - if ( cu_fg.isValid() ) + if ( cu_fg.isValid() ) effectiveRendition(); - else + else setForeColor(COLOR_SPACE_DEFAULT,DEFAULT_FORE_COLOR); } @@ -1179,7 +1179,7 @@ { cu_bg = CharacterColor(space, color); - if ( cu_bg.isValid() ) + if ( cu_bg.isValid() ) effectiveRendition(); else setBackColor(COLOR_SPACE_DEFAULT,DEFAULT_BACK_COLOR); @@ -1203,7 +1203,7 @@ if ( sel_TL != -1 ) { column = sel_TL % columns; - line = sel_TL / columns; + line = sel_TL / columns; } else { @@ -1222,7 +1222,7 @@ { column = cuX + getHistLines(); line = cuY + getHistLines(); - } + } } void Screen::setSelectionStart(/*const ScreenCursor& viewCursor ,*/ const int x, const int y, const bool mode) { @@ -1282,12 +1282,12 @@ { QString result; QTextStream stream(&result, QIODevice::ReadWrite); - + PlainTextDecoder decoder; decoder.begin(&stream); writeSelectionToStream(&decoder , preserveLineBreaks); decoder.end(); - + return result; } @@ -1296,7 +1296,7 @@ return ( sel_TL >= 0 && sel_BR >= 0 ); } -void Screen::writeSelectionToStream(TerminalCharacterDecoder* decoder , +void Screen::writeSelectionToStream(TerminalCharacterDecoder* decoder , bool preserveLineBreaks) { // do nothing if selection is invalid @@ -1326,22 +1326,22 @@ copyLineToStream( y, start, count, - decoder, + decoder, appendNewLine, preserveLineBreaks ); } } -void Screen::copyLineToStream(int line , - int start, +void Screen::copyLineToStream(int line , + int start, int count, TerminalCharacterDecoder* decoder, bool appendNewLine, bool preserveLineBreaks) { //buffer to hold characters for decoding - //the buffer is static to avoid initialising every + //the buffer is static to avoid initialising every //element on each call to copyLineToStream //(which is unnecessary since all elements will be overwritten anyway) static const int MAX_CHARS = 1024; @@ -1371,7 +1371,7 @@ // safety checks assert( start >= 0 ); - assert( count >= 0 ); + assert( count >= 0 ); assert( (start+count) <= hist->getLineLen(line) ); hist->getCells(line,start,count,characterBuffer); @@ -1401,7 +1401,7 @@ count = qBound(0,count,length-start); Q_ASSERT( screenLine < lineProperties.count() ); - currentLineProperties |= lineProperties[screenLine]; + currentLineProperties |= lineProperties[screenLine]; } //do not decode trailing whitespace characters @@ -1422,7 +1422,7 @@ } //decode line and write to text stream - decoder->decodeLine( (Character*) characterBuffer , + decoder->decodeLine( (Character*) characterBuffer , count, currentLineProperties ); } @@ -1435,9 +1435,9 @@ sel_BR = sel_begin; sel_TL = sel_begin; setSelectionEnd(columns-1,lines-1+hist->getLines()-histCursor); - + writeSelectionToStream(stream,decoder); - + clearSelection(); }*/
--- a/libgui/qterminal/libqterminal/unix/Screen.h +++ b/libgui/qterminal/libqterminal/unix/Screen.h @@ -56,21 +56,21 @@ characters from the program currently running in the terminal. From this stream it creates an image of characters which is ultimately rendered by the display widget ( TerminalDisplay ). Some types of emulation - may have more than one screen image. + may have more than one screen image. getImage() is used to retrieve the currently visible image which is then used by the display widget to draw the output from the - terminal. + terminal. The number of lines of output history which are kept in addition to the current - screen image depends on the history scroll being used to store the output. + screen image depends on the history scroll being used to store the output. The scroll is specified using setScroll() The output history can be retrieved using writeToStream() - The screen image has a selection associated with it, specified using + The screen image has a selection associated with it, specified using setSelectionStart() and setSelectionEnd(). The selected text can be retrieved using selectedText(). When getImage() is used to retrieve the the visible image, - characters which are part of the selection have their colours inverted. + characters which are part of the selection have their colours inverted. */ class Screen { @@ -79,9 +79,9 @@ Screen(int lines, int columns); ~Screen(); - // VT100/2 Operations + // VT100/2 Operations // Cursor Movement - + /** Move the cursor up by @p n lines. */ void cursorUp (int n); /** Move the cursor down by @p n lines. */ @@ -99,28 +99,28 @@ /** * Sets the margins for scrolling the screen. * - * @param topLine The top line of the new scrolling margin. - * @param bottomLine The bottom line of the new scrolling margin. + * @param topLine The top line of the new scrolling margin. + * @param bottomLine The bottom line of the new scrolling margin. */ void setMargins (int topLine , int bottomLine); - /** Returns the top line of the scrolling region. */ + /** Returns the top line of the scrolling region. */ int topMargin() const; /** Returns the bottom line of the scrolling region. */ int bottomMargin() const; - /** + /** * Resets the scrolling margins back to the top and bottom lines * of the screen. */ void setDefaultMargins(); - - /** - * Moves the cursor down one line, if the MODE_NewLine mode + + /** + * Moves the cursor down one line, if the MODE_NewLine mode * flag is enabled then the cursor is returned to the leftmost * column first. * * Equivalent to NextLine() if the MODE_NewLine flag is set - * or index() otherwise. + * or index() otherwise. */ void NewLine (); /** @@ -129,7 +129,7 @@ */ void NextLine (); - /** + /** * Move the cursor down one line. If the cursor is on the bottom * line of the scrolling region (as returned by bottomMargin()) the * scrolling region is scrolled up by one line instead. @@ -141,12 +141,12 @@ * region is scrolled down by one line instead. */ void reverseIndex(); - - /** - * Scroll the scrolling region of the screen up by @p n lines. - * The scrolling region is initially the whole screen, but can be changed + + /** + * Scroll the scrolling region of the screen up by @p n lines. + * The scrolling region is initially the whole screen, but can be changed * using setMargins() - */ + */ void scrollUp(int n); /** * Scroll the scrolling region of the screen down by @p n lines. @@ -154,47 +154,47 @@ * using setMargins() */ void scrollDown(int n); - - /** - * Moves the cursor to the beginning of the current line. + + /** + * Moves the cursor to the beginning of the current line. * Equivalent to setCursorX(0) */ void Return (); - /** + /** * Moves the cursor one column to the left and erases the character * at the new cursor position. */ void BackSpace (); - /** + /** * Moves the cursor @p n tab-stops to the right. */ void Tabulate (int n = 1); - /** - * Moves the cursor @p n tab-stops to the left. + /** + * Moves the cursor @p n tab-stops to the left. */ void backTabulate(int n); - + // Editing - - /** - * Erase @p n characters beginning from the current cursor position. + + /** + * Erase @p n characters beginning from the current cursor position. * This is equivalent to over-writing @p n characters starting with the current * cursor position with spaces. - * If @p n is 0 then one character is erased. + * If @p n is 0 then one character is erased. */ void eraseChars (int n); - /** - * Delete @p n characters beginning from the current cursor position. - * If @p n is 0 then one character is deleted. + /** + * Delete @p n characters beginning from the current cursor position. + * If @p n is 0 then one character is deleted. */ void deleteChars (int n); /** * Insert @p n blank characters beginning from the current cursor position. - * The position of the cursor is not altered. + * The position of the cursor is not altered. * If @p n is 0 then one character is inserted. */ void insertChars (int n); - /** + /** * Removes @p n lines beginning from the current cursor position. * The position of the cursor is not altered. * If @p n is 0 then one line is removed. @@ -208,14 +208,14 @@ void insertLines (int n); /** Clears all the tab stops. */ void clearTabStops(); - /** Sets or removes a tab stop at the cursor's current column. */ + /** Sets or removes a tab stop at the cursor's current column. */ void changeTabStop(bool set); - + /** Resets (clears) the specified screen @p mode. */ void resetMode (int mode); /** Sets (enables) the specified screen @p mode. */ void setMode (int mode); - /** + /** * Saves the state of the specified screen @p mode. It can be restored * using restoreMode() */ @@ -224,19 +224,19 @@ void restoreMode (int mode); /** Returns whether the specified screen @p mode is enabled or not .*/ bool getMode (int mode) const; - - /** - * Saves the current position and appearence (text color and style) of the cursor. - * It can be restored by calling restoreCursor() - */ + + /** + * Saves the current position and appearence (text color and style) of the cursor. + * It can be restored by calling restoreCursor() + */ void saveCursor (); /** Restores the position and appearence of the cursor. See saveCursor() */ void restoreCursor(); - - /** Clear the whole screen, moving the current screen contents into the history first. */ + + /** Clear the whole screen, moving the current screen contents into the history first. */ void clearEntireScreen(); - /** - * Clear the area of the screen from the current cursor position to the end of + /** + * Clear the area of the screen from the current cursor position to the end of * the screen. */ void clearToEndOfScreen(); @@ -251,16 +251,16 @@ void clearToEndOfLine(); /** Clears from the current cursor position to the beginning of the line. */ void clearToBeginOfLine(); - + /** Fills the entire screen with the letter 'E' */ void helpAlign (); - - /** - * Enables the given @p rendition flag. Rendition flags control the appearence + + /** + * Enables the given @p rendition flag. Rendition flags control the appearence * of characters on the screen. * * @see Character::rendition - */ + */ void setRendition (int rendition); /** * Disables the given @p rendition flag. Rendition flags control the appearence @@ -269,8 +269,8 @@ * @see Character::rendition */ void resetRendition(int rendition); - - /** + + /** * Sets the cursor's foreground color. * @param space The color space used by the @p color argument * @param color The new foreground color. The meaning of this depends on @@ -288,22 +288,22 @@ * @see CharacterColor */ void setBackColor (int space, int color); - /** - * Resets the cursor's color back to the default and sets the + /** + * Resets the cursor's color back to the default and sets the * character's rendition flags back to the default settings. */ void setDefaultRendition(); - + /** Returns the column which the cursor is positioned at. */ int getCursorX() const; /** Returns the line which the cursor is positioned on. */ int getCursorY() const; - - /** TODO Document me */ + + /** TODO Document me */ void clear(); - /** + /** * Sets the position of the cursor to the 'home' position at the top-left - * corner of the screen (0,0) + * corner of the screen (0,0) */ void home(); /** @@ -320,29 +320,29 @@ * <li>New line mode is disabled. TODO Document me</li> * </ul> * - * If @p clearScreen is true then the screen contents are erased entirely, + * If @p clearScreen is true then the screen contents are erased entirely, * otherwise they are unaltered. */ void reset(bool clearScreen = true); - - /** - * Displays a new character at the current cursor position. - * + + /** + * Displays a new character at the current cursor position. + * * If the cursor is currently positioned at the right-edge of the screen and - * line wrapping is enabled then the character is added at the start of a new + * line wrapping is enabled then the character is added at the start of a new * line below the current one. * - * If the MODE_Insert screen mode is currently enabled then the character - * is inserted at the current cursor position, otherwise it will replace the - * character already at the current cursor position. - */ + * If the MODE_Insert screen mode is currently enabled then the character + * is inserted at the current cursor position, otherwise it will replace the + * character already at the current cursor position. + */ void ShowCharacter(unsigned short c); - + // Do composition with last shown character FIXME: Not implemented yet for KDE 4 void compose(const QString& compose); - - /** - * Resizes the image to a new fixed size of @p new_lines by @p new_columns. + + /** + * Resizes the image to a new fixed size of @p new_lines by @p new_columns. * In the case that @p new_columns is smaller than the current number of columns, * existing lines are not truncated. This prevents characters from being lost * if the terminal display is resized smaller and then larger again. @@ -351,9 +351,9 @@ * truncated when making the screen image smaller) */ void resizeImage(int new_lines, int new_columns); - + /** - * Returns the current screen image. + * Returns the current screen image. * The result is an array of Characters of size [getLines()][getColumns()] which * must be freed by the caller after use. * @@ -364,9 +364,9 @@ */ void getImage( Character* dest , int size , int startLine , int endLine ) const; - /** + /** * Returns the additional attributes associated with lines in the image. - * The most important attribute is LINE_WRAPPED which specifies that the + * The most important attribute is LINE_WRAPPED which specifies that the * line is wrapped, * other attributes control the size of characters in the line. */ @@ -379,21 +379,21 @@ int getColumns() { return columns; } /** Return the number of lines in the history buffer. */ int getHistLines (); - /** - * Sets the type of storage used to keep lines in the history. - * If @p copyPreviousScroll is true then the contents of the previous + /** + * Sets the type of storage used to keep lines in the history. + * If @p copyPreviousScroll is true then the contents of the previous * history buffer are copied into the new scroll. */ void setScroll(const HistoryType& , bool copyPreviousScroll = true); /** Returns the type of storage used to keep lines in the history. */ const HistoryType& getScroll(); - /** + /** * Returns true if this screen keeps lines that are scrolled off the screen * in a history buffer. */ bool hasScroll(); - /** + /** * Sets the start of the selection. * * @param column The column index of the first character in the selection. @@ -401,21 +401,21 @@ * @param columnmode True if the selection is in column mode. */ void setSelectionStart(const int column, const int line, const bool columnmode); - + /** * Sets the end of the current selection. * * @param column The column index of the last character in the selection. - * @param line The line index of the last character in the selection. - */ + * @param line The line index of the last character in the selection. + */ void setSelectionEnd(const int column, const int line); - + /** * Retrieves the start of the selection or the cursor position if there * is no selection. */ void getSelectionStart(int& column , int& line); - + /** * Retrieves the end of the selection or the cursor position if there * is no selection. @@ -427,19 +427,19 @@ void setBusySelecting(bool busy) { sel_busy = busy; } - /** + /** * Returns true if the character at (@p column, @p line) is part of the - * current selection. - */ + * current selection. + */ bool isSelected(const int column,const int line) const; - /** - * Convenience method. Returns the currently selected text. - * @param preserveLineBreaks Specifies whether new line characters should + /** + * Convenience method. Returns the currently selected text. + * @param preserveLineBreaks Specifies whether new line characters should * be inserted into the returned text at the end of each terminal line. */ QString selectedText(bool preserveLineBreaks); - + /** * Copies part of the output to a stream. * @@ -449,7 +449,7 @@ */ void writeToStream(TerminalCharacterDecoder* decoder, int from, int to); - /** + /** * Sets the selection to line @p no in the history and returns * the text of that line from the history buffer. */ @@ -459,11 +459,11 @@ * Copies the selected characters, set using @see setSelBeginXY and @see setSelExtentXY * into a stream. * - * @param decoder A decoder which converts terminal characters into text. - * PlainTextDecoder is the most commonly used decoder which coverts characters + * @param decoder A decoder which converts terminal characters into text. + * PlainTextDecoder is the most commonly used decoder which coverts characters * into plain text with no formatting. - * @param preserveLineBreaks Specifies whether new line characters should - * be inserted into the returned text at the end of each terminal line. + * @param preserveLineBreaks Specifies whether new line characters should + * be inserted into the returned text at the end of each terminal line. */ void writeSelectionToStream(TerminalCharacterDecoder* decoder , bool preserveLineBreaks = true); @@ -471,16 +471,16 @@ /** TODO Document me */ void checkSelection(int from, int to); - /** + /** * Sets or clears an attribute of the current line. - * + * * @param property The attribute to set or clear * Possible properties are: * LINE_WRAPPED: Specifies that the line is wrapped. * LINE_DOUBLEWIDTH: Specifies that the characters in the current line should be double the normal width. * LINE_DOUBLEHEIGHT:Specifies that the characters in the current line should be double the normal height. * Double-height lines are formed of two lines containing the same characters, - * with both having the LINE_DOUBLEHEIGHT attribute. This allows other parts of the + * with both having the LINE_DOUBLEHEIGHT attribute. This allows other parts of the * code to work on the assumption that all lines are the same height. * * @param enable true to apply the attribute to the current line or false to remove it @@ -488,24 +488,24 @@ void setLineProperty(LineProperty property , bool enable); - /** + /** * Returns the number of lines that the image has been scrolled up or down by, * since the last call to resetScrolledLines(). * * a positive return value indicates that the image has been scrolled up, - * a negative return value indicates that the image has been scrolled down. + * a negative return value indicates that the image has been scrolled down. */ int scrolledLines() const; /** * Returns the region of the image which was last scrolled. * - * This is the area of the image from the top margin to the + * This is the area of the image from the top margin to the * bottom margin when the last scroll occurred. */ QRect lastScrolledRegion() const; - /** + /** * Resets the count of the number of lines that the image has been scrolled up or down by, * see scrolledLines() */ @@ -518,7 +518,7 @@ * * If the history is not unlimited then it will drop * the oldest lines of output if new lines are added when - * it is full. + * it is full. */ int droppedLines() const; @@ -528,25 +528,25 @@ */ void resetDroppedLines(); - /** + /** * Fills the buffer @p dest with @p count instances of the default (ie. blank) * Character style. */ static void fillWithDefaultChar(Character* dest, int count); -private: +private: - //copies a line of text from the screen or history into a stream using a + //copies a line of text from the screen or history into a stream using a //specified character decoder - //line - the line number to copy, from 0 (the earliest line in the history) up to + //line - the line number to copy, from 0 (the earliest line in the history) up to // hist->getLines() + lines - 1 //start - the first column on the line to copy //count - the number of characters on the line to copy //decoder - a decoder which coverts terminal characters (an Character array) into text //appendNewLine - if true a new line character (\n) is appended to the end of the line - void copyLineToStream(int line, - int start, - int count, + void copyLineToStream(int line, + int start, + int count, TerminalCharacterDecoder* decoder, bool appendNewLine, bool preserveLineBreaks); @@ -560,7 +560,7 @@ //the parameters are specified as offsets from the start of the screen image. //the loc(x,y) macro can be used to generate these values from a column,line pair. void moveImage(int dest, int sourceBegin, int sourceEnd); - + void scrollUp(int from, int i); void scrollDown(int from, int i); @@ -593,11 +593,11 @@ int _droppedLines; - QVarLengthArray<LineProperty,64> lineProperties; + QVarLengthArray<LineProperty,64> lineProperties; // history buffer --------------- HistoryScroll *hist; - + // cursor location int cuX; int cuY; @@ -632,7 +632,7 @@ // // save cursor, rendition & states ------------ - // + // // cursor location int sa_cuX; @@ -642,7 +642,7 @@ quint8 sa_cu_re; CharacterColor sa_cu_fg; CharacterColor sa_cu_bg; - + // last position where we added a character int lastPos;
--- a/libgui/qterminal/libqterminal/unix/ScreenWindow.cpp +++ b/libgui/qterminal/libqterminal/unix/ScreenWindow.cpp @@ -60,7 +60,7 @@ { // reallocate internal buffer if the window size has changed int size = windowLines() * windowColumns(); - if (_windowBuffer == 0 || _windowBufferSize != size) + if (_windowBuffer == 0 || _windowBufferSize != size) { delete[] _windowBuffer; _windowBufferSize = size; @@ -70,11 +70,11 @@ if (!_bufferNeedsUpdate) return _windowBuffer; - + _screen->getImage(_windowBuffer,size, currentLine(),endWindowLine()); - // this window may look beyond the end of the screen, in which + // this window may look beyond the end of the screen, in which // case there will be an unused area which needs to be filled // with blank characters fillUnusedArea(); @@ -91,10 +91,10 @@ int unusedLines = windowEndLine - screenEndLine; int charsToFill = unusedLines * windowColumns(); - Screen::fillWithDefaultChar(_windowBuffer + _windowBufferSize - charsToFill,charsToFill); + Screen::fillWithDefaultChar(_windowBuffer + _windowBufferSize - charsToFill,charsToFill); } -// return the index of the line at the end of this window, or if this window +// return the index of the line at the end of this window, or if this window // goes beyond the end of the screen, the index of the line at the end // of the screen. // @@ -187,11 +187,11 @@ QPoint ScreenWindow::cursorPosition() const { QPoint position; - + position.setX( _screen->getCursorX() ); position.setY( _screen->getCursorY() ); - return position; + return position; } int ScreenWindow::currentLine() const @@ -207,7 +207,7 @@ } else if ( mode == ScrollPages ) { - scrollTo( currentLine() + amount * ( windowLines() / 2 ) ); + scrollTo( currentLine() + amount * ( windowLines() / 2 ) ); } } @@ -248,7 +248,7 @@ return _scrollCount; } -void ScreenWindow::resetScrollCount() +void ScreenWindow::resetScrollCount() { _scrollCount = 0; } @@ -268,18 +268,18 @@ // move window to the bottom of the screen and update scroll count // if this window is currently tracking the bottom of the screen if ( _trackOutput ) - { + { _scrollCount -= _screen->scrolledLines(); _currentLine = qMax(0,_screen->getHistLines() - (windowLines()-_screen->getLines())); } else { - // if the history is not unlimited then it may + // if the history is not unlimited then it may // have run out of space and dropped the oldest // lines of output - in this case the screen - // window's current line number will need to + // window's current line number will need to // be adjusted - otherwise the output will scroll - _currentLine = qMax(0,_currentLine - + _currentLine = qMax(0,_currentLine - _screen->droppedLines()); // ensure that the screen window's current position does @@ -289,6 +289,6 @@ _bufferNeedsUpdate = true; - emit outputChanged(); + emit outputChanged(); }
--- a/libgui/qterminal/libqterminal/unix/ScreenWindow.h +++ b/libgui/qterminal/libqterminal/unix/ScreenWindow.h @@ -36,7 +36,7 @@ * Provides a window onto a section of a terminal screen. * This window can then be rendered by a terminal display widget ( TerminalDisplay ). * - * To use the screen window, create a new ScreenWindow() instance and associated it with + * To use the screen window, create a new ScreenWindow() instance and associated it with * a terminal screen using setScreen(). * Use the scrollTo() method to scroll the window up and down on the screen. * Call the getImage() method to retrieve the character image which is currently visible in the window. @@ -53,7 +53,7 @@ Q_OBJECT public: - /** + /** * Constructs a new screen window with the given parent. * A screen must be specified by calling setScreen() before calling getImage() or getLineProperties(). * @@ -70,7 +70,7 @@ /** Returns the screen which this window looks onto */ Screen* screen() const; - /** + /** * Returns the image of characters which are currently visible through this window * onto the screen. * @@ -87,14 +87,14 @@ /** * Returns the number of lines which the region of the window - * specified by scrollRegion() has been scrolled by since the last call - * to resetScrollCount(). scrollRegion() is in most cases the + * specified by scrollRegion() has been scrolled by since the last call + * to resetScrollCount(). scrollRegion() is in most cases the * whole window, but will be a smaller area in, for example, applications * which provide split-screen facilities. * * This is not guaranteed to be accurate, but allows views to optimise * rendering by reducing the amount of costly text rendering that - * needs to be done when the output is scrolled. + * needs to be done when the output is scrolled. */ int scrollCount() const; @@ -104,7 +104,7 @@ void resetScrollCount(); /** - * Returns the area of the window which was last scrolled, this is + * Returns the area of the window which was last scrolled, this is * usually the whole window area. * * Like scrollCount(), this is not guaranteed to be accurate, @@ -112,8 +112,8 @@ */ QRect scrollRegion() const; - /** - * Sets the start of the selection to the given @p line and @p column within + /** + * Sets the start of the selection to the given @p line and @p column within * the window. */ void setSelectionStart( int column , int line , bool columnMode ); @@ -121,7 +121,7 @@ * Sets the end of the selection to the given @p line and @p column within * the window. */ - void setSelectionEnd( int column , int line ); + void setSelectionEnd( int column , int line ); /** * Retrieves the start of the selection within the window. */ @@ -134,7 +134,7 @@ * Returns true if the character at @p line , @p column is part of the selection. */ bool isSelected( int column , int line ); - /** + /** * Clears the current selection */ void clearSelection(); @@ -145,7 +145,7 @@ int windowLines() const; /** Returns the number of columns in the window */ int windowColumns() const; - + /** Returns the total number of lines in the screen */ int lineCount() const; /** Returns the total number of columns in the screen */ @@ -154,13 +154,13 @@ /** Returns the index of the line which is currently at the top of this window */ int currentLine() const; - /** - * Returns the position of the cursor + /** + * Returns the position of the cursor * within the window. */ QPoint cursorPosition() const; - /** + /** * Convenience method. Returns true if the window is currently at the bottom * of the screen. */ @@ -175,26 +175,26 @@ ScrollPages }; - /** + /** * Scrolls the window relative to its current position on the screen. * * @param mode Specifies whether @p amount refers to the number of lines or the number - * of pages to scroll. + * of pages to scroll. * @param amount The number of lines or pages ( depending on @p mode ) to scroll by. If * this number is positive, the view is scrolled down. If this number is negative, the view * is scrolled up. */ void scrollBy( RelativeScrollMode mode , int amount ); - /** + /** * Specifies whether the window should automatically move to the bottom * of the screen when new output is added. * - * If this is set to true, the window will be moved to the bottom of the associated screen ( see + * If this is set to true, the window will be moved to the bottom of the associated screen ( see * screen() ) when the notifyOutputChanged() method is called. */ void setTrackOutput(bool trackOutput); - /** + /** * Returns whether the window automatically moves to the bottom of the screen as * new output is added. See setTrackOutput() */ @@ -208,7 +208,7 @@ QString selectedText( bool preserveLineBreaks ) const; public slots: - /** + /** * Notifies the window that the contents of the associated terminal screen have changed. * This moves the window to the bottom of the screen if trackOutput() is true and causes * the outputChanged() signal to be emitted. @@ -217,13 +217,13 @@ signals: /** - * Emitted when the contents of the associated terminal screen ( see screen() ) changes. + * Emitted when the contents of the associated terminal screen ( see screen() ) changes. */ void outputChanged(); /** * Emitted when the screen window is scrolled to a different position. - * + * * @param line The line which is now at the top of the window. */ void scrolled(int line); @@ -244,7 +244,7 @@ int _windowLines; int _currentLine; // see scrollTo() , currentLine() - bool _trackOutput; // see setTrackOutput() , trackOutput() + bool _trackOutput; // see setTrackOutput() , trackOutput() int _scrollCount; // count of lines which the window has been scrolled by since // the last call to resetScrollCount() };
--- a/libgui/qterminal/libqterminal/unix/TerminalCharacterDecoder.cpp +++ b/libgui/qterminal/libqterminal/unix/TerminalCharacterDecoder.cpp @@ -1,8 +1,8 @@ /* This file is part of Konsole, an X terminal. - + Copyright (C) 2006, 2013 by Robert Knight <robertknight@gmail.com> - + Rewritten for QT4 by e_k <e_k at users.sourceforge.net>, Copyright (C)2008 This program is free software; you can redistribute it and/or modify @@ -43,7 +43,7 @@ } void PlainTextDecoder::begin(QTextStream* output) { - _output = output; + _output = output; } void PlainTextDecoder::end() { @@ -61,7 +61,7 @@ //(since QTextStream always deals with QStrings internally anyway) QString plainText; plainText.reserve(count); - + int outputCount = count; // if inclusion of trailing whitespace is disabled then find the end of the
--- a/libgui/qterminal/libqterminal/unix/TerminalCharacterDecoder.h +++ b/libgui/qterminal/libqterminal/unix/TerminalCharacterDecoder.h @@ -1,8 +1,8 @@ /* This file is part of Konsole, an X terminal. - + Copyright (C) 2006-2007, 2013 by Robert Knight <robertknight@gmail.com> - + Rewritten for QT4 by e_k <e_k at users.sourceforge.net>, Copyright (C)2008 This program is free software; you can redistribute it and/or modify @@ -35,7 +35,7 @@ * and background colours and other appearance-related properties into text strings. * * Derived classes may produce either plain text with no other colour or appearance information, or - * they may produce text which incorporates these additional properties. + * they may produce text which incorporates these additional properties. */ class TerminalCharacterDecoder { @@ -55,9 +55,9 @@ * @param properties Additional properties which affect all characters in the line * @param output The output stream which receives the decoded text */ - virtual void decodeLine(const Character* const characters, + virtual void decodeLine(const Character* const characters, int count, - LineProperty properties) = 0; + LineProperty properties) = 0; }; /** @@ -67,10 +67,10 @@ class PlainTextDecoder : public TerminalCharacterDecoder { public: - PlainTextDecoder(); + PlainTextDecoder(); - /** - * Set whether trailing whitespace at the end of lines should be included + /** + * Set whether trailing whitespace at the end of lines should be included * in the output. * Defaults to true. */ @@ -88,7 +88,7 @@ int count, LineProperty properties); - + private: QTextStream* _output; bool _includeTrailingWhitespace; @@ -100,7 +100,7 @@ class HTMLDecoder : public TerminalCharacterDecoder { public: - /** + /** * Constructs an HTML decoder using a default black-on-white color scheme. */ HTMLDecoder(); @@ -124,7 +124,7 @@ QTextStream* _output; const ColorEntry* _colorTable; - bool _innerSpanOpen; + bool _innerSpanOpen; quint8 _lastRendition; CharacterColor _lastForeColor; CharacterColor _lastBackColor;
--- a/libgui/qterminal/libqterminal/unix/Vt102Emulation.h +++ b/libgui/qterminal/libqterminal/unix/Vt102Emulation.h @@ -1,6 +1,6 @@ /* This file is part of Konsole, an X terminal. - + Copyright (C) 2007, 2013 by Robert Knight <robertknight@gmail.com> Copyright (C) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> @@ -28,7 +28,7 @@ // Standard Library #include <stdio.h> -// Qt +// Qt #include <QKeyEvent> #include <QtCore/QHash> #include <QtCore/QTimer> @@ -66,15 +66,15 @@ /** * Provides an xterm compatible terminal emulation based on the DEC VT102 terminal. * A full description of this terminal can be found at http://vt100.net/docs/vt102-ug/ - * - * In addition, various additional xterm escape sequences are supported to provide + * + * In addition, various additional xterm escape sequences are supported to provide * features such as mouse input handling. * See http://rtfm.etla.org/xterm/ctlseq.html for a description of xterm's escape - * sequences. + * sequences. * */ class Vt102Emulation : public Emulation -{ +{ Q_OBJECT public: @@ -82,30 +82,30 @@ /** Constructs a new emulation */ Vt102Emulation(); ~Vt102Emulation(); - + // reimplemented virtual void clearEntireScreen(); virtual void reset(); - + // reimplemented virtual char getErase() const; - -public slots: - // reimplemented +public slots: + + // reimplemented virtual void sendString(const char*,int length = -1); virtual void sendText(const QString& text); virtual void sendKeyEvent(QKeyEvent*); virtual void sendMouseEvent( int buttons, int column, int line , int eventType ); - + protected: // reimplemented virtual void setMode (int mode); virtual void resetMode (int mode); - // reimplemented + // reimplemented virtual void receiveChar(int cc); - + private slots: @@ -131,7 +131,7 @@ bool getMode (int mode); // saves the current boolean value of 'mode' void saveMode (int mode); - // restores the boolean value of 'mode' + // restores the boolean value of 'mode' void restoreMode(int mode); // resets all modes void resetModes(); @@ -174,14 +174,14 @@ DECpar _currParm; DECpar _saveParm; - //hash table and timer for buffering calls to the session instance + //hash table and timer for buffering calls to the session instance //to update the name of the session //or window title. - //these calls occur when certain escape sequences are seen in the + //these calls occur when certain escape sequences are seen in the //output from the terminal QHash<int,QString> _pendingTitleUpdates; QTimer* _titleUpdateTimer; - + }; #endif // VT102EMULATION_H
--- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp +++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp @@ -279,7 +279,7 @@ QConsolePrivate::QConsolePrivate (QWinTerminalImpl* parent, const QString& cmd) : q (parent), m_command (cmd), m_cursorBlinking (false), - m_hasBlinkingCursor (true), m_cursorType (BlockCursor), + m_hasBlinkingCursor (true), m_cursorType (BlockCursor), m_beginSelection (0, 0), m_endSelection (0, 0), m_settingSelection (false), m_process (NULL), m_inWheelEvent (false) { @@ -416,7 +416,7 @@ m_blinkCursorTimer = new QTimer (parent); QObject::connect (m_blinkCursorTimer, SIGNAL (timeout()), - q, SLOT (blinkCursorEvent ())); + q, SLOT (blinkCursorEvent ())); QObject::connect (m_horizontalScrollBar, SIGNAL (valueChanged (int)), q, SLOT (horizontalScrollValueChanged (int))); @@ -857,9 +857,9 @@ { // draw the cursor outline, adjusting the area so that // it is draw entirely inside 'rect' - + int penWidth = qMax (1, p.pen().width()); - + p.drawRect (rect.adjusted (penWidth/2, penWidth/2, - penWidth/2 - penWidth%2, - penWidth/2 - penWidth%2)); @@ -1376,11 +1376,11 @@ events[nEvents].Event.KeyEvent.uChar.UnicodeChar = c.unicode (); events[nEvents].Event.KeyEvent.dwControlKeyState = 0; nEvents++; - + WriteConsoleInput (hStdIn, events, nEvents, &written); nEvents = 0; ZeroMemory (events, sizeof (events)); - + } else {
--- a/libgui/qterminal/qterminal/main.cpp +++ b/libgui/qterminal/qterminal/main.cpp @@ -33,8 +33,8 @@ mainWindow->setCentralWidget(terminal); mainWindow->resize(600, 400); - mainWindow->show(); + mainWindow->show(); return app.exec(); -} +} - +
--- a/libgui/src/m-editor/file-editor-tab.cc +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -2077,7 +2077,7 @@ } } -void +void file_editor_tab::handle_cursor_moved (int line, int col) { if (_edit_area->SendScintilla (QsciScintillaBase::SCI_AUTOCACTIVE))
--- a/libgui/src/octave-gui.cc +++ b/libgui/src/octave-gui.cc @@ -184,7 +184,7 @@ QApplication application (argc, argv); octave_cli_thread main_thread (argc, argv); - + application.setQuitOnLastWindowClosed (false); main_thread.start ();
--- a/libgui/src/octave-qt-link.cc +++ b/libgui/src/octave-qt-link.cc @@ -554,5 +554,5 @@ void octave_qt_link::terminal_interrupt (void) { - command_interpreter->interrupt (); + command_interpreter->interrupt (); }
--- a/libinterp/corefcn/data.cc +++ b/libinterp/corefcn/data.cc @@ -6728,7 +6728,7 @@ if (vals.is_single_type ()) { if (vals.is_complex_type ()) - retval = do_accumarray_sum (idx, + retval = do_accumarray_sum (idx, vals.float_complex_array_value (), n); else
--- a/libinterp/corefcn/defun-int.h +++ b/libinterp/corefcn/defun-int.h @@ -91,7 +91,7 @@ typedef bool (*octave_dld_fcn_installer) (const octave_shlib&, bool relative); -typedef octave_function * +typedef octave_function * (*octave_dld_fcn_getter) (const octave_shlib&, bool relative); #define DEFINE_FUN_INSTALLER_FUN(name, doc) \
--- a/libinterp/corefcn/det.cc +++ b/libinterp/corefcn/det.cc @@ -234,7 +234,7 @@ if (! error_state) { MAYBE_CAST (rep, octave_complex_matrix); - MatrixType mtype = rep ? rep -> matrix_type () + MatrixType mtype = rep ? rep -> matrix_type () : MatrixType (); ComplexDET det = m.determinant (mtype, info, rcond); retval(1) = rcond;
--- a/libinterp/corefcn/gl2ps-renderer.cc +++ b/libinterp/corefcn/gl2ps-renderer.cc @@ -197,7 +197,7 @@ // Convert to GL_FLOAT as it is the only type gl2ps accepts. for (unsigned int i = 0; i < 3*w*h; i++) a[i] = data[i] / maxval; - + gl2psDrawPixels (w, h, 0, 0, format, GL_FLOAT, a); }
--- a/libinterp/corefcn/graphics.cc +++ b/libinterp/corefcn/graphics.cc @@ -3779,7 +3779,7 @@ else if (std::abs (sz(0) - 182.0 * mm2in) + std::abs (sz(1) - 257.0 * mm2in) < tol) typ = "b5"; - else if (std::abs (sz(0) - 9.0) + else if (std::abs (sz(0) - 9.0) + std::abs (sz(1) - 12.0) < tol) typ = "arch-a"; else if (std::abs (sz(0) - 12.0) @@ -3794,7 +3794,7 @@ else if (std::abs (sz(0) - 36.0) + std::abs (sz(1) - 48.0) < tol) typ = "arch-e"; - else if (std::abs (sz(0) - 8.5) + else if (std::abs (sz(0) - 8.5) + std::abs (sz(1) - 11.0) < tol) typ = "a"; else if (std::abs (sz(0) - 11.0)
--- a/libinterp/corefcn/graphics.in.h +++ b/libinterp/corefcn/graphics.in.h @@ -5163,7 +5163,7 @@ { position.add_constraint (dim_vector (1, 4)); } - + void update_units (const caseless_str& old_units); void update_fontunits (const caseless_str& old_units);
--- a/libinterp/corefcn/ls-mat5.cc +++ b/libinterp/corefcn/ls-mat5.cc @@ -550,7 +550,7 @@ // FIXME: find a way to avoid casting away const here! - int err = uncompress (reinterpret_cast<Bytef *> + int err = uncompress (reinterpret_cast<Bytef *> (const_cast<char *> (outbuf.c_str ())), &destLen, reinterpret_cast<Bytef *> (inbuf), element_length);
--- a/libinterp/corefcn/lu.cc +++ b/libinterp/corefcn/lu.cc @@ -227,7 +227,7 @@ retval(1) = octave_value ( - fact.U () * fact.Pc_mat ().transpose (), + fact.U () * fact.Pc_mat ().transpose (), MatrixType (MatrixType::Permuted_Upper, nc, fact.col_perm ())); @@ -297,7 +297,7 @@ retval(1) = octave_value ( - fact.U () * fact.Pc_mat ().transpose (), + fact.U () * fact.Pc_mat ().transpose (), MatrixType (MatrixType::Permuted_Upper, nc, fact.col_perm ()));
--- a/libinterp/corefcn/oct-tex-parser.yy +++ b/libinterp/corefcn/oct-tex-parser.yy @@ -47,7 +47,7 @@ %name-prefix="octave_tex_" %define api.pure -%parse-param { text_parser_tex& parser } +%parse-param { text_parser_tex& parser } %lex-param { void *scanner } %code requires {#include <string>}
--- a/libinterp/corefcn/oct-tex-symbols.in +++ b/libinterp/corefcn/oct-tex-symbols.in @@ -3,7 +3,7 @@ # - symbol name # - Unicode code # - MS symbol code (http://www.kostis.net/charsets/symbol.htm) -# - Arranged by listings in The TeXbook, Appendix F +# - Arranged by listings in The TeXbook, Appendix F # - Lowercase Greek letters: Greek Upper case: Misc Symbols type Ord: "Large" operators: # - Binary operators: Relations: Negated relations: Arrows: Openings: Closings: Alternate names: # - Other (not in Appendix F Tables):
--- a/libinterp/corefcn/quadcc.cc +++ b/libinterp/corefcn/quadcc.cc @@ -1643,7 +1643,7 @@ nivals = 1 + args(4).numel (); } - int cquad_heapsize = (nivals >= min_cquad_heapsize ? nivals + 1 + int cquad_heapsize = (nivals >= min_cquad_heapsize ? nivals + 1 : min_cquad_heapsize); /* The interval heap. */ OCTAVE_LOCAL_BUFFER (cquad_ival, ivals, cquad_heapsize);
--- a/libinterp/corefcn/zfstream.cc +++ b/libinterp/corefcn/zfstream.cc @@ -405,7 +405,7 @@ this->setg (buffer, buffer, buffer); // Setup entire internal buffer as put area. // The one-past-end pointer actually points to the last element of - // the buffer, so that overflow(c) can safely add the extra character + // the buffer, so that overflow(c) can safely add the extra character // c to the sequence. These pointers remain in place for the // duration of the buffer this->setp (buffer, buffer + buffer_size - 1);
--- a/libinterp/dldfcn/__eigs__.cc +++ b/libinterp/dldfcn/__eigs__.cc @@ -573,7 +573,7 @@ if (a_is_sparse) nconv = EigsRealNonSymmetricMatrixShift (asmm, sigmar, k, p, info, eig_vec, eig_val, bsmm, - permB, resid, octave_stdout, tol, (nargout > 1), + permB, resid, octave_stdout, tol, (nargout > 1), cholB, disp, maxit); else nconv = EigsRealNonSymmetricMatrixShift
--- a/libinterp/dldfcn/__voronoi__.cc +++ b/libinterp/dldfcn/__voronoi__.cc @@ -198,7 +198,7 @@ { facet->seen = false; } - + OCTAVE_LOCAL_BUFFER (octave_idx_type, ni, num_voronoi_regions); for (octave_idx_type i = 0; i < num_voronoi_regions; i++) ni[i] = 0; @@ -209,7 +209,7 @@ { if (qh hull_dim == 3) qh_order_vertexneighbors (vertex); - + bool infinity_seen = false; facetT *neighbor, **neighborp;
--- a/libinterp/gendoc.pl +++ b/libinterp/gendoc.pl @@ -43,7 +43,7 @@ $src_fname = $1; next LINE; } - if (/XDEF/ and ! /XDEFALIAS/) + if (/XDEF/ and ! /XDEFALIAS/) { ## Decode 4 or 5 part macro definition. ($func, $str) = /\("?(\w+)"?,[^,]+,[^,]+,(?:[^,]+,)?\s*"(.*)"\)\s*$/ ;
--- a/libinterp/genprops.awk +++ b/libinterp/genprops.awk @@ -1,17 +1,17 @@ ## Copyright (C) 2007-2013 John W. Eaton ## ## This file is part of Octave. -## +## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by the ## Free Software Foundation; either version 3 of the License, or (at ## your option) any later version. -## +## ## Octave is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## for more details. -## +## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>. @@ -73,7 +73,7 @@ ################################################################################ ## 'o','O','a' are currently not processed. They are commented out in code. ################################################################################ -## +## ## o: There is a custom inline definition for the octave_value version ## of the set function, so we don't emit one. ## @@ -144,7 +144,7 @@ function emit_get_accessor (i, rtype, faccess) { printf (" %s get_%s (void) const", rtype, name[i]); - + if (emit_get[i] == "definition") printf (" { return %s.%s (); }\n", name[i], faccess); else @@ -156,7 +156,7 @@ function emit_get_bool (i) { printf (" bool is_%s (void) const", name[i]); - + if (emit_get[i] == "definition") printf (" { return %s.is_on (); }\n", name[i]); else @@ -170,7 +170,7 @@ function emit_get_radio (i) { printf (" bool %s_is (const std::string& v) const", name[i]); - + if (emit_get[i] == "definition") printf (" { return %s.is (v); }\n", name[i]); else @@ -186,14 +186,14 @@ printf (" bool %s_is_rgb (void) const { return %s.is_rgb (); }\n", name[i], name[i]); printf (" bool %s_is (const std::string& v) const", name[i]); - + if (emit_get[i] == "definition") printf (" { return %s.is (v); }\n", name[i]); else printf (";\n"); - + printf (" Matrix get_%s_rgb (void) const", name[i]); - + if (emit_get[i] == "definition") printf (" { return (%s.is_rgb () ? %s.rgb () : Matrix ()); }\n", name[i], name[i]); else @@ -209,14 +209,14 @@ printf (" bool %s_is_double (void) const { return %s.is_double (); }\n", name[i], name[i]); printf (" bool %s_is (const std::string& v) const", name[i]); - + if (emit_get[i] == "definition") printf (" { return %s.is (v); }\n", name[i]); else printf (";\n"); - + printf (" double get_%s_double (void) const", name[i]); - + if (emit_get[i] == "definition") printf (" { return (%s.is_double () ? %s.double_value () : 0); }\n", name[i], name[i]); else @@ -230,7 +230,7 @@ function emit_get_callback (i) { printf (" void execute_%s (const octave_value& data = octave_value ()) const", name[i]); - + if (emit_get[i] == "definition") printf (" { %s.execute (data); }\n", name[i]); else @@ -303,7 +303,7 @@ if (idx > 0) print "\npublic:\n"; - + if (idx > 0) { printf (" enum\n {"); @@ -763,7 +763,7 @@ ## but we still emit the declaration. if (index (quals, "S")) emit_set[idx] = "declaration"; - + ## The property is hidden if (index (quals, "h")) hidden[idx] = 1; @@ -776,7 +776,7 @@ ## from the set method if (index (quals, "u")) updater[idx] = "inline"; - + ## There is an extern updater method that should be called ## from the set method if (index (quals, "U"))
--- a/libinterp/mk-errno-list +++ b/libinterp/mk-errno-list @@ -3,17 +3,17 @@ # Copyright (C) 2005-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/libinterp/mk-pkg-add +++ b/libinterp/mk-pkg-add @@ -3,17 +3,17 @@ # Copyright (C) 2005-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. @@ -26,7 +26,7 @@ if [ -f $f ]; then ## Compute and print the autoloads. - + base=`basename $f | $SED 's/\.df$//'` fcns=`$SED -n -e 's/^ *XDEFUN_DLD_INTERNAL *( *\([^, ]*\)[, ].*$/\1/p' \ -e 's/^ *XDEFUNX_DLD_INTERNAL *( *"\([^"]*\)".*$/\1/p' $f | \
--- a/libinterp/mkbuiltins +++ b/libinterp/mkbuiltins @@ -3,17 +3,17 @@ # Copyright (C) 1996-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/libinterp/mkdefs +++ b/libinterp/mkdefs @@ -3,17 +3,17 @@ # Copyright (C) 1996-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/libinterp/mkdocs +++ b/libinterp/mkdocs @@ -3,17 +3,17 @@ # Copyright (C) 1999-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/libinterp/mkops +++ b/libinterp/mkops @@ -3,17 +3,17 @@ # Copyright (C) 1997-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/libinterp/octave-value/ov-java.cc +++ b/libinterp/octave-value/ov-java.cc @@ -1012,7 +1012,7 @@ { jmethodID m = jni_env->GetMethodID (cls, "charValue", "()C"); retval = jni_env->CallCharMethod (jobj, m); - retval = retval.convert_to_str (false, true); + retval = retval.convert_to_str (false, true); break; }
--- a/libinterp/parse-tree/lex.ll +++ b/libinterp/parse-tree/lex.ll @@ -179,7 +179,7 @@ } \ } \ while (0) - + #define CMD_OR_UNARY_OP(PATTERN, TOK, COMPAT) \ \ do \ @@ -729,7 +729,7 @@ looks_like_block_comment = false; break; } - } + } if (looks_like_block_comment) { @@ -764,7 +764,7 @@ curr_lexer->xunput (yytext[0]); - curr_lexer->finish_comment (octave_comment_elt::full_line); + curr_lexer->finish_comment (octave_comment_elt::full_line); curr_lexer->pop_start_state (); } @@ -1964,7 +1964,7 @@ looking_at_decl_list = false; looking_at_initializer_expression = false; looking_at_matrix_or_assign_lhs = false; - looking_for_object_index = false; + looking_for_object_index = false; looking_at_indirect_ref = false; parsing_class_method = false; maybe_classdef_get_set_method = false; @@ -3377,7 +3377,7 @@ { std::cerr << "R: "; display_token (tok); - std::cerr << std::endl; + std::cerr << std::endl; } return tok; @@ -3410,7 +3410,7 @@ if (input_buf.empty () && ! input_buf.at_eof ()) input_buf.fill (std::string (1, static_cast<char> (1)), false); - + if (! input_buf.empty ()) status = input_buf.copy_chunk (buf, max_size); else
--- a/libinterp/parse-tree/oct-parse.in.yy +++ b/libinterp/parse-tree/oct-parse.in.yy @@ -303,31 +303,31 @@ %destructor { } <dummy_type> %destructor { } <> -%destructor { delete $$; } <tree_type> -%destructor { delete $$; } <tree_matrix_type> -%destructor { delete $$; } <tree_cell_type> -%destructor { delete $$; } <tree_expression_type> -%destructor { delete $$; } <tree_constant_type> -%destructor { delete $$; } <tree_fcn_handle_type> -%destructor { delete $$; } <tree_anon_fcn_handle_type> -%destructor { delete $$; } <tree_identifier_type> -%destructor { delete $$; } <tree_index_expression_type> -%destructor { delete $$; } <tree_colon_expression_type> -%destructor { delete $$; } <tree_argument_list_type> -%destructor { delete $$; } <tree_parameter_list_type> -%destructor { delete $$; } <tree_command_type> -%destructor { delete $$; } <tree_if_command_type> -%destructor { delete $$; } <tree_if_clause_type> -%destructor { delete $$; } <tree_if_command_list_type> -%destructor { delete $$; } <tree_switch_command_type> -%destructor { delete $$; } <tree_switch_case_type> -%destructor { delete $$; } <tree_switch_case_list_type> -%destructor { delete $$; } <tree_decl_elt_type> -%destructor { delete $$; } <tree_decl_init_list_type> -%destructor { delete $$; } <tree_decl_command_type> -%destructor { delete $$; } <tree_statement_type> -%destructor { delete $$; } <tree_statement_list_type> -%destructor { delete $$; } <octave_user_function_type> +%destructor { delete $$; } <tree_type> +%destructor { delete $$; } <tree_matrix_type> +%destructor { delete $$; } <tree_cell_type> +%destructor { delete $$; } <tree_expression_type> +%destructor { delete $$; } <tree_constant_type> +%destructor { delete $$; } <tree_fcn_handle_type> +%destructor { delete $$; } <tree_anon_fcn_handle_type> +%destructor { delete $$; } <tree_identifier_type> +%destructor { delete $$; } <tree_index_expression_type> +%destructor { delete $$; } <tree_colon_expression_type> +%destructor { delete $$; } <tree_argument_list_type> +%destructor { delete $$; } <tree_parameter_list_type> +%destructor { delete $$; } <tree_command_type> +%destructor { delete $$; } <tree_if_command_type> +%destructor { delete $$; } <tree_if_clause_type> +%destructor { delete $$; } <tree_if_command_list_type> +%destructor { delete $$; } <tree_switch_command_type> +%destructor { delete $$; } <tree_switch_case_type> +%destructor { delete $$; } <tree_switch_case_list_type> +%destructor { delete $$; } <tree_decl_elt_type> +%destructor { delete $$; } <tree_decl_init_list_type> +%destructor { delete $$; } <tree_decl_command_type> +%destructor { delete $$; } <tree_statement_type> +%destructor { delete $$; } <tree_statement_list_type> +%destructor { delete $$; } <octave_user_function_type> %destructor { warning_with_id @@ -3428,7 +3428,7 @@ dynamic_cast<octave_push_lexer&> (lexer).append_input (input, eof); do - { + { YYSTYPE lval; int token = octave_lex (&lval, scanner); @@ -3461,7 +3461,7 @@ static octave_function * parse_fcn_file (const std::string& full_file, const std::string& file, const std::string& dispatch_type, - bool require_file, bool force_script, bool autoload, + bool require_file, bool force_script, bool autoload, bool relative_lookup, const std::string& warn_for) { unwind_protect frame; @@ -4610,7 +4610,7 @@ if (nargin == 1 || nargin == 2) { std::string file = args(0).string_value (); - + std::string full_file = octave_env::make_absolute (file); size_t file_len = file.length ();
--- a/libinterp/parse-tree/octave.gperf +++ b/libinterp/parse-tree/octave.gperf @@ -86,7 +86,7 @@ end, END, end_kw end_try_catch, END, end_try_catch_kw end_unwind_protect, END, end_unwind_protect_kw -endclassdef, END, endclassdef_kw +endclassdef, END, endclassdef_kw endenumeration, END, endenumeration_kw endevents, END, endevents_kw endfor, END, endfor_kw
--- a/liboctave/Makefile.am +++ b/liboctave/Makefile.am @@ -83,7 +83,7 @@ ## liboctave merely collects a bunch of compiled convenience libraries. ## It has no source code itself. -liboctave_la_SOURCES = +liboctave_la_SOURCES = liboctave_la_CPPFLAGS = @OCTAVE_DLL_DEFS@ @CRUFT_DLL_DEFS@ $(AM_CPPFLAGS)
--- a/liboctave/array/Array.cc +++ b/liboctave/array/Array.cc @@ -2522,7 +2522,7 @@ \ template <> Array<T> \ Array<T>::nth_element (const idx_vector&, int) const { return Array<T> (); } \ - + template <class T> Array<T>
--- a/liboctave/array/module.mk +++ b/liboctave/array/module.mk @@ -123,7 +123,7 @@ array/uint16NDArray.cc \ array/uint32NDArray.cc \ array/uint64NDArray.cc \ - array/uint8NDArray.cc + array/uint8NDArray.cc TEMPLATE_SRC += \ array/Array.cc \
--- a/liboctave/cruft/daspk/datv.f +++ b/liboctave/cruft/daspk/datv.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DATV (NEQ, Y, TN, YPRIME, SAVR, V, WGHT, YPTEM, RES, @@ -52,7 +52,7 @@ C C IWP = Integer work array used by preconditioner PSOL. C -C CJ = Scalar proportional to current value of +C CJ = Scalar proportional to current value of C 1/(step size H). C C
--- a/liboctave/cruft/daspk/dcnst0.f +++ b/liboctave/cruft/daspk/dcnst0.f @@ -12,7 +12,7 @@ C----------------------------------------------------------------------- C***DESCRIPTION C -C This subroutine checks for constraint violations in the initial +C This subroutine checks for constraint violations in the initial C approximate solution u. C C On entry @@ -57,17 +57,17 @@ IF (Y(I) .LT. ZERO) THEN IRET = I RETURN - ENDIF + ENDIF ELSEIF (ICNSTR(I) .EQ. -1) THEN IF (Y(I) .GT. ZERO) THEN IRET = I RETURN - ENDIF + ENDIF ELSEIF (ICNSTR(I) .EQ. -2) THEN IF (Y(I) .GE. ZERO) THEN IRET = I RETURN - ENDIF + ENDIF ENDIF 100 CONTINUE RETURN
--- a/liboctave/cruft/daspk/dcnstr.f +++ b/liboctave/cruft/daspk/dcnstr.f @@ -12,7 +12,7 @@ C----------------------------------------------------------------------- C***DESCRIPTION C -C This subroutine checks for constraint violations in the proposed +C This subroutine checks for constraint violations in the proposed C new approximate solution YNEW. C If a constraint violation occurs, then a new step length, TAU, C is calculated, and this value is to be given to the linesearch routine
--- a/liboctave/cruft/daspk/ddasic.f +++ b/liboctave/cruft/daspk/ddasic.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DDASIC (X, Y, YPRIME, NEQ, ICOPT, ID, RES, JAC, PSOL, @@ -17,7 +17,7 @@ C***DESCRIPTION C C DDASIC is a driver routine to compute consistent initial values -C for Y and YPRIME. There are two different options: +C for Y and YPRIME. There are two different options: C Denoting the differential variables in Y by Y_d, and C the algebraic variables by Y_a, the problem solved is either: C 1. Given Y_d, calculate Y_a and Y_d', or @@ -40,19 +40,19 @@ C ID -- Array of dimension NEQ, which must be initialized C if option 1 is chosen. C ID(i) = +1 if Y_i is a differential variable, -C ID(i) = -1 if Y_i is an algebraic variable. +C ID(i) = -1 if Y_i is an algebraic variable. C RES -- External user-supplied subroutine to evaluate the C residual. See RES description in DDASPK prologue. C JAC -- External user-supplied routine to update Jacobian C or preconditioner information in the nonlinear solver C (optional). See JAC description in DDASPK prologue. C PSOL -- External user-supplied routine to solve -C a linear system using preconditioning. +C a linear system using preconditioning. C See PSOL in DDASPK prologue. -C H -- Scaling factor in iteration matrix. DDASIC may +C H -- Scaling factor in iteration matrix. DDASIC may C reduce H to achieve convergence. C WT -- Vector of weights for error criterion. -C NIC -- Input number of initial condition calculation call +C NIC -- Input number of initial condition calculation call C (= 1 or 2). C IDID -- Completion code. See IDID in DDASPK prologue. C RPAR,IPAR -- Real and integer parameter arrays that @@ -115,7 +115,7 @@ CALL DCOPY (NEQ, YPRIME, 1, PHI(1,2), 1) C IF (ICOPT .EQ. 2) THEN - CJ = 0.0D0 + CJ = 0.0D0 ELSE CJ = 1.0D0/H ENDIF
--- a/liboctave/cruft/daspk/ddasid.f +++ b/liboctave/cruft/daspk/ddasid.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DDASID(X,Y,YPRIME,NEQ,ICOPT,ID,RES,JACD,PDUM,H,WT, @@ -67,7 +67,7 @@ C value allowed. C ICNFLG -- Integer scalar. If nonzero, then constraint C violations in the proposed new approximate solution -C will be checked for, and the maximum step length +C will be checked for, and the maximum step length C will be adjusted accordingly. C ICNSTR -- Integer array of length NEQ containing flags for C checking constraints.
--- a/liboctave/cruft/daspk/ddasik.f +++ b/liboctave/cruft/daspk/ddasik.f @@ -1,5 +1,5 @@ C Work perfored under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DDASIK(X,Y,YPRIME,NEQ,ICOPT,ID,RES,JACK,PSOL,H,WT, @@ -74,7 +74,7 @@ C JFLG -- Flag showing whether a Jacobian routine is supplied. C ICNFLG -- Integer scalar. If nonzero, then constraint C violations in the proposed new approximate solution -C will be checked for, and the maximum step length +C will be checked for, and the maximum step length C will be adjusted accordingly. C ICNSTR -- Integer array of length NEQ containing flags for C checking constraints. @@ -151,7 +151,7 @@ C C Up to MXNIT iterations were done, the convergence rate is < 1, C a Jacobian routine is supplied, and the number of JACK calls -C is less than MXNJ. +C is less than MXNJ. C Copy the residual SAVR to DELTA, call JACK, and try again. C CALL DCOPY (NEQ, SAVR, 1, DELTA, 1)
--- a/liboctave/cruft/daspk/ddaspk.f +++ b/liboctave/cruft/daspk/ddaspk.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DDASPK (RES, NEQ, T, Y, YPRIME, TOUT, INFO, RTOL, ATOL, @@ -7,7 +7,7 @@ C C***BEGIN PROLOGUE DDASPK C***DATE WRITTEN 890101 (YYMMDD) -C***REVISION DATE 910624 +C***REVISION DATE 910624 C***REVISION DATE 920929 (CJ in RES call, RES counter fix.) C***REVISION DATE 921215 (Warnings on poor iteration performance) C***REVISION DATE 921216 (NRMAX as optional input) @@ -33,11 +33,11 @@ C Lawrence Livermore National Laboratory C P.O. Box 808, C Livermore, CA 94551 -C***PURPOSE This code solves a system of differential/algebraic -C equations of the form -C G(t,y,y') = 0 , -C using a combination of Backward Differentiation Formula -C (BDF) methods and a choice of two linear system solution +C***PURPOSE This code solves a system of differential/algebraic +C equations of the form +C G(t,y,y') = 0 , +C using a combination of Backward Differentiation Formula +C (BDF) methods and a choice of two linear system solution C methods: direct (dense or band) or Krylov (iterative). C This version is in double precision. C----------------------------------------------------------------------- @@ -66,7 +66,7 @@ C C NEQ:IN This is the number of equations in the system. C -C T:INOUT This is the current value of the independent +C T:INOUT This is the current value of the independent C variable. C C Y(*):INOUT This array contains the solution components at T. @@ -107,7 +107,7 @@ C program and the RES, JAC, and PSOL subroutines. C C JAC:EXT This is the name of a subroutine which you may -C provide (optionally) for calculating Jacobian +C provide (optionally) for calculating Jacobian C (partial derivative) data involved in solving linear C systems within DDASPK. C @@ -120,9 +120,9 @@ C C The DDASPK solver uses the backward differentiation formulas of C orders one through five to solve a system of the form G(t,y,y') = 0 -C for y = Y and y' = YPRIME. Values for Y and YPRIME at the initial -C time must be given as input. These values should be consistent, -C that is, if T, Y, YPRIME are the given initial values, they should +C for y = Y and y' = YPRIME. Values for Y and YPRIME at the initial +C time must be given as input. These values should be consistent, +C that is, if T, Y, YPRIME are the given initial values, they should C satisfy G(T,Y,YPRIME) = 0. However, if consistent values are not C known, in many cases you can have DDASPK solve for them -- see INFO(11). C (This and other options are described in more detail below.) @@ -132,24 +132,24 @@ C the interval mode of operation. Intermediate results can also be C obtained easily by specifying INFO(3). C -C On each step taken by DDASPK, a sequence of nonlinear algebraic +C On each step taken by DDASPK, a sequence of nonlinear algebraic C systems arises. These are solved by one of two types of C methods: C * a Newton iteration with a direct method for the linear C systems involved (INFO(12) = 0), or -C * a Newton iteration with a preconditioned Krylov iterative +C * a Newton iteration with a preconditioned Krylov iterative C method for the linear systems involved (INFO(12) = 1). C -C The direct method choices are dense and band matrix solvers, -C with either a user-supplied or an internal difference quotient +C The direct method choices are dense and band matrix solvers, +C with either a user-supplied or an internal difference quotient C Jacobian matrix, as specified by INFO(5) and INFO(6). C In the band case, INFO(6) = 1, you must supply half-bandwidths C in IWORK(1) and IWORK(2). C -C The Krylov method is the Generalized Minimum Residual (GMRES) -C method, in either complete or incomplete form, and with +C The Krylov method is the Generalized Minimum Residual (GMRES) +C method, in either complete or incomplete form, and with C scaling and preconditioning. The method is implemented -C in an algorithm called SPIGMR. Certain options in the Krylov +C in an algorithm called SPIGMR. Certain options in the Krylov C method case are specified by INFO(13) and INFO(15). C C If the Krylov method is chosen, you may supply a pair of routines, @@ -232,7 +232,7 @@ C YPRIME(*) -- Set this array to the initial values of the NEQ first C derivatives of the solution components at the initial C point. You must dimension YPRIME at least NEQ in your -C calling program. +C calling program. C C TOUT - Set it to the first point at which a solution is desired. C You cannot take TOUT = T. Integration either forward in T @@ -263,13 +263,13 @@ C C INFO(*) - Use the INFO array to give the code more details about C how you want your problem solved. This array should be -C dimensioned of length 20, though DDASPK uses only the +C dimensioned of length 20, though DDASPK uses only the C first 15 entries. You must respond to all of the following C items, which are arranged as questions. The simplest use C of DDASPK corresponds to setting all entries of INFO to 0. C C INFO(1) - This parameter enables the code to initialize itself. -C You must set it to indicate the start of every new +C You must set it to indicate the start of every new C problem. C C **** Is this the first call for this problem ... @@ -346,8 +346,8 @@ C is told this. In this case, the storage needed will be C greatly reduced, numerical differencing will be performed C much cheaper, and a number of important algorithms will -C execute much faster. The differential equation is said -C to have half-bandwidths ML (lower) and MU (upper) if +C execute much faster. The differential equation is said +C to have half-bandwidths ML (lower) and MU (upper) if C equation i involves only unknowns Y(j) with C i-ML .le. j .le. i+MU . C For all i=1,2,...,NEQ. Thus, ML and MU are the widths @@ -386,8 +386,8 @@ C C INFO(8) - Differential/algebraic problems may occasionally C suffer from severe scaling difficulties on the first -C step. If you know a great deal about the scaling of -C your problem, you can help to alleviate this problem +C step. If you know a great deal about the scaling of +C your problem, you can help to alleviate this problem C by specifying an initial stepsize H0. C C **** Do you want the code to define its own initial @@ -400,8 +400,8 @@ C INFO(9) - If storage is a severe problem, you can save some C storage by restricting the maximum method order MAXORD. C The default value is 5. For each order decrease below 5, -C the code requires NEQ fewer locations, but it is likely -C to be slower. In any case, you must have +C the code requires NEQ fewer locations, but it is likely +C to be slower. In any case, you must have C 1 .le. MAXORD .le. 5. C **** Do you want the maximum order to default to 5 ... C yes - set INFO(9) = 0 @@ -426,7 +426,7 @@ C **** Do you want the code to solve the problem without C invoking any special inequality constraints ... C yes - set INFO(10) = 0 -C no - set INFO(10) = 1 to have option 1 enforced +C no - set INFO(10) = 1 to have option 1 enforced C no - set INFO(10) = 2 to have option 2 enforced C no - set INFO(10) = 3 to have option 3 enforced **** C @@ -474,7 +474,7 @@ C C INFO(12) - Except for the addition of the RES argument CJ, C DDASPK by default is downward-compatible with DDASSL, -C which uses only direct (dense or band) methods to solve +C which uses only direct (dense or band) methods to solve C the linear systems involved. You must set INFO(12) to C indicate whether you want the direct methods or the C Krylov iterative method. @@ -484,24 +484,24 @@ C Krylov method - set INFO(12) = 1, C and check the settings of INFO(13) and INFO(15). C -C INFO(13) - used when INFO(12) = 1 (Krylov methods). +C INFO(13) - used when INFO(12) = 1 (Krylov methods). C DDASPK uses scalars MAXL, KMP, NRMAX, and EPLI for the -C iterative solution of linear systems. INFO(13) allows -C you to override the default values of these parameters. +C iterative solution of linear systems. INFO(13) allows +C you to override the default values of these parameters. C These parameters and their defaults are as follows: -C MAXL = maximum number of iterations in the SPIGMR -C algorithm (MAXL .le. NEQ). The default is +C MAXL = maximum number of iterations in the SPIGMR +C algorithm (MAXL .le. NEQ). The default is C MAXL = MIN(5,NEQ). -C KMP = number of vectors on which orthogonalization is -C done in the SPIGMR algorithm. The default is -C KMP = MAXL, which corresponds to complete GMRES -C iteration, as opposed to the incomplete form. -C NRMAX = maximum number of restarts of the SPIGMR +C KMP = number of vectors on which orthogonalization is +C done in the SPIGMR algorithm. The default is +C KMP = MAXL, which corresponds to complete GMRES +C iteration, as opposed to the incomplete form. +C NRMAX = maximum number of restarts of the SPIGMR C algorithm per nonlinear iteration. The default is C NRMAX = 5. C EPLI = convergence test constant in SPIGMR algorithm. C The default is EPLI = 0.05. -C Note that the length of RWORK depends on both MAXL +C Note that the length of RWORK depends on both MAXL C and KMP. See the definition of LRW below. C **** Are MAXL, KMP, and EPLI to be given their C default values ... @@ -513,7 +513,7 @@ C IWORK(26) = NRMAX (NRMAX .ge. 0) C RWORK(10) = EPLI (0 .lt. EPLI .lt. 1.0) **** C -C INFO(14) - used with INFO(11) > 0 (initial condition +C INFO(14) - used with INFO(11) > 0 (initial condition C calculation is requested). In this case, you may C request control to be returned to the calling program C immediately after the initial condition calculation, @@ -521,8 +521,8 @@ C (e.g. to examine the computed Y and YPRIME). C If this is done, and if the initialization succeeded C (IDID = 4), you should reset INFO(11) to 0 for the -C next call, to prevent the solver from repeating the -C initialization (and to avoid an infinite loop). +C next call, to prevent the solver from repeating the +C initialization (and to avoid an infinite loop). C **** Do you want to proceed to the integration after C the initial condition calculation is done ... C yes - set INFO(14) = 0 @@ -551,7 +551,7 @@ C preprocess any required Jacobian data. **** C C INFO(16) - option to exclude algebraic variables from -C the error test. +C the error test. C **** Do you wish to control errors locally on C all the variables... C yes - set INFO(16) = 0 @@ -562,14 +562,14 @@ C components (algebraic components are components C whose derivatives do not appear explicitly C in the function G(T,Y,YPRIME)). You must set: -C IWORK(LID+I) = +1 if Y(I) is a differential +C IWORK(LID+I) = +1 if Y(I) is a differential C variable, and C IWORK(LID+I) = -1 if Y(I) is an algebraic C variable, -C where LID = 40 if INFO(10) = 0 or 2 and +C where LID = 40 if INFO(10) = 0 or 2 and C LID = 40 + NEQ if INFO(10) = 1 or 3. C -C INFO(17) - used when INFO(11) > 0 (DDASPK is to do an +C INFO(17) - used when INFO(11) > 0 (DDASPK is to do an C initial condition calculation). C DDASPK uses several heuristic control quantities in the C initial condition calculation. They have default values, @@ -604,7 +604,7 @@ C less than EPINIT*EPCON, where EPCON = .33 is the C analogous test constant used in the time steps. C The default is EPINIT = .01. -C **** Are the initial condition heuristic controls to be +C **** Are the initial condition heuristic controls to be C given their default values... C yes - set INFO(17) = 0 C no - set INFO(17) = 1, @@ -616,7 +616,7 @@ C RWORK(14) = STPTOL (.GT. 0.0) C RWORK(15) = EPINIT (.GT. 0.0) **** C -C INFO(18) - option to get extra printing in initial condition +C INFO(18) - option to get extra printing in initial condition C calculation. C **** Do you wish to have extra printing... C no - set INFO(18) = 0 @@ -639,7 +639,7 @@ C The tolerances are used by the code in a local error C test at each step which requires roughly that C abs(local error in Y(i)) .le. EWT(i) , -C where EWT(i) = RTOL*abs(Y(i)) + ATOL is an error weight +C where EWT(i) = RTOL*abs(Y(i)) + ATOL is an error weight C quantity, for each vector component. C (More specifically, a root-mean-square norm is used to C measure the size of vectors, and the error test uses the @@ -656,7 +656,7 @@ C the computed Y is comparable to the error tolerances. C This code will usually, but not always, deliver a more C accurate solution if you reduce the tolerances and -C integrate again. By comparing two such solutions you +C integrate again. By comparing two such solutions you C can get a fairly reliable idea of the true error in the C solution at the larger tolerances. C @@ -700,7 +700,7 @@ C base = 50 + (MAXORD+5)*NEQ + (MAXL+3+MIN0(1,MAXL-KMP))*NEQ + C + (MAXL+3)*MAXL + 1 + LENWP. C See PSOL for description of LENWP. The default values are: -C MAXORD = 5 (see INFO(9)), MAXL = min(5,NEQ) and KMP = MAXL +C MAXORD = 5 (see INFO(9)), MAXL = min(5,NEQ) and KMP = MAXL C (see INFO(13)). C With the default values for MAXORD, MAXL and KMP, C base = 91 + 18*NEQ + LENWP. @@ -745,7 +745,7 @@ C (optionally) that relates to the Jacobian matrix of the C nonlinear system that the code must solve at each T step. C The role of JAC (and its call sequence) depends on whether -C a direct (INFO(12) = 0) or Krylov (INFO(12) = 1) method +C a direct (INFO(12) = 0) or Krylov (INFO(12) = 1) method C is selected. C C **** INFO(12) = 0 (direct methods): @@ -761,8 +761,8 @@ C The JAC routine must dimension Y, YPRIME, and PD (and RPAR C and IPAR if used). CJ is a scalar which is input to JAC. C For the given values of T, Y, and YPRIME, the JAC routine -C must evaluate the nonzero elements of the matrix A, and -C store these values in the array PD. The elements of PD are +C must evaluate the nonzero elements of the matrix A, and +C store these values in the array PD. The elements of PD are C set to zero before each call to JAC, so that only nonzero C elements need to be defined. C The way you store the elements into the PD array depends @@ -775,10 +775,10 @@ C PD(i,j) = dG(i)/dY(j) + CJ*dG(i)/dYPRIME(j). C *** INFO(6) = 1 (banded matrix with half-bandwidths ML, MU C as described under INFO(6)) *** -C Give PD a first dimension of 2*ML+MU+1. When you -C evaluate the nonzero partial derivatives of equation i -C (i.e. of G(i)) with respect to component j (of Y and -C YPRIME), you must store the element in PD according to +C Give PD a first dimension of 2*ML+MU+1. When you +C evaluate the nonzero partial derivatives of equation i +C (i.e. of G(i)) with respect to component j (of Y and +C YPRIME), you must store the element in PD according to C IROW = i - j + ML + MU + 1 C PD(IROW,j) = dG(i)/dY(j) + CJ*dG(i)/dYPRIME(j). C @@ -797,10 +797,10 @@ C The JAC routine must dimension Y, YPRIME, REWT, SAVR, WK, C and (if used) WP, IWP, RPAR, and IPAR. C The Y, YPRIME, and SAVR arrays contain the current values -C of Y, YPRIME, and the residual G, respectively. -C The array WK is work space of length NEQ. +C of Y, YPRIME, and the residual G, respectively. +C The array WK is work space of length NEQ. C H is the step size. CJ is a scalar, input to JAC, that is -C normally proportional to 1/H. REWT is an array of +C normally proportional to 1/H. REWT is an array of C reciprocal error weights, 1/EWT(i), where EWT(i) is C RTOL*abs(Y(i)) + ATOL (unless you supplied routine DDAWTS C instead), for use in JAC if needed. For example, if JAC @@ -814,13 +814,13 @@ C C WP and IWP are real and integer work arrays which you may C use for communication between your JAC routine and your -C PSOL routine. These may be used to store elements of the +C PSOL routine. These may be used to store elements of the C preconditioner P, or related matrix data (such as factored C forms). They are not altered by DDASPK. C If you do not need WP or IWP, ignore these parameters by C treating them as dummy arguments. If you do use them, C dimension them appropriately in your JAC and PSOL routines. -C See the PSOL description for instructions on setting +C See the PSOL description for instructions on setting C the lengths of WP and IWP. C C On return, JAC should set the error flag IER as follows.. @@ -839,23 +839,23 @@ C C PSOL -- This is the name of a routine you must supply if you have C selected a Krylov method (INFO(12) = 1) with preconditioning. -C In the direct case (INFO(12) = 0), PSOL can be absent -C (a dummy routine may have to be supplied to satisfy the -C loader). Otherwise, you must provide a PSOL routine to +C In the direct case (INFO(12) = 0), PSOL can be absent +C (a dummy routine may have to be supplied to satisfy the +C loader). Otherwise, you must provide a PSOL routine to C solve linear systems arising from preconditioning. -C When supplied with INFO(12) = 1, the PSOL routine is to +C When supplied with INFO(12) = 1, the PSOL routine is to C have the form C C SUBROUTINE PSOL (NEQ, T, Y, YPRIME, SAVR, WK, CJ, WGHT, C WP, IWP, B, EPLIN, IER, RPAR, IPAR) C -C The PSOL routine must solve linear systems of the form +C The PSOL routine must solve linear systems of the form C P*x = b where P is the left preconditioner matrix. C C The right-hand side vector b is in the B array on input, and C PSOL must return the solution vector x in B. C The Y, YPRIME, and SAVR arrays contain the current values -C of Y, YPRIME, and the residual G, respectively. +C of Y, YPRIME, and the residual G, respectively. C C Work space required by JAC and/or PSOL, and space for data to C be communicated from JAC to PSOL is made available in the form @@ -900,7 +900,7 @@ C C OPTIONALLY REPLACEABLE SUBROUTINE: C -C DDASPK uses a weighted root-mean-square norm to measure the +C DDASPK uses a weighted root-mean-square norm to measure the C size of various error vectors. The weights used in this norm C are set in the following subroutine: C @@ -914,13 +914,13 @@ C EWT(I) = RTOL(I)*ABS(Y(I)) + ATOL(I) C in the case of array tolerances (IWT = 1). (IWT is INFO(2).) C In some special cases, it may be appropriate for you to define -C your own error weights by writing a subroutine DDAWTS to be -C called instead of the version supplied. However, this should -C be attempted only after careful thought and consideration. -C If you supply this routine, you may use the tolerances and Y +C your own error weights by writing a subroutine DDAWTS to be +C called instead of the version supplied. However, this should +C be attempted only after careful thought and consideration. +C If you supply this routine, you may use the tolerances and Y C as appropriate, but do not overwrite these variables. You C may also use RPAR and IPAR to communicate data as appropriate. -C ***Note: Aside from the values of the weights, the choice of +C ***Note: Aside from the values of the weights, the choice of C norm used in DDASPK (weighted root-mean-square) is not subject C to replacement by the user. In this respect, DDASPK is not C downward-compatible with the original DDASSL solver (in which @@ -991,11 +991,11 @@ C to be singular (direct method). C C IDID = -9 -- the nonlinear system solver in the time integration -C failed to achieve convergence, and there were repeated +C failed to achieve convergence, and there were repeated C error test failures in this step. C -C IDID =-10 -- the nonlinear system solver in the time integration -C failed to achieve convergence because IRES was equal +C IDID =-10 -- the nonlinear system solver in the time integration +C failed to achieve convergence because IRES was equal C to -1. C C IDID =-11 -- IRES = -2 was encountered and control is @@ -1007,7 +1007,7 @@ C PSOL routine, and control is being returned to C the calling program. C -C IDID =-14 -- the Krylov linear system solver could not +C IDID =-14 -- the Krylov linear system solver could not C achieve convergence. C C IDID =-15,..,-32 -- Not applicable for this code. @@ -1029,9 +1029,9 @@ C values of RTOL and ATOL. C C RWORK, IWORK -- contain information which is usually of no interest -C to the user but necessary for subsequent calls. +C to the user but necessary for subsequent calls. C However, you may be interested in the performance data -C listed below. These quantities are accessed in RWORK +C listed below. These quantities are accessed in RWORK C and IWORK but have internal mnemonic names, as follows.. C C RWORK(3)--contains H, the step size h to be attempted @@ -1039,8 +1039,8 @@ C C RWORK(4)--contains TN, the current value of the C independent variable, i.e. the farthest point -C integration has reached. This will differ -C from T if interpolation has been performed +C integration has reached. This will differ +C from T if interpolation has been performed C (IDID = 3). C C RWORK(7)--contains HOLD, the stepsize used on the last @@ -1048,16 +1048,16 @@ C this contains the value of H used in the C initial condition calculation. C -C IWORK(7)--contains K, the order of the method to be +C IWORK(7)--contains K, the order of the method to be C attempted on the next step. C C IWORK(8)--contains KOLD, the order of the method used C on the last step. C -C IWORK(11)--contains NST, the number of steps (in T) +C IWORK(11)--contains NST, the number of steps (in T) C taken so far. C -C IWORK(12)--contains NRE, the number of calls to RES +C IWORK(12)--contains NRE, the number of calls to RES C so far. C C IWORK(13)--contains NJE, the number of calls to JAC so @@ -1075,12 +1075,12 @@ C failures of the linear iteration so far. C C IWORK(17)--contains LENIW, the length of IWORK actually -C required. This is defined on normal returns +C required. This is defined on normal returns C and on an illegal input return for C insufficient storage. C C IWORK(18)--contains LENRW, the length of RWORK actually -C required. This is defined on normal returns +C required. This is defined on normal returns C and on an illegal input return for C insufficient storage. C @@ -1095,7 +1095,7 @@ C far, for preconditioning solve operations or C for solutions with the user-supplied method. C -C Note: The various counters in IWORK do not include +C Note: The various counters in IWORK do not include C counts during a call made with INFO(11) > 0 and C INFO(14) = 1. C @@ -1113,9 +1113,9 @@ C to do is specify a new TOUT upon reaching the current TOUT. C C Do not alter any quantity not specifically permitted below. In -C particular do not alter NEQ, T, Y(*), YPRIME(*), RWORK(*), -C IWORK(*), or the differential equation in subroutine RES. Any -C such alteration constitutes a new problem and must be treated +C particular do not alter NEQ, T, Y(*), YPRIME(*), RWORK(*), +C IWORK(*), or the differential equation in subroutine RES. Any +C such alteration constitutes a new problem and must be treated C as such, i.e. you must start afresh. C C You cannot change from array to scalar error control or vice @@ -1151,7 +1151,7 @@ C IDID = 4, reset INFO(11) = 0 and call the code again to begin C the integration. (If you leave INFO(11) > 0 and C INFO(14) = 1, you may generate an infinite loop.) -C In this situation, the next call to DASPK is +C In this situation, the next call to DASPK is C considered to be the first call for the problem, C in that all initializations are done. C @@ -1177,7 +1177,7 @@ C IDID = -3, a solution component is zero and you set the C corresponding component of ATOL to zero. If you C are sure you want to continue, you must first alter -C the error criterion to use positive values of ATOL +C the error criterion to use positive values of ATOL C for those components corresponding to zero solution C components, then set INFO(1) = 1 and call the code C again. @@ -1228,14 +1228,14 @@ C cause before trying again. C C IDID = -12, DDASPK failed to compute the initial Y and YPRIME -C vectors. This could happen because the initial +C vectors. This could happen because the initial C approximation to Y or YPRIME was not very good, or C because no consistent values of these vectors exist. C The problem could also be caused by an inaccurate or C singular iteration matrix, or a poor preconditioner. C -C IDID = -13, there was an unrecoverable error encountered inside -C your PSOL routine. Determine the cause before +C IDID = -13, there was an unrecoverable error encountered inside +C your PSOL routine. Determine the cause before C trying again. C C IDID = -14, the Krylov linear system solver failed to achieve @@ -1263,7 +1263,7 @@ C 1. L. R. Petzold, A Description of DASSL: A Differential/Algebraic C System Solver, in Scientific Computing, R. S. Stepleman et al. C (Eds.), North-Holland, Amsterdam, 1983, pp. 65-68. -C 2. K. E. Brenan, S. L. Campbell, and L. R. Petzold, Numerical +C 2. K. E. Brenan, S. L. Campbell, and L. R. Petzold, Numerical C Solution of Initial-Value Problems in Differential-Algebraic C Equations, Elsevier, New York, 1989. C 3. P. N. Brown and A. C. Hindmarsh, Reduced Storage Matrix Methods @@ -1291,7 +1291,7 @@ C DDATRP performs interpolation to get an output solution. C DDWNRM computes the weighted root-mean-square norm of a vector. C D1MACH provides the unit roundoff of the computer. -C XERRWD/XSETF/XSETUN/IXSAV is a package to handle error messages. +C XERRWD/XSETF/XSETUN/IXSAV is a package to handle error messages. C DDASID nonlinear equation driver to initialize Y and YPRIME using C direct linear system solver methods. Interfaces to Newton C solver (direct case). @@ -1326,7 +1326,7 @@ C DORTH performs orthogonalization of Krylov basis vectors. C DHEQR performs QR factorization of Hessenberg matrix. C DHELS finds least-squares solution of Hessenberg linear system. -C DGETRF, DGETRS, DGBTRF, DGBTRS are LAPACK routines for solving +C DGETRF, DGETRS, DGBTRF, DGBTRS are LAPACK routines for solving C linear systems (dense or band direct methods). C DAXPY, DCOPY, DDOT, DNRM2, DSCAL are Basic Linear Algebra (BLAS) C routines. @@ -1350,7 +1350,7 @@ C C Set pointers into IWORK. C - PARAMETER (LML=1, LMU=2, LMTYPE=4, + PARAMETER (LML=1, LMU=2, LMTYPE=4, * LIWM=1, LMXORD=3, LJCALC=5, LPHASE=6, LK=7, LKOLD=8, * LNS=9, LNSTL=10, LNST=11, LNRE=12, LNJE=13, LETF=14, LNCFN=15, * LNCFL=16, LNIW=17, LNRW=18, LNNI=19, LNLI=20, LNPS=21, @@ -1493,7 +1493,7 @@ C Compute MTYPE, etc. Check ML and MU. C NCPHI = MAX(MXORD + 1, 4) - IF(INFO(6).EQ.0) THEN + IF(INFO(6).EQ.0) THEN LENPD = NEQ**2 LENRW = 50 + (NCPHI+3)*NEQ + LENPD IF(INFO(5).EQ.0) THEN @@ -1692,7 +1692,7 @@ HMIN = 4.0D0*UROUND*MAX(ABS(T),ABS(TOUT)) C C Set/check STPTOL control for initial condition calculation. -C +C IF (INFO(11) .NE. 0) THEN IF( INFO(17) .EQ. 0) THEN RWORK(LSTOL) = UROUND**.6667D0 @@ -1749,7 +1749,7 @@ C C Compute unknown components of initial Y and YPRIME, depending C on INFO(11) and INFO(12). INFO(12) represents the nonlinear -C solver type (direct/Krylov). Pass the name of the specific +C solver type (direct/Krylov). Pass the name of the specific C nonlinear solver, depending on INFO(12). The location of the work C arrays SAVR, YIC, YPIC, PWK also differ in the two cases. C
--- a/liboctave/cruft/daspk/ddstp.f +++ b/liboctave/cruft/daspk/ddstp.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DDSTP(X,Y,YPRIME,NEQ,RES,JAC,PSOL,H,WT,VT, @@ -18,11 +18,11 @@ C----------------------------------------------------------------------- C***DESCRIPTION C -C DDSTP solves a system of differential/algebraic equations of +C DDSTP solves a system of differential/algebraic equations of C the form G(X,Y,YPRIME) = 0, for one step (normally from X to X+H). C -C The methods used are modified divided difference, fixed leading -C coefficient forms of backward differentiation formulas. +C The methods used are modified divided difference, fixed leading +C coefficient forms of backward differentiation formulas. C The code adjusts the stepsize and order to control the local error C per step. C @@ -41,7 +41,7 @@ C nonlinear solver. See JAC description in DDASPK C prologue. C PSOL -- External user-supplied routine to solve -C a linear system using preconditioning. +C a linear system using preconditioning. C (This is optional). See PSOL in DDASPK prologue. C H -- Appropriate step size for next step. C Normally determined by the code. @@ -451,7 +451,7 @@ RETURN C C -C Go back and try this step again. +C Go back and try this step again. C If this is the first step, reset PSI(1) and rescale PHI(*,2). C 690 IF (KOLD .EQ. 0) THEN
--- a/liboctave/cruft/daspk/ddwnrm.f +++ b/liboctave/cruft/daspk/ddwnrm.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C DOUBLE PRECISION FUNCTION DDWNRM(NEQ,V,RWT,RPAR,IPAR)
--- a/liboctave/cruft/daspk/dfnrmd.f +++ b/liboctave/cruft/daspk/dfnrmd.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DFNRMD (NEQ, Y, T, YPRIME, R, CJ, WT, RES, IRES,
--- a/liboctave/cruft/daspk/dfnrmk.f +++ b/liboctave/cruft/daspk/dfnrmk.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DFNRMK (NEQ, Y, T, YPRIME, SAVR, R, CJ, WT,
--- a/liboctave/cruft/daspk/dhels.f +++ b/liboctave/cruft/daspk/dhels.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DHELS (A, LDA, N, Q, B) @@ -51,7 +51,7 @@ C C----------------------------------------------------------------------- C***ROUTINES CALLED -C DAXPY +C DAXPY C C***END PROLOGUE DHELS C
--- a/liboctave/cruft/daspk/dheqr.f +++ b/liboctave/cruft/daspk/dheqr.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DHEQR (A, LDA, N, Q, INFO, IJOB)
--- a/liboctave/cruft/daspk/dinvwt.f +++ b/liboctave/cruft/daspk/dinvwt.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DINVWT(NEQ,WT,IER)
--- a/liboctave/cruft/daspk/dlinsd.f +++ b/liboctave/cruft/daspk/dlinsd.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DLINSD (NEQ, Y, T, YPRIME, CJ, P, PNRM, WT, LSOFF, @@ -18,7 +18,7 @@ C***DESCRIPTION C C DLINSD uses a linesearch algorithm to calculate a new (Y,YPRIME) -C pair (YNEW,YPNEW) such that +C pair (YNEW,YPNEW) such that C C f(YNEW,YPNEW) .le. (1 - 2*ALPHA*RL)*f(Y,YPRIME) , C @@ -51,11 +51,11 @@ C YPNEW -- Array of length NEQ used to hold the new YPRIME in C performing the linesearch. C Y -- Array of length NEQ containing the new Y (i.e.,=YNEW). -C YPRIME -- Array of length NEQ containing the new YPRIME +C YPRIME -- Array of length NEQ containing the new YPRIME C (i.e.,=YPNEW). C FNRM -- Real scalar containing SQRT(2*f(Y,YPRIME)) for the C current (Y,YPRIME) on input and output. -C R -- Work array of length NEQ, containing the scaled +C R -- Work array of length NEQ, containing the scaled C residual (J-inverse)*G(t,y,y') on return. C IRET -- Return flag. C IRET=0 means that a satisfactory (Y,YPRIME) was found. @@ -96,7 +96,7 @@ RL = ONE C----------------------------------------------------------------------- C Check for violations of the constraints, if any are imposed. -C If any violations are found, the step vector P is rescaled, and the +C If any violations are found, the step vector P is rescaled, and the C constraint check is repeated, until no violations are found. C----------------------------------------------------------------------- IF (ICNFLG .NE. 0) THEN @@ -166,7 +166,7 @@ RETURN C----------------------------------------------------------------------- C Alpha-condition not satisfied. Perform backtrack to compute new RL -C value. If no satisfactory YNEW,YPNEW can be found sufficiently +C value. If no satisfactory YNEW,YPNEW can be found sufficiently C distinct from Y,YPRIME, then return IRET = 1. C----------------------------------------------------------------------- 200 CONTINUE
--- a/liboctave/cruft/daspk/dlinsk.f +++ b/liboctave/cruft/daspk/dlinsk.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DLINSK (NEQ, Y, T, YPRIME, SAVR, CJ, P, PNRM, WT, @@ -18,13 +18,13 @@ C***DESCRIPTION C C DLINSK uses a linesearch algorithm to calculate a new (Y,YPRIME) -C pair (YNEW,YPNEW) such that +C pair (YNEW,YPNEW) such that C -C f(YNEW,YPNEW) .le. (1 - 2*ALPHA*RL)*f(Y,YPRIME) + +C f(YNEW,YPNEW) .le. (1 - 2*ALPHA*RL)*f(Y,YPRIME) + C ALPHA*RL*RHOK*RHOK , C C where 0 < RL <= 1, and RHOK is the scaled preconditioned norm of -C the final residual vector in the Krylov iteration. +C the final residual vector in the Krylov iteration. C Here, f(y,y') is defined as C C f(y,y') = (1/2)*norm( (P-inverse)*G(t,y,y') )**2 , @@ -40,7 +40,7 @@ C P -- Approximate Newton step used in backtracking. C PNRM -- Weighted RMS norm of P. C LSOFF -- Flag showing whether the linesearch algorithm is -C to be invoked. 0 means do the linesearch, +C to be invoked. 0 means do the linesearch, C 1 means turn off linesearch. C STPTOL -- Tolerance used in calculating the minimum lambda C value allowed. @@ -58,7 +58,7 @@ C performing the linesearch. C PWK -- Work vector of length NEQ for use in PSOL. C Y -- Array of length NEQ containing the new Y (i.e.,=YNEW). -C YPRIME -- Array of length NEQ containing the new YPRIME +C YPRIME -- Array of length NEQ containing the new YPRIME C (i.e.,=YPNEW). C FNRM -- Real scalar containing SQRT(2*f(Y,YPRIME)) for the C current (Y,YPRIME) on input and output. @@ -101,7 +101,7 @@ RL = ONE C----------------------------------------------------------------------- C Check for violations of the constraints, if any are imposed. -C If any violations are found, the step vector P is rescaled, and the +C If any violations are found, the step vector P is rescaled, and the C constraint check is repeated, until no violations are found. C----------------------------------------------------------------------- IF (ICNFLG .NE. 0) THEN
--- a/liboctave/cruft/daspk/dmatd.f +++ b/liboctave/cruft/daspk/dmatd.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DMATD(NEQ,X,Y,YPRIME,DELTA,CJ,H,IER,EWT,E,
--- a/liboctave/cruft/daspk/dnedd.f +++ b/liboctave/cruft/daspk/dnedd.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DNEDD(X,Y,YPRIME,NEQ,RES,JACD,PDUM,H,WT, @@ -121,7 +121,7 @@ C IERTYP -- Flag which tells whether this subroutine is correct. C 0 ==> correct subroutine. C 1 ==> incorrect subroutine. -C +C C----------------------------------------------------------------------- C***ROUTINES CALLED C DDWNRM, RES, DMATD, DNSD @@ -192,14 +192,14 @@ 330 CONTINUE PNORM = DDWNRM (NEQ,Y,WT,RPAR,IPAR) TOLNEW = 100.D0*UROUND*PNORM -C +C C Call RES to initialize DELTA. C IWM(LNRE)=IWM(LNRE)+1 CALL RES(X,Y,YPRIME,CJ,DELTA,IRES,RPAR,IPAR) IF (IRES .LT. 0) GO TO 380 C -C If indicated, reevaluate the iteration matrix +C If indicated, reevaluate the iteration matrix C J = dG/dY + CJ*dG/dYPRIME (where G(X,Y,YPRIME)=0). C Set JCALC to 0 as an indicator that this has been done. C
--- a/liboctave/cruft/daspk/dnedk.f +++ b/liboctave/cruft/daspk/dnedk.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DNEDK(X,Y,YPRIME,NEQ,RES,JACK,PSOL, @@ -37,7 +37,7 @@ C See JAC description for the case C INFO(12) = 1 in the DDASPK prologue. C PSOL -- External user-supplied routine to solve -C a linear system using preconditioning. +C a linear system using preconditioning. C (This is optional). See explanation inside DDASPK. C H -- Appropriate step size for this step. C WT -- Vector of weights for error criterion.
--- a/liboctave/cruft/daspk/dnsd.f +++ b/liboctave/cruft/daspk/dnsd.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DNSD(X,Y,YPRIME,NEQ,RES,PDUM,WT,RPAR,IPAR, @@ -90,7 +90,7 @@ C PARAMETER (LNRE=12, LNNI=19) C -C Initialize Newton counter M and accumulation vector E. +C Initialize Newton counter M and accumulation vector E. C M = 0 DO 100 I=1,NEQ
--- a/liboctave/cruft/daspk/dnsid.f +++ b/liboctave/cruft/daspk/dnsid.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DNSID(X,Y,YPRIME,NEQ,ICOPT,ID,RES,WT,RPAR,IPAR, @@ -42,7 +42,7 @@ C such as the matrix of partial derivatives, C permutation vector, and various other information. C CJ -- Matrix parameter = 1/H (ICOPT = 1) or 0 (ICOPT = 2). -C R -- Array of length NEQ used as workspace by the +C R -- Array of length NEQ used as workspace by the C linesearch routine DLINSD. C YIC,YPIC -- Work vectors for DLINSD, each of length NEQ. C EPCON -- Tolerance to test for convergence of the Newton @@ -54,7 +54,7 @@ C value allowed. C ICNFLG -- Integer scalar. If nonzero, then constraint C violations in the proposed new approximate solution -C will be checked for, and the maximum step length +C will be checked for, and the maximum step length C will be adjusted accordingly. C ICNSTR -- Integer array of length NEQ containing flags for C checking constraints. @@ -133,7 +133,7 @@ C another iteration. C CALL DCOPY (NEQ, R, 1, DELTA, 1) - DELNRM = FNRM + DELNRM = FNRM GO TO 300 C C The maximum number of iterations was done. Set IERNEW and return.
--- a/liboctave/cruft/daspk/dnsik.f +++ b/liboctave/cruft/daspk/dnsik.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DNSIK(X,Y,YPRIME,NEQ,ICOPT,ID,RES,PSOL,WT,RPAR,IPAR, @@ -35,7 +35,7 @@ C to evaluate the residual. See RES description C in DDASPK prologue. C PSOL -- External user-supplied routine to solve -C a linear system using preconditioning. +C a linear system using preconditioning. C See explanation inside DDASPK. C WT -- Vector of weights for error criterion. C RPAR,IPAR -- Real and integer arrays used for communication @@ -179,7 +179,7 @@ IERNEW = -1 ELSE IERNEW = 3 - IF (IRES .EQ. 0 .AND. IERSL .EQ. 1 .AND. M .GE. 2 + IF (IRES .EQ. 0 .AND. IERSL .EQ. 1 .AND. M .GE. 2 1 .AND. RATE .LT. 1.0D0) IERNEW = 1 ENDIF RETURN
--- a/liboctave/cruft/daspk/dnsk.f +++ b/liboctave/cruft/daspk/dnsk.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DNSK(X,Y,YPRIME,NEQ,RES,PSOL,WT,RPAR,IPAR, @@ -32,7 +32,7 @@ C to evaluate the residual. See RES description C in DDASPK prologue. C PSOL -- External user-supplied routine to solve -C a linear system using preconditioning. +C a linear system using preconditioning. C See explanation inside DDASPK. C WT -- Vector of weights for error criterion. C RPAR,IPAR -- Real and integer arrays used for communication
--- a/liboctave/cruft/daspk/dorth.f +++ b/liboctave/cruft/daspk/dorth.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DORTH (VNEW, V, HES, N, LL, LDHES, KMP, SNORMW) @@ -50,7 +50,7 @@ C C----------------------------------------------------------------------- C***ROUTINES CALLED -C DDOT, DNRM2, DAXPY +C DDOT, DNRM2, DAXPY C C***END PROLOGUE DORTH C
--- a/liboctave/cruft/daspk/dslvd.f +++ b/liboctave/cruft/daspk/dslvd.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DSLVD(NEQ,DELTA,WM,IWM) @@ -49,7 +49,7 @@ C Banded matrix. C 400 MEBAND=2*IWM(LML)+IWM(LMU)+1 - CALL DGBTRS('N', NEQ, IWM(LML), IWM(LMU), 1, WM, MEBAND, + CALL DGBTRS('N', NEQ, IWM(LML), IWM(LMU), 1, WM, MEBAND, * IWM(LIPVT), DELTA, NEQ, INLPCK) RETURN C
--- a/liboctave/cruft/daspk/dslvk.f +++ b/liboctave/cruft/daspk/dslvk.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DSLVK (NEQ, Y, TN, YPRIME, SAVR, X, EWT, WM, IWM, @@ -43,15 +43,15 @@ INTEGER NEQ, IWM, IRES, IERSL, IPAR DOUBLE PRECISION Y, TN, YPRIME, SAVR, X, EWT, WM, CJ, EPLIN, 1 SQRTN, RSQRTN, RHOK, RPAR - DIMENSION Y(*), YPRIME(*), SAVR(*), X(*), EWT(*), + DIMENSION Y(*), YPRIME(*), SAVR(*), X(*), EWT(*), 1 WM(*), IWM(*), RPAR(*), IPAR(*) C INTEGER IFLAG, IRST, NRSTS, NRMAX, LR, LDL, LHES, LGMR, LQ, LV, 1 LWK, LZ, MAXLP1, NPSL INTEGER NLI, NPS, NCFL, NRE, MAXL, KMP, MITER EXTERNAL RES, PSOL -C - PARAMETER (LNRE=12, LNCFL=16, LNLI=20, LNPS=21) +C + PARAMETER (LNRE=12, LNCFL=16, LNLI=20, LNPS=21) PARAMETER (LLOCWP=29, LLCIWP=30) PARAMETER (LMITER=23, LMAXL=24, LKMP=25, LNRMAX=26) C @@ -67,9 +67,9 @@ NCFL = IWM(LNCFL) NRE = IWM(LNRE) LWP = IWM(LLOCWP) - MAXL = IWM(LMAXL) + MAXL = IWM(LMAXL) KMP = IWM(LKMP) - NRMAX = IWM(LNRMAX) + NRMAX = IWM(LNRMAX) MITER = IWM(LMITER) IERSL = 0 IRES = 0 @@ -113,7 +113,7 @@ NPS = NPS + NPSL NRE = NRE + NRES DO 120 I = 1,NEQ - 120 X(I) = X(I) + WM(LZ+I-1) + 120 X(I) = X(I) + WM(LZ+I-1) IF ((IFLAG .EQ. 1) .AND. (NRSTS .LT. NRMAX) .AND. (IRES .EQ. 0)) 1 GO TO 115 C----------------------------------------------------------------------- @@ -124,8 +124,8 @@ NCFL = NCFL + 1 ELSE IF (IFLAG .NE. 0) THEN NCFL = NCFL + 1 - IF (IFLAG .GT. 0) IERSL = 1 - IF (IFLAG .LT. 0) IERSL = -1 + IF (IFLAG .GT. 0) IERSL = 1 + IF (IFLAG .LT. 0) IERSL = -1 ENDIF C----------------------------------------------------------------------- C Update IWM with counters, rescale EWT, and return.
--- a/liboctave/cruft/daspk/dspigm.f +++ b/liboctave/cruft/daspk/dspigm.f @@ -1,5 +1,5 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C SUBROUTINE DSPIGM (NEQ, TN, Y, YPRIME, SAVR, R, WGHT, MAXL, @@ -50,7 +50,7 @@ C C EPLIN = Tolerance on residuals R-A*Z in weighted rms norm. C -C CJ = Scalar proportional to current value of +C CJ = Scalar proportional to current value of C 1/(step size H). C C WK = Real work array used by routine DATV and PSOL. @@ -100,7 +100,7 @@ C C IRES = Error flag from RES. C -C DL = Scaled preconditioned residual, +C DL = Scaled preconditioned residual, C (D-inverse)*(P-inverse)*(R-A*Z). Only loaded when C performing restarts of the Krylov iteration. C @@ -255,7 +255,7 @@ C----------------------------------------------------------------------- C The tolerance was not met, but the residual norm was reduced. C If performing restarting (IRST .gt. 0) calculate the residual vector -C RL and store it in the DL array. If the incomplete version is +C RL and store it in the DL array. If the incomplete version is C being used (KMP .lt. MAXL) then DL has already been calculated. C----------------------------------------------------------------------- IF (IRST .GT. 0) THEN
--- a/liboctave/cruft/daspk/dyypnw.f +++ b/liboctave/cruft/daspk/dyypnw.f @@ -1,8 +1,8 @@ C Work performed under the auspices of the U.S. Department of Energy -C by Lawrence Livermore National Laboratory under contract number +C by Lawrence Livermore National Laboratory under contract number C W-7405-Eng-48. C - SUBROUTINE DYYPNW (NEQ, Y, YPRIME, CJ, RL, P, ICOPT, ID, + SUBROUTINE DYYPNW (NEQ, Y, YPRIME, CJ, RL, P, ICOPT, ID, * YNEW, YPNEW) C C***BEGIN PROLOGUE DYYPNW
--- a/liboctave/cruft/dasrt/ddasrt.f +++ b/liboctave/cruft/dasrt/ddasrt.f @@ -854,7 +854,7 @@ C --------------------------------------------------------------------- C C***REFERENCE -C K. E. Brenan, S. L. Campbell, and L. R. Petzold, Numerical +C K. E. Brenan, S. L. Campbell, and L. R. Petzold, Numerical C Solution of Initial-Value Problems in Differential-Algebraic C Equations, Elsevier, New York, 1989. C @@ -1284,7 +1284,7 @@ IF (INFO(7) .EQ. 0) GO TO 526 RH = ABS(H)/RWORK(LHMAX) IF (RH .GT. 1.0D0) H = H/RH -526 CONTINUE +526 CONTINUE C CALL DDASTP(TN,Y,YPRIME,NEQ, * RES,JAC,H,RWORK(LWT),INFO(1),IDID,RPAR,IPAR,
--- a/liboctave/cruft/dasrt/drchek.f +++ b/liboctave/cruft/dasrt/drchek.f @@ -60,7 +60,7 @@ C STORED IN THE GLOBAL ARRAY IWORK. C INFO3 = COPY OF INFO(3) (INPUT ONLY). C----------------------------------------------------------------------- -C +C H = PSI(1) IRT = 0 DO 10 I = 1,NG
--- a/liboctave/cruft/dassl/ddaslv.f +++ b/liboctave/cruft/dassl/ddaslv.f @@ -45,7 +45,7 @@ GO TO(100,100,300,400,400),MTYPE C C DENSE MATRIX -100 CALL DGETRS('N', NEQ, 1, WM(NPD), NEQ, IWM(LIPVT), DELTA, NEQ, +100 CALL DGETRS('N', NEQ, 1, WM(NPD), NEQ, IWM(LIPVT), DELTA, NEQ, * INFO) RETURN C @@ -55,7 +55,7 @@ C C BANDED MATRIX 400 MEBAND=2*IWM(LML)+IWM(LMU)+1 - CALL DGBTRS ('N', NEQ, IWM(LML), IWM(LMU), 1, WM(NPD), MEBAND, + CALL DGBTRS ('N', NEQ, IWM(LML), IWM(LMU), 1, WM(NPD), MEBAND, * IWM(LIPVT), DELTA, NEQ, INLPCK) RETURN C------END OF SUBROUTINE DDASLV------
--- a/liboctave/cruft/dassl/ddassl.f +++ b/liboctave/cruft/dassl/ddassl.f @@ -1314,7 +1314,7 @@ IF (INFO(7) .EQ. 0) GO TO 526 RH = ABS(H)/RWORK(LHMAX) IF (RH .GT. 1.0D0) H = H/RH -526 CONTINUE +526 CONTINUE C CALL DDASTP(TN,Y,YPRIME,NEQ, * RES,JAC,H,RWORK(LWT),INFO(1),IDID,RPAR,IPAR,
--- a/liboctave/cruft/misc/blaswrap.c +++ b/liboctave/cruft/misc/blaswrap.c @@ -149,7 +149,7 @@ #define F2C_LAPACK_CALL(name, args) F2C_LAPACK_CALL_ ## args (name) #define ENUM_ITEM(name, args) \ - f2c_ ## name, + f2c_ ## name, #define NAME_TO_STRING_CASE(name, args) \ case f2c_ ## name: return #name;
--- a/liboctave/cruft/misc/module.mk +++ b/liboctave/cruft/misc/module.mk @@ -1,6 +1,6 @@ EXTRA_DIST += \ misc/module.mk \ - misc/d1mach-tst.for + misc/d1mach-tst.for libcruft_la_SOURCES += \ misc/blaswrap.c \
--- a/liboctave/cruft/odepack/cfode.f +++ b/liboctave/cruft/odepack/cfode.f @@ -10,19 +10,19 @@ C CFODE IS CALLED BY THE INTEGRATOR ROUTINE TO SET COEFFICIENTS C NEEDED THERE. THE COEFFICIENTS FOR THE CURRENT METHOD, AS C GIVEN BY THE VALUE OF METH, ARE SET FOR ALL ORDERS AND SAVED. -C THE MAXIMUM ORDER ASSUMED HERE IS 12 IF METH = 1 AND 5 IF METH = 2. +C THE MAXIMUM ORDER ASSUMED HERE IS 12 IF METH = 1 AND 5 IF METH = 2. C (A SMALLER VALUE OF THE MAXIMUM ORDER IS ALSO ALLOWED.) C CFODE IS CALLED ONCE AT THE BEGINNING OF THE PROBLEM, -C AND IS NOT CALLED AGAIN UNLESS AND UNTIL METH IS CHANGED. +C AND IS NOT CALLED AGAIN UNLESS AND UNTIL METH IS CHANGED. C C THE ELCO ARRAY CONTAINS THE BASIC METHOD COEFFICIENTS. C THE COEFFICIENTS EL(I), 1 .LE. I .LE. NQ+1, FOR THE METHOD OF -C ORDER NQ ARE STORED IN ELCO(I,NQ). THEY ARE GIVEN BY A GENETRATING -C POLYNOMIAL, I.E., +C ORDER NQ ARE STORED IN ELCO(I,NQ). THEY ARE GIVEN BY A GENETRATING +C POLYNOMIAL, I.E., C L(X) = EL(1) + EL(2)*X + ... + EL(NQ+1)*X**NQ. C FOR THE IMPLICIT ADAMS METHODS, L(X) IS GIVEN BY -C DL/DX = (X+1)*(X+2)*...*(X+NQ-1)/FACTORIAL(NQ-1), L(-1) = 0. -C FOR THE BDF METHODS, L(X) IS GIVEN BY +C DL/DX = (X+1)*(X+2)*...*(X+NQ-1)/FACTORIAL(NQ-1), L(-1) = 0. +C FOR THE BDF METHODS, L(X) IS GIVEN BY C L(X) = (X+1)*(X+2)* ... *(X+NQ)/K, C WHERE K = FACTORIAL(NQ)*(1 + 1/2 + ... + 1/NQ). C @@ -42,8 +42,8 @@ TESCO(2,1) = 2.0D0 TESCO(1,2) = 1.0D0 TESCO(3,12) = 0.0D0 - PC(1) = 1.0D0 - RQFAC = 1.0D0 + PC(1) = 1.0D0 + RQFAC = 1.0D0 DO 140 NQ = 2,12 C----------------------------------------------------------------------- C THE PC ARRAY WILL CONTAIN THE COEFFICIENTS OF THE POLYNOMIAL @@ -53,13 +53,13 @@ RQ1FAC = RQFAC RQFAC = RQFAC/DBLE(NQ) NQM1 = NQ - 1 - FNQM1 = DBLE(NQM1) + FNQM1 = DBLE(NQM1) NQP1 = NQ + 1 C FORM COEFFICIENTS OF P(X)*(X+NQ-1). ---------------------------------- PC(NQ) = 0.0D0 DO 110 IB = 1,NQM1 I = NQP1 - IB - 110 PC(I) = PC(I-1) + FNQM1*PC(I) + 110 PC(I) = PC(I-1) + FNQM1*PC(I) PC(1) = FNQM1*PC(1) C COMPUTE INTEGRAL, -1 TO 0, OF P(X) AND X*P(X). ----------------------- PINT = PC(1) @@ -67,22 +67,22 @@ TSIGN = 1.0D0 DO 120 I = 2,NQ TSIGN = -TSIGN - PINT = PINT + TSIGN*PC(I)/DBLE(I) - 120 XPIN = XPIN + TSIGN*PC(I)/DBLE(I+1) + PINT = PINT + TSIGN*PC(I)/DBLE(I) + 120 XPIN = XPIN + TSIGN*PC(I)/DBLE(I+1) C STORE COEFFICIENTS IN ELCO AND TESCO. -------------------------------- ELCO(1,NQ) = PINT*RQ1FAC ELCO(2,NQ) = 1.0D0 DO 130 I = 2,NQ - 130 ELCO(I+1,NQ) = RQ1FAC*PC(I)/DBLE(I) + 130 ELCO(I+1,NQ) = RQ1FAC*PC(I)/DBLE(I) AGAMQ = RQFAC*XPIN RAGQ = 1.0D0/AGAMQ TESCO(2,NQ) = RAGQ - IF (NQ .LT. 12) TESCO(1,NQP1) = RAGQ*RQFAC/DBLE(NQP1) + IF (NQ .LT. 12) TESCO(1,NQP1) = RAGQ*RQFAC/DBLE(NQP1) TESCO(3,NQM1) = RAGQ 140 CONTINUE RETURN C - 200 PC(1) = 1.0D0 + 200 PC(1) = 1.0D0 RQ1FAC = 1.0D0 DO 230 NQ = 1,5 C----------------------------------------------------------------------- @@ -90,7 +90,7 @@ C P(X) = (X+1)*(X+2)*...*(X+NQ). C INITIALLY, P(X) = 1. C----------------------------------------------------------------------- - FNQ = DBLE(NQ) + FNQ = DBLE(NQ) NQP1 = NQ + 1 C FORM COEFFICIENTS OF P(X)*(X+NQ). ------------------------------------ PC(NQP1) = 0.0D0 @@ -103,10 +103,10 @@ 220 ELCO(I,NQ) = PC(I)/PC(2) ELCO(2,NQ) = 1.0D0 TESCO(1,NQ) = RQ1FAC - TESCO(2,NQ) = DBLE(NQP1)/ELCO(1,NQ) - TESCO(3,NQ) = DBLE(NQ+2)/ELCO(1,NQ) + TESCO(2,NQ) = DBLE(NQP1)/ELCO(1,NQ) + TESCO(3,NQ) = DBLE(NQ+2)/ELCO(1,NQ) RQ1FAC = RQ1FAC/FNQ 230 CONTINUE RETURN C----------------------- END OF SUBROUTINE CFODE ----------------------- - END + END
--- a/liboctave/cruft/odepack/dlsode.f +++ b/liboctave/cruft/odepack/dlsode.f @@ -5,7 +5,7 @@ DOUBLE PRECISION Y, T, TOUT, RTOL, ATOL, RWORK DIMENSION NEQ(*), Y(*), RTOL(*), ATOL(*), RWORK(LRW), IWORK(LIW) C----------------------------------------------------------------------- -C THIS IS THE MARCH 30, 1987 VERSION OF +C THIS IS THE MARCH 30, 1987 VERSION OF C LSODE.. LIVERMORE SOLVER FOR ORDINARY DIFFERENTIAL EQUATIONS. C THIS VERSION IS IN DOUBLE PRECISION. C @@ -13,7 +13,7 @@ C SYSTEMS OF FIRST ORDER ODE-S, C DY/DT = F(T,Y) , OR, IN COMPONENT FORM, C DY(I)/DT = F(I) = F(I,T,Y(1),Y(2),...,Y(NEQ)) (I = 1,...,NEQ). -C LSODE IS A PACKAGE BASED ON THE GEAR AND GEARB PACKAGES, AND ON THE +C LSODE IS A PACKAGE BASED ON THE GEAR AND GEARB PACKAGES, AND ON THE C OCTOBER 23, 1978 VERSION OF THE TENTATIVE ODEPACK USER INTERFACE C STANDARD, WITH MINOR MODIFICATIONS. C----------------------------------------------------------------------- @@ -23,18 +23,18 @@ C NORTH-HOLLAND, AMSTERDAM, 1983, PP. 55-64. C----------------------------------------------------------------------- C AUTHOR AND CONTACT.. ALAN C. HINDMARSH, -C COMPUTING AND MATHEMATICS RESEARCH DIV., L-316 +C COMPUTING AND MATHEMATICS RESEARCH DIV., L-316 C LAWRENCE LIVERMORE NATIONAL LABORATORY C LIVERMORE, CA 94550. C----------------------------------------------------------------------- -C SUMMARY OF USAGE. +C SUMMARY OF USAGE. C C COMMUNICATION BETWEEN THE USER AND THE LSODE PACKAGE, FOR NORMAL C SITUATIONS, IS SUMMARIZED HERE. THIS SUMMARY DESCRIBES ONLY A SUBSET -C OF THE FULL SET OF OPTIONS AVAILABLE. SEE THE FULL DESCRIPTION FOR +C OF THE FULL SET OF OPTIONS AVAILABLE. SEE THE FULL DESCRIPTION FOR C DETAILS, INCLUDING OPTIONAL COMMUNICATION, NONSTANDARD OPTIONS, C AND INSTRUCTIONS FOR SPECIAL SITUATIONS. SEE ALSO THE EXAMPLE -C PROBLEM (WITH PROGRAM AND OUTPUT) FOLLOWING THIS SUMMARY. +C PROBLEM (WITH PROGRAM AND OUTPUT) FOLLOWING THIS SUMMARY. C C A. FIRST PROVIDE A SUBROUTINE OF THE FORM.. C SUBROUTINE F (NEQ, T, Y, YDOT, IERR) @@ -43,16 +43,16 @@ C C B. NEXT DETERMINE (OR GUESS) WHETHER OR NOT THE PROBLEM IS STIFF. C STIFFNESS OCCURS WHEN THE JACOBIAN MATRIX DF/DY HAS AN EIGENVALUE -C WHOSE REAL PART IS NEGATIVE AND LARGE IN MAGNITUDE, COMPARED TO THE +C WHOSE REAL PART IS NEGATIVE AND LARGE IN MAGNITUDE, COMPARED TO THE C RECIPROCAL OF THE T SPAN OF INTEREST. IF THE PROBLEM IS NONSTIFF, -C USE A METHOD FLAG MF = 10. IF IT IS STIFF, THERE ARE FOUR STANDARD +C USE A METHOD FLAG MF = 10. IF IT IS STIFF, THERE ARE FOUR STANDARD C CHOICES FOR MF, AND LSODE REQUIRES THE JACOBIAN MATRIX IN SOME FORM. C THIS MATRIX IS REGARDED EITHER AS FULL (MF = 21 OR 22), C OR BANDED (MF = 24 OR 25). IN THE BANDED CASE, LSODE REQUIRES TWO C HALF-BANDWIDTH PARAMETERS ML AND MU. THESE ARE, RESPECTIVELY, THE -C WIDTHS OF THE LOWER AND UPPER PARTS OF THE BAND, EXCLUDING THE MAIN +C WIDTHS OF THE LOWER AND UPPER PARTS OF THE BAND, EXCLUDING THE MAIN C DIAGONAL. THUS THE BAND CONSISTS OF THE LOCATIONS (I,J) WITH -C I-ML .LE. J .LE. I+MU, AND THE FULL BANDWIDTH IS ML+MU+1. +C I-ML .LE. J .LE. I+MU, AND THE FULL BANDWIDTH IS ML+MU+1. C C C. IF THE PROBLEM IS STIFF, YOU ARE ENCOURAGED TO SUPPLY THE JACOBIAN C DIRECTLY (MF = 21 OR 24), BUT IF THIS IS NOT FEASIBLE, LSODE WILL @@ -60,30 +60,30 @@ C IF YOU ARE SUPPLYING THE JACOBIAN, PROVIDE A SUBROUTINE OF THE FORM.. C SUBROUTINE JAC (NEQ, T, Y, ML, MU, PD, NROWPD) C DIMENSION Y(NEQ), PD(NROWPD,NEQ) -C WHICH SUPPLIES DF/DY BY LOADING PD AS FOLLOWS.. +C WHICH SUPPLIES DF/DY BY LOADING PD AS FOLLOWS.. C FOR A FULL JACOBIAN (MF = 21), LOAD PD(I,J) WITH DF(I)/DY(J), C THE PARTIAL DERIVATIVE OF F(I) WITH RESPECT TO Y(J). (IGNORE THE C ML AND MU ARGUMENTS IN THIS CASE.) C FOR A BANDED JACOBIAN (MF = 24), LOAD PD(I-J+MU+1,J) WITH -C DF(I)/DY(J), I.E. LOAD THE DIAGONAL LINES OF DF/DY INTO THE ROWS OF +C DF(I)/DY(J), I.E. LOAD THE DIAGONAL LINES OF DF/DY INTO THE ROWS OF C PD FROM THE TOP DOWN. -C IN EITHER CASE, ONLY NONZERO ELEMENTS NEED BE LOADED. +C IN EITHER CASE, ONLY NONZERO ELEMENTS NEED BE LOADED. C C D. WRITE A MAIN PROGRAM WHICH CALLS SUBROUTINE LSODE ONCE FOR C EACH POINT AT WHICH ANSWERS ARE DESIRED. THIS SHOULD ALSO PROVIDE C FOR POSSIBLE USE OF LOGICAL UNIT 6 FOR OUTPUT OF ERROR MESSAGES C BY LSODE. ON THE FIRST CALL TO LSODE, SUPPLY ARGUMENTS AS FOLLOWS.. -C F = NAME OF SUBROUTINE FOR RIGHT-HAND SIDE VECTOR F. +C F = NAME OF SUBROUTINE FOR RIGHT-HAND SIDE VECTOR F. C THIS NAME MUST BE DECLARED EXTERNAL IN CALLING PROGRAM. -C NEQ = NUMBER OF FIRST ORDER ODE-S. +C NEQ = NUMBER OF FIRST ORDER ODE-S. C Y = ARRAY OF INITIAL VALUES, OF LENGTH NEQ. C T = THE INITIAL VALUE OF THE INDEPENDENT VARIABLE. C TOUT = FIRST POINT WHERE OUTPUT IS DESIRED (.NE. T). C ITOL = 1 OR 2 ACCORDING AS ATOL (BELOW) IS A SCALAR OR ARRAY. -C RTOL = RELATIVE TOLERANCE PARAMETER (SCALAR). +C RTOL = RELATIVE TOLERANCE PARAMETER (SCALAR). C ATOL = ABSOLUTE TOLERANCE PARAMETER (SCALAR OR ARRAY). -C THE ESTIMATED LOCAL ERROR IN Y(I) WILL BE CONTROLLED SO AS -C TO BE ROUGHLY LESS (IN MAGNITUDE) THAN +C THE ESTIMATED LOCAL ERROR IN Y(I) WILL BE CONTROLLED SO AS +C TO BE ROUGHLY LESS (IN MAGNITUDE) THAN C EWT(I) = RTOL*ABS(Y(I)) + ATOL IF ITOL = 1, OR C EWT(I) = RTOL*ABS(Y(I)) + ATOL(I) IF ITOL = 2. C THUS THE LOCAL ERROR TEST PASSES IF, IN EACH COMPONENT, @@ -92,10 +92,10 @@ C USE RTOL = 0.0 FOR PURE ABSOLUTE ERROR CONTROL, AND C USE ATOL = 0.0 (OR ATOL(I) = 0.0) FOR PURE RELATIVE ERROR C CONTROL. CAUTION.. ACTUAL (GLOBAL) ERRORS MAY EXCEED THESE -C LOCAL TOLERANCES, SO CHOOSE THEM CONSERVATIVELY. +C LOCAL TOLERANCES, SO CHOOSE THEM CONSERVATIVELY. C ITASK = 1 FOR NORMAL COMPUTATION OF OUTPUT VALUES OF Y AT T = TOUT. C ISTATE = INTEGER FLAG (INPUT AND OUTPUT). SET ISTATE = 1. -C IOPT = 0 TO INDICATE NO OPTIONAL INPUTS USED. +C IOPT = 0 TO INDICATE NO OPTIONAL INPUTS USED. C RWORK = REAL WORK ARRAY OF LENGTH AT LEAST.. C 20 + 16*NEQ FOR MF = 10, C 22 + 9*NEQ + NEQ**2 FOR MF = 21 OR 22, @@ -115,7 +115,7 @@ C 21 FOR STIFF (BDF) METHOD, USER-SUPPLIED FULL JACOBIAN. C 22 FOR STIFF METHOD, INTERNALLY GENERATED FULL JACOBIAN. C 24 FOR STIFF METHOD, USER-SUPPLIED BANDED JACOBIAN. -C 25 FOR STIFF METHOD, INTERNALLY GENERATED BANDED JACOBIAN. +C 25 FOR STIFF METHOD, INTERNALLY GENERATED BANDED JACOBIAN. C NOTE THAT THE MAIN PROGRAM MUST DECLARE ARRAYS Y, RWORK, IWORK, C AND POSSIBLY ATOL. C @@ -123,8 +123,8 @@ C Y = ARRAY OF COMPUTED VALUES OF Y(T) VECTOR. C T = CORRESPONDING VALUE OF INDEPENDENT VARIABLE (NORMALLY TOUT). C ISTATE = 2 IF LSODE WAS SUCCESSFUL, NEGATIVE OTHERWISE. -C -1 MEANS EXCESS WORK DONE ON THIS CALL (PERHAPS WRONG MF). -C -2 MEANS EXCESS ACCURACY REQUESTED (TOLERANCES TOO SMALL). +C -1 MEANS EXCESS WORK DONE ON THIS CALL (PERHAPS WRONG MF). +C -2 MEANS EXCESS ACCURACY REQUESTED (TOLERANCES TOO SMALL). C -3 MEANS ILLEGAL INPUT DETECTED (SEE PRINTED MESSAGE). C -4 MEANS REPEATED ERROR TEST FAILURES (CHECK ALL INPUTS). C -5 MEANS REPEATED CONVERGENCE FAILURES (PERHAPS BAD JACOBIAN @@ -151,7 +151,7 @@ C THE FOLLOWING CODING SOLVES THIS PROBLEM WITH LSODE, USING MF = 21 C AND PRINTING RESULTS AT T = .4, 4., ..., 4.E10. IT USES C ITOL = 2 AND ATOL MUCH SMALLER FOR Y2 THAN Y1 OR Y3 BECAUSE -C Y2 HAS MUCH SMALLER VALUES. +C Y2 HAS MUCH SMALLER VALUES. C AT THE END OF THE RUN, STATISTICAL QUANTITIES OF INTEREST ARE C PRINTED (SEE OPTIONAL OUTPUTS IN THE FULL DESCRIPTION BELOW). C @@ -183,21 +183,21 @@ C IF (ISTATE .LT. 0) GO TO 80 C 40 TOUT = TOUT*10.D0 C WRITE(6,60)IWORK(11),IWORK(12),IWORK(13) -C 60 FORMAT(/12H NO. STEPS =,I4,11H NO. F-S =,I4,11H NO. J-S =,I4) +C 60 FORMAT(/12H NO. STEPS =,I4,11H NO. F-S =,I4,11H NO. J-S =,I4) C STOP C 80 WRITE(6,90)ISTATE C 90 FORMAT(///22H ERROR HALT.. ISTATE =,I3) C STOP -C END +C END C C SUBROUTINE FEX (NEQ, T, Y, YDOT) C DOUBLE PRECISION T, Y, YDOT -C DIMENSION Y(3), YDOT(3) +C DIMENSION Y(3), YDOT(3) C YDOT(1) = -.04D0*Y(1) + 1.D4*Y(2)*Y(3) C YDOT(3) = 3.D7*Y(2)*Y(2) C YDOT(2) = -YDOT(1) - YDOT(3) C RETURN -C END +C END C C SUBROUTINE JEX (NEQ, T, Y, ML, MU, PD, NRPD) C DOUBLE PRECISION PD, T, Y @@ -210,7 +210,7 @@ C PD(3,2) = 6.D7*Y(2) C PD(2,2) = -PD(1,2) - PD(3,2) C RETURN -C END +C END C C THE OUTPUT OF THIS PROGRAM (ON A CDC-7600 IN SINGLE PRECISION) C IS AS FOLLOWS.. @@ -228,7 +228,7 @@ C AT T = 4.0000E+09 Y = 5.129458E-07 2.051784E-12 9.999995E-01 C AT T = 4.0000E+10 Y = -7.170586E-08 -2.868234E-13 1.000000E+00 C -C NO. STEPS = 330 NO. F-S = 405 NO. J-S = 69 +C NO. STEPS = 330 NO. F-S = 405 NO. J-S = 69 C----------------------------------------------------------------------- C FULL DESCRIPTION OF USER INTERFACE TO LSODE. C @@ -242,9 +242,9 @@ C A DESCRIPTION OF OPTIONAL OUTPUTS (IN THE WORK ARRAYS). C C II. DESCRIPTIONS OF OTHER ROUTINES IN THE LSODE PACKAGE THAT MAY BE -C (OPTIONALLY) CALLED BY THE USER. THESE PROVIDE THE ABILITY TO +C (OPTIONALLY) CALLED BY THE USER. THESE PROVIDE THE ABILITY TO C ALTER ERROR MESSAGE HANDLING, SAVE AND RESTORE THE INTERNAL -C COMMON, AND OBTAIN SPECIFIED DERIVATIVES OF THE SOLUTION Y(T). +C COMMON, AND OBTAIN SPECIFIED DERIVATIVES OF THE SOLUTION Y(T). C C III. DESCRIPTIONS OF COMMON BLOCKS TO BE DECLARED IN OVERLAY C OR SIMILAR ENVIRONMENTS, OR TO BE SAVED WHEN DOING AN INTERRUPT @@ -252,18 +252,18 @@ C C IV. DESCRIPTION OF TWO ROUTINES IN THE LSODE PACKAGE, EITHER OF C WHICH THE USER MAY REPLACE WITH HIS OWN VERSION, IF DESIRED. -C THESE RELATE TO THE MEASUREMENT OF ERRORS. +C THESE RELATE TO THE MEASUREMENT OF ERRORS. C C----------------------------------------------------------------------- C PART I. CALL SEQUENCE. C C THE CALL SEQUENCE PARAMETERS USED FOR INPUT ONLY ARE -C F, NEQ, TOUT, ITOL, RTOL, ATOL, ITASK, IOPT, LRW, LIW, JAC, MF, +C F, NEQ, TOUT, ITOL, RTOL, ATOL, ITASK, IOPT, LRW, LIW, JAC, MF, C AND THOSE USED FOR BOTH INPUT AND OUTPUT ARE -C Y, T, ISTATE. +C Y, T, ISTATE. C THE WORK ARRAYS RWORK AND IWORK ARE ALSO USED FOR CONDITIONAL AND -C OPTIONAL INPUTS AND OPTIONAL OUTPUTS. (THE TERM OUTPUT HERE REFERS -C TO THE RETURN FROM SUBROUTINE LSODE TO THE USER-S CALLING PROGRAM.) +C OPTIONAL INPUTS AND OPTIONAL OUTPUTS. (THE TERM OUTPUT HERE REFERS +C TO THE RETURN FROM SUBROUTINE LSODE TO THE USER-S CALLING PROGRAM.) C C THE LEGALITY OF INPUT PARAMETERS WILL BE THOROUGHLY CHECKED ON THE C INITIAL CALL FOR THE PROBLEM, BUT NOT CHECKED THEREAFTER UNLESS A @@ -277,9 +277,9 @@ C OF THE SCALAR T AND THE VECTOR Y. SUBROUTINE F IS TO C COMPUTE THE FUNCTION F. IT IS TO HAVE THE FORM C SUBROUTINE F (NEQ, T, Y, YDOT) -C DIMENSION Y(1), YDOT(1) -C WHERE NEQ, T, AND Y ARE INPUT, AND THE ARRAY YDOT = F(T,Y) -C IS OUTPUT. Y AND YDOT ARE ARRAYS OF LENGTH NEQ. +C DIMENSION Y(1), YDOT(1) +C WHERE NEQ, T, AND Y ARE INPUT, AND THE ARRAY YDOT = F(T,Y) +C IS OUTPUT. Y AND YDOT ARE ARRAYS OF LENGTH NEQ. C (IN THE DIMENSION STATEMENT ABOVE, 1 IS A DUMMY C DIMENSION.. IT CAN BE REPLACED BY ANY VALUE.) C SUBROUTINE F SHOULD NOT ALTER Y(1),...,Y(NEQ). @@ -293,7 +293,7 @@ C IF QUANTITIES COMPUTED IN THE F ROUTINE ARE NEEDED C EXTERNALLY TO LSODE, AN EXTRA CALL TO F SHOULD BE MADE C FOR THIS PURPOSE, FOR CONSISTENT AND ACCURATE RESULTS. -C IF ONLY THE DERIVATIVE DY/DT IS NEEDED, USE INTDY INSTEAD. +C IF ONLY THE DERIVATIVE DY/DT IS NEEDED, USE INTDY INSTEAD. C C NEQ = THE SIZE OF THE ODE SYSTEM (NUMBER OF FIRST ORDER C ORDINARY DIFFERENTIAL EQUATIONS). USED ONLY FOR INPUT. @@ -302,18 +302,18 @@ C REMAINING COMPONENTS OF Y SHOULD BE LEFT UNDISTURBED, IF C THESE ARE TO BE ACCESSED IN F AND/OR JAC. C -C NORMALLY, NEQ IS A SCALAR, AND IT IS GENERALLY REFERRED TO +C NORMALLY, NEQ IS A SCALAR, AND IT IS GENERALLY REFERRED TO C AS A SCALAR IN THIS USER INTERFACE DESCRIPTION. HOWEVER, C NEQ MAY BE AN ARRAY, WITH NEQ(1) SET TO THE SYSTEM SIZE. -C (THE LSODE PACKAGE ACCESSES ONLY NEQ(1).) IN EITHER CASE, +C (THE LSODE PACKAGE ACCESSES ONLY NEQ(1).) IN EITHER CASE, C THIS PARAMETER IS PASSED AS THE NEQ ARGUMENT IN ALL CALLS C TO F AND JAC. HENCE, IF IT IS AN ARRAY, LOCATIONS C NEQ(2),... MAY BE USED TO STORE OTHER INTEGER DATA AND PASS -C IT TO F AND/OR JAC. SUBROUTINES F AND/OR JAC MUST INCLUDE +C IT TO F AND/OR JAC. SUBROUTINES F AND/OR JAC MUST INCLUDE C NEQ IN A DIMENSION STATEMENT IN THAT CASE. C C Y = A REAL ARRAY FOR THE VECTOR OF DEPENDENT VARIABLES, OF -C LENGTH NEQ OR MORE. USED FOR BOTH INPUT AND OUTPUT ON THE +C LENGTH NEQ OR MORE. USED FOR BOTH INPUT AND OUTPUT ON THE C FIRST CALL (ISTATE = 1), AND ONLY FOR OUTPUT ON OTHER CALLS. C ON THE FIRST CALL, Y MUST CONTAIN THE VECTOR OF INITIAL C VALUES. ON OUTPUT, Y CONTAINS THE COMPUTED SOLUTION VECTOR, @@ -321,12 +321,12 @@ C FOR OTHER PURPOSES BETWEEN CALLS TO THE SOLVER. C C THIS ARRAY IS PASSED AS THE Y ARGUMENT IN ALL CALLS TO -C F AND JAC. HENCE ITS LENGTH MAY EXCEED NEQ, AND LOCATIONS +C F AND JAC. HENCE ITS LENGTH MAY EXCEED NEQ, AND LOCATIONS C Y(NEQ+1),... MAY BE USED TO STORE OTHER REAL DATA AND -C PASS IT TO F AND/OR JAC. (THE LSODE PACKAGE ACCESSES ONLY +C PASS IT TO F AND/OR JAC. (THE LSODE PACKAGE ACCESSES ONLY C Y(1),...,Y(NEQ).) C -C T = THE INDEPENDENT VARIABLE. ON INPUT, T IS USED ONLY ON THE +C T = THE INDEPENDENT VARIABLE. ON INPUT, T IS USED ONLY ON THE C FIRST CALL, AS THE INITIAL POINT OF THE INTEGRATION. C ON OUTPUT, AFTER EACH CALL, T IS THE VALUE AT WHICH A C COMPUTED SOLUTION Y IS EVALUATED (USUALLY THE SAME AS TOUT). @@ -353,11 +353,11 @@ C TCUR - HU AND TCUR (SEE OPTIONAL OUTPUTS, BELOW, FOR C TCUR AND HU). C -C ITOL = AN INDICATOR FOR THE TYPE OF ERROR CONTROL. SEE +C ITOL = AN INDICATOR FOR THE TYPE OF ERROR CONTROL. SEE C DESCRIPTION BELOW UNDER ATOL. USED ONLY FOR INPUT. C C RTOL = A RELATIVE ERROR TOLERANCE PARAMETER, EITHER A SCALAR OR -C AN ARRAY OF LENGTH NEQ. SEE DESCRIPTION BELOW UNDER ATOL. +C AN ARRAY OF LENGTH NEQ. SEE DESCRIPTION BELOW UNDER ATOL. C INPUT ONLY. C C ATOL = AN ABSOLUTE ERROR TOLERANCE PARAMETER, EITHER A SCALAR OR @@ -369,7 +369,7 @@ C IN Y, ACCORDING TO AN INEQUALITY OF THE FORM C RMS-NORM OF ( E(I)/EWT(I) ) .LE. 1, C WHERE EWT(I) = RTOL(I)*ABS(Y(I)) + ATOL(I), -C AND THE RMS-NORM (ROOT-MEAN-SQUARE NORM) HERE IS +C AND THE RMS-NORM (ROOT-MEAN-SQUARE NORM) HERE IS C RMS-NORM(V) = SQRT(SUM V(I)**2 / NEQ). HERE EWT = (EWT(I)) C IS A VECTOR OF WEIGHTS WHICH MUST ALWAYS BE POSITIVE, AND C THE VALUES OF RTOL AND ATOL SHOULD ALL BE NON-NEGATIVE. @@ -393,23 +393,23 @@ C C IF GLOBAL ERRORS ARE TO BE ESTIMATED BY MAKING A REPEATED C RUN ON THE SAME PROBLEM WITH SMALLER TOLERANCES, THEN ALL -C COMPONENTS OF RTOL AND ATOL (I.E. OF EWT) SHOULD BE SCALED +C COMPONENTS OF RTOL AND ATOL (I.E. OF EWT) SHOULD BE SCALED C DOWN UNIFORMLY. C C ITASK = AN INDEX SPECIFYING THE TASK TO BE PERFORMED. C INPUT ONLY. ITASK HAS THE FOLLOWING VALUES AND MEANINGS. C 1 MEANS NORMAL COMPUTATION OF OUTPUT VALUES OF Y(T) AT -C T = TOUT (BY OVERSHOOTING AND INTERPOLATING). +C T = TOUT (BY OVERSHOOTING AND INTERPOLATING). C 2 MEANS TAKE ONE STEP ONLY AND RETURN. C 3 MEANS STOP AT THE FIRST INTERNAL MESH POINT AT OR C BEYOND T = TOUT AND RETURN. C 4 MEANS NORMAL COMPUTATION OF OUTPUT VALUES OF Y(T) AT C T = TOUT BUT WITHOUT OVERSHOOTING T = TCRIT. -C TCRIT MUST BE INPUT AS RWORK(1). TCRIT MAY BE EQUAL TO +C TCRIT MUST BE INPUT AS RWORK(1). TCRIT MAY BE EQUAL TO C OR BEYOND TOUT, BUT NOT BEHIND IT IN THE DIRECTION OF C INTEGRATION. THIS OPTION IS USEFUL IF THE PROBLEM C HAS A SINGULARITY AT OR BEYOND T = TCRIT. -C 5 MEANS TAKE ONE STEP, WITHOUT PASSING TCRIT, AND RETURN. +C 5 MEANS TAKE ONE STEP, WITHOUT PASSING TCRIT, AND RETURN. C TCRIT MUST BE INPUT AS RWORK(1). C C NOTE.. IF ITASK = 4 OR 5 AND THE SOLVER REACHES TCRIT @@ -430,7 +430,7 @@ C WITH ISTATE = 2, THE NEW VALUES WILL BE USED BUT NOT C TESTED FOR LEGALITY.) C 3 MEANS THIS IS NOT THE FIRST CALL, AND THE -C CALCULATION IS TO CONTINUE NORMALLY, BUT WITH +C CALCULATION IS TO CONTINUE NORMALLY, BUT WITH C A CHANGE IN INPUT PARAMETERS OTHER THAN C TOUT AND ITASK. CHANGES ARE ALLOWED IN C NEQ, ITOL, RTOL, ATOL, IOPT, LRW, LIW, MF, ML, MU, @@ -463,7 +463,7 @@ C WAS SUCCESSFUL AS FAR AS T. TO CONTINUE, THE TOLERANCE C PARAMETERS MUST BE RESET, AND ISTATE MUST BE SET C TO 3. THE OPTIONAL OUTPUT TOLSF MAY BE USED FOR THIS -C PURPOSE. (NOTE.. IF THIS CONDITION IS DETECTED BEFORE +C PURPOSE. (NOTE.. IF THIS CONDITION IS DETECTED BEFORE C TAKING ANY STEPS, THEN AN ILLEGAL INPUT RETURN C (ISTATE = -3) OCCURS INSTEAD.) C -3 MEANS ILLEGAL INPUT WAS DETECTED, BEFORE TAKING ANY @@ -476,7 +476,7 @@ C TASK, BUT THE INTEGRATION WAS SUCCESSFUL AS FAR AS T. C THE PROBLEM MAY HAVE A SINGULARITY, OR THE INPUT C MAY BE INAPPROPRIATE. -C -5 MEANS THERE WERE REPEATED CONVERGENCE TEST FAILURES ON +C -5 MEANS THERE WERE REPEATED CONVERGENCE TEST FAILURES ON C ONE ATTEMPTED STEP, BEFORE COMPLETING THE REQUESTED C TASK, BUT THE INTEGRATION WAS SUCCESSFUL AS FAR AS T. C THIS MAY BE CAUSED BY AN INACCURATE JACOBIAN MATRIX, @@ -494,11 +494,11 @@ C CALLING THE SOLVER AGAIN. C C IOPT = AN INTEGER FLAG TO SPECIFY WHETHER OR NOT ANY OPTIONAL -C INPUTS ARE BEING USED ON THIS CALL. INPUT ONLY. -C THE OPTIONAL INPUTS ARE LISTED SEPARATELY BELOW. +C INPUTS ARE BEING USED ON THIS CALL. INPUT ONLY. +C THE OPTIONAL INPUTS ARE LISTED SEPARATELY BELOW. C IOPT = 0 MEANS NO OPTIONAL INPUTS ARE BEING USED. C DEFAULT VALUES WILL BE USED IN ALL CASES. -C IOPT = 1 MEANS ONE OR MORE OPTIONAL INPUTS ARE BEING USED. +C IOPT = 1 MEANS ONE OR MORE OPTIONAL INPUTS ARE BEING USED. C C RWORK = A REAL WORKING ARRAY (DOUBLE PRECISION). C THE LENGTH OF RWORK MUST BE AT LEAST @@ -541,7 +541,7 @@ C THE FOLLOWING 2 WORDS IN IWORK ARE CONDITIONAL INPUTS.. C IWORK(1) = ML THESE ARE THE LOWER AND UPPER C IWORK(2) = MU HALF-BANDWIDTHS, RESPECTIVELY, OF THE -C BANDED JACOBIAN, EXCLUDING THE MAIN DIAGONAL. +C BANDED JACOBIAN, EXCLUDING THE MAIN DIAGONAL. C THE BAND IS DEFINED BY THE MATRIX LOCATIONS C (I,J) WITH I-ML .LE. J .LE. I+MU. ML AND MU C MUST SATISFY 0 .LE. ML,MU .LE. NEQ-1. @@ -583,29 +583,29 @@ C CORRESPOND TO NONEXISTENT MATRIX ELEMENTS CAN BE IGNORED C OR LOADED ARBITRARILY, AS THEY ARE OVERWRITTEN BY LSODE. C JAC NEED NOT PROVIDE DF/DY EXACTLY. A CRUDE -C APPROXIMATION (POSSIBLY WITH A SMALLER BANDWIDTH) WILL DO. +C APPROXIMATION (POSSIBLY WITH A SMALLER BANDWIDTH) WILL DO. C IN EITHER CASE, PD IS PRESET TO ZERO BY THE SOLVER, C SO THAT ONLY THE NONZERO ELEMENTS NEED BE LOADED BY JAC. C EACH CALL TO JAC IS PRECEDED BY A CALL TO F WITH THE SAME C ARGUMENTS NEQ, T, AND Y. THUS TO GAIN SOME EFFICIENCY, -C INTERMEDIATE QUANTITIES SHARED BY BOTH CALCULATIONS MAY BE +C INTERMEDIATE QUANTITIES SHARED BY BOTH CALCULATIONS MAY BE C SAVED IN A USER COMMON BLOCK BY F AND NOT RECOMPUTED BY JAC, C IF DESIRED. ALSO, JAC MAY ALTER THE Y ARRAY, IF DESIRED. C JAC MUST BE DECLARED EXTERNAL IN THE CALLING PROGRAM. C SUBROUTINE JAC MAY ACCESS USER-DEFINED QUANTITIES IN C NEQ(2),... AND/OR IN Y(NEQ(1)+1),... IF NEQ IS AN ARRAY -C (DIMENSIONED IN JAC) AND/OR Y HAS LENGTH EXCEEDING NEQ(1). +C (DIMENSIONED IN JAC) AND/OR Y HAS LENGTH EXCEEDING NEQ(1). C SEE THE DESCRIPTIONS OF NEQ AND Y ABOVE. C C MF = THE METHOD FLAG. USED ONLY FOR INPUT. THE LEGAL VALUES OF -C MF ARE 10, 11, 12, 13, 14, 15, 20, 21, 22, 23, 24, AND 25. +C MF ARE 10, 11, 12, 13, 14, 15, 20, 21, 22, 23, 24, AND 25. C MF HAS DECIMAL DIGITS METH AND MITER.. MF = 10*METH + MITER. C METH INDICATES THE BASIC LINEAR MULTISTEP METHOD.. C METH = 1 MEANS THE IMPLICIT ADAMS METHOD. C METH = 2 MEANS THE METHOD BASED ON BACKWARD C DIFFERENTIATION FORMULAS (BDF-S). -C MITER INDICATES THE CORRECTOR ITERATION METHOD.. -C MITER = 0 MEANS FUNCTIONAL ITERATION (NO JACOBIAN MATRIX +C MITER INDICATES THE CORRECTOR ITERATION METHOD.. +C MITER = 0 MEANS FUNCTIONAL ITERATION (NO JACOBIAN MATRIX C IS INVOLVED). C MITER = 1 MEANS CHORD ITERATION WITH A USER-SUPPLIED C FULL (NEQ BY NEQ) JACOBIAN. @@ -616,9 +616,9 @@ C GENERATED DIAGONAL JACOBIAN APPROXIMATION. C (USING 1 EXTRA CALL TO F PER DF/DY EVALUATION). C MITER = 4 MEANS CHORD ITERATION WITH A USER-SUPPLIED -C BANDED JACOBIAN. +C BANDED JACOBIAN. C MITER = 5 MEANS CHORD ITERATION WITH AN INTERNALLY -C GENERATED BANDED JACOBIAN (USING ML+MU+1 EXTRA +C GENERATED BANDED JACOBIAN (USING ML+MU+1 EXTRA C CALLS TO F PER DF/DY EVALUATION). C IF MITER = 1 OR 4, THE USER MUST SUPPLY A SUBROUTINE JAC C (THE NAME IS ARBITRARY) AS DESCRIBED ABOVE UNDER JAC. @@ -634,19 +634,19 @@ C CASE ALL OF THESE INPUTS ARE EXAMINED. A VALUE OF ZERO FOR ANY C OF THESE OPTIONAL INPUTS WILL CAUSE THE DEFAULT VALUE TO BE USED. C THUS TO USE A SUBSET OF THE OPTIONAL INPUTS, SIMPLY PRELOAD -C LOCATIONS 5 TO 10 IN RWORK AND IWORK TO 0.0 AND 0 RESPECTIVELY, AND +C LOCATIONS 5 TO 10 IN RWORK AND IWORK TO 0.0 AND 0 RESPECTIVELY, AND C THEN SET THOSE OF INTEREST TO NONZERO VALUES. C -C NAME LOCATION MEANING AND DEFAULT VALUE +C NAME LOCATION MEANING AND DEFAULT VALUE C C H0 RWORK(5) THE STEP SIZE TO BE ATTEMPTED ON THE FIRST STEP. C THE DEFAULT VALUE IS DETERMINED BY THE SOLVER. C -C HMAX RWORK(6) THE MAXIMUM ABSOLUTE STEP SIZE ALLOWED. +C HMAX RWORK(6) THE MAXIMUM ABSOLUTE STEP SIZE ALLOWED. C THE DEFAULT VALUE IS INFINITE. C -C HMIN RWORK(7) THE MINIMUM ABSOLUTE STEP SIZE ALLOWED. -C THE DEFAULT VALUE IS 0. (THIS LOWER BOUND IS NOT +C HMIN RWORK(7) THE MINIMUM ABSOLUTE STEP SIZE ALLOWED. +C THE DEFAULT VALUE IS 0. (THIS LOWER BOUND IS NOT C ENFORCED ON THE FINAL STEP BEFORE REACHING TCRIT C WHEN ITASK = 4 OR 5.) C @@ -662,11 +662,11 @@ C THE DEFAULT VALUE IS 500. C C MXHNIL IWORK(7) MAXIMUM NUMBER OF MESSAGES PRINTED (PER PROBLEM) -C WARNING THAT T + H = T ON A STEP (H = STEP SIZE). +C WARNING THAT T + H = T ON A STEP (H = STEP SIZE). C THIS MUST BE POSITIVE TO RESULT IN A NON-DEFAULT C VALUE. THE DEFAULT VALUE IS 10. C----------------------------------------------------------------------- -C OPTIONAL OUTPUTS. +C OPTIONAL OUTPUTS. C C AS OPTIONAL ADDITIONAL OUTPUT FROM LSODE, THE VARIABLES LISTED C BELOW ARE QUANTITIES RELATED TO THE PERFORMANCE OF LSODE @@ -677,7 +677,7 @@ C ISTATE = -1, -2, -4, -5, OR -6. ON AN ILLEGAL INPUT RETURN C (ISTATE = -3), THEY WILL BE UNCHANGED FROM THEIR EXISTING VALUES C (IF ANY), EXCEPT POSSIBLY FOR TOLSF, LENRW, AND LENIW. -C ON ANY ERROR RETURN, OUTPUTS RELEVANT TO THE ERROR WILL BE DEFINED, +C ON ANY ERROR RETURN, OUTPUTS RELEVANT TO THE ERROR WILL BE DEFINED, C AS NOTED BELOW. C C NAME LOCATION MEANING @@ -693,20 +693,20 @@ C T, BUT MAY BE FARTHER (IF INTERPOLATION WAS DONE). C C TOLSF RWORK(14) A TOLERANCE SCALE FACTOR, GREATER THAN 1.0, -C COMPUTED WHEN A REQUEST FOR TOO MUCH ACCURACY WAS -C DETECTED (ISTATE = -3 IF DETECTED AT THE START OF +C COMPUTED WHEN A REQUEST FOR TOO MUCH ACCURACY WAS +C DETECTED (ISTATE = -3 IF DETECTED AT THE START OF C THE PROBLEM, ISTATE = -2 OTHERWISE). IF ITOL IS C LEFT UNALTERED BUT RTOL AND ATOL ARE UNIFORMLY -C SCALED UP BY A FACTOR OF TOLSF FOR THE NEXT CALL, +C SCALED UP BY A FACTOR OF TOLSF FOR THE NEXT CALL, C THEN THE SOLVER IS DEEMED LIKELY TO SUCCEED. C (THE USER MAY ALSO IGNORE TOLSF AND ALTER THE C TOLERANCE PARAMETERS IN ANY OTHER WAY APPROPRIATE.) C -C NST IWORK(11) THE NUMBER OF STEPS TAKEN FOR THE PROBLEM SO FAR. +C NST IWORK(11) THE NUMBER OF STEPS TAKEN FOR THE PROBLEM SO FAR. C C NFE IWORK(12) THE NUMBER OF F EVALUATIONS FOR THE PROBLEM SO FAR. C -C NJE IWORK(13) THE NUMBER OF JACOBIAN EVALUATIONS (AND OF MATRIX +C NJE IWORK(13) THE NUMBER OF JACOBIAN EVALUATIONS (AND OF MATRIX C LU DECOMPOSITIONS) FOR THE PROBLEM SO FAR. C C NQU IWORK(14) THE METHOD ORDER LAST USED (SUCCESSFULLY). @@ -728,9 +728,9 @@ C THE FOLLOWING TWO ARRAYS ARE SEGMENTS OF THE RWORK ARRAY WHICH C MAY ALSO BE OF INTEREST TO THE USER AS OPTIONAL OUTPUTS. C FOR EACH ARRAY, THE TABLE BELOW GIVES ITS INTERNAL NAME, -C ITS BASE ADDRESS IN RWORK, AND ITS DESCRIPTION. +C ITS BASE ADDRESS IN RWORK, AND ITS DESCRIPTION. C -C NAME BASE ADDRESS DESCRIPTION +C NAME BASE ADDRESS DESCRIPTION C C YH 21 THE NORDSIECK HISTORY ARRAY, OF SIZE NYH BY C (NQCUR + 1), WHERE NYH IS THE INITIAL VALUE @@ -744,7 +744,7 @@ C CORRECTIONS ON EACH STEP, SCALED ON OUTPUT C TO REPRESENT THE ESTIMATED LOCAL ERROR IN Y C ON THE LAST STEP. THIS IS THE VECTOR E IN -C THE DESCRIPTION OF THE ERROR CONTROL. IT IS +C THE DESCRIPTION OF THE ERROR CONTROL. IT IS C DEFINED ONLY ON A SUCCESSFUL RETURN FROM LSODE. C C----------------------------------------------------------------------- @@ -763,7 +763,7 @@ C C CALL XSETF(MFLAG) SET A FLAG TO CONTROL THE PRINTING OF C MESSAGES BY LSODE. -C MFLAG = 0 MEANS DO NOT PRINT. (DANGER.. +C MFLAG = 0 MEANS DO NOT PRINT. (DANGER.. C THIS RISKS LOSING VALUABLE INFORMATION.) C MFLAG = 1 MEANS PRINT (THE DEFAULT). C @@ -773,10 +773,10 @@ C CALL SRCOM(RSAV,ISAV,JOB) SAVES AND RESTORES THE CONTENTS OF C THE INTERNAL COMMON BLOCKS USED BY C LSODE (SEE PART III BELOW). -C RSAV MUST BE A REAL ARRAY OF LENGTH 218 +C RSAV MUST BE A REAL ARRAY OF LENGTH 218 C OR MORE, AND ISAV MUST BE AN INTEGER C ARRAY OF LENGTH 41 OR MORE. -C JOB=1 MEANS SAVE COMMON INTO RSAV/ISAV. +C JOB=1 MEANS SAVE COMMON INTO RSAV/ISAV. C JOB=2 MEANS RESTORE COMMON FROM RSAV/ISAV. C SRCOM IS USEFUL IF ONE IS C INTERRUPTING A RUN AND RESTARTING @@ -788,14 +788,14 @@ C DESIRED. IT MAY BE CALLED ONLY AFTER C A SUCCESSFUL RETURN FROM LSODE. C -C THE DETAILED INSTRUCTIONS FOR USING INTDY ARE AS FOLLOWS. +C THE DETAILED INSTRUCTIONS FOR USING INTDY ARE AS FOLLOWS. C THE FORM OF THE CALL IS.. C -C CALL INTDY (T, K, RWORK(21), NYH, DKY, IFLAG) +C CALL INTDY (T, K, RWORK(21), NYH, DKY, IFLAG) C C THE INPUT PARAMETERS ARE.. C -C T = VALUE OF INDEPENDENT VARIABLE WHERE ANSWERS ARE DESIRED +C T = VALUE OF INDEPENDENT VARIABLE WHERE ANSWERS ARE DESIRED C (NORMALLY THE SAME AS THE T LAST RETURNED BY LSODE). C FOR VALID RESULTS, T MUST LIE BETWEEN TCUR - HU AND TCUR. C (SEE OPTIONAL OUTPUTS FOR TCUR AND HU.) @@ -806,14 +806,14 @@ C BY LSODE DIRECTLY. SINCE NQCUR .GE. 1, THE FIRST C DERIVATIVE DY/DT IS ALWAYS AVAILABLE WITH INTDY. C RWORK(21) = THE BASE ADDRESS OF THE HISTORY ARRAY YH. -C NYH = COLUMN LENGTH OF YH, EQUAL TO THE INITIAL VALUE OF NEQ. +C NYH = COLUMN LENGTH OF YH, EQUAL TO THE INITIAL VALUE OF NEQ. C -C THE OUTPUT PARAMETERS ARE.. +C THE OUTPUT PARAMETERS ARE.. C C DKY = A REAL ARRAY OF LENGTH NEQ CONTAINING THE COMPUTED VALUE C OF THE K-TH DERIVATIVE OF Y(T). C IFLAG = INTEGER FLAG, RETURNED AS 0 IF K AND T WERE LEGAL, -C -1 IF K WAS ILLEGAL, AND -2 IF T WAS ILLEGAL. +C -1 IF K WAS ILLEGAL, AND -2 IF T WAS ILLEGAL. C ON AN ERROR RETURN, A MESSAGE IS ALSO WRITTEN. C----------------------------------------------------------------------- C PART III. COMMON BLOCKS. @@ -867,7 +867,7 @@ C AND THE INCREMENTS FOR DIFFERENCE QUOTIENT JACOBIANS. C C IN THE USER-SUPPLIED VERSION OF EWSET, IT MAY BE DESIRABLE TO USE -C THE CURRENT VALUES OF DERIVATIVES OF Y. DERIVATIVES UP TO ORDER NQ +C THE CURRENT VALUES OF DERIVATIVES OF Y. DERIVATIVES UP TO ORDER NQ C ARE AVAILABLE FROM THE HISTORY ARRAY YH, DESCRIBED ABOVE UNDER C OPTIONAL OUTPUTS. IN EWSET, YH IS IDENTICAL TO THE YCUR ARRAY, C EXTENDED TO NQ + 1 COLUMNS WITH A COLUMN LENGTH OF NYH AND SCALE @@ -875,11 +875,11 @@ C GIVEN BY NST = 0, NQ IS 1 AND H IS TEMPORARILY SET TO 1.0. C THE QUANTITIES NQ, NYH, H, AND NST CAN BE OBTAINED BY INCLUDING C IN EWSET THE STATEMENTS.. -C DOUBLE PRECISION H, RLS +C DOUBLE PRECISION H, RLS C COMMON /LS0001/ RLS(218),ILS(39) C NQ = ILS(35) -C NYH = ILS(14) -C NST = ILS(36) +C NYH = ILS(14) +C NST = ILS(36) C H = RLS(212) C THUS, FOR EXAMPLE, THE CURRENT VALUE OF DY/DT CAN BE OBTAINED AS C YCUR(NYH+I)/H (I=1,...,NEQ) (AND THE DIVISION BY H IS @@ -887,9 +887,9 @@ C C (B) VNORM. C THE FOLLOWING IS A REAL FUNCTION ROUTINE WHICH COMPUTES THE WEIGHTED -C ROOT-MEAN-SQUARE NORM OF A VECTOR V.. +C ROOT-MEAN-SQUARE NORM OF A VECTOR V.. C D = VNORM (N, V, W) -C WHERE.. +C WHERE.. C N = THE LENGTH OF THE VECTOR, C V = REAL ARRAY OF LENGTH N CONTAINING THE VECTOR, C W = REAL ARRAY OF LENGTH N CONTAINING WEIGHTS, @@ -897,7 +897,7 @@ C VNORM IS CALLED WITH N = NEQ AND WITH W(I) = 1.0/EWT(I), WHERE C EWT IS AS SET BY SUBROUTINE EWSET. C -C IF THE USER SUPPLIES THIS FUNCTION, IT SHOULD RETURN A NON-NEGATIVE +C IF THE USER SUPPLIES THIS FUNCTION, IT SHOULD RETURN A NON-NEGATIVE C VALUE OF VNORM SUITABLE FOR USE IN THE ERROR CONTROL IN LSODE. C NONE OF THE ARGUMENTS SHOULD BE ALTERED BY VNORM. C FOR EXAMPLE, A USER-SUPPLIED VNORM ROUTINE MIGHT.. @@ -915,7 +915,7 @@ C INTEGRATION AND THE ASSOCIATED ERROR CONTROL. C CFODE SETS ALL METHOD COEFFICIENTS AND TEST CONSTANTS. C PREPJ COMPUTES AND PREPROCESSES THE JACOBIAN MATRIX J = DF/DY -C AND THE NEWTON ITERATION MATRIX P = I - H*L0*J. +C AND THE NEWTON ITERATION MATRIX P = I - H*L0*J. C SOLSY MANAGES SOLUTION OF LINEAR SYSTEM IN CHORD ITERATION. C EWSET SETS THE ERROR WEIGHT VECTOR EWT BEFORE EACH STEP. C VNORM COMPUTES THE WEIGHTED R.M.S. NORM OF A VECTOR. @@ -934,7 +934,7 @@ C ALL THE OTHERS ARE SUBROUTINES. C C THE INTRINSIC AND EXTERNAL ROUTINES USED BY LSODE ARE.. -C DABS, DMAX1, DMIN1, DBLE, MAX0, MIN0, MOD, DSIGN, DSQRT, AND WRITE. +C DABS, DMAX1, DMIN1, DBLE, MAX0, MIN0, MOD, DSIGN, DSQRT, AND WRITE. C C A BLOCK DATA SUBPROGRAM IS ALSO INCLUDED WITH THE PACKAGE, C FOR LOADING SOME OF THE VARIABLES IN INTERNAL COMMON. @@ -946,11 +946,11 @@ EXTERNAL PREPJ, SOLSY INTEGER ILLIN, INIT, LYH, LEWT, LACOR, LSAVF, LWM, LIWM, 1 MXSTEP, MXHNIL, NHNIL, NTREP, NSLAST, NYH, IOWNS - INTEGER ICF, IERPJ, IERSL, JCUR, JSTART, KFLAG, L, METH, MITER, + INTEGER ICF, IERPJ, IERSL, JCUR, JSTART, KFLAG, L, METH, MITER, 1 MAXORD, MAXCOR, MSBP, MXNCF, N, NQ, NST, NFE, NJE, NQU INTEGER I, I1, I2, IFLAG, IMXER, KGO, LF0, 1 LENIW, LENRW, LENWM, ML, MORD, MU, MXHNL0, MXSTP0 - DOUBLE PRECISION ROWNS, + DOUBLE PRECISION ROWNS, 1 CCMAX, EL0, H, HMIN, HMXI, HU, RC, TN, UROUND DOUBLE PRECISION ATOLI, AYI, BIG, EWTI, H0, HMAX, HMX, RH, RTOLI, 1 TCRIT, TDIST, TNEXT, TOL, TOLSF, TP, SIZE, SUM, W0, @@ -961,7 +961,7 @@ C THE FOLLOWING INTERNAL COMMON BLOCK CONTAINS C (A) VARIABLES WHICH ARE LOCAL TO ANY SUBROUTINE BUT WHOSE VALUES MUST C BE PRESERVED BETWEEN CALLS TO THE ROUTINE (OWN VARIABLES), AND -C (B) VARIABLES WHICH ARE COMMUNICATED BETWEEN SUBROUTINES. +C (B) VARIABLES WHICH ARE COMMUNICATED BETWEEN SUBROUTINES. C THE STRUCTURE OF THE BLOCK IS AS FOLLOWS.. ALL REAL VARIABLES ARE C LISTED FIRST, FOLLOWED BY ALL INTEGERS. WITHIN EACH TYPE, THE C VARIABLES ARE GROUPED WITH THOSE LOCAL TO SUBROUTINE LSODE FIRST, @@ -985,7 +985,7 @@ C IT TESTS ISTATE AND ITASK FOR LEGALITY AND BRANCHES APPROPRIATELY. C IF ISTATE .GT. 1 BUT THE FLAG INIT SHOWS THAT INITIALIZATION HAS C NOT YET BEEN DONE, AN ERROR RETURN OCCURS. -C IF ISTATE = 1 AND TOUT = T, JUMP TO BLOCK G AND RETURN IMMEDIATELY. +C IF ISTATE = 1 AND TOUT = T, JUMP TO BLOCK G AND RETURN IMMEDIATELY. C----------------------------------------------------------------------- IF (ISTATE .LT. 1 .OR. ISTATE .GT. 3) GO TO 601 IF (ITASK .LT. 1 .OR. ITASK .GT. 5) GO TO 602 @@ -1009,15 +1009,15 @@ IF (ISTATE .EQ. 1) GO TO 25 IF (NEQ(1) .GT. N) GO TO 605 25 N = NEQ(1) - IF (ITOL .LT. 1 .OR. ITOL .GT. 4) GO TO 606 - IF (IOPT .LT. 0 .OR. IOPT .GT. 1) GO TO 607 + IF (ITOL .LT. 1 .OR. ITOL .GT. 4) GO TO 606 + IF (IOPT .LT. 0 .OR. IOPT .GT. 1) GO TO 607 METH = MF/10 MITER = MF - 10*METH - IF (METH .LT. 1 .OR. METH .GT. 2) GO TO 608 + IF (METH .LT. 1 .OR. METH .GT. 2) GO TO 608 IF (MITER .LT. 0 .OR. MITER .GT. 5) GO TO 608 IF (MITER .LE. 3) GO TO 30 - ML = IWORK(1) - MU = IWORK(2) + ML = IWORK(1) + MU = IWORK(2) IF (ML .LT. 0 .OR. ML .GE. N) GO TO 609 IF (MU .LT. 0 .OR. MU .GE. N) GO TO 610 30 CONTINUE @@ -1041,7 +1041,7 @@ IF (MXHNIL .LT. 0) GO TO 613 IF (MXHNIL .EQ. 0) MXHNIL = MXHNL0 IF (ISTATE .NE. 1) GO TO 50 - H0 = RWORK(5) + H0 = RWORK(5) IF ((TOUT - T)*H0 .LT. 0.0D0) GO TO 614 50 HMAX = RWORK(6) IF (HMAX .LT. 0.0D0) GO TO 615 @@ -1051,7 +1051,7 @@ IF (HMIN .LT. 0.0D0) GO TO 616 C----------------------------------------------------------------------- C SET WORK ARRAY POINTERS AND CHECK LENGTHS LRW AND LIW. -C POINTERS TO SEGMENTS OF RWORK AND IWORK ARE NAMED BY PREFIXING L TO +C POINTERS TO SEGMENTS OF RWORK AND IWORK ARE NAMED BY PREFIXING L TO C THE NAME OF THE SEGMENT. E.G., THE SEGMENT YH STARTS AT RWORK(LYH). C SEGMENTS OF RWORK (IN ORDER) ARE DENOTED YH, WM, EWT, SAVF, ACOR. C----------------------------------------------------------------------- @@ -1076,18 +1076,18 @@ C CHECK RTOL AND ATOL FOR LEGALITY. ------------------------------------ RTOLI = RTOL(1) ATOLI = ATOL(1) - DO 70 I = 1,N + DO 70 I = 1,N IF (ITOL .GE. 3) RTOLI = RTOL(I) IF (ITOL .EQ. 2 .OR. ITOL .EQ. 4) ATOLI = ATOL(I) - IF (RTOLI .LT. 0.0D0) GO TO 619 - IF (ATOLI .LT. 0.0D0) GO TO 620 + IF (RTOLI .LT. 0.0D0) GO TO 619 + IF (ATOLI .LT. 0.0D0) GO TO 620 70 CONTINUE IF (ISTATE .EQ. 1) GO TO 100 C IF ISTATE = 3, SET FLAG TO SIGNAL PARAMETER CHANGES TO STODE. -------- JSTART = -1 IF (NQ .LE. MAXORD) GO TO 90 C MAXORD WAS REDUCED BELOW NQ. COPY YH(*,MAXORD+2) INTO SAVF. --------- - DO 80 I = 1,N + DO 80 I = 1,N 80 RWORK(I+LSAVF-1) = RWORK(I+LWM-1) C RELOAD WM(1) = RWORK(LWM), SINCE LWM MAY HAVE CHANGED. --------------- 90 IF (MITER .GT. 0) RWORK(LWM) = DSQRT(UROUND) @@ -1101,10 +1101,10 @@ GO TO 200 C----------------------------------------------------------------------- C BLOCK C. -C THE NEXT BLOCK IS FOR THE INITIAL CALL ONLY (ISTATE = 1). +C THE NEXT BLOCK IS FOR THE INITIAL CALL ONLY (ISTATE = 1). C IT CONTAINS ALL REMAINING INITIALIZATIONS, THE INITIAL CALL TO F, C AND THE CALCULATION OF THE INITIAL STEP SIZE. -C THE ERROR WEIGHTS IN EWT ARE INVERTED AFTER BEING LOADED. +C THE ERROR WEIGHTS IN EWT ARE INVERTED AFTER BEING LOADED. C----------------------------------------------------------------------- 100 UROUND = D1MACH(4) TN = T @@ -1121,7 +1121,7 @@ NSLAST = 0 HU = 0.0D0 NQU = 0 - CCMAX = 0.3D0 + CCMAX = 0.3D0 MAXCOR = 3 MSBP = 20 MXNCF = 10 @@ -1136,16 +1136,16 @@ NFE = 1 C LOAD THE INITIAL VALUE VECTOR IN YH. --------------------------------- DO 115 I = 1,N - 115 RWORK(I+LYH-1) = Y(I) + 115 RWORK(I+LYH-1) = Y(I) C LOAD AND INVERT THE EWT ARRAY. (H IS TEMPORARILY SET TO 1.0.) ------- NQ = 1 H = 1.0D0 CALL EWSET (N, ITOL, RTOL, ATOL, RWORK(LYH), RWORK(LEWT)) DO 120 I = 1,N - IF (RWORK(I+LEWT-1) .LE. 0.0D0) GO TO 621 + IF (RWORK(I+LEWT-1) .LE. 0.0D0) GO TO 621 120 RWORK(I+LEWT-1) = 1.0D0/RWORK(I+LEWT-1) C----------------------------------------------------------------------- -C THE CODING BELOW COMPUTES THE STEP SIZE, H0, TO BE ATTEMPTED ON THE +C THE CODING BELOW COMPUTES THE STEP SIZE, H0, TO BE ATTEMPTED ON THE C FIRST STEP, UNLESS THE USER HAS SUPPLIED A VALUE FOR THIS. C FIRST CHECK THAT TOUT - T DIFFERS SIGNIFICANTLY FROM ZERO. C A SCALAR TOLERANCE QUANTITY TOL IS COMPUTED, AS MAX(RTOL(I)) @@ -1164,7 +1164,7 @@ TDIST = DABS(TOUT - T) W0 = DMAX1(DABS(T),DABS(TOUT)) IF (TDIST .LT. 2.0D0*UROUND*W0) GO TO 622 - TOL = RTOL(1) + TOL = RTOL(1) IF (ITOL .LE. 2) GO TO 140 DO 130 I = 1,N 130 TOL = DMAX1(TOL,RTOL(I)) @@ -1220,25 +1220,25 @@ IHIT = DABS(TN - TCRIT) .LE. 100.0D0*UROUND*HMX IF (IHIT) GO TO 400 TNEXT = TN + H*(1.0D0 + 4.0D0*UROUND) - IF ((TNEXT - TCRIT)*H .LE. 0.0D0) GO TO 250 + IF ((TNEXT - TCRIT)*H .LE. 0.0D0) GO TO 250 H = (TCRIT - TN)*(1.0D0 - 4.0D0*UROUND) IF (ISTATE .EQ. 2) JSTART = -2 C----------------------------------------------------------------------- C BLOCK E. C THE NEXT BLOCK IS NORMALLY EXECUTED FOR ALL CALLS AND CONTAINS -C THE CALL TO THE ONE-STEP CORE INTEGRATOR STODE. +C THE CALL TO THE ONE-STEP CORE INTEGRATOR STODE. C C THIS IS A LOOPING POINT FOR THE INTEGRATION STEPS. C C FIRST CHECK FOR TOO MANY STEPS BEING TAKEN, UPDATE EWT (IF NOT AT -C START OF PROBLEM), CHECK FOR TOO MUCH ACCURACY BEING REQUESTED, AND +C START OF PROBLEM), CHECK FOR TOO MUCH ACCURACY BEING REQUESTED, AND C CHECK FOR H BELOW THE ROUNDOFF LEVEL IN T. C----------------------------------------------------------------------- 250 CONTINUE IF ((NST-NSLAST) .GE. MXSTEP) GO TO 500 CALL EWSET (N, ITOL, RTOL, ATOL, RWORK(LYH), RWORK(LEWT)) DO 260 I = 1,N - IF (RWORK(I+LEWT-1) .LE. 0.0D0) GO TO 510 + IF (RWORK(I+LEWT-1) .LE. 0.0D0) GO TO 510 260 RWORK(I+LEWT-1) = 1.0D0/RWORK(I+LEWT-1) 270 TOLSF = UROUND*VNORM (N, RWORK(LYH), RWORK(LEWT)) IF (TOLSF .LE. 1.0D0) GO TO 280 @@ -1254,7 +1254,7 @@ 1 ' SUCH THAT IN THE MACHINE, T + H = T ON THE NEXT STEP ', 1 60, 101, 0, 0, 0, 0, 0, 0.0D0, 0.0D0) CALL XERRWD(' (H = STEP SIZE). SOLVER WILL CONTINUE ANYWAY', - 1 50, 101, 0, 0, 0, 0, 2, TN, H) + 1 50, 101, 0, 0, 0, 0, 2, TN, H) IF (NHNIL .LT. MXHNIL) GO TO 290 CALL XERRWD('LSODE-- ABOVE WARNING HAS BEEN ISSUED I1 TIMES. ', 1 50, 102, 0, 0, 0, 0, 0, 0.0D0, 0.0D0) @@ -1298,7 +1298,7 @@ IHIT = DABS(TN - TCRIT) .LE. 100.0D0*UROUND*HMX IF (IHIT) GO TO 400 TNEXT = TN + H*(1.0D0 + 4.0D0*UROUND) - IF ((TNEXT - TCRIT)*H .LE. 0.0D0) GO TO 250 + IF ((TNEXT - TCRIT)*H .LE. 0.0D0) GO TO 250 H = (TCRIT - TN)*(1.0D0 - 4.0D0*UROUND) JSTART = -2 GO TO 250 @@ -1311,18 +1311,18 @@ C IF ITASK .NE. 1, Y IS LOADED FROM YH AND T IS SET ACCORDINGLY. C ISTATE IS SET TO 2, THE ILLEGAL INPUT COUNTER IS ZEROED, AND THE C OPTIONAL OUTPUTS ARE LOADED INTO THE WORK ARRAYS BEFORE RETURNING. -C IF ISTATE = 1 AND TOUT = T, THERE IS A RETURN WITH NO ACTION TAKEN, -C EXCEPT THAT IF THIS HAS HAPPENED REPEATEDLY, THE RUN IS TERMINATED. +C IF ISTATE = 1 AND TOUT = T, THERE IS A RETURN WITH NO ACTION TAKEN, +C EXCEPT THAT IF THIS HAS HAPPENED REPEATEDLY, THE RUN IS TERMINATED. C----------------------------------------------------------------------- 400 DO 410 I = 1,N - 410 Y(I) = RWORK(I+LYH-1) + 410 Y(I) = RWORK(I+LYH-1) T = TN IF (ITASK .NE. 4 .AND. ITASK .NE. 5) GO TO 420 IF (IHIT) T = TCRIT 420 ISTATE = 2 ILLIN = 0 RWORK(11) = HU - RWORK(12) = H + RWORK(12) = H RWORK(13) = TN IWORK(11) = NST IWORK(12) = NFE @@ -1371,7 +1371,7 @@ 530 CALL XERRWD('LSODE-- AT T(=R1) AND STEP SIZE H(=R2), THE ERROR', 1 50, 204, 0, 0, 0, 0, 0, 0.0D0, 0.0D0) CALL XERRWD(' TEST FAILED REPEATEDLY OR WITH ABS(H) = HMIN', - 1 50, 204, 0, 0, 0, 0, 2, TN, H) + 1 50, 204, 0, 0, 0, 0, 2, TN, H) ISTATE = -4 GO TO 560 C KFLAG = -2. CONVERGENCE FAILED REPEATEDLY OR WITH ABS(H) = HMIN. ---- @@ -1380,7 +1380,7 @@ CALL XERRWD(' CORRECTOR CONVERGENCE FAILED REPEATEDLY ', 1 50, 205, 0, 0, 0, 0, 0, 0.0D0, 0.0D0) CALL XERRWD(' OR WITH ABS(H) = HMIN ', - 1 30, 205, 0, 0, 0, 0, 2, TN, H) + 1 30, 205, 0, 0, 0, 0, 2, TN, H) ISTATE = -5 C COMPUTE IMXER IF RELEVANT. ------------------------------------------- 560 BIG = 0.0D0 @@ -1394,11 +1394,11 @@ IWORK(16) = IMXER C SET Y VECTOR, T, ILLIN, AND OPTIONAL OUTPUTS. ------------------------ 580 DO 590 I = 1,N - 590 Y(I) = RWORK(I+LYH-1) + 590 Y(I) = RWORK(I+LYH-1) T = TN ILLIN = 0 RWORK(11) = HU - RWORK(12) = H + RWORK(12) = H RWORK(13) = TN IWORK(11) = NST IWORK(12) = NFE @@ -1410,12 +1410,12 @@ C BLOCK I. C THE FOLLOWING BLOCK HANDLES ALL ERROR RETURNS DUE TO ILLEGAL INPUT C (ISTATE = -3), AS DETECTED BEFORE CALLING THE CORE INTEGRATOR. -C FIRST THE ERROR MESSAGE ROUTINE IS CALLED. THEN IF THERE HAVE BEEN +C FIRST THE ERROR MESSAGE ROUTINE IS CALLED. THEN IF THERE HAVE BEEN C 5 CONSECUTIVE SUCH RETURNS JUST BEFORE THIS CALL TO THE SOLVER, C THE RUN IS HALTED. C----------------------------------------------------------------------- 601 CALL XERRWD('LSODE-- ISTATE (=I1) ILLEGAL ', - 1 30, 1, 0, 1, ISTATE, 0, 0, 0.0D0, 0.0D0) + 1 30, 1, 0, 1, ISTATE, 0, 0, 0.0D0, 0.0D0) GO TO 700 602 CALL XERRWD('LSODE-- ITASK (=I1) ILLEGAL ', 1 30, 2, 0, 1, ITASK, 0, 0, 0.0D0, 0.0D0) @@ -1424,10 +1424,10 @@ 1 50, 3, 0, 0, 0, 0, 0, 0.0D0, 0.0D0) GO TO 700 604 CALL XERRWD('LSODE-- NEQ (=I1) .LT. 1 ', - 1 30, 4, 0, 1, NEQ(1), 0, 0, 0.0D0, 0.0D0) + 1 30, 4, 0, 1, NEQ(1), 0, 0, 0.0D0, 0.0D0) GO TO 700 605 CALL XERRWD('LSODE-- ISTATE = 3 AND NEQ INCREASED (I1 TO I2) ', - 1 50, 5, 0, 2, N, NEQ(1), 0, 0.0D0, 0.0D0) + 1 50, 5, 0, 2, N, NEQ(1), 0, 0.0D0, 0.0D0) GO TO 700 606 CALL XERRWD('LSODE-- ITOL (=I1) ILLEGAL ', 1 30, 6, 0, 1, ITOL, 0, 0, 0.0D0, 0.0D0) @@ -1519,4 +1519,4 @@ 1 50, 303, 2, 0, 0, 0, 0, 0.0D0, 0.0D0) RETURN C----------------------- END OF SUBROUTINE LSODE ----------------------- - END + END
--- a/liboctave/cruft/odepack/ewset.f +++ b/liboctave/cruft/odepack/ewset.f @@ -9,24 +9,24 @@ INTEGER N, ITOL INTEGER I DOUBLE PRECISION RTOL, ATOL, YCUR, EWT - DIMENSION RTOL(*), ATOL(*), YCUR(N), EWT(N) + DIMENSION RTOL(*), ATOL(*), YCUR(N), EWT(N) C GO TO (10, 20, 30, 40), ITOL 10 CONTINUE - DO 15 I = 1,N + DO 15 I = 1,N 15 EWT(I) = RTOL(1)*DABS(YCUR(I)) + ATOL(1) RETURN 20 CONTINUE - DO 25 I = 1,N + DO 25 I = 1,N 25 EWT(I) = RTOL(1)*DABS(YCUR(I)) + ATOL(I) RETURN 30 CONTINUE - DO 35 I = 1,N + DO 35 I = 1,N 35 EWT(I) = RTOL(I)*DABS(YCUR(I)) + ATOL(1) RETURN 40 CONTINUE - DO 45 I = 1,N + DO 45 I = 1,N 45 EWT(I) = RTOL(I)*DABS(YCUR(I)) + ATOL(I) RETURN C----------------------- END OF SUBROUTINE EWSET ----------------------- - END + END
--- a/liboctave/cruft/odepack/intdy.f +++ b/liboctave/cruft/odepack/intdy.f @@ -6,13 +6,13 @@ 2 MAXORD, MAXCOR, MSBP, MXNCF, N, NQ, NST, NFE, NJE, NQU INTEGER I, IC, J, JB, JB2, JJ, JJ1, JP1 DOUBLE PRECISION T, YH, DKY - DOUBLE PRECISION ROWNS, + DOUBLE PRECISION ROWNS, 1 CCMAX, EL0, H, HMIN, HMXI, HU, RC, TN, UROUND DOUBLE PRECISION C, R, S, TP DIMENSION YH(NYH,*), DKY(*) COMMON /LS0001/ ROWNS(209), 2 CCMAX, EL0, H, HMIN, HMXI, HU, RC, TN, UROUND, - 3 IOWND(14), IOWNS(6), + 3 IOWND(14), IOWNS(6), 4 ICF, IERPJ, IERSL, JCUR, JSTART, KFLAG, L, METH, MITER, 5 MAXORD, MAXCOR, MSBP, MXNCF, N, NQ, NST, NFE, NJE, NQU C----------------------------------------------------------------------- @@ -25,7 +25,7 @@ C THE COMPUTED VALUES IN DKY ARE GOTTEN BY INTERPOLATION USING THE C NORDSIECK HISTORY ARRAY YH. THIS ARRAY CORRESPONDS UNIQUELY TO A C VECTOR-VALUED POLYNOMIAL OF DEGREE NQCUR OR LESS, AND DKY IS SET -C TO THE K-TH DERIVATIVE OF THIS POLYNOMIAL AT T. +C TO THE K-TH DERIVATIVE OF THIS POLYNOMIAL AT T. C THE FORMULA FOR DKY IS.. C Q C DKY(I) = SUM C(J,K) * (T - TN)**(J-K) * H**(-J) * YH(I,J+1) @@ -47,13 +47,13 @@ DO 10 JJ = JJ1,NQ 10 IC = IC*JJ 15 C = DBLE(IC) - DO 20 I = 1,N + DO 20 I = 1,N 20 DKY(I) = C*YH(I,L) - IF (K .EQ. NQ) GO TO 55 + IF (K .EQ. NQ) GO TO 55 JB2 = NQ - K DO 50 JB = 1,JB2 - J = NQ - JB - JP1 = J + 1 + J = NQ - JB + JP1 = J + 1 IC = 1 IF (K .EQ. 0) GO TO 35 JJ1 = JP1 - K @@ -65,7 +65,7 @@ 50 CONTINUE IF (K .EQ. 0) RETURN 55 R = H**(-K) - DO 60 I = 1,N + DO 60 I = 1,N 60 DKY(I) = R*DKY(I) RETURN C @@ -77,8 +77,8 @@ 1 30, 52, 0, 0, 0, 0, 1, T, 0.0D0) CALL XERRWD( 1 ' T NOT IN INTERVAL TCUR - HU (= R1) TO TCUR (=R2) ', - 1 60, 52, 0, 0, 0, 0, 2, TP, TN) + 1 60, 52, 0, 0, 0, 0, 2, TP, TN) IFLAG = -2 RETURN C----------------------- END OF SUBROUTINE INTDY ----------------------- - END + END
--- a/liboctave/cruft/odepack/prepj.f +++ b/liboctave/cruft/odepack/prepj.f @@ -8,8 +8,8 @@ 2 MAXORD, MAXCOR, MSBP, MXNCF, N, NQ, NST, NFE, NJE, NQU INTEGER I, I1, I2, IER, II, J, J1, JJ, LENP, 1 MBA, MBAND, MEB1, MEBAND, ML, ML3, MU, NP1 - DOUBLE PRECISION Y, YH, EWT, FTEM, SAVF, WM - DOUBLE PRECISION ROWNS, + DOUBLE PRECISION Y, YH, EWT, FTEM, SAVF, WM + DOUBLE PRECISION ROWNS, 1 CCMAX, EL0, H, HMIN, HMXI, HU, RC, TN, UROUND DOUBLE PRECISION CON, DI, FAC, HL0, R, R0, SRUR, YI, YJ, YJJ, 1 VNORM @@ -17,7 +17,7 @@ 1 WM(*), IWM(*) COMMON /LS0001/ ROWNS(209), 2 CCMAX, EL0, H, HMIN, HMXI, HU, RC, TN, UROUND, - 3 IOWND(14), IOWNS(6), + 3 IOWND(14), IOWNS(6), 4 ICF, IERPJ, IERSL, JCUR, JSTART, KFLAG, L, METH, MITER, 5 MAXORD, MAXCOR, MSBP, MXNCF, N, NQ, NST, NFE, NJE, NQU C----------------------------------------------------------------------- @@ -34,7 +34,7 @@ C IN ADDITION TO VARIABLES DESCRIBED PREVIOUSLY, COMMUNICATION C WITH PREPJ USES THE FOLLOWING.. C Y = ARRAY CONTAINING PREDICTED VALUES ON ENTRY. -C FTEM = WORK ARRAY OF LENGTH N (ACOR IN STODE). +C FTEM = WORK ARRAY OF LENGTH N (ACOR IN STODE). C SAVF = ARRAY CONTAINING F EVALUATED AT PREDICTED Y. C WM = REAL WORK SPACE FOR MATRICES. ON OUTPUT IT CONTAINS THE C INVERSE DIAGONAL MATRIX IF MITER = 3 AND THE LU DECOMPOSITION @@ -44,7 +44,7 @@ C WM(1) = SQRT(UROUND), USED IN NUMERICAL JACOBIAN INCREMENTS. C WM(2) = H*EL0, SAVED FOR LATER USE IF MITER = 3. C IWM = INTEGER WORK SPACE CONTAINING PIVOT INFORMATION, STARTING AT -C IWM(21), IF MITER IS 1, 2, 4, OR 5. IWM ALSO CONTAINS BAND +C IWM(21), IF MITER IS 1, 2, 4, OR 5. IWM ALSO CONTAINS BAND C PARAMETERS ML = IWM(1) AND MU = IWM(2) IF MITER IS 4 OR 5. C EL0 = EL(1) (INPUT). C IERPJ = OUTPUT ERROR FLAG, = 0 IF NO TROUBLE, .GT. 0 IF @@ -54,7 +54,7 @@ C THIS ROUTINE ALSO USES THE COMMON VARIABLES EL0, H, TN, UROUND, C MITER, N, NFE, AND NJE. C----------------------------------------------------------------------- - NJE = NJE + 1 + NJE = NJE + 1 IERPJ = 0 JCUR = 1 HL0 = H*EL0 @@ -66,11 +66,11 @@ CALL JAC (NEQ, TN, Y, 0, 0, WM(3), N) CON = -HL0 DO 120 I = 1,LENP - 120 WM(I+2) = WM(I+2)*CON + 120 WM(I+2) = WM(I+2)*CON GO TO 240 C IF MITER = 2, MAKE N CALLS TO F TO APPROXIMATE J. -------------------- 200 FAC = VNORM (N, SAVF, EWT) - R0 = 1000.0D0*DABS(H)*UROUND*DBLE(N)*FAC + R0 = 1000.0D0*DABS(H)*UROUND*DBLE(N)*FAC IF (R0 .EQ. 0.0D0) R0 = 1.0D0 SRUR = WM(1) J1 = 2 @@ -85,35 +85,35 @@ DO 220 I = 1,N 220 WM(I+J1) = (FTEM(I) - SAVF(I))*FAC Y(J) = YJ - J1 = J1 + N + J1 = J1 + N 230 CONTINUE - NFE = NFE + N + NFE = NFE + N C ADD IDENTITY MATRIX. ------------------------------------------------- 240 J = 3 NP1 = N + 1 DO 250 I = 1,N - WM(J) = WM(J) + 1.0D0 - 250 J = J + NP1 + WM(J) = WM(J) + 1.0D0 + 250 J = J + NP1 C DO LU DECOMPOSITION ON P. -------------------------------------------- CALL DGETRF ( N, N, WM(3), N, IWM(21), IER) IF (IER .NE. 0) IERPJ = 1 RETURN C IF MITER = 3, CONSTRUCT A DIAGONAL APPROXIMATION TO J AND P. --------- 300 WM(2) = HL0 - R = EL0*0.1D0 + R = EL0*0.1D0 DO 310 I = 1,N 310 Y(I) = Y(I) + R*(H*SAVF(I) - YH(I,2)) IERR = 0 CALL F (NEQ, TN, Y, WM(3), IERR) IF (IERR .LT. 0) RETURN - NFE = NFE + 1 + NFE = NFE + 1 DO 320 I = 1,N R0 = H*SAVF(I) - YH(I,2) DI = 0.1D0*R0 - H*(WM(I+2) - SAVF(I)) WM(I+2) = 1.0D0 IF (DABS(R0) .LT. UROUND/EWT(I)) GO TO 320 IF (DABS(DI) .EQ. 0.0D0) GO TO 330 - WM(I+2) = 0.1D0*R0/DI + WM(I+2) = 0.1D0*R0/DI 320 CONTINUE RETURN 330 IERPJ = 1 @@ -130,7 +130,7 @@ CALL JAC (NEQ, TN, Y, ML, MU, WM(ML3), MEBAND) CON = -HL0 DO 420 I = 1,LENP - 420 WM(I+2) = WM(I+2)*CON + 420 WM(I+2) = WM(I+2)*CON GO TO 570 C IF MITER = 5, MAKE MBAND CALLS TO F TO APPROXIMATE J. ---------------- 500 ML = IWM(1) @@ -141,17 +141,17 @@ MEB1 = MEBAND - 1 SRUR = WM(1) FAC = VNORM (N, SAVF, EWT) - R0 = 1000.0D0*DABS(H)*UROUND*DBLE(N)*FAC + R0 = 1000.0D0*DABS(H)*UROUND*DBLE(N)*FAC IF (R0 .EQ. 0.0D0) R0 = 1.0D0 DO 560 J = 1,MBA DO 530 I = J,N,MBAND - YI = Y(I) + YI = Y(I) R = DMAX1(SRUR*DABS(YI),R0/EWT(I)) 530 Y(I) = Y(I) + R IERR = 0 CALL F (NEQ, TN, Y, FTEM, IERR) IF (IERR .LT. 0) RETURN - DO 550 JJ = J,N,MBAND + DO 550 JJ = J,N,MBAND Y(JJ) = YH(JJ,1) YJJ = Y(JJ) R = DMAX1(SRUR*DABS(YJJ),R0/EWT(JJ)) @@ -174,4 +174,4 @@ IF (IER .NE. 0) IERPJ = 1 RETURN C----------------------- END OF SUBROUTINE PREPJ ----------------------- - END + END
--- a/liboctave/cruft/odepack/sintdy.f +++ b/liboctave/cruft/odepack/sintdy.f @@ -93,11 +93,11 @@ 60 DKY(I) = R*DKY(I) RETURN C - 80 CALL XERRWD('SINTDY- K (=I1) illegal ', + 80 CALL XERRWD('SINTDY- K (=I1) illegal ', 1 30, 51, 0, 1, K, 0, 0, 0.0E0, 0.0E0) IFLAG = -1 RETURN - 90 CALL XERRWD('SINTDY- T (=R1) illegal ', + 90 CALL XERRWD('SINTDY- T (=R1) illegal ', 1 30, 52, 0, 0, 0, 0, 1, T, 0.0E0) CALL XERRWD( 1 ' T not in interval TCUR - HU (= R1) to TCUR (=R2) ',
--- a/liboctave/cruft/odepack/slsode.f +++ b/liboctave/cruft/odepack/slsode.f @@ -295,10 +295,10 @@ C on the interval from t = 0.0 to t = 4.E10, with initial conditions C y1 = 1.0, y2 = y3 = 0. The problem is stiff. C -C The following coding solves this problem with SLSODE, using -C MF = 21 and printing results at t = .4, 4., ..., 4.E10. It uses -C ITOL = 2 and ATOL much smaller for y2 than for y1 or y3 because y2 -C has much smaller values. At the end of the run, statistical +C The following coding solves this problem with SLSODE, using +C MF = 21 and printing results at t = .4, 4., ..., 4.E10. It uses +C ITOL = 2 and ATOL much smaller for y2 than for y1 or y3 because y2 +C has much smaller values. At the end of the run, statistical C quantities of interest are printed. C C EXTERNAL FEX, JEX @@ -389,7 +389,7 @@ C C *Portability: C Since NEQ is dimensioned inside SLSODE, some compilers may object -C to a call to SLSODE with NEQ a scalar variable. In this event, +C to a call to SLSODE with NEQ a scalar variable. In this event, C use DIMENSION NEQ(1). Similar remarks apply to RTOL and ATOL. C C Note to Cray users: @@ -877,9 +877,9 @@ C Optional Outputs C ---------------- C As optional additional output from SLSODE, the variables listed -C below are quantities related to the performance of SLSODE which +C below are quantities related to the performance of SLSODE which C are available to the user. These are communicated by way of the -C work arrays, but also have internal mnemonic names as shown. +C work arrays, but also have internal mnemonic names as shown. C Except where stated otherwise, all of these outputs are defined on C any successful return from SLSODE, and on any return with ISTATE = C -1, -2, -4, -5, or -6. On an illegal input return (ISTATE = -3), @@ -1021,7 +1021,7 @@ C If SLSODE is to be used in an overlay situation, the user must C declare, in the primary overlay, the variables in: C (1) the call sequence to SLSODE, -C (2) the internal COMMON block /SLS001/, of length 255 +C (2) the internal COMMON block /SLS001/, of length 255 C (218 single precision words followed by 37 integer words). C C If SLSODE is used on a system in which the contents of internal @@ -1157,7 +1157,7 @@ C 19930723 Changed R1MACH to RUMACH. (FNF) C 19930801 Removed ILLIN and NTREP from Common (affects driver logic); C minor changes to prologue and internal comments; -C changed Hollerith strings to quoted strings; +C changed Hollerith strings to quoted strings; C changed internal comments to mixed case; C replaced XERRWV with new version using character type; C changed dummy dimensions from 1 to *. (ACH) @@ -1504,17 +1504,17 @@ 280 IF ((TN + H) .NE. TN) GO TO 290 NHNIL = NHNIL + 1 IF (NHNIL .GT. MXHNIL) GO TO 290 - CALL XERRWD('SLSODE- Warning..internal T (=R1) and H (=R2) are', + CALL XERRWD('SLSODE- Warning..internal T (=R1) and H (=R2) are', 1 50, 101, 0, 0, 0, 0, 0, 0.0E0, 0.0E0) CALL XERRWD( - 1 ' such that in the machine, T + H = T on the next step ', + 1 ' such that in the machine, T + H = T on the next step ', 1 60, 101, 0, 0, 0, 0, 0, 0.0E0, 0.0E0) - CALL XERRWD(' (H = step size). Solver will continue anyway', + CALL XERRWD(' (H = step size). Solver will continue anyway', 1 50, 101, 0, 0, 0, 0, 2, TN, H) IF (NHNIL .LT. MXHNIL) GO TO 290 - CALL XERRWD('SLSODE- Above warning has been issued I1 times. ', + CALL XERRWD('SLSODE- Above warning has been issued I1 times. ', 1 50, 102, 0, 0, 0, 0, 0, 0.0E0, 0.0E0) - CALL XERRWD(' It will not be issued again for this problem', + CALL XERRWD(' It will not be issued again for this problem', 1 50, 102, 0, 1, MXHNIL, 0, 0, 0.0E0, 0.0E0) 290 CONTINUE C----------------------------------------------------------------------- @@ -1587,39 +1587,39 @@ C are loaded into the work arrays before returning. C----------------------------------------------------------------------- C The maximum number of steps was taken before reaching TOUT. ---------- - 500 CALL XERRWD('SLSODE- At current T (=R1), MXSTEP (=I1) steps ', + 500 CALL XERRWD('SLSODE- At current T (=R1), MXSTEP (=I1) steps ', 1 50, 201, 0, 0, 0, 0, 0, 0.0E0, 0.0E0) - CALL XERRWD(' taken on this call before reaching TOUT ', + CALL XERRWD(' taken on this call before reaching TOUT ', 1 50, 201, 0, 1, MXSTEP, 0, 1, TN, 0.0E0) ISTATE = -1 GO TO 580 C EWT(I) .LE. 0.0 for some I (not at start of problem). ---------------- 510 EWTI = RWORK(LEWT+I-1) - CALL XERRWD('SLSODE- At T (=R1), EWT(I1) has become R2 .LE. 0.', + CALL XERRWD('SLSODE- At T (=R1), EWT(I1) has become R2 .LE. 0.', 1 50, 202, 0, 1, I, 0, 2, TN, EWTI) ISTATE = -6 GO TO 580 C Too much accuracy requested for machine precision. ------------------- - 520 CALL XERRWD('SLSODE- At T (=R1), too much accuracy requested ', + 520 CALL XERRWD('SLSODE- At T (=R1), too much accuracy requested ', 1 50, 203, 0, 0, 0, 0, 0, 0.0E0, 0.0E0) - CALL XERRWD(' for precision of machine.. see TOLSF (=R2) ', + CALL XERRWD(' for precision of machine.. see TOLSF (=R2) ', 1 50, 203, 0, 0, 0, 0, 2, TN, TOLSF) RWORK(14) = TOLSF ISTATE = -2 GO TO 580 C KFLAG = -1. Error test failed repeatedly or with ABS(H) = HMIN. ----- - 530 CALL XERRWD('SLSODE- At T(=R1) and step size H(=R2), the error', + 530 CALL XERRWD('SLSODE- At T(=R1) and step size H(=R2), the error', 1 50, 204, 0, 0, 0, 0, 0, 0.0E0, 0.0E0) - CALL XERRWD(' test failed repeatedly or with ABS(H) = HMIN', + CALL XERRWD(' test failed repeatedly or with ABS(H) = HMIN', 1 50, 204, 0, 0, 0, 0, 2, TN, H) ISTATE = -4 GO TO 560 C KFLAG = -2. Convergence failed repeatedly or with ABS(H) = HMIN. ---- 540 CALL XERRWD('SLSODE- At T (=R1) and step size H (=R2), the ', 1 50, 205, 0, 0, 0, 0, 0, 0.0E0, 0.0E0) - CALL XERRWD(' corrector convergence failed repeatedly ', + CALL XERRWD(' corrector convergence failed repeatedly ', 1 50, 205, 0, 0, 0, 0, 0, 0.0E0, 0.0E0) - CALL XERRWD(' or with ABS(H) = HMIN ', + CALL XERRWD(' or with ABS(H) = HMIN ', 1 30, 205, 0, 0, 0, 0, 2, TN, H) ISTATE = -5 C Compute IMXER if relevant. ------------------------------------------- @@ -1649,76 +1649,76 @@ C Block I. C The following block handles all error returns due to illegal input C (ISTATE = -3), as detected before calling the core integrator. -C First the error message routine is called. If the illegal input +C First the error message routine is called. If the illegal input C is a negative ISTATE, the run is aborted (apparent infinite loop). C----------------------------------------------------------------------- 601 CALL XERRWD('SLSODE- ISTATE (=I1) illegal ', 1 30, 1, 0, 1, ISTATE, 0, 0, 0.0E0, 0.0E0) IF (ISTATE .LT. 0) GO TO 800 GO TO 700 - 602 CALL XERRWD('SLSODE- ITASK (=I1) illegal ', + 602 CALL XERRWD('SLSODE- ITASK (=I1) illegal ', 1 30, 2, 0, 1, ITASK, 0, 0, 0.0E0, 0.0E0) GO TO 700 - 603 CALL XERRWD('SLSODE- ISTATE .GT. 1 but SLSODE not initialized ', + 603 CALL XERRWD('SLSODE- ISTATE .GT. 1 but SLSODE not initialized ', 1 50, 3, 0, 0, 0, 0, 0, 0.0E0, 0.0E0) GO TO 700 - 604 CALL XERRWD('SLSODE- NEQ (=I1) .LT. 1 ', + 604 CALL XERRWD('SLSODE- NEQ (=I1) .LT. 1 ', 1 30, 4, 0, 1, NEQ(1), 0, 0, 0.0E0, 0.0E0) GO TO 700 - 605 CALL XERRWD('SLSODE- ISTATE = 3 and NEQ increased (I1 to I2) ', + 605 CALL XERRWD('SLSODE- ISTATE = 3 and NEQ increased (I1 to I2) ', 1 50, 5, 0, 2, N, NEQ(1), 0, 0.0E0, 0.0E0) GO TO 700 606 CALL XERRWD('SLSODE- ITOL (=I1) illegal ', 1 30, 6, 0, 1, ITOL, 0, 0, 0.0E0, 0.0E0) GO TO 700 - 607 CALL XERRWD('SLSODE- IOPT (=I1) illegal ', + 607 CALL XERRWD('SLSODE- IOPT (=I1) illegal ', 1 30, 7, 0, 1, IOPT, 0, 0, 0.0E0, 0.0E0) GO TO 700 - 608 CALL XERRWD('SLSODE- MF (=I1) illegal ', + 608 CALL XERRWD('SLSODE- MF (=I1) illegal ', 1 30, 8, 0, 1, MF, 0, 0, 0.0E0, 0.0E0) GO TO 700 - 609 CALL XERRWD('SLSODE- ML (=I1) illegal.. .LT.0 or .GE.NEQ (=I2)', + 609 CALL XERRWD('SLSODE- ML (=I1) illegal.. .LT.0 or .GE.NEQ (=I2)', 1 50, 9, 0, 2, ML, NEQ(1), 0, 0.0E0, 0.0E0) GO TO 700 - 610 CALL XERRWD('SLSODE- MU (=I1) illegal.. .LT.0 or .GE.NEQ (=I2)', + 610 CALL XERRWD('SLSODE- MU (=I1) illegal.. .LT.0 or .GE.NEQ (=I2)', 1 50, 10, 0, 2, MU, NEQ(1), 0, 0.0E0, 0.0E0) GO TO 700 - 611 CALL XERRWD('SLSODE- MAXORD (=I1) .LT. 0 ', + 611 CALL XERRWD('SLSODE- MAXORD (=I1) .LT. 0 ', 1 30, 11, 0, 1, MAXORD, 0, 0, 0.0E0, 0.0E0) GO TO 700 - 612 CALL XERRWD('SLSODE- MXSTEP (=I1) .LT. 0 ', + 612 CALL XERRWD('SLSODE- MXSTEP (=I1) .LT. 0 ', 1 30, 12, 0, 1, MXSTEP, 0, 0, 0.0E0, 0.0E0) GO TO 700 - 613 CALL XERRWD('SLSODE- MXHNIL (=I1) .LT. 0 ', + 613 CALL XERRWD('SLSODE- MXHNIL (=I1) .LT. 0 ', 1 30, 13, 0, 1, MXHNIL, 0, 0, 0.0E0, 0.0E0) GO TO 700 - 614 CALL XERRWD('SLSODE- TOUT (=R1) behind T (=R2) ', + 614 CALL XERRWD('SLSODE- TOUT (=R1) behind T (=R2) ', 1 40, 14, 0, 0, 0, 0, 2, TOUT, T) - CALL XERRWD(' Integration direction is given by H0 (=R1) ', + CALL XERRWD(' Integration direction is given by H0 (=R1) ', 1 50, 14, 0, 0, 0, 0, 1, H0, 0.0E0) GO TO 700 - 615 CALL XERRWD('SLSODE- HMAX (=R1) .LT. 0.0 ', + 615 CALL XERRWD('SLSODE- HMAX (=R1) .LT. 0.0 ', 1 30, 15, 0, 0, 0, 0, 1, HMAX, 0.0E0) GO TO 700 - 616 CALL XERRWD('SLSODE- HMIN (=R1) .LT. 0.0 ', + 616 CALL XERRWD('SLSODE- HMIN (=R1) .LT. 0.0 ', 1 30, 16, 0, 0, 0, 0, 1, HMIN, 0.0E0) GO TO 700 617 CALL XERRWD( - 1 'SLSODE- RWORK length needed, LENRW (=I1), exceeds LRW (=I2)', + 1 'SLSODE- RWORK length needed, LENRW (=I1), exceeds LRW (=I2)', 1 60, 17, 0, 2, LENRW, LRW, 0, 0.0E0, 0.0E0) GO TO 700 618 CALL XERRWD( 1 'SLSODE- IWORK length needed, LENIW (=I1), exceeds LIW (=I2)', 1 60, 18, 0, 2, LENIW, LIW, 0, 0.0E0, 0.0E0) GO TO 700 - 619 CALL XERRWD('SLSODE- RTOL(I1) is R1 .LT. 0.0 ', + 619 CALL XERRWD('SLSODE- RTOL(I1) is R1 .LT. 0.0 ', 1 40, 19, 0, 1, I, 0, 1, RTOLI, 0.0E0) GO TO 700 - 620 CALL XERRWD('SLSODE- ATOL(I1) is R1 .LT. 0.0 ', + 620 CALL XERRWD('SLSODE- ATOL(I1) is R1 .LT. 0.0 ', 1 40, 20, 0, 1, I, 0, 1, ATOLI, 0.0E0) GO TO 700 621 EWTI = RWORK(LEWT+I-1) - CALL XERRWD('SLSODE- EWT(I1) is R1 .LE. 0.0 ', + CALL XERRWD('SLSODE- EWT(I1) is R1 .LE. 0.0 ', 1 40, 21, 0, 1, I, 0, 1, EWTI, 0.0E0) GO TO 700 622 CALL XERRWD( @@ -1726,7 +1726,7 @@ 1 60, 22, 0, 0, 0, 0, 2, TOUT, T) GO TO 700 623 CALL XERRWD( - 1 'SLSODE- ITASK = I1 and TOUT (=R1) behind TCUR - HU (= R2) ', + 1 'SLSODE- ITASK = I1 and TOUT (=R1) behind TCUR - HU (= R2) ', 1 60, 23, 0, 1, ITASK, 0, 2, TOUT, TP) GO TO 700 624 CALL XERRWD( @@ -1744,13 +1744,13 @@ 1 60, 26, 0, 0, 0, 0, 1, TOLSF, 0.0E0) RWORK(14) = TOLSF GO TO 700 - 627 CALL XERRWD('SLSODE- Trouble in SINTDY. ITASK = I1, TOUT = R1', + 627 CALL XERRWD('SLSODE- Trouble in SINTDY. ITASK = I1, TOUT = R1', 1 50, 27, 0, 1, ITASK, 0, 1, TOUT, 0.0E0) C 700 ISTATE = -3 RETURN C - 800 CALL XERRWD('SLSODE- Run aborted.. apparent infinite loop ', + 800 CALL XERRWD('SLSODE- Run aborted.. apparent infinite loop ', 1 50, 303, 2, 0, 0, 0, 0, 0.0E0, 0.0E0) RETURN C----------------------- END OF SUBROUTINE SLSODE ----------------------
--- a/liboctave/cruft/odepack/solsy.f +++ b/liboctave/cruft/odepack/solsy.f @@ -6,17 +6,17 @@ 2 MAXORD, MAXCOR, MSBP, MXNCF, N, NQ, NST, NFE, NJE, NQU INTEGER I, MEBAND, ML, MU DOUBLE PRECISION WM, X, TEM - DOUBLE PRECISION ROWNS, + DOUBLE PRECISION ROWNS, 1 CCMAX, EL0, H, HMIN, HMXI, HU, RC, TN, UROUND - DOUBLE PRECISION DI, HL0, PHL0, R + DOUBLE PRECISION DI, HL0, PHL0, R DIMENSION WM(*), IWM(*), X(*), TEM(*) COMMON /LS0001/ ROWNS(209), 2 CCMAX, EL0, H, HMIN, HMXI, HU, RC, TN, UROUND, - 3 IOWND(14), IOWNS(6), + 3 IOWND(14), IOWNS(6), 4 ICF, IERPJ, IERSL, JCUR, JSTART, KFLAG, L, METH, MITER, 5 MAXORD, MAXCOR, MSBP, MXNCF, N, NQ, NST, NFE, NJE, NQU C----------------------------------------------------------------------- -C THIS ROUTINE MANAGES THE SOLUTION OF THE LINEAR SYSTEM ARISING FROM +C THIS ROUTINE MANAGES THE SOLUTION OF THE LINEAR SYSTEM ARISING FROM C A CHORD ITERATION. IT IS CALLED IF MITER .NE. 0. C IF MITER IS 1 OR 2, IT CALLS DGETRS TO ACCOMPLISH THIS. C IF MITER = 3 IT UPDATES THE COEFFICIENT H*EL0 IN THE DIAGONAL @@ -24,18 +24,18 @@ C IF MITER IS 4 OR 5, IT CALLS DGBTRS. C COMMUNICATION WITH SOLSY USES THE FOLLOWING VARIABLES.. C WM = REAL WORK SPACE CONTAINING THE INVERSE DIAGONAL MATRIX IF -C MITER = 3 AND THE LU DECOMPOSITION OF THE MATRIX OTHERWISE. +C MITER = 3 AND THE LU DECOMPOSITION OF THE MATRIX OTHERWISE. C STORAGE OF MATRIX ELEMENTS STARTS AT WM(3). C WM ALSO CONTAINS THE FOLLOWING MATRIX-RELATED DATA.. C WM(1) = SQRT(UROUND) (NOT USED HERE), C WM(2) = HL0, THE PREVIOUS VALUE OF H*EL0, USED IF MITER = 3. C IWM = INTEGER WORK SPACE CONTAINING PIVOT INFORMATION, STARTING AT -C IWM(21), IF MITER IS 1, 2, 4, OR 5. IWM ALSO CONTAINS BAND +C IWM(21), IF MITER IS 1, 2, 4, OR 5. IWM ALSO CONTAINS BAND C PARAMETERS ML = IWM(1) AND MU = IWM(2) IF MITER IS 4 OR 5. C X = THE RIGHT-HAND SIDE VECTOR ON INPUT, AND THE SOLUTION VECTOR C ON OUTPUT, OF LENGTH N. -C TEM = VECTOR OF WORK SPACE OF LENGTH N, NOT USED IN THIS VERSION. -C IERSL = OUTPUT FLAG (IN COMMON). IERSL = 0 IF NO TROUBLE OCCURRED. +C TEM = VECTOR OF WORK SPACE OF LENGTH N, NOT USED IN THIS VERSION. +C IERSL = OUTPUT FLAG (IN COMMON). IERSL = 0 IF NO TROUBLE OCCURRED. C IERSL = 1 IF A SINGULAR MATRIX AROSE WITH MITER = 3. C THIS ROUTINE ALSO USES THE COMMON VARIABLES EL0, H, MITER, AND N. C----------------------------------------------------------------------- @@ -62,8 +62,8 @@ 400 ML = IWM(1) MU = IWM(2) MEBAND = 2*ML + MU + 1 - CALL DGBTRS ( 'N', N, ML, MU, 1, WM(3), MEBAND, IWM(21), X, N, + CALL DGBTRS ( 'N', N, ML, MU, 1, WM(3), MEBAND, IWM(21), X, N, * INLPCK) RETURN C----------------------- END OF SUBROUTINE SOLSY ----------------------- - END + END
--- a/liboctave/cruft/odepack/ssolsy.f +++ b/liboctave/cruft/odepack/ssolsy.f @@ -84,7 +84,7 @@ 400 ML = IWM(1) MU = IWM(2) MEBAND = 2*ML + MU + 1 - CALL SGBTRS ( 'N', N, ML, MU, 1, WM(3), MEBAND, IWM(21), X, N, + CALL SGBTRS ( 'N', N, ML, MU, 1, WM(3), MEBAND, IWM(21), X, N, * INLPCK) RETURN C----------------------- END OF SUBROUTINE SSOLSY ----------------------
--- a/liboctave/cruft/odepack/stode.f +++ b/liboctave/cruft/odepack/stode.f @@ -51,9 +51,9 @@ C THE ESTIMATED ONE-STEP LOCAL ERROR IN Y(I). C WM,IWM = REAL AND INTEGER WORK ARRAYS ASSOCIATED WITH MATRIX C OPERATIONS IN CHORD ITERATION (MITER .NE. 0). -C PJAC = NAME OF ROUTINE TO EVALUATE AND PREPROCESS JACOBIAN MATRIX +C PJAC = NAME OF ROUTINE TO EVALUATE AND PREPROCESS JACOBIAN MATRIX C AND P = I - H*EL0*JAC, IF A CHORD METHOD IS BEING USED. -C SLVS = NAME OF ROUTINE TO SOLVE LINEAR SYSTEM IN CHORD ITERATION. +C SLVS = NAME OF ROUTINE TO SOLVE LINEAR SYSTEM IN CHORD ITERATION. C CCMAX = MAXIMUM RELATIVE CHANGE IN H*EL0 BEFORE PJAC IS CALLED. C H = THE STEP SIZE TO BE ATTEMPTED ON THE NEXT STEP. C H IS ALTERED BY THE ERROR CONTROL ALGORITHM DURING THE @@ -61,7 +61,7 @@ C SIGN MUST REMAIN CONSTANT THROUGHOUT THE PROBLEM. C HMIN = THE MINIMUM ABSOLUTE VALUE OF THE STEP SIZE H TO BE USED. C HMXI = INVERSE OF THE MAXIMUM ABSOLUTE VALUE OF H TO BE USED. -C HMXI = 0.0 IS ALLOWED AND CORRESPONDS TO AN INFINITE HMAX. +C HMXI = 0.0 IS ALLOWED AND CORRESPONDS TO AN INFINITE HMAX. C HMIN AND HMXI MAY BE CHANGED AT ANY TIME, BUT WILL NOT C TAKE EFFECT UNTIL THE NEXT CHANGE OF H IS CONSIDERED. C TN = THE INDEPENDENT VARIABLE. TN IS UPDATED ON EACH STEP TAKEN. @@ -82,11 +82,11 @@ C A RETURN WITH KFLAG = -1 OR -2 MEANS EITHER C ABS(H) = HMIN OR 10 CONSECUTIVE FAILURES OCCURRED. C ON A RETURN WITH KFLAG NEGATIVE, THE VALUES OF TN AND -C THE YH ARRAY ARE AS OF THE BEGINNING OF THE LAST +C THE YH ARRAY ARE AS OF THE BEGINNING OF THE LAST C STEP, AND H IS THE LAST STEP SIZE ATTEMPTED. C MAXORD = THE MAXIMUM ORDER OF INTEGRATION METHOD TO BE ALLOWED. C MAXCOR = THE MAXIMUM NUMBER OF CORRECTOR ITERATIONS ALLOWED. -C MSBP = MAXIMUM NUMBER OF STEPS BETWEEN PJAC CALLS (MITER .GT. 0). +C MSBP = MAXIMUM NUMBER OF STEPS BETWEEN PJAC CALLS (MITER .GT. 0). C MXNCF = MAXIMUM NUMBER OF CONVERGENCE FAILURES ALLOWED. C METH/MITER = THE METHOD FLAGS. SEE DESCRIPTION IN DRIVER. C N = THE NUMBER OF FIRST-ORDER DIFFERENTIAL EQUATIONS. @@ -105,8 +105,8 @@ IF (JSTART .EQ. -2) GO TO 160 C----------------------------------------------------------------------- C ON THE FIRST CALL, THE ORDER IS SET TO 1, AND OTHER VARIABLES ARE -C INITIALIZED. RMAX IS THE MAXIMUM RATIO BY WHICH H CAN BE INCREASED -C IN A SINGLE STEP. IT IS INITIALLY 1.E4 TO COMPENSATE FOR THE SMALL +C INITIALIZED. RMAX IS THE MAXIMUM RATIO BY WHICH H CAN BE INCREASED +C IN A SINGLE STEP. IT IS INITIALLY 1.E4 TO COMPENSATE FOR THE SMALL C INITIAL H, BUT THEN IS NORMALLY EQUAL TO 10. IF A FAILURE C OCCURS (IN CORRECTOR CONVERGENCE OR ERROR TEST), RMAX IS SET AT 2 C FOR THE NEXT INCREASE. @@ -118,7 +118,7 @@ RMAX = 10000.0D0 RC = 0.0D0 EL0 = 1.0D0 - CRATE = 0.7D0 + CRATE = 0.7D0 HOLD = H MEO = METH NSLP = 0 @@ -158,7 +158,7 @@ EL0 = EL(1) CONIT = 0.5D0/DBLE(NQ+2) DDN = VNORM (N, SAVF, EWT)/TESCO(1,L) - EXDN = 1.0D0/DBLE(L) + EXDN = 1.0D0/DBLE(L) RHDN = 1.0D0/(1.3D0*DDN**EXDN + 0.0000013D0) RH = DMIN1(RHDN,1.0D0) IREDO = 3 @@ -197,20 +197,20 @@ DO 180 J = 2,L R = R*RH DO 180 I = 1,N - 180 YH(I,J) = YH(I,J)*R + 180 YH(I,J) = YH(I,J)*R H = H*RH RC = RC*RH IALTH = L IF (IREDO .EQ. 0) GO TO 690 C----------------------------------------------------------------------- -C THIS SECTION COMPUTES THE PREDICTED VALUES BY EFFECTIVELY +C THIS SECTION COMPUTES THE PREDICTED VALUES BY EFFECTIVELY C MULTIPLYING THE YH ARRAY BY THE PASCAL TRIANGLE MATRIX. C RC IS THE RATIO OF NEW TO OLD VALUES OF THE COEFFICIENT H*EL(1). C WHEN RC DIFFERS FROM 1 BY MORE THAN CCMAX, IPUP IS SET TO MITER C TO FORCE PJAC TO BE CALLED, IF A JACOBIAN IS INVOLVED. C IN ANY CASE, PJAC IS CALLED AT LEAST EVERY MSBP STEPS. C----------------------------------------------------------------------- - 200 IF (DABS(RC-1.0D0) .GT. CCMAX) IPUP = MITER + 200 IF (DABS(RC-1.0D0) .GT. CCMAX) IPUP = MITER IF (NST .GE. NSLP+MSBP) IPUP = MITER TN = TN + H I1 = NQNYH + 1 @@ -221,10 +221,10 @@ 210 YH1(I) = YH1(I) + YH1(I+NYH) 215 CONTINUE C----------------------------------------------------------------------- -C UP TO MAXCOR CORRECTOR ITERATIONS ARE TAKEN. A CONVERGENCE TEST IS +C UP TO MAXCOR CORRECTOR ITERATIONS ARE TAKEN. A CONVERGENCE TEST IS C MADE ON THE R.M.S. NORM OF EACH CORRECTION, WEIGHTED BY THE ERROR C WEIGHT VECTOR EWT. THE SUM OF THE CORRECTIONS IS ACCUMULATED IN THE -C VECTOR ACOR(I). THE YH ARRAY IS NOT ALTERED IN THE CORRECTOR LOOP. +C VECTOR ACOR(I). THE YH ARRAY IS NOT ALTERED IN THE CORRECTOR LOOP. C----------------------------------------------------------------------- 220 M = 0 DO 230 I = 1,N @@ -232,7 +232,7 @@ IERR = 0 CALL F (NEQ, TN, Y, SAVF, IERR) IF (IERR .LT. 0) RETURN - NFE = NFE + 1 + NFE = NFE + 1 IF (IPUP .LE. 0) GO TO 250 C----------------------------------------------------------------------- C IF INDICATED, THE MATRIX P = I - H*EL(1)*J IS REEVALUATED AND @@ -246,7 +246,7 @@ IPUP = 0 RC = 1.0D0 NSLP = NST - CRATE = 0.7D0 + CRATE = 0.7D0 IF (IERPJ .NE. 0) GO TO 430 250 DO 260 I = 1,N 260 ACOR(I) = 0.0D0 @@ -258,7 +258,7 @@ DO 290 I = 1,N SAVF(I) = H*SAVF(I) - YH(I,2) 290 Y(I) = SAVF(I) - ACOR(I) - DEL = VNORM (N, Y, EWT) + DEL = VNORM (N, Y, EWT) DO 300 I = 1,N Y(I) = YH(I,1) + EL(1)*SAVF(I) 300 ACOR(I) = SAVF(I) @@ -273,7 +273,7 @@ CALL SLVS (WM, IWM, Y, SAVF) IF (IERSL .LT. 0) GO TO 430 IF (IERSL .GT. 0) GO TO 410 - DEL = VNORM (N, Y, EWT) + DEL = VNORM (N, Y, EWT) DO 380 I = 1,N ACOR(I) = ACOR(I) + Y(I) 380 Y(I) = YH(I,1) + EL(1)*ACOR(I) @@ -291,11 +291,11 @@ IERR = 0 CALL F (NEQ, TN, Y, SAVF, IERR) IF (IERR .LT. 0) RETURN - NFE = NFE + 1 + NFE = NFE + 1 GO TO 270 C----------------------------------------------------------------------- C THE CORRECTOR ITERATION FAILED TO CONVERGE. -C IF MITER .NE. 0 AND THE JACOBIAN IS OUT OF DATE, PJAC IS CALLED FOR +C IF MITER .NE. 0 AND THE JACOBIAN IS OUT OF DATE, PJAC IS CALLED FOR C THE NEXT TRY. OTHERWISE THE YH ARRAY IS RETRACTED TO ITS VALUES C BEFORE PREDICTION, AND H IS REDUCED, IF POSSIBLE. IF H CANNOT BE C REDUCED OR MXNCF FAILURES HAVE OCCURRED, EXIT WITH KFLAG = -2. @@ -305,7 +305,7 @@ IPUP = MITER GO TO 220 430 ICF = 2 - NCF = NCF + 1 + NCF = NCF + 1 RMAX = 2.0D0 TN = TOLD I1 = NQNYH + 1 @@ -344,7 +344,7 @@ C----------------------------------------------------------------------- KFLAG = 0 IREDO = 0 - NST = NST + 1 + NST = NST + 1 HU = H NQU = NQ DO 470 J = 1,L @@ -361,8 +361,8 @@ C THE ERROR TEST FAILED. KFLAG KEEPS TRACK OF MULTIPLE FAILURES. C RESTORE TN AND THE YH ARRAY TO THEIR PREVIOUS VALUES, AND PREPARE C TO TRY THE STEP AGAIN. COMPUTE THE OPTIMUM STEP SIZE FOR THIS OR -C ONE LOWER ORDER. AFTER 2 OR MORE FAILURES, H IS FORCED TO DECREASE -C BY A FACTOR OF 0.2 OR LESS. +C ONE LOWER ORDER. AFTER 2 OR MORE FAILURES, H IS FORCED TO DECREASE +C BY A FACTOR OF 0.2 OR LESS. C----------------------------------------------------------------------- 500 KFLAG = KFLAG - 1 TN = TOLD @@ -380,9 +380,9 @@ RHUP = 0.0D0 GO TO 540 C----------------------------------------------------------------------- -C REGARDLESS OF THE SUCCESS OR FAILURE OF THE STEP, FACTORS +C REGARDLESS OF THE SUCCESS OR FAILURE OF THE STEP, FACTORS C RHDN, RHSM, AND RHUP ARE COMPUTED, BY WHICH H COULD BE MULTIPLIED -C AT ORDER NQ - 1, ORDER NQ, OR ORDER NQ + 1, RESPECTIVELY. +C AT ORDER NQ - 1, ORDER NQ, OR ORDER NQ + 1, RESPECTIVELY. C IN THE CASE OF FAILURE, RHUP = 0.0 TO AVOID AN ORDER INCREASE. C THE LARGEST OF THESE IS DETERMINED AND THE NEW ORDER CHOSEN C ACCORDINGLY. IF THE ORDER IS TO BE INCREASED, WE COMPUTE ONE @@ -395,12 +395,12 @@ DUP = VNORM (N, SAVF, EWT)/TESCO(3,NQ) EXUP = 1.0D0/DBLE(L+1) RHUP = 1.0D0/(1.4D0*DUP**EXUP + 0.0000014D0) - 540 EXSM = 1.0D0/DBLE(L) + 540 EXSM = 1.0D0/DBLE(L) RHSM = 1.0D0/(1.2D0*DSM**EXSM + 0.0000012D0) RHDN = 0.0D0 IF (NQ .EQ. 1) GO TO 560 DDN = VNORM (N, YH(1,L), EWT)/TESCO(1,NQ) - EXDN = 1.0D0/DBLE(NQ) + EXDN = 1.0D0/DBLE(NQ) RHDN = 1.0D0/(1.3D0*DDN**EXDN + 0.0000013D0) 560 IF (RHSM .GE. RHUP) GO TO 570 IF (RHUP .GT. RHDN) GO TO 590 @@ -409,14 +409,14 @@ NEWQ = NQ RH = RHSM GO TO 620 - 580 NEWQ = NQ - 1 + 580 NEWQ = NQ - 1 RH = RHDN IF (KFLAG .LT. 0 .AND. RH .GT. 1.0D0) RH = 1.0D0 GO TO 620 590 NEWQ = L RH = RHUP IF (RH .LT. 1.1D0) GO TO 610 - R = EL(L)/DBLE(L) + R = EL(L)/DBLE(L) DO 600 I = 1,N 600 YH(I,NEWQ+1) = ACOR(I)*R GO TO 630 @@ -438,7 +438,7 @@ C CONTROL REACHES THIS SECTION IF 3 OR MORE FAILURES HAVE OCCURED. C IF 10 FAILURES HAVE OCCURRED, EXIT WITH KFLAG = -1. C IT IS ASSUMED THAT THE DERIVATIVES THAT HAVE ACCUMULATED IN THE -C YH ARRAY HAVE ERRORS OF THE WRONG ORDER. HENCE THE FIRST +C YH ARRAY HAVE ERRORS OF THE WRONG ORDER. HENCE THE FIRST C DERIVATIVE IS RECOMPUTED, AND THE ORDER IS SET TO 1. THEN C H IS REDUCED BY A FACTOR OF 10, AND THE STEP IS RETRIED, C UNTIL IT SUCCEEDS OR H REACHES HMIN. @@ -452,7 +452,7 @@ IERR = 0 CALL F (NEQ, TN, Y, SAVF, IERR) IF (IERR .LT. 0) RETURN - NFE = NFE + 1 + NFE = NFE + 1 DO 650 I = 1,N 650 YH(I,2) = H*SAVF(I) IPUP = MITER @@ -472,7 +472,7 @@ GO TO 720 680 KFLAG = -3 GO TO 720 - 690 RMAX = 10.0D0 + 690 RMAX = 10.0D0 700 R = 1.0D0/TESCO(2,NQU) DO 710 I = 1,N 710 ACOR(I) = ACOR(I)*R @@ -480,4 +480,4 @@ JSTART = 1 RETURN C----------------------- END OF SUBROUTINE STODE ----------------------- - END + END
--- a/liboctave/cruft/odepack/vnorm.f +++ b/liboctave/cruft/odepack/vnorm.f @@ -10,9 +10,9 @@ DOUBLE PRECISION V, W, SUM DIMENSION V(N), W(N) SUM = 0.0D0 - DO 10 I = 1,N + DO 10 I = 1,N 10 SUM = SUM + (V(I)*W(I))**2 - VNORM = DSQRT(SUM/DBLE(N)) + VNORM = DSQRT(SUM/DBLE(N)) RETURN C----------------------- END OF FUNCTION VNORM ------------------------- - END + END
--- a/liboctave/cruft/ranlib/Basegen.doc +++ b/liboctave/cruft/ranlib/Basegen.doc @@ -33,7 +33,7 @@ Barry W. Brown James Lovato - + @@ -177,49 +177,49 @@ A. SETTING THE SEED OF ALL GENERATORS -C********************************************************************** -C -C SUBROUTINE SETALL(ISEED1,ISEED2) -C SET ALL random number generators -C -C Sets the initial seed of generator 1 to ISEED1 and ISEED2. The -C initial seeds of the other generators are set accordingly, and -C all generators states are set to these seeds. -C -C Arguments -C -C -C ISEED1 -> First of two integer seeds -C INTEGER ISEED1 -C -C ISEED2 -> Second of two integer seeds -C INTEGER ISEED1 -C -C********************************************************************** +C********************************************************************** +C +C SUBROUTINE SETALL(ISEED1,ISEED2) +C SET ALL random number generators +C +C Sets the initial seed of generator 1 to ISEED1 and ISEED2. The +C initial seeds of the other generators are set accordingly, and +C all generators states are set to these seeds. +C +C Arguments +C +C +C ISEED1 -> First of two integer seeds +C INTEGER ISEED1 +C +C ISEED2 -> Second of two integer seeds +C INTEGER ISEED1 +C +C********************************************************************** B. OBTAINING RANDOM NUMBERS -C********************************************************************** -C -C INTEGER FUNCTION IGNLGI() -C GeNerate LarGe Integer -C -C Returns a random integer following a uniform distribution over -C (1, 2147483562) using the current generator. -C -C********************************************************************** +C********************************************************************** +C +C INTEGER FUNCTION IGNLGI() +C GeNerate LarGe Integer +C +C Returns a random integer following a uniform distribution over +C (1, 2147483562) using the current generator. +C +C********************************************************************** -C********************************************************************** -C -C REAL FUNCTION RANF() -C RANDom number generator as a Function -C -C Returns a random floating point number from a uniform distribution -C over 0 - 1 (endpoints of this interval are not returned) using the -C current generator -C -C********************************************************************** +C********************************************************************** +C +C REAL FUNCTION RANF() +C RANDom number generator as a Function +C +C Returns a random floating point number from a uniform distribution +C over 0 - 1 (endpoints of this interval are not returned) using the +C current generator +C +C********************************************************************** @@ -228,116 +228,116 @@ C. SETTING AND OBTAINING THE NUMBER OF THE CURRENT GENERATOR -C********************************************************************** -C -C SUBROUTINE SETCGN( G ) -C Set GeNerator -C +C********************************************************************** +C +C SUBROUTINE SETCGN( G ) +C Set GeNerator +C C Sets the current generator to G. All references to a generator -C are to the current generator. -C -C Arguments -C -C G --> Number of the current random number generator (1..32) -C INTEGER G -C +C are to the current generator. +C +C Arguments +C +C G --> Number of the current random number generator (1..32) +C INTEGER G +C C********************************************************************** -C********************************************************************** -C -C SUBROUTINE GETCGN(G) -C Get GeNerator -C -C Returns in G the number of the current random number generator -C -C Arguments -C -C G <-- Number of the current random number generator (1..32) -C INTEGER G -C -C********************************************************************** - +C********************************************************************** +C +C SUBROUTINE GETCGN(G) +C Get GeNerator +C +C Returns in G the number of the current random number generator +C +C Arguments +C +C G <-- Number of the current random number generator (1..32) +C INTEGER G +C +C********************************************************************** + D. OBTAINING OR CHANGING SEEDS IN CURRENT GENERATOR -C********************************************************************** -C -C SUBROUTINE ADVNST(K) -C ADV-a-N-ce ST-ate -C -C Advances the state of the current generator by 2^K values and -C resets the initial seed to that value. -C -C Arguments -C -C -C K -> The generator is advanced by 2^K values -C INTEGER K -C -C********************************************************************** +C********************************************************************** +C +C SUBROUTINE ADVNST(K) +C ADV-a-N-ce ST-ate +C +C Advances the state of the current generator by 2^K values and +C resets the initial seed to that value. +C +C Arguments +C +C +C K -> The generator is advanced by 2^K values +C INTEGER K +C +C********************************************************************** Base Random Number Generator Page 5 -C********************************************************************** -C -C SUBROUTINE GETSD(ISEED1,ISEED2) -C GET SeeD -C -C Returns the value of two integer seeds of the current generator +C********************************************************************** +C +C SUBROUTINE GETSD(ISEED1,ISEED2) +C GET SeeD +C +C Returns the value of two integer seeds of the current generator +C +C Arguments +C +C +C +C ISEED1 <- First integer seed of generator G +C INTEGER ISEED1 C -C Arguments -C -C -C -C ISEED1 <- First integer seed of generator G -C INTEGER ISEED1 -C -C ISEED2 <- Second integer seed of generator G -C INTEGER ISEED1 -C -C********************************************************************** +C ISEED2 <- Second integer seed of generator G +C INTEGER ISEED1 +C +C********************************************************************** -C********************************************************************** -C -C SUBROUTINE INITGN(ISDTYP) -C INIT-ialize current G-e-N-erator -C -C Reinitializes the state of the current generator +C********************************************************************** +C +C SUBROUTINE INITGN(ISDTYP) +C INIT-ialize current G-e-N-erator C -C Arguments -C -C -C ISDTYP -> The state to which the generator is to be set +C Reinitializes the state of the current generator +C +C Arguments +C +C +C ISDTYP -> The state to which the generator is to be set C ISDTYP = -1 => sets the seeds to their initial value C ISDTYP = 0 => sets the seeds to the first value of C the current block C ISDTYP = 1 => sets the seeds to the first value of C the next block -C -C INTEGER ISDTYP -C -C********************************************************************** +C +C INTEGER ISDTYP +C +C********************************************************************** -C********************************************************************** -C -C SUBROUTINE SETSD(ISEED1,ISEED2) -C SET S-ee-D of current generator -C +C********************************************************************** +C +C SUBROUTINE SETSD(ISEED1,ISEED2) +C SET S-ee-D of current generator +C C Resets the initial seed of the current generator to ISEED1 and C ISEED2. The seeds of the other generators remain unchanged. -C -C Arguments -C -C -C ISEED1 -> First integer seed -C INTEGER ISEED1 -C -C ISEED2 -> Second integer seed -C INTEGER ISEED1 -C -C********************************************************************** +C +C Arguments +C +C +C ISEED1 -> First integer seed +C INTEGER ISEED1 +C +C ISEED2 -> Second integer seed +C INTEGER ISEED1 +C +C********************************************************************** @@ -346,37 +346,37 @@ E. MISCELLANY -C********************************************************************** -C -C INTEGER FUNCTION MLTMOD(A,S,M) -C -C Returns (A*S) MOD M -C -C Arguments -C -C -C A, S, M --> -C INTEGER A,S,M -C -C********************************************************************** +C********************************************************************** +C +C INTEGER FUNCTION MLTMOD(A,S,M) +C +C Returns (A*S) MOD M +C +C Arguments +C +C +C A, S, M --> +C INTEGER A,S,M +C +C********************************************************************** -C********************************************************************** -C -C SUBROUTINE SETANT(QVALUE) -C SET ANTithetic -C -C Sets whether the current generator produces antithetic values. If -C X is the value normally returned from a uniform [0,1] random -C number generator then 1 - X is the antithetic value. If X is the -C value normally returned from a uniform [0,N] random number -C generator then N - 1 - X is the antithetic value. -C -C All generators are initialized to NOT generate antithetic values. -C -C Arguments -C -C QVALUE -> .TRUE. if generator G is to generating antithetic -C values, otherwise .FALSE. -C LOGICAL QVALUE -C -C********************************************************************** +C********************************************************************** +C +C SUBROUTINE SETANT(QVALUE) +C SET ANTithetic +C +C Sets whether the current generator produces antithetic values. If +C X is the value normally returned from a uniform [0,1] random +C number generator then 1 - X is the antithetic value. If X is the +C value normally returned from a uniform [0,N] random number +C generator then N - 1 - X is the antithetic value. +C +C All generators are initialized to NOT generate antithetic values. +C +C Arguments +C +C QVALUE -> .TRUE. if generator G is to generating antithetic +C values, otherwise .FALSE. +C LOGICAL QVALUE +C +C**********************************************************************
--- a/liboctave/cruft/ranlib/README +++ b/liboctave/cruft/ranlib/README @@ -142,13 +142,13 @@ Gamma -(Case R >= 1.0) +(Case R >= 1.0) Ahrens, J.H. and Dieter, U. Generating Gamma Variates by a Modified Rejection Technique. Comm. ACM, 25,1 (Jan. 1982), 47 - 54. -Algorithm GD +Algorithm GD -(Case 0.0 <= R <= 1.0) +(Case 0.0 <= R <= 1.0) Ahrens, J.H. and Dieter, U. Computer Methods for Sampling from Gamma, Beta, Poisson and Binomial Distributions. Computing, 12 (1974), @@ -221,17 +221,17 @@ Krogh, F. Algorithms Policy. ACM Tran. Math. Softw. 13(1987), 183-186. -We place the Randlib code that we have written in the public domain. +We place the Randlib code that we have written in the public domain. NO WARRANTY - + WE PROVIDE ABSOLUTELY NO WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THIS PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - + IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR ANY OF ITS COMPONENT INSTITUTIONS INCLUDING M. D. ANDERSON HOSPITAL BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, @@ -239,14 +239,14 @@ INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA OR ITS ANALYSIS BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES) THE PROGRAM. - + (Above NO WARRANTY modified from the GNU NO WARRANTY statement.) WHAT'S NEW IN VERSION 1.1? - + Random number generation for the Negative Binomial and Multinomial distributions has been included.
--- a/liboctave/cruft/ranlib/genbet.f +++ b/liboctave/cruft/ranlib/genbet.f @@ -127,7 +127,7 @@ C C Step 4 C -C JJV added checker to see if log(alpha/(b+w)) will +C JJV added checker to see if log(alpha/(b+w)) will C JJV overflow. If so, we count the log as -INF, and C JJV consequently evaluate conditional as true, i.e. C JJV the algorithm rejects the trial and starts over
--- a/liboctave/cruft/ranlib/genexp.f +++ b/liboctave/cruft/ranlib/genexp.f @@ -48,7 +48,7 @@ EXTERNAL sexpo C .. C .. Executable Statements .. -C JJV added check to ensure AV >= 0.0 +C JJV added check to ensure AV >= 0.0 IF (av.GE.0.0) GO TO 10 WRITE (*,*) 'AV < 0.0 in GENEXP - ABORT' WRITE (*,*) 'Value of AV: ',av
--- a/liboctave/cruft/ranlib/gennch.f +++ b/liboctave/cruft/ranlib/gennch.f @@ -47,7 +47,7 @@ C .. Intrinsic Functions .. INTRINSIC sqrt C .. -C JJV changed abort to df < 1, and added case: df = 1 +C JJV changed abort to df < 1, and added case: df = 1 C .. Executable Statements .. IF (.NOT. (df.LT.1.0.OR.xnonc.LT.0.0)) GO TO 10 WRITE (*,*) 'DF < 1 or XNONC < 0 in GENNCH - ABORT' @@ -65,5 +65,5 @@ C JJV case DF > 1.0 20 gennch = 2.0*sgamma((df-1.0)/2.0) + (snorm() + sqrt(xnonc))**2 30 RETURN - + END
--- a/liboctave/cruft/ranlib/gennf.f +++ b/liboctave/cruft/ranlib/gennf.f @@ -78,7 +78,7 @@ C xden = genchi(dfd)/dfd 30 xden = 2.0*sgamma(dfd/2.0)/dfd - + C JJV changed constant so that it will not underflow at compile time C JJV while not slowing generator by using double precision or logs. C IF (.NOT. (xden.LE. (1.0E-38*xnum))) GO TO 40
--- a/liboctave/cruft/ranlib/gennor.f +++ b/liboctave/cruft/ranlib/gennor.f @@ -49,7 +49,7 @@ EXTERNAL snorm C .. C .. Executable Statements .. -C JJV added check to ensure SD >= 0.0 +C JJV added check to ensure SD >= 0.0 IF (sd.GE.0.0) GO TO 10 WRITE (*,*) 'SD < 0.0 in GENNOR - ABORT' WRITE (*,*) 'Value of SD: ',sd
--- a/liboctave/cruft/ranlib/getsd.f +++ b/liboctave/cruft/ranlib/getsd.f @@ -62,7 +62,7 @@ IF (qrgnin()) GO TO 10 WRITE (*,*) ' GETSD called before random number generator ', + ' initialized -- abort!' - CALL XSTOPX + CALL XSTOPX + (' GETSD called before random number generator initialized') 10 CALL getcgn(g)
--- a/liboctave/cruft/ranlib/initgn.f +++ b/liboctave/cruft/ranlib/initgn.f @@ -66,7 +66,7 @@ IF (qrgnin()) GO TO 10 WRITE (*,*) ' INITGN called before random number generator ', + ' initialized -- abort!' - CALL XSTOPX + CALL XSTOPX + (' INITGN called before random number generator initialized') 10 CALL getcgn(g)
--- a/liboctave/cruft/ranlib/phrtsd.f +++ b/liboctave/cruft/ranlib/phrtsd.f @@ -61,11 +61,11 @@ C .. Intrinsic Functions .. INTRINSIC index,mod C .. -C JJV added Save statement for variable in Data statement +C JJV added Save statement for variable in Data statement C .. Save statements .. SAVE shift -C JJV end addition -C .. +C JJV end addition +C .. C .. Data statements .. DATA shift/1,64,4096,262144,16777216/ C ..
--- a/liboctave/cruft/ranlib/randlib.fdoc +++ b/liboctave/cruft/ranlib/randlib.fdoc @@ -33,7 +33,7 @@ Barry W. Brown James Lovato - + @@ -51,244 +51,244 @@ This work was supported by grant CA-16672 from the National Cancer Institute. -C********************************************************************** -C -C SUBROUTINE ADVNST(K) -C ADV-a-N-ce ST-ate -C -C Advances the state of the current generator by 2^K values and -C resets the initial seed to that value. -C -C This is a transcription from Pascal to Fortran of routine -C Advance_State from the paper -C -C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package -C with Splitting Facilities." ACM Transactions on Mathematical -C Software, 17:98-111 (1991) -C -C -C Arguments -C -C -C K -> The generator is advanced by2^K values -C INTEGER K -C -C********************************************************************** -C********************************************************************** -C -C REAL FUNCTION GENBET( A, B ) -C GeNerate BETa random deviate -C -C -C Function -C -C -C Returns a single random deviate from the beta distribution with -C parameters A and B. The density of the beta is -C x^(a-1) * (1-x)^(b-1) / B(a,b) for 0 < x < 1 -C -C -C Arguments -C -C -C A --> First parameter of the beta distribution -C REAL A +C********************************************************************** +C +C SUBROUTINE ADVNST(K) +C ADV-a-N-ce ST-ate +C +C Advances the state of the current generator by 2^K values and +C resets the initial seed to that value. +C +C This is a transcription from Pascal to Fortran of routine +C Advance_State from the paper +C +C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package +C with Splitting Facilities." ACM Transactions on Mathematical +C Software, 17:98-111 (1991) +C +C +C Arguments +C +C +C K -> The generator is advanced by2^K values +C INTEGER K +C +C********************************************************************** +C********************************************************************** +C +C REAL FUNCTION GENBET( A, B ) +C GeNerate BETa random deviate +C +C +C Function +C +C +C Returns a single random deviate from the beta distribution with +C parameters A and B. The density of the beta is +C x^(a-1) * (1-x)^(b-1) / B(a,b) for 0 < x < 1 +C +C +C Arguments +C +C +C A --> First parameter of the beta distribution +C REAL A C (A >= 1.0E-37) -C -C B --> Second parameter of the beta distribution -C REAL B +C +C B --> Second parameter of the beta distribution +C REAL B C (B >= 1.0E-37) -C -C -C Method -C -C -C R. C. H. Cheng -C Generating Beta Variables with Nonintegral Shape Parameters -C Communications of the ACM, 21:317-322 (1978) -C (Algorithms BB and BC) -C -C********************************************************************** -C********************************************************************** -C -C REAL FUNCTION GENCHI( DF ) -C Generate random value of CHIsquare variable -C -C -C Function -C -C -C Generates random deviate from the distribution of a chisquare -C with DF degrees of freedom random variable. -C -C -C Arguments -C -C -C DF --> Degrees of freedom of the chisquare -C (Must be positive) -C REAL DF -C -C -C Method -C -C -C Uses relation between chisquare and gamma. -C -C********************************************************************** -C********************************************************************** -C -C REAL FUNCTION GENEXP( AV ) -C -C GENerate EXPonential random deviate -C -C -C Function -C -C -C Generates a single random deviate from an exponential -C distribution with mean AV. -C -C -C Arguments -C -C -C AV --> The mean of the exponential distribution from which -C a random deviate is to be generated. -C REAL AV +C +C +C Method +C +C +C R. C. H. Cheng +C Generating Beta Variables with Nonintegral Shape Parameters +C Communications of the ACM, 21:317-322 (1978) +C (Algorithms BB and BC) +C +C********************************************************************** +C********************************************************************** +C +C REAL FUNCTION GENCHI( DF ) +C Generate random value of CHIsquare variable +C +C +C Function +C +C +C Generates random deviate from the distribution of a chisquare +C with DF degrees of freedom random variable. +C +C +C Arguments +C +C +C DF --> Degrees of freedom of the chisquare +C (Must be positive) +C REAL DF +C +C +C Method +C +C +C Uses relation between chisquare and gamma. +C +C********************************************************************** +C********************************************************************** +C +C REAL FUNCTION GENEXP( AV ) +C +C GENerate EXPonential random deviate +C +C +C Function +C +C +C Generates a single random deviate from an exponential +C distribution with mean AV. +C +C +C Arguments +C +C +C AV --> The mean of the exponential distribution from which +C a random deviate is to be generated. +C REAL AV C (AV >= 0) -C -C GENEXP <-- The random deviate. -C REAL GENEXP -C -C -C Method -C -C -C Renames SEXPO from TOMS as slightly modified by BWB to use RANF -C instead of SUNIF. -C -C For details see: -C -C Ahrens, J.H. and Dieter, U. -C Computer Methods for Sampling From the -C Exponential and Normal Distributions. -C Comm. ACM, 15,10 (Oct. 1972), 873 - 882. -C -C********************************************************************** -C********************************************************************** -C -C REAL FUNCTION GENF( DFN, DFD ) -C GENerate random deviate from the F distribution -C -C -C Function -C -C -C Generates a random deviate from the F (variance ratio) -C distribution with DFN degrees of freedom in the numerator -C and DFD degrees of freedom in the denominator. -C -C -C Arguments -C -C -C DFN --> Numerator degrees of freedom -C (Must be positive) -C REAL DFN -C DFD --> Denominator degrees of freedom -C (Must be positive) -C REAL DFD -C -C -C Method -C -C -C Directly generates ratio of chisquare variates -C -C********************************************************************** -C********************************************************************** -C -C REAL FUNCTION GENGAM( A, R ) -C GENerates random deviates from GAMma distribution -C -C -C Function -C -C -C Generates random deviates from the gamma distribution whose -C density is -C (A**R)/Gamma(R) * X**(R-1) * Exp(-A*X) -C -C -C Arguments -C -C -C A --> Location parameter of Gamma distribution +C +C GENEXP <-- The random deviate. +C REAL GENEXP +C +C +C Method +C +C +C Renames SEXPO from TOMS as slightly modified by BWB to use RANF +C instead of SUNIF. +C +C For details see: +C +C Ahrens, J.H. and Dieter, U. +C Computer Methods for Sampling From the +C Exponential and Normal Distributions. +C Comm. ACM, 15,10 (Oct. 1972), 873 - 882. +C +C********************************************************************** +C********************************************************************** +C +C REAL FUNCTION GENF( DFN, DFD ) +C GENerate random deviate from the F distribution +C +C +C Function +C +C +C Generates a random deviate from the F (variance ratio) +C distribution with DFN degrees of freedom in the numerator +C and DFD degrees of freedom in the denominator. +C +C +C Arguments +C +C +C DFN --> Numerator degrees of freedom +C (Must be positive) +C REAL DFN +C DFD --> Denominator degrees of freedom +C (Must be positive) +C REAL DFD +C +C +C Method +C +C +C Directly generates ratio of chisquare variates +C +C********************************************************************** +C********************************************************************** +C +C REAL FUNCTION GENGAM( A, R ) +C GENerates random deviates from GAMma distribution +C +C +C Function +C +C +C Generates random deviates from the gamma distribution whose +C density is +C (A**R)/Gamma(R) * X**(R-1) * Exp(-A*X) +C +C +C Arguments +C +C +C A --> Location parameter of Gamma distribution C REAL A ( A > 0 ) -C -C R --> Shape parameter of Gamma distribution +C +C R --> Shape parameter of Gamma distribution C REAL R ( R > 0 ) -C -C -C Method -C -C -C Renames SGAMMA from TOMS as slightly modified by BWB to use RANF -C instead of SUNIF. -C -C For details see: -C (Case R >= 1.0) -C Ahrens, J.H. and Dieter, U. -C Generating Gamma Variates by a -C Modified Rejection Technique. -C Comm. ACM, 25,1 (Jan. 1982), 47 - 54. -C Algorithm GD -C -C (Case 0.0 < R < 1.0) -C Ahrens, J.H. and Dieter, U. -C Computer Methods for Sampling from Gamma, -C Beta, Poisson and Binomial Distributions. -C Computing, 12 (1974), 223-246/ -C Adapted algorithm GS. -C -C********************************************************************** -C********************************************************************** -C -C SUBROUTINE GENMN(PARM,X,WORK) -C GENerate Multivariate Normal random deviate -C -C -C Arguments -C -C -C PARM --> Parameters needed to generate multivariate normal -C deviates (MEANV and Cholesky decomposition of -C COVM). Set by a previous call to SETGMN. -C -C 1 : 1 - size of deviate, P -C 2 : P + 1 - mean vector -C P+2 : P*(P+3)/2 + 1 - upper half of cholesky -C decomposition of cov matrix -C REAL PARM(*) -C -C X <-- Vector deviate generated. -C REAL X(P) -C -C WORK <--> Scratch array -C REAL WORK(P) -C -C -C Method -C -C -C 1) Generate P independent standard normal deviates - Ei ~ N(0,1) -C +C +C +C Method +C +C +C Renames SGAMMA from TOMS as slightly modified by BWB to use RANF +C instead of SUNIF. +C +C For details see: +C (Case R >= 1.0) +C Ahrens, J.H. and Dieter, U. +C Generating Gamma Variates by a +C Modified Rejection Technique. +C Comm. ACM, 25,1 (Jan. 1982), 47 - 54. +C Algorithm GD +C +C (Case 0.0 < R < 1.0) +C Ahrens, J.H. and Dieter, U. +C Computer Methods for Sampling from Gamma, +C Beta, Poisson and Binomial Distributions. +C Computing, 12 (1974), 223-246/ +C Adapted algorithm GS. +C +C********************************************************************** +C********************************************************************** +C +C SUBROUTINE GENMN(PARM,X,WORK) +C GENerate Multivariate Normal random deviate +C +C +C Arguments +C +C +C PARM --> Parameters needed to generate multivariate normal +C deviates (MEANV and Cholesky decomposition of +C COVM). Set by a previous call to SETGMN. +C +C 1 : 1 - size of deviate, P +C 2 : P + 1 - mean vector +C P+2 : P*(P+3)/2 + 1 - upper half of cholesky +C decomposition of cov matrix +C REAL PARM(*) +C +C X <-- Vector deviate generated. +C REAL X(P) +C +C WORK <--> Scratch array +C REAL WORK(P) +C +C +C Method +C +C +C 1) Generate P independent standard normal deviates - Ei ~ N(0,1) +C C 2) SETGMN uses Cholesky decomposition find A s.t. trans(A)*A = COV -C -C 3) Generate trans(A)*E + MEANV ~ N(MEANV,COVM) -C -C********************************************************************** +C +C 3) Generate trans(A)*E + MEANV ~ N(MEANV,COVM) +C +C********************************************************************** C********************************************************************** C C SUBROUTINE GENMUL( N, P, NCAT, IX ) @@ -330,256 +330,256 @@ C New York, 1986. C C********************************************************************** -C********************************************************************** -C -C REAL FUNCTION GENNCH( DF, XNONC ) -C Generate random value of Noncentral CHIsquare variable -C -C -C Function -C -C -C -C Generates random deviate from the distribution of a noncentral -C chisquare with DF degrees of freedom and noncentrality parameter -C XNONC. -C -C -C Arguments -C -C -C DF --> Degrees of freedom of the chisquare -C (Must be >= 1.0) -C REAL DF -C -C XNONC --> Noncentrality parameter of the chisquare -C (Must be >= 0.0) -C REAL XNONC -C -C -C Method -C -C -C Uses fact that noncentral chisquare is the sum of a chisquare -C deviate with DF-1 degrees of freedom plus the square of a normal -C deviate with mean XNONC and standard deviation 1. -C -C********************************************************************** -C********************************************************************** -C -C REAL FUNCTION GENNF( DFN, DFD, XNONC ) -C GENerate random deviate from the Noncentral F distribution -C -C -C Function -C -C -C Generates a random deviate from the noncentral F (variance ratio) -C distribution with DFN degrees of freedom in the numerator, and DFD -C degrees of freedom in the denominator, and noncentrality parameter -C XNONC. -C -C -C Arguments -C -C -C DFN --> Numerator degrees of freedom -C (Must be >= 1.0) -C REAL DFN -C DFD --> Denominator degrees of freedom -C (Must be positive) -C REAL DFD -C -C XNONC --> Noncentrality parameter -C (Must be nonnegative) -C REAL XNONC -C -C -C Method -C -C -C Directly generates ratio of noncentral numerator chisquare variate -C to central denominator chisquare variate. -C -C********************************************************************** -C********************************************************************** -C -C REAL FUNCTION GENNOR( AV, SD ) -C -C GENerate random deviate from a NORmal distribution -C -C -C Function -C -C -C Generates a single random deviate from a normal distribution -C with mean, AV, and standard deviation, SD. -C -C -C Arguments -C -C -C AV --> Mean of the normal distribution. -C REAL AV -C -C SD --> Standard deviation of the normal distribution. -C REAL SD +C********************************************************************** +C +C REAL FUNCTION GENNCH( DF, XNONC ) +C Generate random value of Noncentral CHIsquare variable +C +C +C Function +C +C +C +C Generates random deviate from the distribution of a noncentral +C chisquare with DF degrees of freedom and noncentrality parameter +C XNONC. +C +C +C Arguments +C +C +C DF --> Degrees of freedom of the chisquare +C (Must be >= 1.0) +C REAL DF +C +C XNONC --> Noncentrality parameter of the chisquare +C (Must be >= 0.0) +C REAL XNONC +C +C +C Method +C +C +C Uses fact that noncentral chisquare is the sum of a chisquare +C deviate with DF-1 degrees of freedom plus the square of a normal +C deviate with mean XNONC and standard deviation 1. +C +C********************************************************************** +C********************************************************************** +C +C REAL FUNCTION GENNF( DFN, DFD, XNONC ) +C GENerate random deviate from the Noncentral F distribution +C +C +C Function +C +C +C Generates a random deviate from the noncentral F (variance ratio) +C distribution with DFN degrees of freedom in the numerator, and DFD +C degrees of freedom in the denominator, and noncentrality parameter +C XNONC. +C +C +C Arguments +C +C +C DFN --> Numerator degrees of freedom +C (Must be >= 1.0) +C REAL DFN +C DFD --> Denominator degrees of freedom +C (Must be positive) +C REAL DFD +C +C XNONC --> Noncentrality parameter +C (Must be nonnegative) +C REAL XNONC +C +C +C Method +C +C +C Directly generates ratio of noncentral numerator chisquare variate +C to central denominator chisquare variate. +C +C********************************************************************** +C********************************************************************** +C +C REAL FUNCTION GENNOR( AV, SD ) +C +C GENerate random deviate from a NORmal distribution +C +C +C Function +C +C +C Generates a single random deviate from a normal distribution +C with mean, AV, and standard deviation, SD. +C +C +C Arguments +C +C +C AV --> Mean of the normal distribution. +C REAL AV +C +C SD --> Standard deviation of the normal distribution. +C REAL SD C (SD >= 0) -C -C GENNOR <-- Generated normal deviate. -C REAL GENNOR -C -C -C Method -C -C -C Renames SNORM from TOMS as slightly modified by BWB to use RANF -C instead of SUNIF. -C -C For details see: -C Ahrens, J.H. and Dieter, U. -C Extensions of Forsythe's Method for Random -C Sampling from the Normal Distribution. -C Math. Comput., 27,124 (Oct. 1973), 927 - 937. -C -C -C********************************************************************** -C********************************************************************** -C -C SUBROUTINE GENPRM( IARRAY, LARRAY ) -C GENerate random PeRMutation of iarray -C -C -C Arguments -C -C -C IARRAY <--> On output IARRAY is a random permutation of its -C value on input -C INTEGER IARRAY( LARRAY ) -C -C LARRAY <--> Length of IARRAY -C INTEGER LARRAY -C -C********************************************************************** -C********************************************************************** -C -C REAL FUNCTION GENUNF( LOW, HIGH ) -C -C GeNerate Uniform Real between LOW and HIGH -C -C -C Function -C -C -C Generates a real uniformly distributed between LOW and HIGH. -C -C -C Arguments -C -C -C LOW --> Low bound (exclusive) on real value to be generated -C REAL LOW -C -C HIGH --> High bound (exclusive) on real value to be generated -C REAL HIGH -C -C********************************************************************** -C********************************************************************** -C -C SUBROUTINE GETCGN(G) -C Get GeNerator -C -C Returns in G the number of the current random number generator -C -C -C Arguments -C -C -C G <-- Number of the current random number generator (1..32) -C INTEGER G -C -C********************************************************************** -C********************************************************************** -C -C SUBROUTINE GETSD(ISEED1,ISEED2) -C GET SeeD -C -C Returns the value of two integer seeds of the current generator -C -C This is a transcription from Pascal to Fortran of routine -C Get_State from the paper -C -C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package -C with Splitting Facilities." ACM Transactions on Mathematical -C Software, 17:98-111 (1991) -C -C -C Arguments -C -C -C -C ISEED1 <- First integer seed of generator G -C INTEGER ISEED1 -C -C ISEED2 <- Second integer seed of generator G -C INTEGER ISEED1 -C -C********************************************************************** -C********************************************************************** -C -C INTEGER FUNCTION IGNBIN( N, P ) -C -C GENerate BINomial random deviate -C -C -C Function -C -C -C Generates a single random deviate from a binomial -C distribution whose number of trials is N and whose -C probability of an event in each trial is P. -C -C -C Arguments -C -C -C N --> The number of trials in the binomial distribution -C from which a random deviate is to be generated. -C INTEGER N +C +C GENNOR <-- Generated normal deviate. +C REAL GENNOR +C +C +C Method +C +C +C Renames SNORM from TOMS as slightly modified by BWB to use RANF +C instead of SUNIF. +C +C For details see: +C Ahrens, J.H. and Dieter, U. +C Extensions of Forsythe's Method for Random +C Sampling from the Normal Distribution. +C Math. Comput., 27,124 (Oct. 1973), 927 - 937. +C +C +C********************************************************************** +C********************************************************************** +C +C SUBROUTINE GENPRM( IARRAY, LARRAY ) +C GENerate random PeRMutation of iarray +C +C +C Arguments +C +C +C IARRAY <--> On output IARRAY is a random permutation of its +C value on input +C INTEGER IARRAY( LARRAY ) +C +C LARRAY <--> Length of IARRAY +C INTEGER LARRAY +C +C********************************************************************** +C********************************************************************** +C +C REAL FUNCTION GENUNF( LOW, HIGH ) +C +C GeNerate Uniform Real between LOW and HIGH +C +C +C Function +C +C +C Generates a real uniformly distributed between LOW and HIGH. +C +C +C Arguments +C +C +C LOW --> Low bound (exclusive) on real value to be generated +C REAL LOW +C +C HIGH --> High bound (exclusive) on real value to be generated +C REAL HIGH +C +C********************************************************************** +C********************************************************************** +C +C SUBROUTINE GETCGN(G) +C Get GeNerator +C +C Returns in G the number of the current random number generator +C +C +C Arguments +C +C +C G <-- Number of the current random number generator (1..32) +C INTEGER G +C +C********************************************************************** +C********************************************************************** +C +C SUBROUTINE GETSD(ISEED1,ISEED2) +C GET SeeD +C +C Returns the value of two integer seeds of the current generator +C +C This is a transcription from Pascal to Fortran of routine +C Get_State from the paper +C +C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package +C with Splitting Facilities." ACM Transactions on Mathematical +C Software, 17:98-111 (1991) +C +C +C Arguments +C +C +C +C ISEED1 <- First integer seed of generator G +C INTEGER ISEED1 +C +C ISEED2 <- Second integer seed of generator G +C INTEGER ISEED1 +C +C********************************************************************** +C********************************************************************** +C +C INTEGER FUNCTION IGNBIN( N, P ) +C +C GENerate BINomial random deviate +C +C +C Function +C +C +C Generates a single random deviate from a binomial +C distribution whose number of trials is N and whose +C probability of an event in each trial is P. +C +C +C Arguments +C +C +C N --> The number of trials in the binomial distribution +C from which a random deviate is to be generated. +C INTEGER N C (N >= 0) -C -C P --> The probability of an event in each trial of the -C binomial distribution from which a random deviate -C is to be generated. -C REAL P +C +C P --> The probability of an event in each trial of the +C binomial distribution from which a random deviate +C is to be generated. +C REAL P C (0.0 <= P <= 1.0) -C -C IGNBIN <-- A random deviate yielding the number of events -C from N independent trials, each of which has -C a probability of event P. -C INTEGER IGNBIN -C -C -C Note -C -C -C Uses RANF so the value of the seeds, ISEED1 and ISEED2 must be set -C by a call similar to the following -C DUM = RANSET( ISEED1, ISEED2 ) -C -C -C Method -C -C -C This is algorithm BTPE from: -C -C Kachitvichyanukul, V. and Schmeiser, B. W. -C -C Binomial Random Variate Generation. -C Communications of the ACM, 31, 2 -C (February, 1988) 216. -C -C********************************************************************** +C +C IGNBIN <-- A random deviate yielding the number of events +C from N independent trials, each of which has +C a probability of event P. +C INTEGER IGNBIN +C +C +C Note +C +C +C Uses RANF so the value of the seeds, ISEED1 and ISEED2 must be set +C by a call similar to the following +C DUM = RANSET( ISEED1, ISEED2 ) +C +C +C Method +C +C +C This is algorithm BTPE from: +C +C Kachitvichyanukul, V. and Schmeiser, B. W. +C +C Binomial Random Variate Generation. +C Communications of the ACM, 31, 2 +C (February, 1988) 216. +C +C********************************************************************** C********************************************************************** C C INTEGER FUNCTION IGNNBN( N, P ) @@ -618,279 +618,279 @@ C New York, 1986. C C********************************************************************** -C********************************************************************** -C -C INTEGER FUNCTION IGNLGI() -C GeNerate LarGe Integer -C -C Returns a random integer following a uniform distribution over -C (1, 2147483562) using the current generator. -C -C This is a transcription from Pascal to Fortran of routine -C Random from the paper -C -C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package -C with Splitting Facilities." ACM Transactions on Mathematical -C Software, 17:98-111 (1991) -C -C********************************************************************** -C********************************************************************** -C -C INTEGER FUNCTION IGNPOI( MU ) -C -C GENerate POIsson random deviate -C -C -C Function -C -C -C Generates a single random deviate from a Poisson -C distribution with mean MU. -C -C -C Arguments -C -C -C MU --> The mean of the Poisson distribution from which -C a random deviate is to be generated. -C REAL MU +C********************************************************************** +C +C INTEGER FUNCTION IGNLGI() +C GeNerate LarGe Integer +C +C Returns a random integer following a uniform distribution over +C (1, 2147483562) using the current generator. +C +C This is a transcription from Pascal to Fortran of routine +C Random from the paper +C +C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package +C with Splitting Facilities." ACM Transactions on Mathematical +C Software, 17:98-111 (1991) +C +C********************************************************************** +C********************************************************************** +C +C INTEGER FUNCTION IGNPOI( MU ) +C +C GENerate POIsson random deviate +C +C +C Function +C +C +C Generates a single random deviate from a Poisson +C distribution with mean MU. +C +C +C Arguments +C +C +C MU --> The mean of the Poisson distribution from which +C a random deviate is to be generated. +C REAL MU C (MU >= 0.0) -C -C IGNPOI <-- The random deviate. +C +C IGNPOI <-- The random deviate. C REAL IGNPOI (non-negative) -C -C -C Method -C -C -C Renames KPOIS from TOMS as slightly modified by BWB to use RANF -C instead of SUNIF. -C -C For details see: -C -C Ahrens, J.H. and Dieter, U. -C Computer Generation of Poisson Deviates -C From Modified Normal Distributions. -C ACM Trans. Math. Software, 8, 2 -C (June 1982),163-179 -C -C********************************************************************** -C********************************************************************** -C -C INTEGER FUNCTION IGNUIN( LOW, HIGH ) -C -C GeNerate Uniform INteger -C -C -C Function -C -C -C Generates an integer uniformly distributed between LOW and HIGH. -C -C -C Arguments -C -C -C LOW --> Low bound (inclusive) on integer value to be generated -C INTEGER LOW -C -C HIGH --> High bound (inclusive) on integer value to be generated -C INTEGER HIGH -C -C -C Note -C -C -C If (HIGH-LOW) > 2,147,483,561 prints error message on * unit and -C stops the program. -C -C********************************************************************** -C********************************************************************** -C -C SUBROUTINE INITGN(ISDTYP) -C INIT-ialize current G-e-N-erator -C -C Reinitializes the state of the current generator -C ISDTYP = -1 => sets the state to its initial seed -C ISDTYP = 0 => sets the state to its last (previous) seed -C ISDTYP = 1 => sets the state to a new seed 2^w values -C from its last seed -C -C This is a transcription from Pascal to Fortran of routine -C Init_Generator from the paper -C -C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package -C with Splitting Facilities." ACM Transactions on Mathematical -C Software, 17:98-111 (1991) -C -C -C Arguments -C -C -C ISDTYP -> The state to which the generator is to be set -C -C INTEGER ISDTYP -C -C********************************************************************** -C********************************************************************** -C -C SUBROUTINE INRGCM() -C INitialize Random number Generator CoMmon -C -C -C Function -C -C -C Initializes common area for random number generator. This saves -C the nuisance of a BLOCK DATA routine and the difficulty of -C assuring that the routine is loaded with the other routines. -C -C********************************************************************** -C********************************************************************** -C -C INTEGER FUNCTION MLTMOD(A,S,M) -C -C Returns (A*S) MOD M -C -C This is a transcription from Pascal to Fortran of routine -C MULtMod_Decompos from the paper -C -C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package -C with Splitting Facilities." ACM Transactions on Mathematical -C Software, 17:98-111 (1991) -C -C -C Arguments -C -C -C A, S, M --> -C INTEGER A,S,M -C -C********************************************************************** -C********************************************************************** -C -C SUBROUTINE PHRTSD( PHRASE, SEED1, SEED2 ) -C PHRase To SeeDs -C -C -C Function -C -C -C Uses a phrase (character string) to generate two seeds for the RGN -C random number generator. -C -C -C Arguments -C -C -C PHRASE --> Phrase to be used for random number generation -C CHARACTER*(*) PHRASE -C -C SEED1 <-- First seed for RGN generator -C INTEGER SEED1 -C -C SEED2 <-- Second seed for RGN generator -C INTEGER SEED2 -C -C -C Note -C -C -C Trailing blanks are eliminated before the seeds are generated. -C -C Generated seed values will fall in the range 1..2^30 -C (1..1,073,741,824) -C -C********************************************************************** -C********************************************************************** -C -C REAL FUNCTION RANF() -C RANDom number generator as a Function -C -C Returns a random floating point number from a uniform distribution -C over 0 - 1 (endpoints of this interval are not returned) using the -C current generator -C -C This is a transcription from Pascal to Fortran of routine -C Uniform_01 from the paper -C -C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package -C with Splitting Facilities." ACM Transactions on Mathematical -C Software, 17:98-111 (1991) -C -C********************************************************************** -C********************************************************************** -C -C SUBROUTINE SETALL(ISEED1,ISEED2) -C SET ALL random number generators -C -C Sets the initial seed of generator 1 to ISEED1 and ISEED2. The -C initial seeds of the other generators are set accordingly, and -C all generators states are set to these seeds. -C -C This is a transcription from Pascal to Fortran of routine -C Set_Initial_Seed from the paper -C -C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package -C with Splitting Facilities." ACM Transactions on Mathematical -C Software, 17:98-111 (1991) -C -C -C Arguments -C -C -C ISEED1 -> First of two integer seeds -C INTEGER ISEED1 -C -C ISEED2 -> Second of two integer seeds -C INTEGER ISEED1 -C -C********************************************************************** -C********************************************************************** -C -C SUBROUTINE SETANT(QVALUE) -C SET ANTithetic -C -C Sets whether the current generator produces antithetic values. If -C X is the value normally returned from a uniform [0,1] random -C number generator then 1 - X is the antithetic value. If X is the -C value normally returned from a uniform [0,N] random number -C generator then N - 1 - X is the antithetic value. -C -C All generators are initialized to NOT generate antithetic values. -C -C This is a transcription from Pascal to Fortran of routine -C Set_Antithetic from the paper -C -C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package -C with Splitting Facilities." ACM Transactions on Mathematical -C Software, 17:98-111 (1991) -C -C -C Arguments -C -C -C QVALUE -> .TRUE. if generator G is to generating antithetic -C values, otherwise .FALSE. -C LOGICAL QVALUE -C -C********************************************************************** -C********************************************************************** -C -C SUBROUTINE SETCGN( G ) -C Set GeNerator -C +C +C +C Method +C +C +C Renames KPOIS from TOMS as slightly modified by BWB to use RANF +C instead of SUNIF. +C +C For details see: +C +C Ahrens, J.H. and Dieter, U. +C Computer Generation of Poisson Deviates +C From Modified Normal Distributions. +C ACM Trans. Math. Software, 8, 2 +C (June 1982),163-179 +C +C********************************************************************** +C********************************************************************** +C +C INTEGER FUNCTION IGNUIN( LOW, HIGH ) +C +C GeNerate Uniform INteger +C +C +C Function +C +C +C Generates an integer uniformly distributed between LOW and HIGH. +C +C +C Arguments +C +C +C LOW --> Low bound (inclusive) on integer value to be generated +C INTEGER LOW +C +C HIGH --> High bound (inclusive) on integer value to be generated +C INTEGER HIGH +C +C +C Note +C +C +C If (HIGH-LOW) > 2,147,483,561 prints error message on * unit and +C stops the program. +C +C********************************************************************** +C********************************************************************** +C +C SUBROUTINE INITGN(ISDTYP) +C INIT-ialize current G-e-N-erator +C +C Reinitializes the state of the current generator +C ISDTYP = -1 => sets the state to its initial seed +C ISDTYP = 0 => sets the state to its last (previous) seed +C ISDTYP = 1 => sets the state to a new seed 2^w values +C from its last seed +C +C This is a transcription from Pascal to Fortran of routine +C Init_Generator from the paper +C +C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package +C with Splitting Facilities." ACM Transactions on Mathematical +C Software, 17:98-111 (1991) +C +C +C Arguments +C +C +C ISDTYP -> The state to which the generator is to be set +C +C INTEGER ISDTYP +C +C********************************************************************** +C********************************************************************** +C +C SUBROUTINE INRGCM() +C INitialize Random number Generator CoMmon +C +C +C Function +C +C +C Initializes common area for random number generator. This saves +C the nuisance of a BLOCK DATA routine and the difficulty of +C assuring that the routine is loaded with the other routines. +C +C********************************************************************** +C********************************************************************** +C +C INTEGER FUNCTION MLTMOD(A,S,M) +C +C Returns (A*S) MOD M +C +C This is a transcription from Pascal to Fortran of routine +C MULtMod_Decompos from the paper +C +C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package +C with Splitting Facilities." ACM Transactions on Mathematical +C Software, 17:98-111 (1991) +C +C +C Arguments +C +C +C A, S, M --> +C INTEGER A,S,M +C +C********************************************************************** +C********************************************************************** +C +C SUBROUTINE PHRTSD( PHRASE, SEED1, SEED2 ) +C PHRase To SeeDs +C +C +C Function +C +C +C Uses a phrase (character string) to generate two seeds for the RGN +C random number generator. +C +C +C Arguments +C +C +C PHRASE --> Phrase to be used for random number generation +C CHARACTER*(*) PHRASE +C +C SEED1 <-- First seed for RGN generator +C INTEGER SEED1 +C +C SEED2 <-- Second seed for RGN generator +C INTEGER SEED2 +C +C +C Note +C +C +C Trailing blanks are eliminated before the seeds are generated. +C +C Generated seed values will fall in the range 1..2^30 +C (1..1,073,741,824) +C +C********************************************************************** +C********************************************************************** +C +C REAL FUNCTION RANF() +C RANDom number generator as a Function +C +C Returns a random floating point number from a uniform distribution +C over 0 - 1 (endpoints of this interval are not returned) using the +C current generator +C +C This is a transcription from Pascal to Fortran of routine +C Uniform_01 from the paper +C +C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package +C with Splitting Facilities." ACM Transactions on Mathematical +C Software, 17:98-111 (1991) +C +C********************************************************************** +C********************************************************************** +C +C SUBROUTINE SETALL(ISEED1,ISEED2) +C SET ALL random number generators +C +C Sets the initial seed of generator 1 to ISEED1 and ISEED2. The +C initial seeds of the other generators are set accordingly, and +C all generators states are set to these seeds. +C +C This is a transcription from Pascal to Fortran of routine +C Set_Initial_Seed from the paper +C +C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package +C with Splitting Facilities." ACM Transactions on Mathematical +C Software, 17:98-111 (1991) +C +C +C Arguments +C +C +C ISEED1 -> First of two integer seeds +C INTEGER ISEED1 +C +C ISEED2 -> Second of two integer seeds +C INTEGER ISEED1 +C +C********************************************************************** +C********************************************************************** +C +C SUBROUTINE SETANT(QVALUE) +C SET ANTithetic +C +C Sets whether the current generator produces antithetic values. If +C X is the value normally returned from a uniform [0,1] random +C number generator then 1 - X is the antithetic value. If X is the +C value normally returned from a uniform [0,N] random number +C generator then N - 1 - X is the antithetic value. +C +C All generators are initialized to NOT generate antithetic values. +C +C This is a transcription from Pascal to Fortran of routine +C Set_Antithetic from the paper +C +C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package +C with Splitting Facilities." ACM Transactions on Mathematical +C Software, 17:98-111 (1991) +C +C +C Arguments +C +C +C QVALUE -> .TRUE. if generator G is to generating antithetic +C values, otherwise .FALSE. +C LOGICAL QVALUE +C +C********************************************************************** +C********************************************************************** +C +C SUBROUTINE SETCGN( G ) +C Set GeNerator +C C Sets the current generator to G. All references to a generato -C are to the current generator. -C -C -C Arguments -C -C -C G --> Number of the current random number generator (1..32) -C INTEGER G -C -C********************************************************************** +C are to the current generator. +C +C +C Arguments +C +C +C G --> Number of the current random number generator (1..32) +C INTEGER G +C +C********************************************************************** C********************************************************************** C C SUBROUTINE SETGMN( MEANV, COVM, LDCOVM, P, PARM) @@ -932,30 +932,30 @@ C REAL PARM(P*(P+3)/2 + 1) C C********************************************************************** -C********************************************************************** -C -C SUBROUTINE SETSD(ISEED1,ISEED2) -C SET S-ee-D of current generator -C -C Resets the initial seed and state of generator g to ISEED1 and -C ISEED2. The seeds and states of the other generators remain -C unchanged. -C -C This is a transcription from Pascal to Fortran of routine -C Set_Seed from the paper -C -C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package -C with Splitting Facilities." ACM Transactions on Mathematical -C Software, 17:98-111 (1991) -C -C -C Arguments -C -C -C ISEED1 -> First integer seed -C INTEGER ISEED1 -C -C ISEED2 -> Second integer seed -C INTEGER ISEED1 -C -C********************************************************************** +C********************************************************************** +C +C SUBROUTINE SETSD(ISEED1,ISEED2) +C SET S-ee-D of current generator +C +C Resets the initial seed and state of generator g to ISEED1 and +C ISEED2. The seeds and states of the other generators remain +C unchanged. +C +C This is a transcription from Pascal to Fortran of routine +C Set_Seed from the paper +C +C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package +C with Splitting Facilities." ACM Transactions on Mathematical +C Software, 17:98-111 (1991) +C +C +C Arguments +C +C +C ISEED1 -> First integer seed +C INTEGER ISEED1 +C +C ISEED2 -> Second integer seed +C INTEGER ISEED1 +C +C**********************************************************************
--- a/liboctave/cruft/ranlib/setsd.f +++ b/liboctave/cruft/ranlib/setsd.f @@ -62,7 +62,7 @@ IF (qrgnin()) GO TO 10 WRITE (*,*) ' SETSD called before random number generator ', + ' initialized -- abort!' - CALL XSTOPX + CALL XSTOPX + (' SETSD called before random number generator initialized') 10 CALL getcgn(g)
--- a/liboctave/cruft/ranlib/tstgmn.for +++ b/liboctave/cruft/ranlib/tstgmn.for @@ -30,7 +30,7 @@ C covar = covar/real(n-1) onecov = onecov/real(n-1) RETURN - + END C JJV Added argument LDXCOV (leading dimension of XCOVAR) to be
--- a/liboctave/cruft/ranlib/tstmid.for +++ b/liboctave/cruft/ranlib/tstmid.for @@ -344,7 +344,7 @@ 310 IF ((13).NE. (iwhich)) GO TO 360 -C +C C Multinomial outcomes C WRITE (*,*) ' Enter (int) number of observations: '
--- a/liboctave/cruft/slatec-fn/atanh.f +++ b/liboctave/cruft/slatec-fn/atanh.f @@ -58,7 +58,7 @@ C Y = ABS(X) IF (Y .GE. 1.0) THEN - IF (Y .GT. 1.0) THEN + IF (Y .GT. 1.0) THEN ATANH = (X - X) / (X - X) ELSE ATANH = X / 0.0
--- a/liboctave/cruft/slatec-fn/datanh.f +++ b/liboctave/cruft/slatec-fn/datanh.f @@ -69,7 +69,7 @@ C Y = ABS(X) IF (Y .GE. 1.D0) THEN - IF (Y .GT. 1.D0) THEN + IF (Y .GT. 1.D0) THEN DATANH = (X - X) / (X - X) ELSE DATANH = X / 0.D0
--- a/liboctave/cruft/slatec-fn/xgmainc.f +++ b/liboctave/cruft/slatec-fn/xgmainc.f @@ -13,7 +13,7 @@ DOUBLE PRECISION AEPS, AINTA, ALGAP1, ALNEPS, ALNG, ALX, $ BOT, H, SGA, SGNGAM, SQEPS, T, D1MACH, D9GMIT, - $ D9LGIC, D9LGIT, DLNGAM, DGAMI + $ D9LGIC, D9LGIT, DLNGAM, DGAMI LOGICAL FIRST
--- a/liboctave/cruft/slatec-fn/xsgmainc.f +++ b/liboctave/cruft/slatec-fn/xsgmainc.f @@ -13,7 +13,7 @@ REAL AEPS, AINTA, ALGAP1, ALNEPS, ALNG, ALX, $ BOT, H, SGA, SGNGAM, SQEPS, T, R1MACH, R9GMIT, - $ R9LGIC, R9LGIT, ALNGAM, GAMI + $ R9LGIC, R9LGIT, ALNGAM, GAMI LOGICAL FIRST
--- a/liboctave/numeric/module.mk +++ b/liboctave/numeric/module.mk @@ -90,7 +90,7 @@ numeric/SparseCmplxQR.h \ numeric/SparsedbleCHOL.h \ numeric/SparsedbleLU.h \ - numeric/SparseQR.h + numeric/SparseQR.h NUMERIC_C_SRC = \ numeric/randgamma.c \
--- a/liboctave/operators/mk-ops.awk +++ b/liboctave/operators/mk-ops.awk @@ -1,17 +1,17 @@ # Copyright (C) 2003-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. @@ -58,7 +58,7 @@ rev_tag[$1] = ntypes; } else - printf ("skipping line %d: %s\n", NR, $0); + printf ("skipping line %d: %s\n", NR, $0); } else if (generate_ops) { @@ -233,7 +233,7 @@ close (cc_file); } else - printf ("skipping line %d: %s\n", NR, $0); + printf ("skipping line %d: %s\n", NR, $0); } } END {
--- a/liboctave/operators/mx-ops +++ b/liboctave/operators/mx-ops @@ -1,17 +1,17 @@ # Copyright (C) 2003-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/liboctave/operators/sparse-mk-ops.awk +++ b/liboctave/operators/sparse-mk-ops.awk @@ -1,17 +1,17 @@ # Copyright (C) 2004-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. @@ -55,7 +55,7 @@ rev_tag[$1] = ntypes; } else - printf ("skipping line %d: %s\n", NR, $0); + printf ("skipping line %d: %s\n", NR, $0); } else if (generate_ops) { @@ -174,7 +174,7 @@ if (bin_ops) printf ("SPARSE_%s%s_BIN_OP_DECLS (%s, %s, %s, %s, OCTAVE_API)\n", lhs_class, - rhs_class, result_type_1, result_type_2, lhs_type, + rhs_class, result_type_1, result_type_2, lhs_type, rhs_type) >> h_file if (cmp_ops) @@ -225,22 +225,22 @@ printf ("#include \"%s\"\n", rhs_header) >> cc_file; if (bin_ops) - printf ("SPARSE_%s%s_BIN_OPS (%s, %s, %s, %s)\n", lhs_class, - rhs_class, result_type_1, result_type_2, lhs_type, + printf ("SPARSE_%s%s_BIN_OPS (%s, %s, %s, %s)\n", lhs_class, + rhs_class, result_type_1, result_type_2, lhs_type, rhs_type) >> cc_file if (cmp_ops) - printf ("SPARSE_%s%s_CMP_OPS (%s, %s, %s, %s, %s, %s)\n", + printf ("SPARSE_%s%s_CMP_OPS (%s, %s, %s, %s, %s, %s)\n", lhs_class, rhs_class, lhs_type, lhs_scalar_zero_val, lhs_conv, rhs_type, rhs_scalar_zero_val, rhs_conv) >> cc_file if (eqne_ops) - printf ("SPARSE_%s%s_EQNE_OPS (%s, %s, %s, %s, %s, %s)\n", + printf ("SPARSE_%s%s_EQNE_OPS (%s, %s, %s, %s, %s, %s)\n", lhs_class, rhs_class, lhs_type, lhs_scalar_zero_val, lhs_conv, rhs_type, rhs_scalar_zero_val, rhs_conv) >> cc_file if (bool_ops) - printf ("SPARSE_%s%s_BOOL_OPS2 (%s, %s, %s, %s)\n", lhs_class, + printf ("SPARSE_%s%s_BOOL_OPS2 (%s, %s, %s, %s)\n", lhs_class, rhs_class, lhs_type, rhs_type, lhs_scalar_zero_val, rhs_scalar_zero_val) >> cc_file @@ -248,7 +248,7 @@ close (cc_file); } else - printf ("skipping line %d: %s\n", NR, $0); + printf ("skipping line %d: %s\n", NR, $0); } } END {
--- a/liboctave/operators/sparse-mx-ops +++ b/liboctave/operators/sparse-mx-ops @@ -1,17 +1,17 @@ # Copyright (C) 2004-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/liboctave/operators/vx-ops +++ b/liboctave/operators/vx-ops @@ -1,17 +1,17 @@ # Copyright (C) 2003-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/liboctave/util/module.mk +++ b/liboctave/util/module.mk @@ -49,7 +49,7 @@ util/f2c-main.c \ util/lo-cutils.c \ util/oct-rl-edit.c \ - util/oct-rl-hist.c + util/oct-rl-hist.c UTIL_SRC = \ util/cmd-edit.cc \
--- a/run-octave.in +++ b/run-octave.in @@ -1,21 +1,21 @@ #! /bin/sh ## ## run-octave -- run Octave in the build tree. -## +## ## Copyright (C) 2006-2013 John W. Eaton ## ## This file is part of Octave. -## +## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by the ## Free Software Foundation; either version 3 of the License, or (at ## your option) any later version. -## +## ## Octave is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## for more details. -## +## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>. @@ -25,7 +25,7 @@ SED=%SED% # FIXME -- is there a better way to handle the possibility of spaces -# in these names? +# in these names? top_srcdir='%abs_top_srcdir%' builddir='%builddir%'
--- a/scripts/@ftp/ftp.m +++ b/scripts/@ftp/ftp.m @@ -31,17 +31,17 @@ ## @headitem Method @tab Description ## @item ascii @tab Set transfer type to ascii ## @item binary @tab Set transfer type to binary -## @item cd @tab Change remote working directory +## @item cd @tab Change remote working directory ## @item close @tab Close FTP connection -## @item delete @tab Delete remote file -## @item dir @tab List remote directory contents +## @item delete @tab Delete remote file +## @item dir @tab List remote directory contents ## @item mget @tab Download remote files ## @item mkdir @tab Create remote directory ## @item mput @tab Upload local files ## @item rename @tab Rename remote file or directory ## @item rmdir @tab Remove remote directory ## @end multitable -## +## ## @end deftypefn function obj = ftp (host = "", username = "anonymous", password = "")
--- a/scripts/audio/wavread.m +++ b/scripts/audio/wavread.m @@ -22,7 +22,7 @@ ## @deftypefnx {Function File} {[@dots{}] =} wavread (@var{filename}, @var{n}) ## @deftypefnx {Function File} {[@dots{}] =} wavread (@var{filename}, [@var{n1} @var{n2}]) ## @deftypefnx {Function File} {[@var{samples}, @var{channels}] =} wavread (@var{filename}, "size") -## +## ## Load the RIFF/WAVE sound file @var{filename}, and return the samples ## in vector @var{y}. If the file contains multichannel data, then ## @var{y} is a matrix with the channels represented as columns.
--- a/scripts/deprecated/java_convert_matrix.m +++ b/scripts/deprecated/java_convert_matrix.m @@ -22,7 +22,7 @@ ## @deftypefnx {Built-in Function} {} java_convert_matrix (@var{new_val}, "local") ## Query or set the internal variable that controls whether Java arrays are ## automatically converted to Octave matrices. The default value is false. -## +## ## When called from inside a function with the @qcode{"local"} option, the ## variable is changed locally for the function and any subroutines it calls. ## The original variable value is restored when exiting the function.
--- a/scripts/deprecated/java_debug.m +++ b/scripts/deprecated/java_debug.m @@ -23,7 +23,7 @@ ## Query or set the internal variable that determines whether extra debugging ## information regarding the initialization of the JVM and any Java exceptions ## is printed. -## +## ## When called from inside a function with the @qcode{"local"} option, the ## variable is changed locally for the function and any subroutines it calls. ## The original variable value is restored when exiting the function.
--- a/scripts/deprecated/java_invoke.m +++ b/scripts/deprecated/java_invoke.m @@ -21,20 +21,20 @@ ## @deftypefnx {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}, @var{arg1}, @dots{}) ## Invoke the method @var{methodname} on the Java object @var{obj} with the ## arguments @var{arg1}, @dots{} For static methods, @var{obj} can be a -## string representing the fully qualified name of the corresponding class. +## string representing the fully qualified name of the corresponding class. ## The function returns the result of the method invocation. -## +## ## When @var{obj} is a regular Java object, structure-like indexing can be ## used as a shortcut syntax. For instance, the two following statements are ## equivalent -## +## ## @example ## @group ## ret = java_invoke (x, "method1", 1.0, "a string") ## ret = x.method1 (1.0, "a string") ## @end group ## @end example -## +## ## @seealso{javaMethod, javaObject} ## @end deftypefn @@ -46,7 +46,7 @@ warning ("Octave:deprecated-function", "java_invoke is obsolete and will be removed from a future version of Octave, please use javaMethod instead"); endif - + if (nargin < 2) print_usage (); endif
--- a/scripts/deprecated/java_new.m +++ b/scripts/deprecated/java_new.m @@ -21,14 +21,14 @@ ## @deftypefnx {Loadable Function} {@var{obj} =} java_new (@var{name}, @var{arg1}, @dots{}) ## Create a Java object of class @var{name}, by calling the class constructor ## with the arguments @var{arg1}, @dots{} -## +## ## @example ## @group ## x = java_new ("java.lang.StringBuffer") ## x = java_new ("java.lang.StringBuffer", "Initial string") ## @end group ## @end example -## +## ## @seealso{javaObject, javaMethod} ## @end deftypefn
--- a/scripts/deprecated/java_unsigned_conversion.m +++ b/scripts/deprecated/java_unsigned_conversion.m @@ -24,7 +24,7 @@ ## converted when Java matrix autoconversion is enabled. When enabled, Java ## arrays of class Byte or Integer are converted to matrices of class uint8 or ## uint32 respectively. -## +## ## When called from inside a function with the @qcode{"local"} option, the ## variable is changed locally for the function and any subroutines it calls. ## The original variable value is restored when exiting the function.
--- a/scripts/deprecated/javafields.m +++ b/scripts/deprecated/javafields.m @@ -20,7 +20,7 @@ ## @deftypefn {Function File} {} javafields (@var{javaobj}) ## @deftypefnx {Function File} {} javafields ("@var{classname}") ## @deftypefnx {Function File} {@var{fld_names} =} javafields (@dots{}) -## Return the fields of a Java object or Java class in the form of a cell +## Return the fields of a Java object or Java class in the form of a cell ## array of strings. If no output is requested, print the result ## to the standard output. ## @seealso{fieldnames, methods, javaObject} @@ -34,11 +34,11 @@ warning ("Octave:deprecated-function", "javafields is obsolete and will be removed from a future version of Octave, please use fieldnames instead"); endif - + if (nargin != 1) print_usage (); endif - + c_methods = javaMethod ("getFields", "org.octave.ClassHelper", javaobj); method_list = ostrsplit (c_methods, ';');
--- a/scripts/deprecated/javamethods.m +++ b/scripts/deprecated/javamethods.m @@ -20,7 +20,7 @@ ## @deftypefn {Function File} {} javamethods (@var{javaobj}) ## @deftypefnx {Function File} {} javamethods ("@var{classname}") ## @deftypefnx {Function File} {@var{mtd_names} =} javamethods (@dots{}) -## Return the methods of a Java object or Java class in the form of a cell +## Return the methods of a Java object or Java class in the form of a cell ## array of strings. If no output is requested, print the result to the ## standard output. ## @seealso{methods, fieldnames, javaMethod, javaObject} @@ -34,7 +34,7 @@ warning ("Octave:deprecated-function", "javamethods is obsolete and will be removed from a future version of Octave, please use methods instead"); endif - + if (nargin != 1) print_usage (); endif
--- a/scripts/general/accumarray.m +++ b/scripts/general/accumarray.m @@ -142,7 +142,7 @@ lensubs = cellfun (@length, subs); - if (any (lensubs != lensubs(1)) || + if (any (lensubs != lensubs(1)) || (lenvals > 1 && lenvals != lensubs(1))) error ("accumarray: dimension mismatch"); endif
--- a/scripts/general/display.m +++ b/scripts/general/display.m @@ -37,12 +37,12 @@ if (nargin != 1) print_usage (); endif - + ## Only reason we got here is that there was no overloaded display() ## function for object a. This may mean it is a built-in. str = disp (a); if (isempty (strfind (str, "<class "))) - disp (str); + disp (str); else error ('display: not defined for class "%s"', class (a)); endif
--- a/scripts/general/fieldnames.m +++ b/scripts/general/fieldnames.m @@ -37,11 +37,11 @@ ## @end deftypefn function names = fieldnames (obj) - + if (nargin != 1) print_usage (); endif - + if (isstruct (obj) || isobject (obj)) ## Call internal C++ function for structs or Octave objects names = __fieldnames__ (obj); @@ -54,7 +54,7 @@ names_str = javaMethod ("getFields", "org.octave.ClassHelper", obj); names = ostrsplit (names_str, ';'); else - error ("fieldnames: Invalid input argument"); + error ("fieldnames: Invalid input argument"); endif endfunction @@ -71,7 +71,7 @@ %! assert (fieldnames (s), cell (0, 1)); ## test Java classname -%!testif HAVE_JAVA +%!testif HAVE_JAVA %! names = fieldnames ("java.lang.Double"); %! search = strfind (names, "java.lang.Double.MAX_VALUE"); %! assert (! isempty ([search{:}]));
--- a/scripts/general/interp1.m +++ b/scripts/general/interp1.m @@ -64,7 +64,7 @@ ## unspecified, @var{extrap} defaults to NA. ## ## If the string argument @qcode{"pp"} is specified, then @var{xi} should not -## be supplied and @code{interp1} returns a piecewise polynomial object. This +## be supplied and @code{interp1} returns a piecewise polynomial object. This ## object can later be used with @code{ppval} to evaluate the interpolation. ## There is an equivalence, such that @code{ppval (interp1 (@var{x}, ## @var{y}, @var{method}, @qcode{"pp"}), @var{xi}) == interp1 (@var{x}, @var{y},
--- a/scripts/general/interp2.m +++ b/scripts/general/interp2.m @@ -621,10 +621,10 @@ %!assert (interp2 (z, "pchip"), zout, tol) %!assert (interp2 (z, "cubic"), zout, 10 * tol) %!assert (interp2 (z, "spline"), zout, tol) -%!assert (interp2 (z, [2 3 1], [2 2 2]', "linear"), repmat ([5, 7, 3], [3, 1]), tol) -%!assert (interp2 (z, [2 3 1], [2 2 2]', "pchip"), repmat ([5, 7, 3], [3, 1]), tol) -%!assert (interp2 (z, [2 3 1], [2 2 2]', "cubic"), repmat ([5, 7, 3], [3, 1]), 10 * tol) -%!assert (interp2 (z, [2 3 1], [2 2 2]', "spline"), repmat ([5, 7, 3], [3, 1]), tol) +%!assert (interp2 (z, [2 3 1], [2 2 2]', "linear"), repmat ([5, 7, 3], [3, 1]), tol) +%!assert (interp2 (z, [2 3 1], [2 2 2]', "pchip"), repmat ([5, 7, 3], [3, 1]), tol) +%!assert (interp2 (z, [2 3 1], [2 2 2]', "cubic"), repmat ([5, 7, 3], [3, 1]), 10 * tol) +%!assert (interp2 (z, [2 3 1], [2 2 2]', "spline"), repmat ([5, 7, 3], [3, 1]), tol) %!assert (interp2 (z, [2 3 1], [2 2 2], "linear"), [5 7 3], tol) %!assert (interp2 (z, [2 3 1], [2 2 2], "pchip"), [5 7 3], tol) %!assert (interp2 (z, [2 3 1], [2 2 2], "cubic"), [5 7 3], 10 * tol)
--- a/scripts/general/interp3.m +++ b/scripts/general/interp3.m @@ -189,7 +189,7 @@ %! z(:,:,3) = z(:,:,2) + 2; %! for n = 1:5 %! zout(:,:,n) = [1 2 3 4 5; -%! 2 3 4 5 6; +%! 2 3 4 5 6; %! 3 4 5 6 7; %! 4 5 6 7 8; %! 5 6 7 8 9] + (n-1);
--- a/scripts/general/methods.m +++ b/scripts/general/methods.m @@ -29,11 +29,11 @@ ## @end deftypefn function mtds = methods (obj) - + if (nargin != 1) print_usage (); endif - + if (isobject (obj)) ## Call internal C++ function for Octave objects mtds_list = __methods__ (obj); @@ -72,7 +72,7 @@ %! assert (mtds{1}, "ascii"); ## test Java classname -%!testif HAVE_JAVA +%!testif HAVE_JAVA %! mtds = methods ("java.lang.Double"); %! search = strfind (mtds, "java.lang.Double valueOf"); %! assert (! isempty ([search{:}]));
--- a/scripts/general/sortrows.m +++ b/scripts/general/sortrows.m @@ -38,7 +38,7 @@ endif if (nargin == 2) - if (! (isnumeric (c) && isvector (c))) + if (! (isnumeric (c) && isvector (c))) error ("sortrows: C must be a numeric vector"); elseif (any (c == 0) || any (abs (c) > columns (A))) error ("sortrows: all elements of C must be in the range [1, columns (A)]");
--- a/scripts/geometry/convhull.m +++ b/scripts/geometry/convhull.m @@ -30,8 +30,8 @@ ## The default option is @code{@{"Qt"@}}. ## ## If @var{options} is not present or @code{[]} then the default arguments are -## used. Otherwise, @var{options} replaces the default argument list. -## To append user options to the defaults it is necessary to repeat the +## used. Otherwise, @var{options} replaces the default argument list. +## To append user options to the defaults it is necessary to repeat the ## default arguments in @var{options}. Use a null string to pass no arguments. ## ## @seealso{convhulln, delaunay, voronoi}
--- a/scripts/geometry/delaunay.m +++ b/scripts/geometry/delaunay.m @@ -41,11 +41,11 @@ ## The default options are @code{@{"Qt", "Qbb", "Qc", "Qz"@}}. ## ## If @var{options} is not present or @code{[]} then the default arguments are -## used. Otherwise, @var{options} replaces the default argument list. -## To append user options to the defaults it is necessary to repeat the +## used. Otherwise, @var{options} replaces the default argument list. +## To append user options to the defaults it is necessary to repeat the ## default arguments in @var{options}. Use a null string to pass no arguments. ## -## If no output argument is specified the resulting Delaunay triangulation +## If no output argument is specified the resulting Delaunay triangulation ## is plotted along with the original set of points. ## ## @example @@ -81,7 +81,7 @@ x = varargin{1}(:,1); y = varargin{1}(:,2); endif - + case 2 if (isnumeric (varargin{2})) x = varargin{1};
--- a/scripts/geometry/delaunay3.m +++ b/scripts/geometry/delaunay3.m @@ -38,8 +38,8 @@ ## The default options are @code{@{"Qt", "Qbb", "Qc", "Qz"@}}. ## ## If @var{options} is not present or @code{[]} then the default arguments are -## used. Otherwise, @var{options} replaces the default argument list. -## To append user options to the defaults it is necessary to repeat the +## used. Otherwise, @var{options} replaces the default argument list. +## To append user options to the defaults it is necessary to repeat the ## default arguments in @var{options}. Use a null string to pass no arguments. ## ## @seealso{delaunay, delaunayn, convhull, voronoi, tetramesh}
--- a/scripts/geometry/delaunayn.m +++ b/scripts/geometry/delaunayn.m @@ -23,7 +23,7 @@ ## The Delaunay triangulation is a tessellation of the convex hull of a set ## of points such that no N-sphere defined by the N-triangles contains ## any other points from the set. -## +## ## The input matrix @var{pts} of size [n, dim] contains n points in a space of ## dimension dim. The return matrix @var{T} has size [m, dim+1]. Each row ## of @var{T} contains a set of indices back into the original set of points @@ -43,8 +43,8 @@ ## @end itemize ## ## If @var{options} is not present or @code{[]} then the default arguments are -## used. Otherwise, @var{options} replaces the default argument list. -## To append user options to the defaults it is necessary to repeat the +## used. Otherwise, @var{options} replaces the default argument list. +## To append user options to the defaults it is necessary to repeat the ## default arguments in @var{options}. Use a null string to pass no arguments. ## ## @seealso{delaunay, delaunay3, convhulln, voronoin, trimesh, tetramesh}
--- a/scripts/geometry/griddata.m +++ b/scripts/geometry/griddata.m @@ -53,7 +53,7 @@ if (isvector (x) && isvector (y) && all ([numel(y), numel(x)] == size (z))) [x, y] = meshgrid (x, y); endif - + if (isvector (x) && isvector (y) && isvector (z)) if (! isequal (length (x), length (y), length (z))) error ("griddata: X, Y, and Z must be vectors of the same length");
--- a/scripts/geometry/griddatan.m +++ b/scripts/geometry/griddatan.m @@ -27,7 +27,7 @@ ## ## The interpolation method can be @qcode{"nearest"} or @qcode{"linear"}. ## If method is omitted it defaults to @qcode{"linear"}. -## +## ## The optional argument @var{options} is passed directly to Qhull when ## computing the Delaunay triangulation used for interpolation. See ## @code{delaunayn} for information on the defaults and how to pass different
--- a/scripts/geometry/voronoi.m +++ b/scripts/geometry/voronoi.m @@ -25,7 +25,7 @@ ## @deftypefnx {Function File} {[@var{vx}, @var{vy}] =} voronoi (@dots{}) ## Plot the Voronoi diagram of points @code{(@var{x}, @var{y})}. ## The Voronoi facets with points at infinity are not drawn. -## +## ## If @qcode{"linespec"} is given it is used to set the color and line style ## of the plot. If an axis graphics handle @var{hax} is supplied then the ## Voronoi diagram is drawn on the specified axis rather than in a new
--- a/scripts/geometry/voronoin.m +++ b/scripts/geometry/voronoin.m @@ -38,8 +38,8 @@ ## @end itemize ## ## If @var{options} is not present or @code{[]} then the default arguments are -## used. Otherwise, @var{options} replaces the default argument list. -## To append user options to the defaults it is necessary to repeat the +## used. Otherwise, @var{options} replaces the default argument list. +## To append user options to the defaults it is necessary to repeat the ## default arguments in @var{options}. Use a null string to pass no arguments. ## ## @seealso{voronoi, convhulln, delaunayn}
--- a/scripts/gui/guihandles.m +++ b/scripts/gui/guihandles.m @@ -21,7 +21,7 @@ ## @deftypefnx {Function File} {@var{hdata} =} guihandles ## Return a structure of object handles for the figure associated with ## handle @var{h}. -## +## ## If no handle is specified the current figure returned by @code{gcf} is used. ## ## The fieldname for each entry of @var{hdata} is taken from the @qcode{"tag"}
--- a/scripts/gui/inputdlg.m +++ b/scripts/gui/inputdlg.m @@ -29,7 +29,7 @@ ## ## @table @var ## @item prompt -## A cell array with strings labeling each text field. This input is required. +## A cell array with strings labeling each text field. This input is required. ## ## @item title ## String to use for the caption of the dialog. The default is @qcode{"Input @@ -43,7 +43,7 @@ ## text field. ## ## @item a vector which defines the individual number of rows -## used for each text field. +## used for each text field. ## ## @item a matrix which defines the individual number of rows and ## columns used for each text field. In the matrix each row describes @@ -91,7 +91,7 @@ defaults = varargin{2}; endswitch - ## specification of text field sizes as in Matlab + ## specification of text field sizes as in Matlab ## Matlab requires a matrix for linespec, not a cell array... ## rc = [1,10; 2,20; 3,30]; ## c1 c2 @@ -122,7 +122,7 @@ error ("inputdlg: unknown form of ROWSCOLS argument"); endif rowscols = ceil (rowscols); - + ## convert numeric values in defaults cell array to strings defs = cellfun (@num2str, defaults, "UniformOutput", false); rc = arrayfun (@num2str, rowscols, "UniformOutput", false); @@ -131,7 +131,7 @@ cstr = __octave_link_input_dialog__ (prompt, title, rowscols, defs); elseif (__have_feature__ ("JAVA")) user_inputs = javaMethod ("inputdlg", "org.octave.JDialogBox", - prompt, title, rc, defs); + prompt, title, rc, defs); if (isempty (user_inputs)) cstr = {}; else
--- a/scripts/gui/listdlg.m +++ b/scripts/gui/listdlg.m @@ -18,7 +18,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {[@var{sel}, @var{ok}] =} listdlg (@var{key}, @var{value}, @dots{}) -## Return user inputs from a list dialog box in a vector of +## Return user inputs from a list dialog box in a vector of ## selection indices @var{sel} and a flag @var{ok} indicating how the ## user closed the dialog box. The value of @var{ok} is 1 if the user ## closed the box with the OK button, otherwise it is 0 and @var{sel} is @@ -26,7 +26,7 @@ ## ## The indices in @var{sel} are 1-based. ## -## The arguments are specified in form of @var{key}, @var{value} pairs. +## The arguments are specified in form of @var{key}, @var{value} pairs. ## The @qcode{"ListString"} argument pair must be specified. ## ## Valid @var{key} and @var{value} pairs are:
--- a/scripts/gui/msgbox.m +++ b/scripts/gui/msgbox.m @@ -20,14 +20,14 @@ ## @deftypefn {Function File} {@var{h} =} msgbox (@var{msg}) ## @deftypefnx {Function File} {@var{h} =} msgbox (@var{msg}, @var{title}) ## @deftypefnx {Function File} {@var{h} =} msgbox (@var{msg}, @var{title}, @var{icon}) -## Display @var{msg} using a message dialog box. +## Display @var{msg} using a message dialog box. ## ## The message may have multiple lines separated by newline characters ## (@qcode{"\n"}), or it may be a cellstr array with one element for each ## line. The optional input @var{title} (character string) can be used to ## decorate the dialog caption. ## -## The optional argument @var{icon} selects a dialog icon. +## The optional argument @var{icon} selects a dialog icon. ## It can be one of @qcode{"none"} (default), @qcode{"error"}, ## @qcode{"help"}, or @qcode{"warn"}. ##
--- a/scripts/gui/questdlg.m +++ b/scripts/gui/questdlg.m @@ -32,7 +32,7 @@ ## line. The optional @var{title} (character string) can be used to ## decorate the dialog caption. ## -## The string @var{default} identifies the default button, +## The string @var{default} identifies the default button, ## which is activated by pressing the @key{ENTER} key. ## It must match one of the strings given in @var{btn1}, @var{btn2}, or ## @var{btn3}. @@ -41,7 +41,7 @@ ## the default captions @qcode{"Yes"}, @qcode{"No"}, and @qcode{"Cancel"} are ## used. ## -## If only two button captions, @var{btn1} and @var{btn2}, are specified +## If only two button captions, @var{btn1} and @var{btn2}, are specified ## the dialog will have only these two buttons. ## ## @seealso{errordlg, helpdlg, inputdlg, listdlg, warndlg} @@ -52,7 +52,7 @@ if (nargin < 1 || nargin > 6) print_usage (); endif - + if (! ischar (msg)) if (iscell (msg)) msg = sprintf ("%s\n", msg{:});
--- a/scripts/gui/uigetfile.m +++ b/scripts/gui/uigetfile.m @@ -80,7 +80,7 @@ endif endif endif - + if (nargin > 7) error ("uigetfile: number of input arguments must be less than eight"); endif
--- a/scripts/gui/waitbar.m +++ b/scripts/gui/waitbar.m @@ -29,7 +29,7 @@ ## [0, 1]. The optional message @var{msg} is centered and displayed above the ## waitbar. The appearance of the waitbar figure window can be configured by ## passing property/value pairs to the function. -## +## ## When called with a single input the current waitbar, if it exists, is ## updated to the new value @var{frac}. If there are multiple outstanding ## waitbars they can be updated individually by passing the handle @var{hwbar} @@ -95,7 +95,7 @@ curr_msg = get (th, "string"); ## graphics handles always store data as column vectors if (iscellstr (msg)) - msg = msg(:); + msg = msg(:); endif cmp = strcmp (msg, curr_msg); if (! all (cmp(:)))
--- a/scripts/gui/warndlg.m +++ b/scripts/gui/warndlg.m @@ -19,7 +19,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{h} =} warndlg (@var{msg}) ## @deftypefnx {Function File} {@var{h} =} warndlg (@var{msg}, @var{title}) -## Display @var{msg} using a warning dialog box. +## Display @var{msg} using a warning dialog box. ## ## The message may have multiple lines separated by newline characters ## ("\n"), or it may be a cellstr array with one element for each
--- a/scripts/help/doc.m +++ b/scripts/help/doc.m @@ -57,7 +57,7 @@ if isguirunning () __octave_link_show_doc__ (fname); else - + if (ftype == 2 || ftype == 3) ffile = which (fname); else @@ -98,7 +98,7 @@ if (have_fname) status = system (sprintf ("%s --index-search \"%s\"", cmd, fname)); endif - + if (! (have_fname && status == 0)) status = system (cmd);
--- a/scripts/help/help.m +++ b/scripts/help/help.m @@ -127,7 +127,7 @@ endfunction function retval = do_list_operators () - + retval = sprintf ("*** operators:\n\n%s\n\n", list_in_columns (__operators__ ())); endfunction
--- a/scripts/help/type.m +++ b/scripts/help/type.m @@ -137,4 +137,4 @@ %!error type () %!error <'__NO_NAME__' undefined> type ('__NO_NAME__') - +
--- a/scripts/image/bone.m +++ b/scripts/image/bone.m @@ -70,7 +70,7 @@ g(1:idx,1) = 7/8 * x(1:idx); g(idx:2*idx,1) = linspace (7/8 * x(idx), 7/8 * x(2*idx) + 1/8, nel); g(2*idx+1:n,1) = 7/8 * x(2*idx+1:n) + 1/8; - + base = 1 / (8*idx); nel = idx; b(1:idx,1) = linspace (base, 7/8 * x(idx) + 1/8, nel);
--- a/scripts/image/cmpermute.m +++ b/scripts/image/cmpermute.m @@ -1,5 +1,5 @@ ## Copyright (C) 2004 Josep Mones i Teixidor -## Copyright (C) 2012-2013 Rik Wehbring +## Copyright (C) 2012-2013 Rik Wehbring ## ## This file is part of Octave. ## @@ -69,11 +69,11 @@ ## build reverse index rindex = zeros (size (index)); rindex(index) = 1:length (index); - + ## preserve class of input image in output - if (strcmp (cls, "double")) + if (strcmp (cls, "double")) Y = rindex(X); - elseif (strcmp (cls, "single")) + elseif (strcmp (cls, "single")) rindex = single (rindex); Y = rindex(X); else @@ -97,7 +97,7 @@ %!test # random permutation, 0-based index %! [Y, newmap] = cmpermute (X, map); %! ## test we didn't lose colors -%! assert (sort (map), sortrows (newmap)); +%! assert (sort (map), sortrows (newmap)); %! ## test if images are equal %! assert (map(double (X)+1), newmap(double (Y)+1)); @@ -115,7 +115,7 @@ %!test # random permutation, 1-based index %! [Y, newmap] = cmpermute (X, map); %! ## test we didn't lose colors -%! assert (sort (map), sortrows (newmap)); +%! assert (sort (map), sortrows (newmap)); %! ## test if images are equal %! assert (map(X), newmap(Y));
--- a/scripts/image/cmunique.m +++ b/scripts/image/cmunique.m @@ -1,5 +1,5 @@ ## Copyright (C) 2004 Josep Mones i Teixidor -## Copyright (C) 2012-2013 Rik Wehbring +## Copyright (C) 2012-2013 Rik Wehbring ## ## This file is part of Octave. ## @@ -24,7 +24,7 @@ ## Convert an input image @var{X} to an ouput indexed image @var{Y} which uses ## the smallest colormap possible @var{newmap}. ## -## When the input is an indexed image (@var{X} with colormap @var{map}) the +## When the input is an indexed image (@var{X} with colormap @var{map}) the ## output is a colormap @var{newmap} from which any repeated rows have been ## eliminated. The output image, @var{Y}, is the original input image with ## the indices adjusted to match the new, possibly smaller, colormap. @@ -92,7 +92,7 @@ otherwise error ("cmunique: X is not a valid image"); endswitch - + ## if image was uint8 or uint16 we have to convert newmap to [0,1] range if (isinteger (X)) newmap = double (newmap) / double (intmax (cls));
--- a/scripts/image/colorcube.m +++ b/scripts/image/colorcube.m @@ -48,7 +48,7 @@ ## Create colorcube of evenly spaced points with side length of n^1/3 cubelen = fix (cbrt (n)); - reserve = n - cubelen^3; + reserve = n - cubelen^3; if (reserve == 0) ## Steal space from blue to put the gray gradient @@ -81,7 +81,7 @@ map = [map cgrad, zeros(csteps, 1), zeros(csteps, 1) zeros(csteps, 1), cgrad, zeros(csteps, 1) - zeros(csteps, 1), zeros(csteps, 1), cgrad + zeros(csteps, 1), zeros(csteps, 1), cgrad 0, 0, 0 ggrad, ggrad, ggrad];
--- a/scripts/image/colormap.m +++ b/scripts/image/colormap.m @@ -158,16 +158,16 @@ %!test %! cmaplst = colormap ("list"); %! assert (iscell (cmaplst)); -%! colormap ("register", "__mycmap__"); +%! colormap ("register", "__mycmap__"); %! cmaplst2 = colormap ("list"); %! assert (numel (cmaplst2), numel (cmaplst) + 1); %! assert (any (strcmp (cmaplst2, "__mycmap__"))); -%! colormap ("unregister", "__mycmap__"); +%! colormap ("unregister", "__mycmap__"); %! cmaplst2 = colormap ("list"); %! assert (numel (cmaplst2), numel (cmaplst)); %! assert (! any (strcmp (cmaplst2, "__mycmap__"))); %! ## Unregister again and verify that nothing has happened -%! colormap ("unregister", "__mycmap__"); +%! colormap ("unregister", "__mycmap__"); %! cmaplst3 = colormap ("list"); %! assert (isequal (cmaplst2, cmaplst3));
--- a/scripts/image/contrast.m +++ b/scripts/image/contrast.m @@ -55,7 +55,7 @@ %! title ("Image with default 64 gray levels"); %! pos = get (gcf, "position"); %! pos(1) += pos(3) + 25; -%! figure ("position", pos); +%! figure ("position", pos); %! colormap (contrast (img, 10)); %! imagesc (img); %! title ("Image with contrast enhanced");
--- a/scripts/image/gray2ind.m +++ b/scripts/image/gray2ind.m @@ -23,7 +23,7 @@ ## @deftypefnx {Function File} {@var{img} =} gray2ind (@var{BW}, @var{n}) ## @deftypefnx {Function File} {[@var{img}, @var{map}] =} gray2ind (@dots{}) ## Convert a grayscale or binary intensity image to an indexed image. -## +## ## The indexed image will consist of @var{n} different intensity values. ## If not given @var{n} defaults to 64 for grayscale images or 2 for ## binary black and white images.
--- a/scripts/image/image.m +++ b/scripts/image/image.m @@ -64,14 +64,14 @@ function h = image (varargin) [hax, varargin, nargin] = __plt_get_axis_arg__ ("image", varargin{:}); - + chararg = find (cellfun ("isclass", varargin, "char"), 1, "first"); - + do_new = true; if (nargin == 0) img = imread ("default.img"); x = y = []; - elseif (chararg == 1) + elseif (chararg == 1) ## Low-Level syntax do_new = false; x = y = img = []; @@ -141,7 +141,7 @@ ## FIXME: Hack for integer formats which use zero-based indexing ## Hack favors correctness of display over size of image in memory. - ## True fix must be done in C++ code for renderer. + ## True fix must be done in C++ code for renderer. if (ndims (img) == 2 && (isinteger (img) || islogical (img))) img = single (img) + 1; endif
--- a/scripts/image/imshow.m +++ b/scripts/image/imshow.m @@ -45,13 +45,13 @@ ## @table @asis ## @item @qcode{"displayrange"} ## @var{value1} is the display range as described above. -## +## ## @item @qcode{"xdata"} ## If @var{value1} is a two element vector, it must contain horizontal axis ## limits in the form [xmin xmax]; Otherwise @var{value1} must be a ## vector and only the first and last elements will be used for xmin and ## xmax respectively. -## +## ## @item @qcode{"ydata"} ## If @var{value1} is a two element vector, it must contain vertical axis ## limits in the form [ymin ymax]; Otherwise @var{value1} must be a
--- a/scripts/image/ind2gray.m +++ b/scripts/image/ind2gray.m @@ -47,7 +47,7 @@ endif [x, map] = ind2x ("ind2gray", x, map); - ## Convert colormap to luminance intensity values + ## Convert colormap to luminance intensity values map *= [0.29894; 0.58704; 0.11402]; ## Convert colormap to same class as that of input so that reshape
--- a/scripts/image/jet.m +++ b/scripts/image/jet.m @@ -60,7 +60,7 @@ r = zeros (n, 1); r(idx1:idx2, 1) = [1:nel] / nel; r(idx2:idx3, 1) = 1; - nel2 = n - idx3; + nel2 = n - idx3; r(idx3:(idx3+nel2), 1) = [nel:-1:(nel - nel2)] / nel; idx1 = idx1 - nel; # ~1/8*n for large n @@ -70,7 +70,7 @@ g = zeros (n, 1); g(idx1:idx2, 1) = [1:nel] / nel; g(idx2:idx3, 1) = 1; - nel2 = min (nel, n - idx3); + nel2 = min (nel, n - idx3); g(idx3:(idx3+nel2), 1) = [nel:-1:(nel - nel2)] / nel; idx1 = max (idx2 - nel, 1); # ~1/8*n for large n @@ -78,10 +78,10 @@ idx3 = idx3; # ~5/8*n for large n b = zeros (n, 1); - nel2 = min (nel, idx1-1); + nel2 = min (nel, idx1-1); b(1:idx1, 1) = [(nel - nel2):nel] / nel; b(idx1:idx2, 1) = 1; - nel2 = min (nel, n - idx3); + nel2 = min (nel, n - idx3); b(idx2:(idx2+nel2), 1) = [nel:-1:(nel - nel2)] / nel; map = [r, g, b];
--- a/scripts/image/rgb2ntsc.m +++ b/scripts/image/rgb2ntsc.m @@ -28,9 +28,9 @@ ## ## @example ## @group -## /Y\ 0.299 0.587 0.114 /R\ -## |I| = 0.596 -0.274 -0.322 |G| -## \Q/ 0.211 -0.523 0.312 \B/ +## /Y\ 0.299 0.587 0.114 /R\ +## |I| = 0.596 -0.274 -0.322 |G| +## \Q/ 0.211 -0.523 0.312 \B/ ## @end group ## @end example ## @@ -86,7 +86,7 @@ 0.587, -0.274, -0.523; 0.114, -0.322, 0.312 ]; - ## Convert data. + ## Convert data. yiq = rgb * trans; ## If input was an image, convert it back into one.
--- a/scripts/image/spinmap.m +++ b/scripts/image/spinmap.m @@ -39,7 +39,7 @@ if (nargin > 2) print_usage (); elseif (ischar (t)) - if (strcmpi (t, "inf")) + if (strcmpi (t, "inf")) t = Inf; else error ('spinmap: time T must be a real scalar or "inf"');
--- a/scripts/io/importdata.m +++ b/scripts/io/importdata.m @@ -29,7 +29,7 @@ ## @itemize ## @item @var{fname} ## The name of the file containing data. -## +## ## @item @var{delimiter} ## The character separating columns of data. Use @code{\t} for tab. ## (Only valid for ASCII files) @@ -100,7 +100,7 @@ case {".au", ".snd", ".flac", ".ogg"} error ("importdata: not implemented for file format %s", ext); case {".avi", ".mj2", ".mpg", ".asf", ".asx", ".wmv", ".mp4", ".m4v", ... - ".mov"} + ".mov"} error ("importdata: not implemented for file format %s", ext); case {".bmp", ".cur", ".gif", ".hdf", ".ico", ".jpe", ".jpeg", ".jpg", ... ".jp2", ".jpf", ".jpx", ".j2c", ".j2k", ".pbm", ".pcx", ".pgm", ... @@ -169,7 +169,7 @@ header_rows = 0; header_cols = 0; - + ## Work through first few rows line by line until a delimiter is found. while (ischar (row = fgetl (fid))) @@ -245,7 +245,7 @@ else fields = ostrsplit (row, delimiter); endif - + text = fields(na_idx(ridx,:)); text = text(! strcmpi (text, "NA")); # Remove valid "NA" entries if (! isempty (text))
--- a/scripts/io/strread.m +++ b/scripts/io/strread.m @@ -161,7 +161,7 @@ ## @table @asis ## @item last character = @qcode{"\n"} ## Data columns are padded with empty fields or Nan so that all columns -## have equal length +## have equal length ## ## @item last character is not @qcode{"\n"} ## Data columns are not padded; strread returns columns of unequal length @@ -177,7 +177,7 @@ if (nargin < 1) print_usage (); endif - + if (isempty (str)) ## Return empty args (no match), rather than raising an error varargout = cell (1, nargout); @@ -302,7 +302,7 @@ ## like %f<literal>) (w/o delimiter in between) are fixed further on format = strrep (format, "%", " %"); fmt_words = regexp (format, '[^ ]+', "match"); - + ## Find position of conversion specifiers (they start with %) idy2 = find (! cellfun ("isempty", regexp (fmt_words, '^%')));
--- a/scripts/io/textread.m +++ b/scripts/io/textread.m @@ -133,7 +133,7 @@ ## Set up default endofline param value varargin(end+1:end+2) = {"endofline", eol_char}; endif - + ## Now that we know what EOL looks like, we can process format_repeat_count. ## FIXME The below isn't ML-compatible: counts lines, not format string uses if (isfinite (nlines) && (nlines > 0)) @@ -170,7 +170,7 @@ str = fread (fid, "char=>char").'; endif fclose (fid); - + ## Set up default whitespace param value if needed if (isempty (find (strcmpi ("whitespace", varargin)))) varargin(end+1:end+2) = {"whitespace", " \b\t"}; @@ -182,7 +182,7 @@ ## Hack to concatenate/reshape numeric output into 2D array (undocumented ML) ## In ML this only works in case of an empty format string if (isempty (format)) - ## Get number of fields per line. + ## Get number of fields per line. ## 1. Get eol_char position iwhsp = find (strcmpi ("whitespace", varargin)); whsp = varargin{iwhsp + 1};
--- a/scripts/io/textscan.m +++ b/scripts/io/textscan.m @@ -204,7 +204,7 @@ elseif (args{headerlines + 1} < 0) warning ("textscan.m: negative headerline value ignored"); endif - endif + endif ## Read a first file chunk. Rest follows after endofline processing [str, count] = fscanf (fid, "%c", BUFLENGTH); @@ -317,7 +317,7 @@ pad = mod (numel (C{1}), ncols); if (pad) ## Textscan returns NaNs for empty fields - C(1) = [C{1}; NaN(ncols - pad, 1)]; + C(1) = [C{1}; NaN(ncols - pad, 1)]; endif ## Replace NaNs with EmptyValue, if any ipos = find (strcmpi (args, "emptyvalue")); @@ -333,7 +333,7 @@ C(ii) = C{1}(:, ii); endfor C{1} = C{1}(:, 1); - endif + endif endif ## If requested, collect output columns of same class
--- a/scripts/java/java_get.m +++ b/scripts/java/java_get.m @@ -21,18 +21,18 @@ ## Get the value of the field @var{name} of the Java object @var{obj}. For ## static fields, @var{obj} can be a string representing the fully qualified ## name of the corresponding class. -## +## ## When @var{obj} is a regular Java object, structure-like indexing can be ## used as a shortcut syntax. For instance, the two following statements are ## equivalent -## +## ## @example ## @group ## java_get (x, "field1") ## x.field1 ## @end group ## @end example -## +## ## @seealso{java_set, javaMethod, javaObject} ## @end deftypefn
--- a/scripts/java/java_set.m +++ b/scripts/java/java_set.m @@ -21,18 +21,18 @@ ## Set the value of the field @var{name} of the Java object @var{obj} to ## @var{val}. For static fields, @var{obj} can be a string representing the ## fully qualified named of the corresponding Java class. -## +## ## When @var{obj} is a regular Java object, structure-like indexing can be ## used as a shortcut syntax. For instance, the two following statements are ## equivalent -## +## ## @example ## @group ## java_set (x, "field1", val) ## x.field1 = val ## @end group ## @end example -## +## ## @seealso{java_get, javaMethod, javaObject} ## @end deftypefn
--- a/scripts/java/javaaddpath.m +++ b/scripts/java/javaaddpath.m @@ -53,7 +53,7 @@ if (! success) warning ("javaaddpath: failed to add '%s' to Java classpath", new_path); endif - endfor - + endfor + endfunction
--- a/scripts/java/javaclasspath.m +++ b/scripts/java/javaclasspath.m @@ -23,22 +23,22 @@ ## @deftypefnx {Function File} {[@var{dpath}, @var{spath}] =} javaclasspath () ## @deftypefnx {Function File} {@var{clspath} =} javaclasspath (@var{what}) ## Return the class path of the Java virtual machine in the form of a cell -## array of strings. +## array of strings. ## ## If called with no inputs: ## ## @itemize -## @item If no output is requested, the dynamic and static classpaths are printed +## @item If no output is requested, the dynamic and static classpaths are printed ## to the standard output. ## ## @item If one output value @var{dpath} is requested, the result is ## the dynamic classpath. ## -## @item If two output values@var{dpath} and @var{spath} are +## @item If two output values@var{dpath} and @var{spath} are ## requested, the first variable will contain the dynamic classpath and ## the second will be contain the static classpath. ## @end itemize -## +## ## If called with a single input parameter @var{what}: ## ## @table @asis @@ -85,7 +85,7 @@ varargout{1} = cellstr (dynamic_path_list); varargout{2} = cellstr (static_path_list); endswitch - + case 1 switch (nargout) case 0 @@ -109,7 +109,7 @@ endif endswitch endswitch - + endfunction ## Display cell array of paths
--- a/scripts/java/javamem.m +++ b/scripts/java/javamem.m @@ -1,5 +1,5 @@ ## Copyright (C) 2010, 2013 Philip Nienhuis -## +## ## This file is part of Octave. ## ## Octave is free software; you can redistribute it and/or modify it @@ -61,7 +61,7 @@ ## Author: Philip Nienhuis ## Created: 2010-03-25 -## Updates: +## Updates: ## 2010-03-26 Changed name to javamem & indentation to double spaces ## 2010-08-25 Corrected text on java memory assignments ## 2010-09-05 Further overhauled help text
--- a/scripts/linear-algebra/linsolve.m +++ b/scripts/linear-algebra/linsolve.m @@ -91,7 +91,7 @@ endif if (isfield (opts, "POSDEF") && opts.POSDEF) A = matrix_type (A, "positive definite"); - endif + endif if (isfield (opts, "LT") && opts.LT) if (trans_A) A = matrix_type (A, "upper"); @@ -105,7 +105,7 @@ else A = matrix_type (A, "upper"); endif - endif + endif endif x = A \ b;
--- a/scripts/linear-algebra/qzhess.m +++ b/scripts/linear-algebra/qzhess.m @@ -39,7 +39,7 @@ ## ## Algorithm taken from Golub and Van Loan, ## @cite{Matrix Computations, 2nd edition}. -## +## ## @seealso{lu, chol, hess, qr, qz, schur, svd} ## @end deftypefn
--- a/scripts/miscellaneous/debug.m +++ b/scripts/miscellaneous/debug.m @@ -20,7 +20,7 @@ ## @deftypefn {Function File} {} debug () ## Summary of debugging commands. For more information on each command ## and available options use @code{help CMD}. -## +## ## The debugging commands available in Octave are ## ## @table @code
--- a/scripts/miscellaneous/desktop.m +++ b/scripts/miscellaneous/desktop.m @@ -33,7 +33,7 @@ elseif (nargin > 1) error ('desktop: only one argument, "-inuse", is allowed'); endif - + switch (tolower (arg)) case "-inuse" retval = isguirunning ();
--- a/scripts/miscellaneous/dir.m +++ b/scripts/miscellaneous/dir.m @@ -28,7 +28,7 @@ ## ## @table @asis ## @item name -## File or directory name. +## File or directory name. ## ## @item date ## Timestamp of file modification (string value). @@ -37,7 +37,7 @@ ## File size in bytes. ## ## @item isdir -## True if name is a directory. +## True if name is a directory. ## ## @item datenum ## Timestamp of file modification as serial date number (double).
--- a/scripts/miscellaneous/dos.m +++ b/scripts/miscellaneous/dos.m @@ -53,7 +53,7 @@ %! unwind_protect %! [status, output] = dos (cmd); %! unwind_protect_cleanup -%! warning (old_wstate); +%! warning (old_wstate); %! end_unwind_protect %! %! if (ispc () && ! isunix ())
--- a/scripts/miscellaneous/edit.m +++ b/scripts/miscellaneous/edit.m @@ -141,7 +141,7 @@ ## User has supplied one arg, this can be a single file name ## or a cell array of strings containing multiple files to be opened if (iscellstr (varargin{1})) - ## If first arg is a cell array of strings, + ## If first arg is a cell array of strings, ## it becomes the list of files to be edited editfilelist = varargin{1}; elseif (ischar (varargin{1})) @@ -240,7 +240,7 @@ endfor else - + ## Only one file name was supplied, get it from the cell array file = tilde_expand (editfilelist{1}); @@ -502,7 +502,7 @@ fclose (fid); do_edit (FUNCTION.EDITOR, fileandpath, FUNCTION.MODE); - + endif endfunction
--- a/scripts/miscellaneous/fact.m +++ b/scripts/miscellaneous/fact.m @@ -1,4 +1,4 @@ -## Copyright (C) 2007-2013 Jordi Gutiérrez Hermoso +## Copyright (C) 2007-2013 Jordi Gutiérrez Hermoso ## Copyright (C) 2007 Stallmanfacts.com ## ## This file is part of Octave.
--- a/scripts/miscellaneous/getappdata.m +++ b/scripts/miscellaneous/getappdata.m @@ -19,10 +19,10 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{value} =} getappdata (@var{h}, @var{name}) ## @deftypefnx {Function File} {@var{appdata} =} getappdata (@var{h}) -## +## ## Return the @var{value} for named application data for the object(s) with ## handle(s) @var{h}. -## +## ## @code{getappdata(@var{h})} returns a structure, @var{appdata}, whose fields ## correspond to the appdata properties. ##
--- a/scripts/miscellaneous/inputname.m +++ b/scripts/miscellaneous/inputname.m @@ -52,7 +52,7 @@ ## To test inputname, I need a function context invoked ## with known parameter names. So define a couple of ## shared parameters, et voila!, the test is trivial. - + %!shared hello, worldly %!assert (inputname (1), "hello") %!assert (inputname (2), "worldly")
--- a/scripts/miscellaneous/license.m +++ b/scripts/miscellaneous/license.m @@ -23,7 +23,7 @@ ## @deftypefnx {Function File} {@var{retval} =} license ("test", @var{feature}) ## @deftypefnx {Function File} {} license ("test", @var{feature}, @var{toggle}) ## @deftypefnx {Function File} {@var{retval} =} license ("checkout", @var{feature}) -## +## ## Display the license of Octave. ## ## @code{license ("inuse")} @@ -89,7 +89,7 @@ print_usage (); endif - if (nin == 0) + if (nin == 0) found = find (strcmp (__octave_licenses__(:,1), "Octave"), 1);
--- a/scripts/miscellaneous/ls_command.m +++ b/scripts/miscellaneous/ls_command.m @@ -60,8 +60,8 @@ %! cmd = ls_command (); %! assert (ischar (cmd)); %! if (ispc () && ! isunix ()) -%! assert (cmd(1:3), "dir"); +%! assert (cmd(1:3), "dir"); %! else -%! assert (cmd(1:2), "ls"); +%! assert (cmd(1:2), "ls"); %! endif
--- a/scripts/miscellaneous/run.m +++ b/scripts/miscellaneous/run.m @@ -33,7 +33,7 @@ ## Implementation Note: If @var{script} includes a path component, then ## @code{run} first changes the directory to the directory where @var{script} ## is found. @code{run} then executes the script, and returns to the original -## directory. +## directory. ## @seealso{path, addpath, source} ## @end deftypefn @@ -52,11 +52,11 @@ script = [script ".m"]; endif endif - + if (! exist (script, "file")) error ("run: file SCRIPT must exist and be a valid Octave scriptfile"); endif - + if (! isempty (d)) if (exist (d, "dir")) wd = pwd ();
--- a/scripts/miscellaneous/setfield.m +++ b/scripts/miscellaneous/setfield.m @@ -21,7 +21,7 @@ ## @deftypefn {Function File} {@var{s} =} setfield (@var{s}, @var{field}, @var{val}) ## @deftypefnx {Function File} {@var{s} =} setfield (@var{s}, @var{idx1}, @var{field1}, @var{idx2}, @var{field2}, @dots{}, @var{val}) ## -## Set a field member @var{field} in a structure @var{s} equal to @var{val}. +## Set a field member @var{field} in a structure @var{s} equal to @var{val}. ## For example: ## ## @example
--- a/scripts/miscellaneous/unix.m +++ b/scripts/miscellaneous/unix.m @@ -53,7 +53,7 @@ %! unwind_protect %! [status, output] = unix (cmd); %! unwind_protect_cleanup -%! warning (old_wstate); +%! warning (old_wstate); %! end_unwind_protect %! %! if (isunix ())
--- a/scripts/miscellaneous/ver.m +++ b/scripts/miscellaneous/ver.m @@ -21,7 +21,7 @@ ## @deftypefnx {Function File} {v =} ver () ## @deftypefnx {Function File} {v =} ver ("Octave") ## @deftypefnx {Function File} {v =} ver (@var{package}) -## +## ## Display a header containing the current Octave version number, license ## string, and operating system followed by a list of installed packages, ## versions, and installation directories.
--- a/scripts/mk-pkg-add +++ b/scripts/mk-pkg-add @@ -3,17 +3,17 @@ # Copyright (C) 2002-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/scripts/mkdoc.pl +++ b/scripts/mkdoc.pl @@ -70,7 +70,7 @@ ################################################################################ sub gethelp { - ($fcn, $fname) = @_[0..1]; + ($fcn, $fname) = @_[0..1]; open (FH, $fname) or return ""; do @@ -95,7 +95,7 @@ push (@help_txt, $_); } until (! defined ($_ = <FH>) or ! /^\s*(?:#|%)/); - } until ($help_txt[0] !~ /^(?:Copyright|Author)/); + } until ($help_txt[0] !~ /^(?:Copyright|Author)/); close (FH);
--- a/scripts/optimization/fminsearch.m +++ b/scripts/optimization/fminsearch.m @@ -28,7 +28,7 @@ ## is better-suited to functions which have discontinuities or for which ## a gradient-based search such as @code{fminunc} fails. ## -## Options for the search are provided in the parameter @var{options} using +## Options for the search are provided in the parameter @var{options} using ## the function @code{optimset}. Currently, @code{fminsearch} accepts the ## options: @qcode{"TolX"}, @qcode{"MaxFunEvals"}, @qcode{"MaxIter"}, ## @qcode{"Display"}. For a description of these options, see
--- a/scripts/optimization/optimset.m +++ b/scripts/optimization/optimset.m @@ -56,7 +56,7 @@ ## value (a complex number, NaN, or Inf). Must be set to @qcode{"on"} or ## @qcode{"off"} [default]. Note: the functions @code{fzero} and ## @code{fminbnd} correctly handle Inf values and only complex values or NaN -## will cause an error in this case. +## will cause an error in this case. ## ## @item GradObj ## When set to @qcode{"on"}, the function to be minimized must return a
--- a/scripts/optimization/sqp.m +++ b/scripts/optimization/sqp.m @@ -410,7 +410,7 @@ ## FIXME -- check QP solution and attempt to recover if it has ## failed. For now, just warn about possible problems. - + id = "Octave:SQP-QP-subproblem"; switch (info) case 2
--- a/scripts/pkg/pkg.m +++ b/scripts/pkg/pkg.m @@ -138,7 +138,7 @@ ## @end example ## ## The option @qcode{"-forge"} lists packages available at the Octave-Forge -## repository. This requires an internet connection and the cURL library. +## repository. This requires an internet connection and the cURL library. ## For example: ## ## @example @@ -449,7 +449,7 @@ else error ("you must specify a prefix directory, or request an output argument"); endif - + case "local_list" if (length (files) == 0 && nargout == 0) disp (local_list); @@ -457,7 +457,7 @@ local_packages = local_list; elseif (length (files) == 1 && nargout == 0 && ischar (files{1})) local_list = files{1}; - if (! exist (local_list, "file")) + if (! exist (local_list, "file")) try ## Force file to be created fclose (fopen (local_list, "wt")); @@ -477,7 +477,7 @@ local_packages = global_list; elseif (length (files) == 1 && nargout == 0 && ischar (files{1})) global_list = files{1}; - if (! exist (global_list, "file")) + if (! exist (global_list, "file")) try ## Force file to be created fclose (fopen (files{1}, "wt"));
--- a/scripts/pkg/private/create_pkgadddel.m +++ b/scripts/pkg/private/create_pkgadddel.m @@ -29,7 +29,7 @@ ## architecture dependent directory so that the autoload/mfilename ## commands work as expected. The only part that doesn't is the ## part in the main directory. - archdir = fullfile (getarchprefix (desc, global_install), + archdir = fullfile (getarchprefix (desc, global_install), [desc.name "-" desc.version], getarch ()); if (exist (getarchdir (desc, global_install), "dir")) archpkg = fullfile (getarchdir (desc, global_install), nm);
--- a/scripts/pkg/private/fix_depends.m +++ b/scripts/pkg/private/fix_depends.m @@ -35,7 +35,7 @@ for i = 1:length (deps) dep = deps{i}; [start, nm] = regexp (dep, dep_pat, 'start', 'names'); - ## Is the dependency specified + ## Is the dependency specified ## in the correct format? if (! isempty (start)) package = tolower (strtrim (nm.name)); @@ -55,7 +55,7 @@ operator = ">="; version = "0.0.0"; endif - deps_cell{i} = struct ("package", package, + deps_cell{i} = struct ("package", package, "operator", operator, "version", version); else
--- a/scripts/pkg/private/install.m +++ b/scripts/pkg/private/install.m @@ -262,7 +262,7 @@ if (isfield (descriptions{i}, "autoload")) a = descriptions{i}.autoload; desc_autoload = ((isnumeric (a) && a > 0) - || (ischar (a) + || (ischar (a) && any (strcmpi (a, str_true)))); endif
--- a/scripts/plot/appearance/axis.m +++ b/scripts/plot/appearance/axis.m @@ -200,7 +200,7 @@ set (ca, "dataaspectratiomode", "auto"); endif set (ca, "dataaspectratio", [1, 1, 1], "plotboxaspectratio", [5 4 4]); - + elseif (strcmpi (ax, "normal")) ## Set plotboxaspectratio to something obtuse so that switching ## back to "auto" will force a re-calculation. @@ -333,12 +333,12 @@ else data = get (kids, strcat (ax, "data")); types = get (kids, "type"); - + scale = get (ca, strcat (ax, "scale")); if (! iscell (data)) data = {data}; endif - + ## Extend image data one pixel idx = strcmp (types, "image"); if (any (idx) && (ax == "x" || ax == "y")) @@ -349,7 +349,7 @@ imdata, px, "uniformoutput", false); data(idx) = imdata; endif - + if (strcmp (scale, "log")) tmp = data; data = cellfun (@(x) x(x>0), tmp, "uniformoutput", false);
--- a/scripts/plot/appearance/box.m +++ b/scripts/plot/appearance/box.m @@ -40,7 +40,7 @@ if (isempty (hax)) hax = gca (); endif - + if (nargs == 0) box_state = get (hax, "box"); if (strcmp (box_state, "on"))
--- a/scripts/plot/appearance/clabel.m +++ b/scripts/plot/appearance/clabel.m @@ -27,7 +27,7 @@ ## ## The contour levels are specified by the contour matrix @var{c} which is ## returned by @code{contour}, @code{contourc}, @code{contourf}, and -## @code{contour3}. Contour labels are rotated to match the local line +## @code{contour3}. Contour labels are rotated to match the local line ## orientation and centered on the line. The position of labels along the ## contour line is chosen randomly. ## @@ -105,7 +105,7 @@ have_labelspacing = true; label_spacing = varargin{2*idx}; varargin(2*idx+(-1:0)) = []; - endif + endif if (have_hg) if (! isempty (v))
--- a/scripts/plot/appearance/daspect.m +++ b/scripts/plot/appearance/daspect.m @@ -26,20 +26,20 @@ ## ## The aspect ratio is a normalized 3-element vector representing the span of ## the x, y, and z-axis limits. -## +## ## @code{daspect (@var{mode})} ## ## Set the data aspect ratio mode of the current axes. @var{mode} is ## either @qcode{"auto"} or @qcode{"manual"}. -## +## ## @code{daspect (@qcode{"mode"})} ## ## Return the data aspect ratio mode of the current axes. -## +## ## @code{daspect (@var{hax}, @dots{})} ## ## Operate on the axes in handle @var{hax} instead of the current axes. -## +## ## @seealso{axis, pbaspect, xlim, ylim, zlim} ## @end deftypefn
--- a/scripts/plot/appearance/datetick.m +++ b/scripts/plot/appearance/datetick.m @@ -41,7 +41,7 @@ endif if (isempty (hax)) hax = gca (); - endif + endif unwind_protect ## FIXME: This will bring the axes to the top of the stack. @@ -99,7 +99,7 @@ varargin = varargin(! idx); endif - nargin = numel (varargin); + nargin = numel (varargin); form = []; ax = "x";
--- a/scripts/plot/appearance/grid.m +++ b/scripts/plot/appearance/grid.m @@ -53,7 +53,7 @@ if (isempty (hax)) hax = gca (); endif - + if (nargs > 2) print_usage (); endif
--- a/scripts/plot/appearance/legend.m +++ b/scripts/plot/appearance/legend.m @@ -585,7 +585,7 @@ ## of "fontsize" property proplist = {"fontunits", "fontangle", "fontname", "fontsize", ... "fontweight"}; - ca_props = get (ca(1), proplist); + ca_props = get (ca(1), proplist); set (hlegend, proplist, ca_props); else addprops = false;
--- a/scripts/plot/appearance/orient.m +++ b/scripts/plot/appearance/orient.m @@ -94,7 +94,7 @@ ## FIXME: Should use "default" here, but Octave complains ## that "paperposition" is not a default property. set (cf, "paperposition", "factory"); - else + else ## landscape also sets the plot to occupy the entire page papersize = get (cf, "papersize"); set (cf, "paperposition", [0.25, 0.25, (papersize - 0.5)]);
--- a/scripts/plot/appearance/shading.m +++ b/scripts/plot/appearance/shading.m @@ -69,7 +69,7 @@ for i = 1 : numel (hglist) props = get (hglist(i)); if (! isfield (props, "levelstep")) - parents(end+1) = hglist(i); + parents(end+1) = hglist(i); endif endfor kids = get (parents, "children");
--- a/scripts/plot/appearance/text.m +++ b/scripts/plot/appearance/text.m @@ -81,7 +81,7 @@ elseif (nx > 1 && nt == nx) ## Mutiple text objects with different strings string = cellstr (string); - else + else ## Mutiple text objects with same string string = repmat ({string}, [nx, 1]); nt = nx; @@ -95,7 +95,7 @@ elseif (iscell (string)) nt = numel (string); - if (nx == 1) + if (nx == 1) ## Single text object with one or more lines string = {string}; nt = 1;
--- a/scripts/plot/appearance/title.m +++ b/scripts/plot/appearance/title.m @@ -43,7 +43,7 @@ if (isempty (hax)) hax = gca (); endif - + if (rem (nargin, 2) != 1) print_usage (); endif
--- a/scripts/plot/appearance/xlabel.m +++ b/scripts/plot/appearance/xlabel.m @@ -43,7 +43,7 @@ if (isempty (hax)) hax = gca (); endif - + if (rem (nargin, 2) != 1) print_usage (); endif
--- a/scripts/plot/appearance/ylabel.m +++ b/scripts/plot/appearance/ylabel.m @@ -45,7 +45,7 @@ if (isempty (hax)) hax = gca (); endif - + if (rem (nargin, 2) != 1) print_usage (); endif
--- a/scripts/plot/appearance/zlabel.m +++ b/scripts/plot/appearance/zlabel.m @@ -42,7 +42,7 @@ if (isempty (hax)) hax = gca (); endif - + if (rem (nargin, 2) != 1) print_usage (); endif
--- a/scripts/plot/draw/area.m +++ b/scripts/plot/draw/area.m @@ -70,14 +70,14 @@ num_numeric = find (cellfun ("isclass", varargin, "char"), 1) - 1; if (isempty (num_numeric)) - num_numeric = nargin; + num_numeric = nargin; endif switch (num_numeric) case 1 y = varargin{1}; case 2 - if (isscalar (varargin{2})) + if (isscalar (varargin{2})) y = varargin{1}; bv = varargin{2}; else @@ -247,7 +247,7 @@ %! y = [sin(t).^2, cos(t).^2]; %! area (t, y); %! axis tight -%! legend ('sin^2', 'cos^2', 'location', 'NorthEastOutside'); +%! legend ('sin^2', 'cos^2', 'location', 'NorthEastOutside'); %! title ('area() plot'); %!demo
--- a/scripts/plot/draw/bar.m +++ b/scripts/plot/draw/bar.m @@ -39,9 +39,9 @@ ## argument which can take the following values: ## ## @table @asis -## @item @qcode{"grouped"} (default) +## @item @qcode{"grouped"} (default) ## Side-by-side bars with a gap between bars and centered over the X-coordinate. -## +## ## @item @qcode{"stacked"} ## Bars are stacked so that each X value has a single bar composed of ## multiple segments.
--- a/scripts/plot/draw/barh.m +++ b/scripts/plot/draw/barh.m @@ -39,9 +39,9 @@ ## argument which can take the following values: ## ## @table @asis -## @item @qcode{"grouped"} (default) +## @item @qcode{"grouped"} (default) ## Side-by-side bars with a gap between bars and centered over the Y-coordinate. -## +## ## @item @qcode{"stacked"} ## Bars are stacked so that each Y value has a single bar composed of ## multiple segments. @@ -60,7 +60,7 @@ ## ## If the first argument @var{hax} is an axes handle, then plot into this axis, ## rather than the current axes returned by @code{gca}. -## +## ## The optional return value @var{h} is a graphics handle to the created ## bar series hggroup. For a description of the use of the ## bar series, @pxref{XREFbar,,bar}.
--- a/scripts/plot/draw/colorbar.m +++ b/scripts/plot/draw/colorbar.m @@ -62,7 +62,7 @@ ## ## To remove a colorbar from a plot use any one of the following keywords for ## the @var{delete_option}: @qcode{"delete"}, @qcode{"hide"}, @qcode{"off"}. -## +## ## If the argument @qcode{"peer"} is given, then the following argument is ## treated as the axes handle in which to add the colorbar. Alternatively, ## If the first argument @var{hax} is an axes handle, then the colorbar is @@ -78,7 +78,7 @@ ## colorbar object. ## ## Implementation Note: A colorbar is created as an additional axes to the -## current figure with the @qcode{"tag"} property set to @qcode{"colorbar"}. +## current figure with the @qcode{"tag"} property set to @qcode{"colorbar"}. ## The created axes object has the extra property @qcode{"location"} which ## controls the positioning of the colorbar. ## @seealso{colormap} @@ -149,10 +149,10 @@ # if (! isempty (args)) # set (hcb, args{:}); # endif - ax = get (get (hcb, "parent"), "currrentaxes"); + ax = get (get (hcb, "parent"), "currrentaxes"); endif endif - + if (isempty (loc)) loc = "eastoutside"; endif @@ -180,7 +180,7 @@ obj.__cbar_hax__ = ax; position = obj.position; ## FIXME: Should this be ancestor to accommodate hggroups? - hpar = get (ax, "parent"); + hpar = get (ax, "parent"); clen = rows (get (hpar, "colormap")); cext = get (ax, "clim"); cdiff = (cext(2) - cext(1)) / clen / 2; @@ -322,7 +322,7 @@ ## Now run the the following code. ## clf; colorbar (); contour (peaks ()) ## Once the keyboard command has been hit in the debugger try - ## set (hiax, "ylim", [0 0.5]) + ## set (hiax, "ylim", [0 0.5]) pos = get (hiax, "position"); pos(1) += eps; set (hiax, "position", pos);
--- a/scripts/plot/draw/contour.m +++ b/scripts/plot/draw/contour.m @@ -69,7 +69,7 @@ endif unwind_protect hax = newplot (hax); - + [ctmp, htmp] = __contour__ (hax, "none", varargin{:}); unwind_protect_cleanup if (! isempty (oldfig))
--- a/scripts/plot/draw/contour3.m +++ b/scripts/plot/draw/contour3.m @@ -71,7 +71,7 @@ endif unwind_protect hax = newplot (hax); - + [ctmp, htmp] = __contour__ (hax, "auto", varargin{:}); unwind_protect_cleanup if (! isempty (oldfig))
--- a/scripts/plot/draw/contourf.m +++ b/scripts/plot/draw/contourf.m @@ -70,7 +70,7 @@ endif unwind_protect hax = newplot (hax); - + [ctmp, htmp] = __contour__ (hax, "none", "fill", "on", "linecolor", "black", varargin{:}); unwind_protect_cleanup
--- a/scripts/plot/draw/ellipsoid.m +++ b/scripts/plot/draw/ellipsoid.m @@ -28,7 +28,7 @@ ## ## The optional input @var{n} determines the number of faces around the ## the circumference of the cylinder. The default value is 20. -## +## ## If the first argument @var{hax} is an axes handle, then plot into this axis, ## rather than the current axes returned by @code{gca}. ## @@ -80,7 +80,7 @@ endif unwind_protect hax = newplot (hax); - + surf (x, y, z); unwind_protect_cleanup if (! isempty (oldfig))
--- a/scripts/plot/draw/errorbar.m +++ b/scripts/plot/draw/errorbar.m @@ -57,7 +57,7 @@ ## When the error is a scalar all points share the same error value. ## The errorbars are symmetric and are drawn from @var{data}-@var{err} to ## @var{data}+@var{err}. -## The @var{fmt} argument determines whether @var{err} is in the x-direction, +## The @var{fmt} argument determines whether @var{err} is in the x-direction, ## y-direction (default), or both. ## ## @item @var{err} (vector or matrix)
--- a/scripts/plot/draw/ezcontour.m +++ b/scripts/plot/draw/ezcontour.m @@ -24,7 +24,7 @@ ## @deftypefnx {Function File} {@var{h} =} ezcontour (@dots{}) ## ## Plot the contour lines of a function. -## +## ## @var{f} is a string, inline function, or function handle with two arguments ## defining the function. By default the plot is over the meshed domain ## @code{-2*pi <= @var{x} | @var{y} <= 2*pi} with 60 points in each dimension.
--- a/scripts/plot/draw/ezcontourf.m +++ b/scripts/plot/draw/ezcontourf.m @@ -24,7 +24,7 @@ ## @deftypefnx {Function File} {@var{h} =} ezcontourf (@dots{}) ## ## Plot the filled contour lines of a function. -## +## ## @var{f} is a string, inline function, or function handle with two arguments ## defining the function. By default the plot is over the meshed domain ## @code{-2*pi <= @var{x} | @var{y} <= 2*pi} with 60 points in each dimension.
--- a/scripts/plot/draw/ezmesh.m +++ b/scripts/plot/draw/ezmesh.m @@ -47,7 +47,7 @@ ## If the first argument @var{hax} is an axes handle, then plot into this axis, ## rather than the current axes returned by @code{gca}. ## -## The optional return value @var{h} is a graphics handle to the created +## The optional return value @var{h} is a graphics handle to the created ## surface object. ## ## Example 1: 2-argument function
--- a/scripts/plot/draw/ezpolar.m +++ b/scripts/plot/draw/ezpolar.m @@ -24,7 +24,7 @@ ## @deftypefnx {Function File} {@var{h} =} ezpolar (@dots{}) ## ## Plot a 2-D function in polar coordinates. -## +## ## The function @var{f} is a string, inline function, or function handle with ## a single argument. The expected form of the function is ## @code{@var{rho} = @var{f}(@var{theta})}.
--- a/scripts/plot/draw/fill.m +++ b/scripts/plot/draw/fill.m @@ -27,7 +27,7 @@ ## The inputs @var{x} and @var{y} are the coordinates of the polygon vertices. ## If the inputs are matrices then the rows represent different vertices and ## each column produces a different polygon. @code{fill} will close any open -## polygons before plotting. +## polygons before plotting. ## ## The input @var{c} determines the color of the polygon. The simplest form ## is a single color specification such as a @code{plot} format or an @@ -76,7 +76,7 @@ if (numel (varargin) > iargs(end) + 2) opts = varargin(iargs(end)+3 : end); endif - + if (! all (cellfun (@(x) iscolorspec (x), varargin(iargs + 2)))) print_usage (); endif @@ -106,7 +106,7 @@ if (fail) print_usage (); endif - + hlist(end+1, 1) = htmp; endfor
--- a/scripts/plot/draw/fplot.m +++ b/scripts/plot/draw/fplot.m @@ -116,8 +116,8 @@ endif endfor - if (n != 5) - ## n was specified + if (n != 5) + ## n was specified x0 = linspace (limits(1), limits(2), n/2 + 1)'; y0 = feval (fn, x0); x = linspace (limits(1), limits(2), n)'; @@ -138,7 +138,7 @@ err0 = Inf; - ## FIXME: This algorithm should really use adaptive scaling as the + ## FIXME: This algorithm should really use adaptive scaling as the ## the numerical quadrature algorithms do so that extra points are ## used where they are needed and not spread evenly over the entire ## x-range. Try any function with a discontinuity, such as
--- a/scripts/plot/draw/hist.m +++ b/scripts/plot/draw/hist.m @@ -80,7 +80,7 @@ if (nargin < 1) print_usage (); endif - + y = varargin{1}; varargin = varargin(2:end); @@ -161,9 +161,9 @@ endif if (nargout > 0) - if (arg_is_vector) + if (arg_is_vector) ## Matlab compatibility requires a row vector return - nn = freq'; + nn = freq'; xx = x'; else nn = freq;
--- a/scripts/plot/draw/meshc.m +++ b/scripts/plot/draw/meshc.m @@ -33,7 +33,7 @@ ## @code{@var{x} = 1:columns (@var{z}), @var{y} = 1:rows (@var{z})}. ## Thus, columns of @var{z} correspond to different @var{x} values and rows ## of @var{z} correspond to different @var{y} values. -## +## ## The color of the mesh is computed by linearly scaling the @var{z} values ## to fit the range of the current colormap. Use @code{caxis} and/or ## change the colormap to control the appearance.
--- a/scripts/plot/draw/meshz.m +++ b/scripts/plot/draw/meshz.m @@ -66,9 +66,9 @@ have_c = false; if (isempty (charidx)) - if (nargin == 2 || nargin == 4) + if (nargin == 2 || nargin == 4) have_c = true; - charidx = nargin; # bundle C matrix back into varargin + charidx = nargin; # bundle C matrix back into varargin else charidx = nargin + 1; endif @@ -110,7 +110,7 @@ cref .* ones(1, columns(c) + 2)]; varargin(charidx) = c; endif - + oldfig = []; if (! isempty (hax)) oldfig = get (0, "currentfigure"); @@ -155,7 +155,7 @@ %! clf; %! colormap ('default'); %! [X,Y,Z] = peaks (); -%! [fx, fy] = gradient (Z); +%! [fx, fy] = gradient (Z); %! C = sqrt (fx.^2 + fy.^2); %! meshz (X,Y,Z,C); %! title ('meshz() plot with color determined by gradient');
--- a/scripts/plot/draw/pareto.m +++ b/scripts/plot/draw/pareto.m @@ -32,7 +32,7 @@ ## ## The fundamental idea (Pareto principle) behind the use of Pareto ## diagrams is that the majority of an effect is due to a small subset of the -## causes. For quality improvement, the first few contributing causes +## causes. For quality improvement, the first few contributing causes ## (leftmost bars as presented on the diagram) to a problem usually account for ## the majority of the result. Thus, targeting these "major causes" for ## elimination results in the most cost-effective improvement scheme.
--- a/scripts/plot/draw/patch.m +++ b/scripts/plot/draw/patch.m @@ -77,11 +77,11 @@ function h = patch (varargin) [hax, varargin] = __plt_get_axis_arg__ ("patch", varargin{:}); - + if (isempty (hax)) hax = gca (); endif - + [htmp, failed] = __patch__ (hax, varargin{:}); if (failed)
--- a/scripts/plot/draw/peaks.m +++ b/scripts/plot/draw/peaks.m @@ -39,7 +39,7 @@ ## ## Called without a return argument, @code{peaks} plots the surface of the ## above function using @code{surf}. -## +## ## If @var{n} is a scalar, @code{peaks} plots the value of the above ## function on an @var{n}-by-@var{n} mesh over the range [-3,3]. The ## default value for @var{n} is 49. @@ -51,7 +51,7 @@ ## When called with output arguments, return the data for the function ## evaluated over the meshgrid. This can subsequently be plotted with ## @code{surf (@var{x}, @var{y}, @var{z})}. -## +## ## @seealso{sombrero, meshgrid, mesh, surf} ## @end deftypefn
--- a/scripts/plot/draw/pie.m +++ b/scripts/plot/draw/pie.m @@ -27,14 +27,14 @@ ## When called with a single vector argument, produce a pie chart of the ## elements in @var{x}. The size of the ith slice is the percentage that the ## element @var{x}i represents of the total sum of @var{x}: -## @code{pct = @var{x}(i) / sum (@var{x})}. +## @code{pct = @var{x}(i) / sum (@var{x})}. ## ## The optional input @var{explode} is a vector of the same length as @var{x} ## that, if non-zero, "explodes" the slice from the pie chart. ## ## The optional input @var{labels} is a cell array of strings of the same ## length as @var{x} specifying the label for each slice. -## +## ## If the first argument @var{hax} is an axes handle, then plot into this axis, ## rather than the current axes returned by @code{gca}. ##
--- a/scripts/plot/draw/pie3.m +++ b/scripts/plot/draw/pie3.m @@ -28,7 +28,7 @@ ## Called with a single vector argument, produces a 3-D pie chart of the ## elements in @var{x}. The size of the ith slice is the percentage that the ## element @var{x}i represents of the total sum of @var{x}: -## @code{pct = @var{x}(i) / sum (@var{x})}. +## @code{pct = @var{x}(i) / sum (@var{x})}. ## ## The optional input @var{explode} is a vector of the same length as @var{x} ## that, if non-zero, "explodes" the slice from the pie chart.
--- a/scripts/plot/draw/plot.m +++ b/scripts/plot/draw/plot.m @@ -73,7 +73,7 @@ ## @item ## @code{squeeze()} is applied to arguments with more than two dimensions, ## but no more than two singleton dimensions. -## +## ## @item ## If both arguments are vectors, the elements of @var{y} are plotted versus ## the elements of @var{x}. @@ -102,7 +102,7 @@ ## @qcode{"markersize"}, @qcode{"markeredgecolor"}, @qcode{"markerfacecolor"}. ## ## The @var{fmt} format argument can also be used to control the plot style. -## The format is composed of three parts: linestyle, markerstyle, color. +## The format is composed of three parts: linestyle, markerstyle, color. ## When a markerstyle is specified, but no linestyle, only the markers are ## plotted. Similarly, if a linestyle is specified, but no markerstyle, then ## only lines are drawn. If both are specified then lines and markers will @@ -247,7 +247,7 @@ %! plot (x1,y1,'bo-', x2,y2,'rs-'); %! axis ('tight'); %! title ({'plot() of blue circles ascending and red squares descending'; -%! 'connecting lines drawn'}); +%! 'connecting lines drawn'}); %!demo %! x = 0:10;
--- a/scripts/plot/draw/plotyy.m +++ b/scripts/plot/draw/plotyy.m @@ -174,7 +174,7 @@ set (ax, "activepositionproperty", "position"); endif - ## Kluge, until __plt_get_axis_arg__ and newplot are reworked. + ## Kluge, until __plt_get_axis_arg__ and newplot are reworked. set (ax(2), "nextplot", "replacechildren"); h2 = feval (fun2, ax(2), x2, y2); set (ax(2), "yaxislocation", "right");
--- a/scripts/plot/draw/private/__bar__.m +++ b/scripts/plot/draw/private/__bar__.m @@ -75,7 +75,7 @@ idx++; elseif (ischar (varargin{idx}) && strcmpi (varargin{idx}, "histc")) group = true; - histc = true; + histc = true; idx++; elseif (ischar (varargin{idx}) && strcmpi (varargin{idx}, "hist")) group = true; @@ -147,7 +147,7 @@ cutoff = 1; endif if (group) - gdelta = cutoff * gwidth / nbars; + gdelta = cutoff * gwidth / nbars; cdelta = repmat ((1 - ((1 - cwidth) / 2)) * gdelta, size (x)); else cdelta = repmat (cutoff * gwidth, size (x)); @@ -373,7 +373,7 @@ function show_baseline (h, ~, prop = "") persistent recursion = false; - + ## Don't allow recursion if (! recursion) unwind_protect
--- a/scripts/plot/draw/private/__contour__.m +++ b/scripts/plot/draw/private/__contour__.m @@ -217,7 +217,7 @@ ## Turn off automatic updating of clim while adding patches climmode = get (ca, "climmode"); - set (ca, "climmode", "manual"); + set (ca, "climmode", "manual"); if (strcmp (lc, "auto")) lc = "flat";
--- a/scripts/plot/draw/private/__errplot__.m +++ b/scripts/plot/draw/private/__errplot__.m @@ -30,7 +30,7 @@ fmt = __pltopt__ ("__errplot__", fstr); ## Set the plot type based on linestyle. - switch (fmt.errorstyle) + switch (fmt.errorstyle) case "~" ifmt = "yerr"; case ">" @@ -199,7 +199,7 @@ endfor ## Process legend key - if (! isempty (fmt.key)) + if (! isempty (fmt.key)) hlegend = []; fkids = get (gcf (), "children"); for i = 1 : numel (fkids) @@ -219,7 +219,7 @@ else [hlgnd, tlgnd] = __getlegenddata__ (hlegend); endif - + hlgnd(end+1) = hg; tlgnd(end+1) = fmt.key;
--- a/scripts/plot/draw/private/__ezplot__.m +++ b/scripts/plot/draw/private/__ezplot__.m @@ -25,7 +25,7 @@ ## As such, most of the function is actually dedicated to sorting ## out the inputs and verifying that the particular ez* function ## called was called correctly. The actual plotting occurs near -## the end in an unwind_protect block. +## the end in an unwind_protect block. function [h, needusage] = __ezplot__ (pltfunc, varargin) @@ -55,11 +55,11 @@ case "plot3" isplot = false; isplot3 = true; - + case "polar" isplot = false; ispolar = true; - + otherwise ## contour, mesh, surf plots isplot = false; @@ -497,7 +497,7 @@ ## 2-D data for isplot domain = [X(1) X(end)]; - ## Guess a range which includes the "mass" of the data by using a + ## Guess a range which includes the "mass" of the data by using a ## median-based approach. The center 3/4 of the data is used to ## determine the range of the data. ## This seems to be vaguely what Matlab does, but can't be sure. @@ -523,15 +523,15 @@ else ## 3-D data such as mesh, surf - Zfinite = ! isnan (Z); - Zrows = any (Zfinite, 2); - rmin = find (Zrows, 1, "first"); - rmax = find (Zrows, 1, "last"); - Zcols = any (Zfinite, 1); - cmin = find (Zcols, 1, "first"); - cmax = find (Zcols, 1, "last"); + Zfinite = ! isnan (Z); + Zrows = any (Zfinite, 2); + rmin = find (Zrows, 1, "first"); + rmax = find (Zrows, 1, "last"); + Zcols = any (Zfinite, 1); + cmin = find (Zcols, 1, "first"); + cmax = find (Zcols, 1, "last"); - ## Handle nasty case of all NaNs + ## Handle nasty case of all NaNs if (isempty (rmin)) rmin = 1, rmax = rows (Z); endif @@ -550,16 +550,16 @@ slope = ((max (Z(:)) - min (Z(:))) / sqrt ((rmax - rmin)^2 + (cmax - cmin)^2)); slope /= 125; # threshold for discarding points. - Zrows = any (Zgrad > slope, 2); - rmin += find (Zrows, 1, "first") - 1; - rmax += find (Zrows, 1, "last") - rows (Zrows); - Zcols = any (Zgrad > slope, 1); - cmin += find (Zcols, 1, "first") - 1; - cmax += find (Zcols, 1, "last") - columns (Zcols); + Zrows = any (Zgrad > slope, 2); + rmin += find (Zrows, 1, "first") - 1; + rmax += find (Zrows, 1, "last") - rows (Zrows); + Zcols = any (Zgrad > slope, 1); + cmin += find (Zcols, 1, "first") - 1; + cmax += find (Zcols, 1, "last") - columns (Zcols); endif domain = [X(1,cmin) X(1,cmax) Y(rmin,1) Y(rmax,1)]; endif - + endfunction
--- a/scripts/plot/draw/private/__patch__.m +++ b/scripts/plot/draw/private/__patch__.m @@ -84,7 +84,7 @@ iarg = 3; if (rem (nargin - iarg, 2) == 1) c = varargin {iarg}; - iarg++; + iarg++; else c = []; endif
--- a/scripts/plot/draw/private/__stem__.m +++ b/scripts/plot/draw/private/__stem__.m @@ -175,11 +175,11 @@ else caller = "stem"; endif - nargin = nargin - 1; # account for have_z argument + nargin = nargin - 1; # account for have_z argument num_numeric = find (cellfun ("isclass", varargin, "char"), 1) - 1; if (isempty (num_numeric)) - num_numeric = nargin; + num_numeric = nargin; endif if (num_numeric < 1 || num_numeric > 3)
--- a/scripts/plot/draw/rectangle.m +++ b/scripts/plot/draw/rectangle.m @@ -25,7 +25,7 @@ ## @deftypefnx {Function File} {} rectangle (@var{hax}, @dots{}) ## @deftypefnx {Function File} {@var{h} =} rectangle (@dots{}) ## Draw a rectangular patch defined by @var{pos} and @var{curv}. -## +## ## The variable @code{@var{pos}(1:2)} defines the lower left-hand corner of ## the patch and @code{@var{pos}(3:4)} defines its width and height. By ## default, the value of @var{pos} is @code{[0, 0, 1, 1]}. @@ -45,8 +45,8 @@ ## min (pos(1:2)) / max (pos(1:2)) * curv ## @end example ## -## Additional property/value pairs are passed to the underlying patch command. -## +## Additional property/value pairs are passed to the underlying patch command. +## ## If the first argument @var{hax} is an axes handle, then plot into this axis, ## rather than the current axes returned by @code{gca}. ## @@ -227,7 +227,7 @@ kids = get (h, "children"); set (kids, {"edgecolor", "linewidth", "linestyle", "facecolor"}, get (h, {"edgecolor", "linewidth", "linestyle", "facecolor"})); - + endfunction
--- a/scripts/plot/draw/ribbon.m +++ b/scripts/plot/draw/ribbon.m @@ -96,7 +96,7 @@ endfor if (! ishold ()) - set (hax, "view", [-37.5, 30], "box", "off", + set (hax, "view", [-37.5, 30], "box", "off", "xgrid", "on", "ygrid", "on", "zgrid", "on"); endif
--- a/scripts/plot/draw/rose.m +++ b/scripts/plot/draw/rose.m @@ -40,7 +40,7 @@ ## The optional return value @var{h} is a vector of graphics handles to the ## line objects representing each histogram. ## -## If two output arguments are requested then no plot is made and +## If two output arguments are requested then no plot is made and ## the polar vectors necessary to plot the histogram are returned instead. ## ## @example
--- a/scripts/plot/draw/scatter.m +++ b/scripts/plot/draw/scatter.m @@ -54,7 +54,7 @@ ## ## The optional return value @var{h} is a graphics handle to the created patch ## object. -## +## ## Example: ## ## @example @@ -82,7 +82,7 @@ endif unwind_protect hax = newplot (hax); - + htmp = __scatter__ (hax, 2, "scatter", varargin{:}); unwind_protect_cleanup if (! isempty (oldfig))
--- a/scripts/plot/draw/scatter3.m +++ b/scripts/plot/draw/scatter3.m @@ -79,7 +79,7 @@ endif unwind_protect hax = newplot (hax); - + htmp = __scatter__ (hax, 3, "scatter3", varargin{:}); if (! ishold (hax))
--- a/scripts/plot/draw/semilogx.m +++ b/scripts/plot/draw/semilogx.m @@ -27,7 +27,7 @@ ## ## See the documentation of @code{plot} for a description of the ## arguments that @code{semilogx} will accept. -## +## ## If the first argument @var{hax} is an axes handle, then plot into this axis, ## rather than the current axes returned by @code{gca}. ##
--- a/scripts/plot/draw/shrinkfaces.m +++ b/scripts/plot/draw/shrinkfaces.m @@ -25,7 +25,7 @@ ## ## Reduce the faces area for a given patch, structure or explicit faces ## and points matrices by a scale factor @var{sf}. The structure -## @var{fv} must contain the fields @qcode{"faces"} and @qcode{"vertices"}. +## @var{fv} must contain the fields @qcode{"faces"} and @qcode{"vertices"}. ## If the factor @var{sf} is omitted then a default of 0.3 is used. ## ## Given a patch handle as the first input argument and no output @@ -69,7 +69,7 @@ if (nargin < 1 || nargin > 3 || nargout > 2) print_usage (); endif - + sf = 0.3; p = varargin{1}; colors = []; @@ -99,7 +99,7 @@ else print_usage (); endif - + if (! isscalar (sf) || sf <= 0) error ("shrinkfaces: scale factor must be a positive scalar"); endif @@ -130,7 +130,7 @@ midpoints = full (kron ( speye (sv / m), ones (m, m) / m) * sparse (v)); v = sqrt (sf) * (v - midpoints) + midpoints; f = reshape (1:sv, m, sv / m)'; - + switch (nargout) case 0 if (ishandle (p))
--- a/scripts/plot/draw/sombrero.m +++ b/scripts/plot/draw/sombrero.m @@ -36,7 +36,7 @@ ## @end ifnottex ## Called without a return argument, @code{sombrero} plots the surface of the ## above function over the meshgrid [-8,8] using @code{surf}. -## +## ## If @var{n} is a scalar the plot is made with @var{n} grid lines. ## The default value for @var{n} is 41. ##
--- a/scripts/plot/draw/sphere.m +++ b/scripts/plot/draw/sphere.m @@ -77,7 +77,7 @@ endif unwind_protect hax = newplot (hax); - + surf (x, y, z); unwind_protect_cleanup if (! isempty (oldfig))
--- a/scripts/plot/draw/stairs.m +++ b/scripts/plot/draw/stairs.m @@ -29,7 +29,7 @@ ## The arguments @var{x} and @var{y} may be vectors or matrices. ## If only one argument is given, it is taken as a vector of Y values ## and the X coordinates are taken to be the indices of the elements. -## +## ## The style to use for the plot can be defined with a line style @var{style} ## of the same format as the @code{plot} command. ##
--- a/scripts/plot/draw/stem.m +++ b/scripts/plot/draw/stem.m @@ -99,7 +99,7 @@ ## The edge color of the marker. (Default: @qcode{"color"} property) ## ## @item markerfacecolor -## The color to use for @nospell{"filling"} the marker. +## The color to use for @nospell{"filling"} the marker. ## (Default: @qcode{"none"} [unfilled]) ## ## @item markersize
--- a/scripts/plot/draw/stemleaf.m +++ b/scripts/plot/draw/stemleaf.m @@ -49,7 +49,7 @@ ## #% nx|___________________ nx = numel (x) ## M% mi| md | mi median index, md median ## H% hi|hl hu| hs hi lower hinge index, hl,hu hinges, -## 1 |x(1) x(nx)| hs h_spreadx(1), x(nx) first +## 1 |x(1) x(nx)| hs h_spreadx(1), x(nx) first ## _______ and last data value. ## ______|step |_______ step 1.5*h_spread ## f|ifl ifh| inner fence, lower and higher @@ -65,12 +65,12 @@ ## successive leaf values are separated by ",". ## ## With no return argument, the plot is immediately displayed. If an output -## argument is provided, the plot is returned as an array of strings. +## argument is provided, the plot is returned as an array of strings. ## ## The leaf digits are not sorted. If sorted leaf values are desired, use ## @code{@var{xs} = sort (@var{x})} before calling @code{stemleaf (@var{xs})}. ## -## The stem and leaf plot and associated displays are described in: +## The stem and leaf plot and associated displays are described in: ## Ch. 3, @cite{Exploratory Data Analysis} by J. W. Tukey, Addison-Wesley, 1977. ## @seealso{hist, printd} ## @end deftypefn @@ -204,7 +204,7 @@ plot_out = [plot_out; sprintf(" M%3d| %5d |", mdidx, md)]; plot_out = [plot_out; sprintf(" H%3d|%5d %5d| %d", hlidx, hl, hu, h_spread)]; plot_out = [plot_out; sprintf(" 1 |%5d %5d|", xs(1), xs(nx))]; - plot_out = [plot_out; sprintf(" _______")]; + plot_out = [plot_out; sprintf(" _______")]; plot_out = [plot_out; sprintf(" ______|%5d|_______",step)]; plot_out = [plot_out; sprintf(" f|%5d %5d|", i_fence_l, i_fence_h)]; plot_out = [plot_out; sprintf(" |%5d %5d| out", n_out_l, n_out_h)]; @@ -288,7 +288,7 @@ plot_out = [plot_out; line]; new_line = 1; else - if (new_line == 1) + if (new_line == 1) plot_out = [plot_out; " :"]; # just print one : if no leaves new_line = 0; endif @@ -349,13 +349,13 @@ %! " " , %! " Fenced Letter Display" , %! " " , -%! " #138|___________________" , -%! " M 69| 52 |" , +%! " #138|___________________" , +%! " M 69| 52 |" , %! " H 35| 30 116| 86" , %! " 1 | -28 146|" , %! " _______" , %! " ______| 129|_______" , -%! " f| -99 245|" , +%! " f| -99 245|" , %! " | 0 0| out" , %! " F| -228 374|" , %! " | 0 0| far" , @@ -389,13 +389,13 @@ %! " " , %! " Fenced Letter Display" , %! " " , -%! " # 14|___________________" , -%! " M 7| 22 |" , +%! " # 14|___________________" , +%! " M 7| 22 |" , %! " H 4| 12 42| 30" , %! " 1 | 5 52|" , %! " _______" , %! " ______| 45|_______" , -%! " f| -33 87|" , +%! " f| -33 87|" , %! " | 0 0| out" , %! " F| -78 132|" , %! " | 0 0| far" , @@ -418,13 +418,13 @@ %! " " , %! " Fenced Letter Display" , %! " " , -%! " # 14|___________________" , -%! " M 7| -28 |" , +%! " # 14|___________________" , +%! " M 7| -28 |" , %! " H 4| -42 -12| 30" , %! " 1 | -52 -5|" , %! " _______" , %! " ______| 45|_______" , -%! " f| -87 33|" , +%! " f| -87 33|" , %! " | 0 0| out" , %! " F| -132 78|" , %! " | 0 0| far" , @@ -446,13 +446,13 @@ %! " " , %! " Fenced Letter Display" , %! " " , -%! " # 15|___________________" , -%! " M 8| 22 |" , +%! " # 15|___________________" , +%! " M 8| 22 |" , %! " H 4| 11 42| 31" , %! " 1 | 0 52|" , %! " _______" , %! " ______| 46|_______" , -%! " f| -35 88|" , +%! " f| -35 88|" , %! " | 0 0| out" , %! " F| -82 135|" , %! " | 0 0| far" , @@ -475,13 +475,13 @@ %! " " , %! " Fenced Letter Display" , %! " " , -%! " # 15|___________________" , -%! " M 8| -22 |" , +%! " # 15|___________________" , +%! " M 8| -22 |" , %! " H 4| -42 -11| 31" , %! " 1 | -52 0|" , %! " _______" , %! " ______| 46|_______" , -%! " f| -88 35|" , +%! " f| -88 35|" , %! " | 0 0| out" , %! " F| -135 82|" , %! " | 0 0| far" , @@ -503,13 +503,13 @@ %! " " , %! " Fenced Letter Display" , %! " " , -%! " # 5|___________________" , -%! " M 3| 0 |" , +%! " # 5|___________________" , +%! " M 3| 0 |" , %! " H 2| -7 0| 7" , %! " 1 | -9 0|" , %! " _______" , %! " ______| 10|_______" , -%! " f| -17 10|" , +%! " f| -17 10|" , %! " | 0 0| out" , %! " F| -28 21|" , %! " | 0 0| far" , @@ -527,13 +527,13 @@ %! " " , %! " Fenced Letter Display" , %! " " , -%! " # 4|___________________" , -%! " M 2| -7 |" , +%! " # 4|___________________" , +%! " M 2| -7 |" , %! " H 1| -9 0| 9" , %! " 1 | -9 0|" , %! " _______" , %! " ______| 13|_______" , -%! " f| -22 13|" , +%! " f| -22 13|" , %! " | 0 0| out" , %! " F| -36 27|" , %! " | 0 0| far" , @@ -552,7 +552,7 @@ %! " " , %! " Fenced Letter Display" , %! " " , -%! " # 17|___________________" , +%! " # 17|___________________" , %! " M 9| 895 |" , %! " H 5| 795 1499| 704" , %! " 1 | 150 1995|" ,
--- a/scripts/plot/draw/surf.m +++ b/scripts/plot/draw/surf.m @@ -68,7 +68,7 @@ endif unwind_protect hax = newplot (hax); - + htmp = surface (varargin{:}); if (! ishold (hax))
--- a/scripts/plot/draw/surface.m +++ b/scripts/plot/draw/surface.m @@ -36,7 +36,7 @@ ## @code{1:columns (@var{z})}. ## ## Any property/value input pairs are assigned to the surface object. -## +## ## If the first argument @var{hax} is an axes handle, then plot into this axis, ## rather than the current axes returned by @code{gca}. ## @@ -56,7 +56,7 @@ else hax = hax(1); endif - + [htmp, bad_usage] = __surface__ (hax, varargin{:}); if (bad_usage)
--- a/scripts/plot/draw/surfc.m +++ b/scripts/plot/draw/surfc.m @@ -70,7 +70,7 @@ endif unwind_protect hax = newplot (hax); - + htmp = surface (varargin{:}); set (htmp, "facecolor", "flat");
--- a/scripts/plot/draw/surfl.m +++ b/scripts/plot/draw/surfl.m @@ -129,7 +129,7 @@ varargin(end) = []; have_lv = true; elseif (len == 2) - [lv(1), lv(2), lv(3)] = sph2cart ((lastarg(1) - 90) * pi/180, + [lv(1), lv(2), lv(3)] = sph2cart ((lastarg(1) - 90) * pi/180, lastarg(2) * pi/180, 1.0); varargin(end) = [];
--- a/scripts/plot/draw/surfnorm.m +++ b/scripts/plot/draw/surfnorm.m @@ -120,7 +120,7 @@ endif unwind_protect hax = newplot (hax); - + surf (x, y, z, varargin{ioff:end}); old_hold_state = get (hax, "nextplot"); unwind_protect @@ -132,7 +132,7 @@ unwind_protect_cleanup set (hax, "nextplot", old_hold_state); end_unwind_protect - + unwind_protect_cleanup if (! isempty (oldfig)) set (0, "currentfigure", oldfig);
--- a/scripts/plot/draw/tetramesh.m +++ b/scripts/plot/draw/tetramesh.m @@ -26,19 +26,19 @@ ## @var{T} is typically the output of a Delaunay triangulation ## of a 3-D set of points. Every row of @var{T} contains four indices into ## the n-by-3 matrix @var{X} of the vertices of a tetrahedron. Every row in -## @var{X} represents one point in 3-D space. +## @var{X} represents one point in 3-D space. ## ## The vector @var{C} specifies the color of each tetrahedron as an index ## into the current colormap. The default value is 1:m where m is the number ## of tetrahedrons; the indices are scaled to map to the full range of the ## colormap. If there are more tetrahedrons than colors in the colormap then ## the values in @var{C} are cyclically repeated. -## +## ## Calling @code{tetramesh (@dots{}, "property", "value", @dots{})} passes all ## property/value pairs directly to the patch function as additional arguments. ## ## The optional return value @var{h} is a vector of patch handles where each -## handle represents one tetrahedron in the order given by @var{T}. +## handle represents one tetrahedron in the order given by @var{T}. ## A typical use case for @var{h} is to turn the respective patch ## @qcode{"visible"} property @qcode{"on"} or @qcode{"off"}. ## @@ -67,11 +67,11 @@ size_T = rows (T); cmap = colormap (); - + if (length (reg) < 3) size_cmap = rows (cmap); C = mod ((1:size_T)' - 1, size_cmap) + 1; - if (size_T < size_cmap && size_T > 1) + if (size_T < size_cmap && size_T > 1) ## expand to the available range of colors C = floor ((C - 1) * (size_cmap - 1) / (size_T - 1)) + 1; endif @@ -90,7 +90,7 @@ ## avoiding identical faces with different colors for i = 1:size_T [th, p] = __shrink__ ([1 2 3 4], X(T(i, :), :), 1 - 1e-7); - hvec(i) = patch ("Faces", th, "Vertices", p, + hvec(i) = patch ("Faces", th, "Vertices", p, "FaceColor", cmap(C(i), :), "FaceAlpha", 0.9, prop{:}); endfor @@ -98,7 +98,7 @@ ## FLTK does not support FaceAlpha. for i = 1:size_T th = [1 2 3; 2 3 4; 3 4 1; 4 1 2]; - hvec(i) = patch ("Faces", th, "Vertices", X(T(i, :), :), + hvec(i) = patch ("Faces", th, "Vertices", X(T(i, :), :), "FaceColor", cmap(C(i), :), "FaceAlpha", 1.0, prop{:}); endfor
--- a/scripts/plot/draw/trimesh.m +++ b/scripts/plot/draw/trimesh.m @@ -23,7 +23,7 @@ ## @deftypefnx {Function File} {} trimesh (@dots{}, @var{prop}, @var{val}, @dots{}) ## @deftypefnx {Function File} {@var{h} =} trimesh (@dots{}) ## Plot a 3-D triangular wireframe mesh. -## +## ## In contrast to @code{mesh}, which plots a mesh using rectangles, ## @code{trimesh} plots the mesh using triangles. ## @@ -33,7 +33,7 @@ ## vertices of the triangles in the x-y plane. @var{z} determines the ## height above the plane of each vertex. If no @var{z} input is given then ## the triangles are plotted as a 2-D figure. -## +## ## The color of the trimesh is computed by linearly scaling the @var{z} values ## to fit the range of the current colormap. Use @code{caxis} and/or ## change the colormap to control the appearance.
--- a/scripts/plot/draw/triplot.m +++ b/scripts/plot/draw/triplot.m @@ -21,7 +21,7 @@ ## @deftypefnx {Function File} {} triplot (@var{tri}, @var{x}, @var{y}, @var{linespec}) ## @deftypefnx {Function File} {@var{h} =} triplot (@dots{}) ## Plot a 2-D triangular mesh. -## +## ## @var{tri} is typically the output of a Delaunay triangulation over the ## grid of @var{x}, @var{y}. Every row of @var{tri} represents one triangle ## and contains three indices into [@var{x}, @var{y}] which are the
--- a/scripts/plot/draw/trisurf.m +++ b/scripts/plot/draw/trisurf.m @@ -22,7 +22,7 @@ ## @deftypefnx {Function File} {} trisurf (@dots{}, @var{prop}, @var{val}, @dots{}) ## @deftypefnx {Function File} {@var{h} =} trisurf (@dots{}) ## Plot a 3-D triangular surface. -## +## ## In contrast to @code{surf}, which plots a surface mesh using rectangles, ## @code{trisurf} plots the mesh using triangles. ## @@ -31,7 +31,7 @@ ## and contains three indices into [@var{x}, @var{y}] which are the ## vertices of the triangles in the x-y plane. @var{z} determines the ## height above the plane of each vertex. -## +## ## The color of the trimesh is computed by linearly scaling the @var{z} values ## to fit the range of the current colormap. Use @code{caxis} and/or ## change the colormap to control the appearance.
--- a/scripts/plot/util/__gnuplot_drawnow__.m +++ b/scripts/plot/util/__gnuplot_drawnow__.m @@ -386,7 +386,7 @@ endfunction function ret = output_to_screen (term) - ret = any (strcmpi (term, + ret = any (strcmpi (term, {"aqua", "dumb", "pm", "qt", "windows", "wxt", "x11"})); endfunction
--- a/scripts/plot/util/__plt_get_axis_arg__.m +++ b/scripts/plot/util/__plt_get_axis_arg__.m @@ -27,7 +27,7 @@ h = []; parent = find (strcmpi (varargin, "parent"), 1); - + ## Look for a scalar which is a graphics handle but not the ## Root Figure (0) or an ordinary figure (integer). if (numel (varargin) > 0 && numel (varargin{1}) == 1
--- a/scripts/plot/util/axes.m +++ b/scripts/plot/util/axes.m @@ -33,7 +33,7 @@ ## corresponding figure so that @var{hax} is the first entry in the list ## of children. This causes @var{hax} to be displayed on top of any other ## axes objects (Z-order stacking). -## +## ## @seealso {gca, set, get} ## @end deftypefn
--- a/scripts/plot/util/clf.m +++ b/scripts/plot/util/clf.m @@ -23,7 +23,7 @@ ## @deftypefnx {Function File} {} clf (@var{hfig}, "reset") ## @deftypefnx {Function File} {@var{h} =} clf (@dots{}) ## Clear the current figure window. -## +## ## @code{clf} operates by deleting child graphics objects with visible ## handles (HandleVisibility = @qcode{"on"}). ## @@ -34,7 +34,7 @@ ## ## If the first argument @var{hfig} is a figure handle, then operate on ## this figure rather than the current figure returned by @code{gcf}. -## +## ## The optional return value @var{h} is the graphics handle of the figure ## window that was cleared. ## @seealso{cla, close, delete, reset}
--- a/scripts/plot/util/copyobj.m +++ b/scripts/plot/util/copyobj.m @@ -47,7 +47,7 @@ ## current figure and axes cf = gcf (); ca = gca (); - + ## compatibility of input handles kididx = find (strcmp (alltypes, get (horig).type)); paridx = find (strcmp (alltypes, get (hparent).type)); @@ -68,7 +68,7 @@ if (get (hnew, "parent") == cf) set (cf, "currentaxes", ca) endif - + endfunction
--- a/scripts/plot/util/figure.m +++ b/scripts/plot/util/figure.m @@ -30,7 +30,7 @@ ## If called with an integer @var{n}, and no such numbered figure exists, then ## a new figure with the specified number is created. If the figure already ## exists then it is made visible and becomes the current figure for plotting. -## +## ## Multiple property-value pairs may be specified for the figure object, but ## they must appear in pairs. ##
--- a/scripts/plot/util/gcbo.m +++ b/scripts/plot/util/gcbo.m @@ -20,7 +20,7 @@ ## @deftypefn {Function File} {@var{h} =} gcbo () ## @deftypefnx {Function File} {[@var{h}, @var{fig}] =} gcbo () ## Return a handle to the object whose callback is currently executing. -## +## ## If no callback is executing, this function returns the empty matrix. This ## handle is obtained from the root object property @qcode{"CallbackObject"}. ##
--- a/scripts/plot/util/graphics_toolkit.m +++ b/scripts/plot/util/graphics_toolkit.m @@ -22,17 +22,17 @@ ## @deftypefnx {Function File} {} graphics_toolkit (@var{name}) ## @deftypefnx {Function File} {} graphics_toolkit (@var{hlist}, @var{name}) ## Query or set the default graphics toolkit which is assigned to new figures. -## +## ## With no inputs, return the current default graphics toolkit. If the input ## is a list of figure graphic handles, @var{hlist}, then return the name ## of the graphics toolkit in use for each figure. -## +## ## When called with a single input @var{name} set the default graphics toolkit ## to @var{name}. If the toolkit is not already loaded, it is initialized by ## calling the function @code{__init_@var{name}__}. If the first input ## is a list of figure handles, @var{hlist}, then the graphics toolkit is set ## to @var{name} for these figures only. -## +## ## @seealso{available_graphics_toolkits} ## @end deftypefn
--- a/scripts/plot/util/hggroup.m +++ b/scripts/plot/util/hggroup.m @@ -36,7 +36,7 @@ ## appropriately. For example, the individual lines of a contour plot are ## collected into a single hggroup so that they can be made visible/invisible ## with a single command, @code{set (hg_handle, "visible", "off")}. -## +## ## @seealso{addproperty, addlistener} ## @end deftypefn @@ -45,11 +45,11 @@ function h = hggroup (varargin) [hax, varargin] = __plt_get_axis_arg__ ("hggroup", varargin{:}); - + if (isempty (hax)) hax = gca (); endif - + htmp = __go_hggroup__ (hax, varargin{:}); if (nargout > 0)
--- a/scripts/plot/util/meshgrid.m +++ b/scripts/plot/util/meshgrid.m @@ -39,7 +39,7 @@ ## @group ## f = @@(x,y) sin (sqrt (x.^2 + y.^2)) ./ sqrt (x.^2 + y.^2); ## range = linspace (-8, 8, 41); -## [@var{X}, @var{Y}] = meshgrid (range, range); +## [@var{X}, @var{Y}] = meshgrid (range, range); ## Z = f (X, Y); ## surf (X, Y, Z); ## @end group
--- a/scripts/plot/util/newplot.m +++ b/scripts/plot/util/newplot.m @@ -89,8 +89,8 @@ ca = []; if (! isempty (hsave)) - ## Find the first valid axes - ca = ancestor (hsave, "axes", "toplevel"); + ## Find the first valid axes + ca = ancestor (hsave, "axes", "toplevel"); if (iscell (ca)) ca = [ca{:}]; endif @@ -100,7 +100,7 @@ if (! isempty (ca)) cf = ancestor (ca, "figure", "toplevel"); else - cf = ancestor (hsave, "figure", "toplevel"); + cf = ancestor (hsave, "figure", "toplevel"); if (iscell (cf)) cf = [cf{:}]; endif @@ -237,18 +237,18 @@ %! newplot (hg2); %! assert (ishandle (li0), false); %! assert (get (hax, "children"), hg1); -%! +%! %! ## kids are preserved for hggroups %! kids = get (hg1, "children"); -%! newplot (hg1); +%! newplot (hg1); %! assert (get (hg1, "children"), kids); -%! +%! %! ## preserve objects %! newplot (li1); %! assert (ishandle (li1)); -%! +%! %! ## kids are deleted for axes -%! newplot (hax); +%! newplot (hax); %! assert (isempty (get (hax, "children"))); %! unwind_protect_cleanup %! close (hf);
--- a/scripts/plot/util/print.m +++ b/scripts/plot/util/print.m @@ -280,7 +280,7 @@ ## @group ## clf (); ## surf (peaks); -## print -dpswrite -PPS_printer +## print -dpswrite -PPS_printer ## @end group ## @end example ##
--- a/scripts/plot/util/private/__add_default_menu__.m +++ b/scripts/plot/util/private/__add_default_menu__.m @@ -56,7 +56,7 @@ ## FIXME: This drawnow () must occur after at least one menu item has ## been defined to avoid sizing issues in new figures. - ## This may lead to flicker. The real fix must be in the C++ code. + ## This may lead to flicker. The real fix must be in the C++ code. drawnow (); set (fig, "menubar", menubar_state);
--- a/scripts/plot/util/private/__fltk_print__.m +++ b/scripts/plot/util/private/__fltk_print__.m @@ -60,7 +60,7 @@ suffix = opts.name(dot+1:end); endif else - error ("print:invalid-suffix", + error ("print:invalid-suffix", "invalid suffix '%s' for device '%s'.", opts.name(dot:end), lower (opts.devopt)); endif
--- a/scripts/plot/util/private/__gnuplot_print__.m +++ b/scripts/plot/util/private/__gnuplot_print__.m @@ -75,7 +75,7 @@ if (any (strcmpi (opts.name(dot:end), {["." suffix], ".tex", "."}))) name = opts.name(1:dot-1); else - error ("print:invalid-suffix", + error ("print:invalid-suffix", "invalid suffix '%s' for device '%s'.", opts.name(dot:end), lower (opts.devopt)); endif
--- a/scripts/plot/util/private/__print_parse_opts__.m +++ b/scripts/plot/util/private/__print_parse_opts__.m @@ -322,7 +322,7 @@ if (arg_st.send_to_printer) if (isempty (arg_st.name)) - ## Pipe the ghostscript output + ## Pipe the ghostscript output arg_st.name = "-"; else error ("print: a file name may not specified when spooling to a printer")
--- a/scripts/plot/util/refreshdata.m +++ b/scripts/plot/util/refreshdata.m @@ -98,7 +98,7 @@ expr = obj.(m{j}); # datasource field val = evalin (workspace, expr); pdname = m{j}(1:end-6); # property data name without "source" - set (h(i), pdname, val); + set (h(i), pdname, val); endfor endfor endfunction
--- a/scripts/plot/util/subplot.m +++ b/scripts/plot/util/subplot.m @@ -129,7 +129,7 @@ endif endif endif - + if (! initial_args_decoded && nargin > 0) arg = varargin{1}; if (nargin == 1 && isaxes (arg))
--- a/scripts/polynomial/conv.m +++ b/scripts/polynomial/conv.m @@ -67,7 +67,7 @@ ## Use shortest vector as the coefficent vector to filter. if (la > lb) - [a, b] = deal (b, a); # Swap vectors + [a, b] = deal (b, a); # Swap vectors lb = la; endif x = b;
--- a/scripts/polynomial/poly.m +++ b/scripts/polynomial/poly.m @@ -39,7 +39,7 @@ ## eigenvalues. ## ## If @var{x} is a vector, @code{poly (@var{x})} is a vector of the -## coefficients of the polynomial whose roots are the elements of @var{x}. +## coefficients of the polynomial whose roots are the elements of @var{x}. ## That is, if @var{c} is a polynomial, then the elements of @code{@var{d} = ## roots (poly (@var{c}))} are contained in @var{c}. The vectors @var{c} and ## @var{d} are not identical, however, due to sorting and numerical errors.
--- a/scripts/polynomial/polyeig.m +++ b/scripts/polynomial/polyeig.m @@ -38,7 +38,7 @@ ## Author: Fotios Kasolis function [z, v] = polyeig (varargin) - + if (nargin < 1 || nargout > 2) print_usage (); endif
--- a/scripts/polynomial/polyfit.m +++ b/scripts/polynomial/polyfit.m @@ -41,7 +41,7 @@ ## The unscaled covariance matrix, formally equal to the inverse of ## @var{x'}*@var{x}, but computed in a way minimizing roundoff error ## propagation. -## +## ## @item df ## The degrees of freedom. ## @@ -114,12 +114,12 @@ [q, r, k] = qr (v(:, polymask), 0); p = r \ (q' * y); p(k) = p; - + if (n != m) - q = p; p = zeros (n+1, 1); + q = p; p = zeros (n+1, 1); p(polymask) = q; endif - + if (nargout > 1) yf = v*p; @@ -128,7 +128,7 @@ else s.yf = yf; endif - s.X = v; + s.X = v; ## r.'*r is positive definite if X(:, polymask) is of full rank. ## Invert it by cholinv to avoid taking the square root of squared @@ -146,7 +146,7 @@ s.R = zeros (n+1, n+1); s.R(polymask, polymask) = r; s.C = zeros (n+1, n+1); s.C(polymask, polymask) = C; else - s.R = r; + s.R = r; s.C = C; endif s.df = l - m - 1;
--- a/scripts/polynomial/polyval.m +++ b/scripts/polynomial/polyval.m @@ -21,19 +21,19 @@ ## @deftypefnx {Function File} {@var{y} =} polyval (@var{p}, @var{x}, [], @var{mu}) ## @deftypefnx {Function File} {[@var{y}, @var{dy}] =} polyval (@var{p}, @var{x}, @var{s}) ## @deftypefnx {Function File} {[@var{y}, @var{dy}] =} polyval (@var{p}, @var{x}, @var{s}, @var{mu}) -## +## ## Evaluate the polynomial @var{p} at the specified values of @var{x}. When ## @var{mu} is present, evaluate the polynomial for ## (@var{x}-@var{mu}(1))/@var{mu}(2). ## If @var{x} is a vector or matrix, the polynomial is evaluated for each of ## the elements of @var{x}. -## +## ## In addition to evaluating the polynomial, the second output ## represents the prediction interval, @var{y} +/- @var{dy}, which ## contains at least 50% of the future predictions. To calculate the ## prediction interval, the structured variable @var{s}, originating ## from @code{polyfit}, must be supplied. -## +## ## @seealso{polyvalm, polyaffine, polyfit, roots, poly} ## @end deftypefn
--- a/scripts/polynomial/private/__splinefit__.m +++ b/scripts/polynomial/private/__splinefit__.m @@ -5,27 +5,27 @@ % Copyright (c) 2010, Jonas Lundgren % All rights reserved. -% -% Redistribution and use in source and binary forms, with or without -% modification, are permitted provided that the following conditions are +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are % met: -% -% * Redistributions of source code must retain the above copyright +% +% * Redistributions of source code must retain the above copyright % notice, this list of conditions and the following disclaimer. -% * Redistributions in binary form must reproduce the above copyright -% notice, this list of conditions and the following disclaimer in +% * Redistributions in binary form must reproduce the above copyright +% notice, this list of conditions and the following disclaimer in % the documentation and/or other materials provided with the distribution -% -% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE % POSSIBILITY OF SUCH DAMAGE. function pp = __splinefit__(varargin) %SPLINEFIT Fit a spline to noisy data.
--- a/scripts/polynomial/spline.m +++ b/scripts/polynomial/spline.m @@ -21,7 +21,7 @@ ## @deftypefn {Function File} {@var{pp} =} spline (@var{x}, @var{y}) ## @deftypefnx {Function File} {@var{yi} =} spline (@var{x}, @var{y}, @var{xi}) ## Return the cubic spline interpolant of points @var{x} and @var{y}. -## +## ## When called with two arguments, return the piecewise polynomial @var{pp} ## that may be used with @code{ppval} to evaluate the polynomial at specific ## points. When called with a third input argument, @code{spline} evaluates
--- a/scripts/prefs/prefdir.m +++ b/scripts/prefs/prefdir.m @@ -17,8 +17,8 @@ ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Command} {} prefdir -## @deftypefnx {Command} {@var{dir} =} prefdir +## @deftypefn {Command} {} prefdir +## @deftypefnx {Command} {@var{dir} =} prefdir ## Return the directory that contains the preferences for Octave. ## ## Examples:
--- a/scripts/prefs/preferences.m +++ b/scripts/prefs/preferences.m @@ -17,7 +17,7 @@ ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Command} {} preferences +## @deftypefn {Command} {} preferences ## Display the GUI preferences dialog window for Octave. ## @end deftypefn
--- a/scripts/prefs/private/prefsfile.m +++ b/scripts/prefs/private/prefsfile.m @@ -26,7 +26,7 @@ function retval = prefsfile () retval = [prefdir() filesep() ".octave_prefs"]; - + endfunction
--- a/scripts/prefs/rmpref.m +++ b/scripts/prefs/rmpref.m @@ -64,7 +64,7 @@ if (! ispref (group)) error ("rmpref: group <%s> does not exist", group); else - idx = find (! valid, 1); + idx = find (! valid, 1); error ("rmpref: pref <%s> does not exist", (cellstr (pref)){idx} ); endif endif
--- a/scripts/signal/freqz.m +++ b/scripts/signal/freqz.m @@ -24,7 +24,7 @@ ## @deftypefnx {Function File} {@var{h} =} freqz (@var{b}, @var{a}, @var{w}) ## @deftypefnx {Function File} {[@dots{}] =} freqz (@dots{}, @var{Fs}) ## @deftypefnx {Function File} {} freqz (@dots{}) -## +## ## Return the complex frequency response @var{h} of the rational IIR filter ## whose numerator and denominator coefficients are @var{b} and @var{a}, ## respectively. The response is evaluated at @var{n} angular frequencies
--- a/scripts/signal/module.mk +++ b/scripts/signal/module.mk @@ -4,7 +4,7 @@ signal/private/rectangle_lw.m \ signal/private/rectangle_sw.m \ signal/private/triangle_lw.m \ - signal/private/triangle_sw.m + signal/private/triangle_sw.m signal_FCN_FILES = \ signal/arch_fit.m \
--- a/scripts/sparse/eigs.m +++ b/scripts/sparse/eigs.m @@ -40,7 +40,7 @@ ## Calculate a limited number of eigenvalues and eigenvectors of @var{A}, ## based on a selection criteria. The number of eigenvalues and eigenvectors to ## calculate is given by @var{k} and defaults to 6. -## +## ## By default, @code{eigs} solve the equation ## @tex ## $A \nu = \lambda \nu$, @@ -63,113 +63,113 @@ ## @ifinfo ## @code{A * v = lambda * B * v}. ## @end ifinfo -## +## ## The argument @var{sigma} determines which eigenvalues are returned. ## @var{sigma} can be either a scalar or a string. When @var{sigma} is a ## scalar, the @var{k} eigenvalues closest to @var{sigma} are returned. If ## @var{sigma} is a string, it must have one of the following values. -## +## ## @table @asis ## @item @qcode{"lm"} ## Largest Magnitude (default). -## +## ## @item @qcode{"sm"} ## Smallest Magnitude. -## +## ## @item @qcode{"la"} ## Largest Algebraic (valid only for real symmetric problems). -## +## ## @item @qcode{"sa"} ## Smallest Algebraic (valid only for real symmetric problems). -## +## ## @item @qcode{"be"} ## Both Ends, with one more from the high-end if @var{k} is odd (valid only for ## real symmetric problems). -## +## ## @item @qcode{"lr"} ## Largest Real part (valid only for complex or unsymmetric problems). -## +## ## @item @qcode{"sr"} ## Smallest Real part (valid only for complex or unsymmetric problems). -## +## ## @item @qcode{"li"} ## Largest Imaginary part (valid only for complex or unsymmetric problems). -## +## ## @item @qcode{"si"} ## Smallest Imaginary part (valid only for complex or unsymmetric problems). ## @end table -## +## ## If @var{opts} is given, it is a structure defining possible options that ## @code{eigs} should use. The fields of the @var{opts} structure are: -## +## ## @table @code ## @item issym ## If @var{af} is given, then flags whether the function @var{af} defines a ## symmetric problem. It is ignored if @var{A} is given. The default is false. -## +## ## @item isreal ## If @var{af} is given, then flags whether the function @var{af} defines a ## real problem. It is ignored if @var{A} is given. The default is true. -## +## ## @item tol ## Defines the required convergence tolerance, calculated as ## @code{tol * norm (A)}. The default is @code{eps}. -## +## ## @item maxit ## The maximum number of iterations. The default is 300. -## +## ## @item p ## The number of Lanzcos basis vectors to use. More vectors will result in ## faster convergence, but a greater use of memory. The optimal value of ## @code{p} is problem dependent and should be in the range @var{k} to @var{n}. ## The default value is @code{2 * @var{k}}. -## +## ## @item v0 ## The starting vector for the algorithm. An initial vector close to the ## final vector will speed up convergence. The default is for @sc{arpack} ## to randomly generate a starting vector. If specified, @code{v0} must be ## an @var{n}-by-1 vector where @code{@var{n} = rows (@var{A})} -## +## ## @item disp ## The level of diagnostic printout (0|1|2). If @code{disp} is 0 then ## diagnostics are disabled. The default value is 0. -## +## ## @item cholB ## Flag if @code{chol (@var{B})} is passed rather than @var{B}. The default is ## false. -## +## ## @item permB ## The permutation vector of the Cholesky@tie{}factorization of @var{B} if ## @code{cholB} is true. That is @code{chol (@var{B}(permB, permB))}. The ## default is @code{1:@var{n}}. -## +## ## @end table -## +## ## It is also possible to represent @var{A} by a function denoted @var{af}. ## @var{af} must be followed by a scalar argument @var{n} defining the length ## of the vector argument accepted by @var{af}. @var{af} can be ## a function handle, an inline function, or a string. When @var{af} is a ## string it holds the name of the function to use. -## +## ## @var{af} is a function of the form @code{y = af (x)} ## where the required return value of @var{af} is determined by ## the value of @var{sigma}. The four possible forms are -## +## ## @table @code ## @item A * x ## if @var{sigma} is not given or is a string other than "sm". -## +## ## @item A \ x ## if @var{sigma} is 0 or "sm". -## +## ## @item (A - sigma * I) \ x ## for the standard eigenvalue problem, where @code{I} is the identity matrix of ## the same size as @var{A}. -## +## ## @item (A - sigma * B) \ x ## for the general eigenvalue problem. ## @end table -## +## ## The return arguments of @code{eigs} depend on the number of return arguments ## requested. With a single return argument, a vector @var{d} of length @var{k} ## is returned containing the @var{k} eigenvalues that have been found. With @@ -178,15 +178,15 @@ ## eigenvalues themselves are returned in @var{d} in the form of a ## @var{n}-by-@var{k} matrix, where the elements on the diagonal are the ## eigenvalues. -## +## ## Given a third return argument @var{flag}, @code{eigs} returns the status ## of the convergence. If @var{flag} is 0 then all eigenvalues have converged. ## Any other value indicates a failure to converge. -## +## ## This function is based on the @sc{arpack} package, written by R. Lehoucq, ## K. Maschhoff, D. Sorensen, and C. Yang. For more information see ## @url{http://www.caam.rice.edu/software/ARPACK/}. -## +## ## @seealso{eig, svds} ## @end deftypefn @@ -215,7 +215,7 @@ if (rows (a) < 9) call_eig = true; endif - + if (nargin > 1 + offset) tmp = varargin{2+offset}; if (isnumeric (tmp) && isscalar (tmp) && isreal (tmp)
--- a/scripts/sparse/pcg.m +++ b/scripts/sparse/pcg.m @@ -109,7 +109,7 @@ ## @var{A} are returned. @code{@var{eigest}(1)} is an overestimate and ## @code{@var{eigest}(2)} is an underestimate, so that ## @code{@var{eigest}(2) / @var{eigest}(1)} is a lower bound for -## @code{cond (@var{P}, 2)}, which nevertheless in the limit should +## @code{cond (@var{P}, 2)}, which nevertheless in the limit should ## theoretically be equal to the actual value of the condition number. ## The method which computes @var{eigest} works only for symmetric positive ## definite @var{A} and @var{m}, and the user is responsible for verifying this @@ -203,7 +203,7 @@ ## SIAM, 1995. (the base PCG algorithm) ## ## @item -## Y. Saad, @cite{Iterative Methods for Sparse Linear Systems}, +## Y. Saad, @cite{Iterative Methods for Sparse Linear Systems}, ## @nospell{PWS} 1996. (condition number estimate from PCG) ## Revised version of this book is available online at ## @url{http://www-users.cs.umn.edu/~saad/books.html}
--- a/scripts/sparse/private/__sprand_impl__.m +++ b/scripts/sparse/private/__sprand_impl__.m @@ -65,7 +65,7 @@ ## reduce the probability that there are less than k distinct ## values; maybe a better strategy could be used but I don't think ## it's worth the price - + ## actual number of entries in S k = min (length (idx), k); j = floor ((idx(1:k) - 1) / m);
--- a/scripts/sparse/sprand.m +++ b/scripts/sparse/sprand.m @@ -81,7 +81,7 @@ %!error sprand (3, 3, -1) %!error sprand (3, 3, 2) -%% Test very large, very low density matrix doesn't fail +%% Test very large, very low density matrix doesn't fail %!test %! s = sprand(1e6,1e6,1e-7);
--- a/scripts/sparse/sprandn.m +++ b/scripts/sparse/sprandn.m @@ -72,7 +72,7 @@ %!error sprandn (3, 3, -1) %!error sprandn (3, 3, 2) -%% Test very large, very low density matrix doesn't fail +%% Test very large, very low density matrix doesn't fail %!test %! s = sprandn(1e6,1e6,1e-7);
--- a/scripts/sparse/spy.m +++ b/scripts/sparse/spy.m @@ -21,7 +21,7 @@ ## @deftypefnx {Function File} {} spy (@dots{}, @var{markersize}) ## @deftypefnx {Function File} {} spy (@dots{}, @var{line_spec}) ## Plot the sparsity pattern of the sparse matrix @var{x}. -## +## ## If the argument @var{markersize} is given as a scalar value, it is used to ## determine the point size in the plot. If the string @var{line_spec} is ## given it is passed to @code{plot} and determines the appearance of the plot.
--- a/scripts/sparse/svds.m +++ b/scripts/sparse/svds.m @@ -143,7 +143,7 @@ endif ## Must initialize variable value, otherwise it may appear to interpreter ## that code is trying to call flag() colormap function. - flag = 0; + flag = 0; if (max_a == 0) s = zeros (k, 1); # special case of zero matrix
--- a/scripts/specfun/expint.m +++ b/scripts/specfun/expint.m @@ -217,7 +217,7 @@ ## Series expansion (-2 < x < 0) ## Expected values from Mathematica -%!test +%!test %! x = [-0.1; -0.5; -1; -1.5; -2]; %! y_exp = [ 1.6228128139692767 - i*pi; %! -0.45421990486317358 - i*pi; @@ -228,7 +228,7 @@ %! assert (y, y_exp, eps (real (y_exp))); ## (x < -2, x real) -%!test +%!test %! x = [-2.5; -3; -10;-15; -25]; %! y_exp = [-7.0737658945786007 - i*pi; %! -9.9338325706254165 - i*pi; @@ -249,7 +249,7 @@ %! assert (y, y_exp, 1e-12); ## Exceptional values (-Inf, Inf, NaN, 0, 0.37250741078) -%!test +%!test %! x = [-Inf; Inf; NaN; 0; -0.3725074107813668]; %! y_exp = [-Inf - i*pi; %! -Inf; # should be 0;
--- a/scripts/specfun/factor.m +++ b/scripts/specfun/factor.m @@ -27,7 +27,7 @@ ## With two output arguments, return the unique primes @var{p} and ## their multiplicities. That is, @code{prod (@var{p} .^ @var{n}) == ## @var{q}}. -## +## ## Implementation Note: The input @var{q} must not be greater than ## @code{bitmax} (9.0072e+15) in order to factor correctly. ## @seealso{gcd, lcm, isprime}
--- a/scripts/special-matrix/gallery.m +++ b/scripts/special-matrix/gallery.m @@ -1294,7 +1294,7 @@ ## So take s = sign(x(1))*norm(x) (which avoids cancellation). ## v'v = (x(1)+s)^2 + x(2)^2 + ... + x(n)^2 ## = 2*norm(x)*(norm(x) + |x(1)|). - ## + ## ## References: ## G.H. Golub and C.F. Van Loan, Matrix Computations, second edition, ## Johns Hopkins University Press, Baltimore, Maryland, 1989. @@ -1343,7 +1343,7 @@ jidx = varargin{end-1}; svec = [varargin{1:end-1}]; varargin(end-1) = []; - else + else error (["gallery: J must be an integer in the range [0, 2^32-1] " ... "for integerdata matrix"]); endif @@ -1357,7 +1357,7 @@ ## Save and restore random state. Initialization done so that reproducible ## data is available from gallery depending on the jidx and size vector. - randstate = rand ("state"); + randstate = rand ("state"); unwind_protect rand ("state", svec); A = randi (varargin{:}); @@ -1461,7 +1461,7 @@ ## [A, d] = IPJFACT(N, K); ## ## Suggested by P. R. Graves-Morris. - ## + ## ## Reference: ## M.J.C. Gover, The explicit inverse of factorial Hankel matrices, ## Dept. of Mathematics, University of Bradford, 1993. @@ -1862,7 +1862,7 @@ jidx = varargin{end-1}; svec = [varargin{1:end-1}]; varargin(end-1) = []; - else + else error (["gallery: J must be an integer in the range [0, 2^32-1] " ... "for normaldata matrix"]); endif @@ -1876,7 +1876,7 @@ ## Save and restore random state. Initialization done so that reproducible ## data is available from gallery depending on the jidx and size vector. - randstate = randn ("state"); + randstate = randn ("state"); unwind_protect randn ("state", svec); A = randn (varargin{:}); @@ -1981,7 +1981,7 @@ ## 1985, Cleve Moler noted that most of the singular values of ## PARTER(N) are very close to PI. An explanation of the phenomenon ## was given by Parter; see also the paper by Tyrtyshnikov. - ## + ## ## References: ## The MathWorks Newsletter, Volume 1, Issue 1, March 1986, page 2. ## S.V. Parter, On the distribution of the singular values of Toeplitz @@ -2087,7 +2087,7 @@ ## This M-file handles the real case only and is intended simply as a ## convenient way to generate random or non-random orthogonal Hessenberg ## matrices. - ## + ## ## Reference: ## W.B. Gragg, The QR algorithm for unitary Hessenberg matrices, ## J. Comp. Appl. Math., 16 (1986), pp. 1-8. @@ -2583,7 +2583,7 @@ jidx = varargin{end-1}; svec = [varargin{1:end-1}]; varargin(end-1) = []; - else + else error (["gallery: J must be an integer in the range [0, 2^32-1] " ... "for uniformdata matrix"]); endif @@ -2597,7 +2597,7 @@ ## Save and restore random state. Initialization done so that reproducible ## data is available from gallery depending on the jidx and size vector. - randstate = rand ("state"); + randstate = rand ("state"); unwind_protect rand ("state", svec); A = rand (varargin{:}); @@ -2713,9 +2713,9 @@ for j = 1:ny for i = 1:nx - ## + ## ## For the element (I,J), determine the indices of the 8 nodes. - ## + ## nn(1) = 3*j*nx + 2*i + 2*j + 1; nn(2) = nn(1) - 1; nn(3) = nn(2) - 1; @@ -2815,7 +2815,7 @@ ## This is a `standard' reduction. Cf. reduction to bidiagonal form ## prior to computing the SVD. This code is a little wasteful in that ## it computes certain elements which are immediately set to zero! - ## + ## ## Reference: ## G.H. Golub and C.F. Van Loan, Matrix Computations, second edition, ## Johns Hopkins University Press, Baltimore, Maryland, 1989.
--- a/scripts/special-matrix/hankel.m +++ b/scripts/special-matrix/hankel.m @@ -65,7 +65,7 @@ else - if (! (isvector (c) && isvector (r))) + if (! (isvector (c) && isvector (r))) error ("hankel: C and R must be vectors"); elseif (r(1) != c(end)) warning ("hankel: column wins anti-diagonal conflict"); @@ -76,7 +76,7 @@ data = [c(:) ; r(2:end)(:)]; endif - + slices = cellslices (data, 1:nc, nr:1:nc+nr-1); retval = horzcat (slices{:});
--- a/scripts/special-matrix/toeplitz.m +++ b/scripts/special-matrix/toeplitz.m @@ -71,7 +71,7 @@ nr = length (c); nc = nr; else - if (! (isvector (c) && isvector (r))) + if (! (isvector (c) && isvector (r))) error ("toeplitz: C and R must be vectors"); elseif (r(1) != c(1)) warning ("toeplitz: column wins diagonal conflict");
--- a/scripts/startup/inputrc +++ b/scripts/startup/inputrc @@ -3,7 +3,7 @@ ## for input-line editing. ## history-search-backward: -## +## ## Search backward through the history for the string of characters ## between the start of the current line and the point. This is a ## non-incremental search. Bound to "\e[A", the ANSI escape @@ -12,7 +12,7 @@ "\e[A": history-search-backward ## history-search-forward: -## +## ## Search forward through the history for the string of characters ## between the start of the current line and the point. This is a ## non-incremental search. Bound to "\e[B", the ANSI escape
--- a/scripts/statistics/base/kurtosis.m +++ b/scripts/statistics/base/kurtosis.m @@ -118,7 +118,7 @@ y(idx) = y(idx) ./ (n * v(idx) .^ 2); y(! idx) = NaN; - ## Apply bias correction to the second and fourth central sample moment + ## Apply bias correction to the second and fourth central sample moment if (flag == 0) if (n > 3) C = (n - 1) / ((n - 2) * (n - 3));
--- a/scripts/statistics/base/moment.m +++ b/scripts/statistics/base/moment.m @@ -38,7 +38,7 @@ ## @end example ## ## @end ifnottex -## +## ## If @var{x} is a matrix, return the row vector containing the @var{p}-th ## central moment of each column. ## @@ -47,7 +47,7 @@ ## ## @table @asis ## @item @qcode{"c"} -## Central Moment (default). +## Central Moment (default). ## ## @item @qcode{"a"} ## @itemx @qcode{"ac"} @@ -69,8 +69,8 @@ ## @end ifnottex ## ## @item @qcode{"r"} -## Raw Moment. The moment about zero defined as -## +## Raw Moment. The moment about zero defined as +## ## @tex ## $$ ## {\rm moment} (x) = { \sum_{i=1}^N {x_i}^p \over N }
--- a/scripts/statistics/base/qqplot.m +++ b/scripts/statistics/base/qqplot.m @@ -92,7 +92,7 @@ else q_label = sprintf ("%s with parameters %g", func2str (f), varargin{1}); param_str = sprintf (", %g", varargin{2:end}); - q_label = [q_label param_str]; + q_label = [q_label param_str]; endif endif
--- a/scripts/statistics/base/var.m +++ b/scripts/statistics/base/var.m @@ -51,7 +51,7 @@ ## normalizes with @math{N}, this provides the second moment around the mean ## @end table ## -## If @math{N==1} the value of @var{opt} is ignored and normalization +## If @math{N==1} the value of @var{opt} is ignored and normalization ## by @math{N} is used. ## ## If the optional argument @var{dim} is given, operate along this dimension.
--- a/scripts/statistics/distributions/betarnd.m +++ b/scripts/statistics/distributions/betarnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the common size of ## @var{a} and @var{b}. ## @end deftypefn
--- a/scripts/statistics/distributions/binoinv.m +++ b/scripts/statistics/distributions/binoinv.m @@ -20,7 +20,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} binoinv (@var{x}, @var{n}, @var{p}) ## For each element of @var{x}, compute the quantile (the inverse of -## the CDF) at @var{x} of the binomial distribution with parameters +## the CDF) at @var{x} of the binomial distribution with parameters ## @var{n} and @var{p}, where @var{n} is the number of trials and ## @var{p} is the probability of success. ## @end deftypefn
--- a/scripts/statistics/distributions/binopdf.m +++ b/scripts/statistics/distributions/binopdf.m @@ -66,9 +66,9 @@ ## Special case inputs ksp = k & (p == 0) & (x == 0); - pdf(ksp) = 1; + pdf(ksp) = 1; ksp = k & (p == 1) & (x == n); - pdf(ksp) = 1; + pdf(ksp) = 1; endfunction
--- a/scripts/statistics/distributions/binornd.m +++ b/scripts/statistics/distributions/binornd.m @@ -31,7 +31,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the common size of ## @var{n} and @var{p}. ## @end deftypefn
--- a/scripts/statistics/distributions/cauchy_rnd.m +++ b/scripts/statistics/distributions/cauchy_rnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the common size of ## @var{location} and @var{scale}. ## @end deftypefn
--- a/scripts/statistics/distributions/chi2rnd.m +++ b/scripts/statistics/distributions/chi2rnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the size of ## @var{n}. ## @end deftypefn
--- a/scripts/statistics/distributions/discrete_pdf.m +++ b/scripts/statistics/distributions/discrete_pdf.m @@ -44,7 +44,7 @@ endif ## Reshape and normalize probability vector. Values not in table get 0 prob. - p = [0 ; p(:)/sum(p)]; + p = [0 ; p(:)/sum(p)]; if (isa (x, "single") || isa (v, "single") || isa (p, "single")) pdf = NaN (size (x), "single");
--- a/scripts/statistics/distributions/discrete_rnd.m +++ b/scripts/statistics/distributions/discrete_rnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the common size of ## @var{v} and @var{p}. ## @end deftypefn
--- a/scripts/statistics/distributions/empirical_rnd.m +++ b/scripts/statistics/distributions/empirical_rnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is a random ordering ## of the sample @var{data}. ## @end deftypefn
--- a/scripts/statistics/distributions/exprnd.m +++ b/scripts/statistics/distributions/exprnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the size of ## @var{lambda}. ## @end deftypefn
--- a/scripts/statistics/distributions/frnd.m +++ b/scripts/statistics/distributions/frnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the common size of ## @var{m} and @var{n}. ## @end deftypefn
--- a/scripts/statistics/distributions/gamrnd.m +++ b/scripts/statistics/distributions/gamrnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the common size of ## @var{a} and @var{b}. ## @end deftypefn @@ -85,7 +85,7 @@ if (isscalar (a) && isscalar (b)) if ((a > 0) && (a < Inf) && (b > 0) && (b < Inf)) rnd = b * randg (a, sz, cls); - else + else rnd = NaN (sz, cls); endif else
--- a/scripts/statistics/distributions/geornd.m +++ b/scripts/statistics/distributions/geornd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the size of ## @var{p}. ##
--- a/scripts/statistics/distributions/hygernd.m +++ b/scripts/statistics/distributions/hygernd.m @@ -33,7 +33,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the common size of ## @var{t}, @var{m}, and @var{n}. ## @end deftypefn
--- a/scripts/statistics/distributions/kolmogorov_smirnov_cdf.m +++ b/scripts/statistics/distributions/kolmogorov_smirnov_cdf.m @@ -19,7 +19,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} kolmogorov_smirnov_cdf (@var{x}, @var{tol}) -## Return the cumulative distribution function (CDF) at @var{x} of the +## Return the cumulative distribution function (CDF) at @var{x} of the ## Kolmogorov-Smirnov distribution, ## @tex ## $$ Q(x) = \sum_{k=-\infty}^\infty (-1)^k \exp (-2 k^2 x^2) $$
--- a/scripts/statistics/distributions/laplace_cdf.m +++ b/scripts/statistics/distributions/laplace_cdf.m @@ -43,7 +43,7 @@ %!shared x,y %! x = [-Inf -log(2) 0 log(2) Inf]; -%! y = [0, 1/4, 1/2, 3/4, 1]; +%! y = [0, 1/4, 1/2, 3/4, 1]; %!assert (laplace_cdf ([x, NaN]), [y, NaN]) %% Test class of input preserved
--- a/scripts/statistics/distributions/laplace_pdf.m +++ b/scripts/statistics/distributions/laplace_pdf.m @@ -31,7 +31,7 @@ if (nargin != 1) print_usage (); endif - + if (iscomplex (x)) error ("laplace_pdf: X must not be complex"); endif @@ -43,7 +43,7 @@ %!shared x,y %! x = [-Inf -log(2) 0 log(2) Inf]; -%! y = [0, 1/4, 1/2, 1/4, 0]; +%! y = [0, 1/4, 1/2, 1/4, 0]; %!assert (laplace_pdf ([x, NaN]), [y, NaN]) %% Test class of input preserved
--- a/scripts/statistics/distributions/logistic_cdf.m +++ b/scripts/statistics/distributions/logistic_cdf.m @@ -43,7 +43,7 @@ %!shared x,y %! x = [-Inf -log(3) 0 log(3) Inf]; -%! y = [0, 1/4, 1/2, 3/4, 1]; +%! y = [0, 1/4, 1/2, 3/4, 1]; %!assert (logistic_cdf ([x, NaN]), [y, NaN], eps) %% Test class of input preserved
--- a/scripts/statistics/distributions/logistic_pdf.m +++ b/scripts/statistics/distributions/logistic_pdf.m @@ -43,7 +43,7 @@ %!shared x,y %! x = [-Inf -log(4) 0 log(4) Inf]; -%! y = [0, 0.16, 1/4, 0.16, 0]; +%! y = [0, 0.16, 1/4, 0.16, 0]; %!assert (logistic_pdf ([x, NaN]), [y, NaN], eps) %% Test class of input preserved
--- a/scripts/statistics/distributions/lognrnd.m +++ b/scripts/statistics/distributions/lognrnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the common size of ## @var{mu} and @var{sigma}. ## @end deftypefn
--- a/scripts/statistics/distributions/nbincdf.m +++ b/scripts/statistics/distributions/nbincdf.m @@ -25,7 +25,7 @@ ## ## When @var{n} is integer this is the Pascal distribution. When ## @var{n} is extended to real numbers this is the Polya distribution. -## +## ## The number of failures in a Bernoulli experiment with success ## probability @var{p} before the @var{n}-th success follows this ## distribution. @@ -57,7 +57,7 @@ cdf = zeros (size (x)); endif - k = (isnan (x) | isnan (n) | (n < 1) | (n == Inf) + k = (isnan (x) | isnan (n) | (n < 1) | (n == Inf) | (p < 0) | (p > 1) | isnan (p)); cdf(k) = NaN;
--- a/scripts/statistics/distributions/nbininv.m +++ b/scripts/statistics/distributions/nbininv.m @@ -25,7 +25,7 @@ ## ## When @var{n} is integer this is the Pascal distribution. When ## @var{n} is extended to real numbers this is the Polya distribution. -## +## ## The number of failures in a Bernoulli experiment with success ## probability @var{p} before the @var{n}-th success follows this ## distribution.
--- a/scripts/statistics/distributions/nbinpdf.m +++ b/scripts/statistics/distributions/nbinpdf.m @@ -25,7 +25,7 @@ ## ## When @var{n} is integer this is the Pascal distribution. When ## @var{n} is extended to real numbers this is the Polya distribution. -## +## ## The number of failures in a Bernoulli experiment with success ## probability @var{p} before the @var{n}-th success follows this ## distribution. @@ -68,7 +68,7 @@ else pdf(k) = bincoeff (-n(k), x(k)) .* (p(k) .^ n(k)) .* ((p(k) - 1) .^ x(k)); endif - + endfunction
--- a/scripts/statistics/distributions/nbinrnd.m +++ b/scripts/statistics/distributions/nbinrnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the common size of ## @var{n} and @var{p}. ## @end deftypefn
--- a/scripts/statistics/distributions/normrnd.m +++ b/scripts/statistics/distributions/normrnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the common size of ## @var{mu} and @var{sigma}. ## @end deftypefn
--- a/scripts/statistics/distributions/poissinv.m +++ b/scripts/statistics/distributions/poissinv.m @@ -62,7 +62,7 @@ else cdf = exp (-lambda(k)); endif - + while (1) m = find (cdf < x(k)); if (any (m))
--- a/scripts/statistics/distributions/poissrnd.m +++ b/scripts/statistics/distributions/poissrnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the size of ## @var{lambda}. ## @end deftypefn
--- a/scripts/statistics/distributions/tinv.m +++ b/scripts/statistics/distributions/tinv.m @@ -20,7 +20,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} tinv (@var{x}, @var{n}) ## For each element of @var{x}, compute the quantile (the inverse of -## the CDF) at @var{x} of the t (Student) distribution with @var{n} +## the CDF) at @var{x} of the t (Student) distribution with @var{n} ## degrees of freedom. This function is analogous to looking in a table ## for the t-value of a single-tailed distribution. ## @end deftypefn
--- a/scripts/statistics/distributions/trnd.m +++ b/scripts/statistics/distributions/trnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the size of ## @var{n}. ## @end deftypefn
--- a/scripts/statistics/distributions/unidcdf.m +++ b/scripts/statistics/distributions/unidcdf.m @@ -52,7 +52,7 @@ cdf(knan) = NaN; endif - k = (x >= n) & !knan; + k = (x >= n) & !knan; cdf(k) = 1; k = (x >= 1) & (x < n) & !knan;
--- a/scripts/statistics/distributions/unidpdf.m +++ b/scripts/statistics/distributions/unidpdf.m @@ -24,7 +24,7 @@ ## the integer values 1--@var{n} with equal probability. ## ## Warning: The underlying implementation uses the double class and -## will only be accurate for @var{n} @leq{} @code{bitmax} +## will only be accurate for @var{n} @leq{} @code{bitmax} ## (@w{@math{2^{53} - 1}} on IEEE-754 compatible systems). ## @end deftypefn
--- a/scripts/statistics/distributions/unidrnd.m +++ b/scripts/statistics/distributions/unidrnd.m @@ -31,7 +31,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the size of ## @var{n}. ## @end deftypefn
--- a/scripts/statistics/distributions/unifrnd.m +++ b/scripts/statistics/distributions/unifrnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the common size of ## @var{a} and @var{b}. ## @end deftypefn
--- a/scripts/statistics/distributions/wblrnd.m +++ b/scripts/statistics/distributions/wblrnd.m @@ -30,7 +30,7 @@ ## first two arguments are taken as the number of rows and columns and any ## further arguments specify additional matrix dimensions. The size may also ## be specified with a vector of dimensions @var{sz}. -## +## ## If no size arguments are given then the result matrix is the common size of ## @var{scale} and @var{shape}. ## @end deftypefn
--- a/scripts/statistics/models/module.mk +++ b/scripts/statistics/models/module.mk @@ -6,7 +6,7 @@ statistics_models_FCN_FILES = \ statistics/models/logistic_regression.m \ - $(statistics_models_PRIVATE_FCN_FILES) + $(statistics_models_PRIVATE_FCN_FILES) FCN_FILES += $(statistics_models_FCN_FILES)
--- a/scripts/statistics/tests/kruskal_wallis_test.m +++ b/scripts/statistics/tests/kruskal_wallis_test.m @@ -37,7 +37,7 @@ ## of ties where @var{t} is the number of ties in the group and @var{n} ## is the total number of values in the input data. For more info on ## this adjustment see William H. Kruskal and W. Allen Wallis, -## @cite{Use of Ranks in One-Criterion Variance Analysis}, +## @cite{Use of Ranks in One-Criterion Variance Analysis}, ## Journal of the American Statistical Association, Vol. 47, ## No. 260 (Dec 1952). ##
--- a/scripts/strings/base2dec.m +++ b/scripts/strings/base2dec.m @@ -96,7 +96,7 @@ R(2, 2:2:2*nr) = num_nonbl; idx = repelems ([false, true], R); idx = reshape (idx, nc, nr); - + ## Create a blank matrix and position the nonblank characters. s2 = repmat (" ", nc, nr); s2(idx) = s(nonbl);
--- a/scripts/strings/deblank.m +++ b/scripts/strings/deblank.m @@ -59,7 +59,7 @@ char_idx = cellfun ("isclass", s, "char"); cell_idx = cellfun ("isclass", s, "cell"); - if (! all (char_idx | cell_idx)) + if (! all (char_idx | cell_idx)) error ("deblank: S argument must be a string or cellstring"); endif
--- a/scripts/strings/dec2base.m +++ b/scripts/strings/dec2base.m @@ -30,7 +30,7 @@ ## @end example ## ## If @var{d} is a matrix or cell array, return a string matrix with one -## row per element in @var{d}, padded with leading zeros to the width of +## row per element in @var{d}, padded with leading zeros to the width of ## the largest value. ## ## If @var{base} is a string then the characters of @var{base} are used as @@ -66,7 +66,7 @@ if (! iscolumn (d)) d = d(:); endif - + ## Treat logical as numeric for compatibility with ML if (islogical (d)) d = double (d);
--- a/scripts/strings/dec2bin.m +++ b/scripts/strings/dec2bin.m @@ -29,7 +29,7 @@ ## @end example ## ## If @var{d} is a matrix or cell array, return a string matrix with one -## row per element in @var{d}, padded with leading zeros to the width of +## row per element in @var{d}, padded with leading zeros to the width of ## the largest value. ## ## The optional second argument, @var{len}, specifies the minimum
--- a/scripts/strings/dec2hex.m +++ b/scripts/strings/dec2hex.m @@ -29,7 +29,7 @@ ## @end example ## ## If @var{d} is a matrix or cell array, return a string matrix with one -## row per element in @var{d}, padded with leading zeros to the width of +## row per element in @var{d}, padded with leading zeros to the width of ## the largest value. ## ## The optional second argument, @var{len}, specifies the minimum
--- a/scripts/strings/mat2str.m +++ b/scripts/strings/mat2str.m @@ -19,7 +19,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{s} =} mat2str (@var{x}, @var{n}) ## @deftypefnx {Function File} {@var{s} =} mat2str (@var{x}, @var{n}, "class") -## Format real, complex, and logical matrices as strings. The +## Format real, complex, and logical matrices as strings. The ## returned string may be used to reconstruct the original matrix by using ## the @code{eval} function. ##
--- a/scripts/strings/ostrsplit.m +++ b/scripts/strings/ostrsplit.m @@ -69,7 +69,7 @@ ## and transform to single string s(:, end+1) = sep(1); s = reshape (s.', 1, numel (s)); - s(end) = []; + s(end) = []; endif ## Split s according to delimiter
--- a/scripts/strings/regexptranslate.m +++ b/scripts/strings/regexptranslate.m @@ -63,8 +63,8 @@ op = tolower (op); if (strcmp ("wildcard", op)) - y = regexprep (regexprep (regexprep (s, '\.', '\.'), - '\*', '.*'), + y = regexprep (regexprep (regexprep (s, '\.', '\.'), + '\*', '.*'), '\?', '.'); elseif (strcmp ("escape", op)) y = regexprep (s, '([^\w])', '\\$1');
--- a/scripts/strings/str2num.m +++ b/scripts/strings/str2num.m @@ -50,7 +50,7 @@ function [m, state] = str2num (s) - if (nargin != 1) + if (nargin != 1) print_usage (); elseif (! ischar (s)) error ("str2num: S must be a string or string array");
--- a/scripts/strings/strcat.m +++ b/scripts/strings/strcat.m @@ -68,7 +68,7 @@ ## @result{} ## @{ ## [1,1] = ababab -## [2,1] = cd cd cd +## [2,1] = cd cd cd ## @} ## @end group ## @end example
--- a/scripts/strings/strjoin.m +++ b/scripts/strings/strjoin.m @@ -65,8 +65,8 @@ delimiter = do_string_escapes (delimiter); delimiter = {delimiter}; endif - - num = numel (cstr); + + num = numel (cstr); if (numel (delimiter) == 1 && num > 1) delimiter = repmat (delimiter, 1, num); delimiter(end) = {""};
--- a/scripts/strings/strsplit.m +++ b/scripts/strings/strsplit.m @@ -62,9 +62,9 @@ ## @result{} ## @{ ## [1,1] = a -## [1,2] = +## [1,2] = ## [1,3] = b -## [1,4] = +## [1,4] = ## [1,5] = c ## @} ## @@ -80,7 +80,7 @@ ## @code{regularexpression}. The default is @var{delimitertype} is ## @code{simple}. ## @end itemize -## +## ## Example: ## ## @example @@ -91,17 +91,17 @@ ## [1,2] = b ## [1,3] = c ## @} -## +## ## strsplit ("a,,b, c", "[, ]", false, "delimitertype", "regularexpression") ## @result{} ## @{ ## [1,1] = a -## [1,2] = +## [1,2] = ## [1,3] = b -## [1,4] = +## [1,4] = ## [1,5] = c ## @} -## +## ## strsplit ("a,\t,b, c", @{',', '\s'@}, "delimitertype", "regularexpression") ## @result{} ## @{ @@ -109,19 +109,19 @@ ## [1,2] = b ## [1,3] = c ## @} -## +## ## strsplit ("a,\t,b, c", @{',', ' ', '\t'@}, "collapsedelimiters", false) ## @result{} ## @{ ## [1,1] = a -## [1,2] = -## [1,3] = +## [1,2] = +## [1,3] = ## [1,4] = b -## [1,5] = +## [1,5] = ## [1,6] = c ## @} ## @end example -## +## ## @seealso{ostrsplit, strjoin, strtok, regexp} ## @end deftypefn
--- a/scripts/strings/strtok.m +++ b/scripts/strings/strtok.m @@ -20,7 +20,7 @@ ## @deftypefn {Function File} {[@var{tok}, @var{rem}] =} strtok (@var{str}) ## @deftypefnx {Function File} {[@var{tok}, @var{rem}] =} strtok (@var{str}, @var{delim}) ## -## Find all characters in the string @var{str} up to, but not including, the +## Find all characters in the string @var{str} up to, but not including, the ## first character which is in the string @var{delim}. If @var{rem} is ## requested, it contains the remainder of the string, starting at the first ## delimiter. Leading delimiters are ignored. If @var{delim} is not @@ -68,7 +68,7 @@ elseif (length (delim) <= 7) ## Build index of delimiters incrementally for low N. idx = str == delim(1); - for i = 2:length (delim) + for i = 2:length (delim) idx |= str == delim(i); endfor else @@ -90,12 +90,12 @@ tok = str; rem = ""; elseif (idx_dlim > idx_nodlim) - ## Normal case. No leading delimiters and at least 1 delimiter in STR. + ## Normal case. No leading delimiters and at least 1 delimiter in STR. tok = str(1:idx_dlim-1); rem = str(idx_dlim:end); else ## Leading delimiter found. - idx_dlim = find (idx(idx_nodlim+1:end), 1); + idx_dlim = find (idx(idx_nodlim+1:end), 1); if (isempty (idx_dlim)) ## No further delimiters. Return STR stripped of delimiter prefix. tok = str(idx_nodlim:end);
--- a/scripts/strings/strtrim.m +++ b/scripts/strings/strtrim.m @@ -58,7 +58,7 @@ char_idx = cellfun ("isclass", s, "char"); cell_idx = cellfun ("isclass", s, "cell"); - if (! all (char_idx | cell_idx)) + if (! all (char_idx | cell_idx)) error ("strtrim: S argument must be a string or cellstring"); endif
--- a/scripts/strings/strtrunc.m +++ b/scripts/strings/strtrunc.m @@ -64,8 +64,8 @@ %!test %! cstr = {"line1"; ["line2"; "line3"]; "line4"}; %! y = strtrunc (cstr, 4); -%! assert (size (y), [3, 1]); -%! assert (size (y{2}), [2, 4]); +%! assert (size (y), [3, 1]); +%! assert (size (y{2}), [2, 4]); %! assert (y{2}, repmat ("line", 2, 1)); %% Test input validation
--- a/scripts/strings/substr.m +++ b/scripts/strings/substr.m @@ -24,7 +24,7 @@ ## ## Position numbering for offsets begins with 1. If @var{offset} is negative, ## extraction starts that far from the end of the string. -## +## ## If @var{len} is omitted, the substring extends to the end of @var{S}. A ## negative value for @var{len} extracts to within @var{len} characters of ## the end of the string
--- a/scripts/testfun/__run_test_suite__.m +++ b/scripts/testfun/__run_test_suite__.m @@ -256,7 +256,7 @@ files_with_no_tests(end+1) = f; endif endif - endfor + endfor ## printf("%s%s -> passes %d of %d tests\n", ident, d, dp, dn); endfunction
--- a/scripts/testfun/speed.m +++ b/scripts/testfun/speed.m @@ -142,7 +142,7 @@ ## computed relatively, as @code{abs ((@var{x} - @var{y}) ./ @var{y})} rather ## than absolutely as @code{abs (@var{x} - @var{y})}. ## -## Type @kbd{example ("speed")} to see some real examples or +## Type @kbd{example ("speed")} to see some real examples or ## @kbd{demo ("speed")} to run them. ## @end deftypefn @@ -268,10 +268,10 @@ if (do_display) figure; ## Strip semicolon added to code fragments before displaying - __init(end) = ""; - __f1(end) = ""; + __init(end) = ""; + __f1(end) = ""; if (! isempty (__f2)) - __f2(end) = ""; + __f2(end) = ""; endif endif
--- a/scripts/testfun/test.m +++ b/scripts/testfun/test.m @@ -476,7 +476,7 @@ elseif (strcmp (__type, "testif")) __e = regexp (__code, '.$', 'lineanchors', 'once'); ## Strip comment any comment from testif line before looking for features - __feat_line = strtok (__code(1:__e), '#%'); + __feat_line = strtok (__code(1:__e), '#%'); __feat = regexp (__feat_line, '\w+', 'match'); __feat = strrep (__feat, "HAVE_", ""); __have_feat = __have_feature__ (__feat);
--- a/scripts/time/asctime.m +++ b/scripts/time/asctime.m @@ -18,7 +18,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} asctime (@var{tm_struct}) -## Convert a time structure to a string using the following +## Convert a time structure to a string using the following ## format: @qcode{"ddd mmm mm HH:MM:SS yyyy"}. For example: ## ## @example
--- a/scripts/time/datenum.m +++ b/scripts/time/datenum.m @@ -35,7 +35,7 @@ ## The fractional part, @code{rem (@var{days}, 1)} corresponds to the time ## on the given day. ## -## The input may be a date vector (see @code{datevec}), +## The input may be a date vector (see @code{datevec}), ## datestr (see @code{datestr}), or directly specified as input. ## ## When processing input datestrings, @var{f} is the format string used to @@ -96,7 +96,7 @@ persistent monthstart = [306; 337; 0; 31; 61; 92; 122; 153; 184; 214; 245; 275]; persistent monthlength = [31; 28; 31; 30; 31; 30; 31; 31; 30; 31; 30; 31]; - if (nargin == 0 || nargin > 6 || + if (nargin == 0 || nargin > 6 || (nargin > 2 && (ischar (year) || iscellstr (year)))) print_usage (); endif @@ -129,7 +129,7 @@ if (floor (month) != month) fracmonth = month - floor (month); month = floor (month); - if ((mod (month-1,12) + 1) == 2 && + if ((mod (month-1,12) + 1) == 2 && (floor (year/4) - floor (year/100) + floor (year/400)) != 0) ## leap year day += fracmonth * 29;
--- a/scripts/time/datevec.m +++ b/scripts/time/datevec.m @@ -235,20 +235,20 @@ function [found, y, m, d, h, mi, s] = __date_str2vec__ (ds, p, f, rY, ry, fy, fm, fd, fh, fmi, fs) idx = strfind (f, "FFF"); - if (! isempty (idx)) + if (! isempty (idx)) ## Kludge to handle FFF millisecond format since strptime does not - f(idx:idx+2) = []; + f(idx:idx+2) = []; [~, nc] = strptime (ds, f); if (nc > 0) - msec = ds(nc:min(nc+2, end)); - f = [f(1:idx-1) msec f(idx:end)]; + msec = ds(nc:min(nc+2, end)); + f = [f(1:idx-1) msec f(idx:end)]; [tm, nc] = strptime (ds, f); tm.usec = 1000 * str2double (msec); endif else [tm, nc] = strptime (ds, f); endif - + if (nc == columns (ds) + 1) found = true; y = tm.year + 1900; m = tm.mon + 1; d = tm.mday;
--- a/scripts/time/weekday.m +++ b/scripts/time/weekday.m @@ -40,7 +40,7 @@ ## @item 6 @tab Fri @tab Friday ## @item 7 @tab Sat @tab Saturday ## @end multitable -## +## ## @seealso{eomday, is_leap_year, calendar, datenum, datevec} ## @end deftypefn
--- a/src/Makefile.am +++ b/src/Makefile.am @@ -136,7 +136,7 @@ @$(do_subst_config_vals) ## main.cc must depend on Makefile. Calling configure may change -## default/config values. However, calling configure will also +## default/config values. However, calling configure will also ## regenerate the Makefiles from Makefile.am and trigger the rules below. main.cc: main.in.cc Makefile @$(do_subst_default_vals)
--- a/test/Makefile.am +++ b/test/Makefile.am @@ -3,17 +3,17 @@ # Copyright (C) 1994-2013 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/test/build-bc-overload-tests.sh +++ b/test/build-bc-overload-tests.sh @@ -3,17 +3,17 @@ # Copyright (C) 2010-2013 VZLU Prague # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/test/build-sparse-tests.sh +++ b/test/build-sparse-tests.sh @@ -3,17 +3,17 @@ # Copyright (C) 2006-2013 David Bateman # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/test/jit.tst +++ b/test/jit.tst @@ -1,17 +1,17 @@ ## Copyright (C) 2012-2013 Max Brister -## +## ## This file is part of Octave. -## +## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by the ## Free Software Foundation; either version 3 of the License, or (at your ## option) any later version. -## +## ## Octave is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## for more details. -## +## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>.
--- a/test/line-continue.tst +++ b/test/line-continue.tst @@ -28,7 +28,7 @@ ## FIXME: Next 3 tests use '\' continuation outside of a double-quoted string ## This behavior is deprecated and will be removed at some point. -## When it does these +## When it does these %!test %! x = [1;2]; %! y = [a... # comments here ok