# HG changeset patch # User Rik # Date 1387165344 28800 # Node ID 7721e78b1337a292a9900326d1313fe2d0f1d302 # Parent 701e91ea0fe606bc473b7389cbf99dd4ad2b9230# Parent a99bbbcf743c67792753524ed00709bedc411e57 maint: Merge stable to gui-release. diff -r a99bbbcf743c -r 7721e78b1337 NEWS --- a/NEWS Sun Dec 15 19:31:18 2013 -0800 +++ b/NEWS Sun Dec 15 19:42:24 2013 -0800 @@ -1,1521 +1,48 @@ -Summary of important user-visible changes for version 3.8: +Summary of important user-visible changes for version 4.0: --------------------------------------------------------- - ** One of the biggest new features for Octave 3.8 is a graphical user - interface. It is the one thing that users have requested most - often over the last few years and now it is almost ready. But - because it is not quite as polished as we would like, we have - decided to wait until the 4.0.x release series before making the - GUI the default interface (until then, you can use the --force-gui - option to start the GUI). - - Given the length of time and the number of bug fixes and - improvements since the last major release Octave, we also decided - against delaying the release of all these new improvements any - longer just to perfect the GUI. So please enjoy the 3.8 release of - Octave and the preview of the new GUI. We believe it is working - reasonably well, but we also know that there are some obvious rough - spots and many things that could be improved. - - WE NEED YOUR HELP. There are many ways that you can help us fix - the remaining problems, complete the GUI, and improve the overall - user experience for both novices and experts alike: - - * If you are a skilled software developer, you can help by - contributing your time to help with Octave's development. See - http://octave.org/get-involved.html for more information. - - * If Octave does not work properly, you are encouraged - report the problems you find. See http://octave.org/bugs.html - for more information about how to report problems. - - * Whether you are a user or developer, you can help to fund the - project. Octave development takes a lot of time and expertise. - Your contributions help to ensure that Octave will continue to - improve. See http://octave.org/donate.html for more details. - - We hope you find Octave to be useful. Please help us make it even - better for the future! - - ** Octave now uses OpenGL graphics by default with FLTK widgets. If - OpenGL libraries or FLTK widgets are not available when Octave is - built, gnuplot is used. You may also choose to use gnuplot for - graphics by executing the command - - graphics_toolkit ("gnuplot") - - Adding this command to your ~/.octaverc file will set the default - for each session. - - ** Printing or saving figures with OpenGL graphics requires the - gl2ps library which is no longer distributed with Octave. The - software is widely available in most package managers. If a - pre-compiled package does not exist for your system, you can find - the current sources at http://www.geuz.org/gl2ps/. + ** For compatibility with Matlab, the "backtrace" warning option is now + enabled by default. - ** Octave now supports nested functions with scoping rules that are - compatible with Matlab. A nested function is one declared and defined - within the body of another function. The nested function is only - accessible from within the enclosing function which makes it one - method for making private functions whose names do not conflict with those - in the global namespace (See also subfunctions and private functions). - In addition, variables in the enclosing function are visible within the - nested function. This makes it possible to have a pseudo-global variable - which can be seen by a group of functions, but which is not visible in - the global namespace. - - Example: - function outerfunc (...) - ... - function nested1 (...) - ... - function nested2 (...) - ... - endfunction - endfunction - - function nested3 (...) - ... - endfunction - endfunction - - ** Line continuations inside character strings have changed. - - The sequence '...' is no longer recognized as a line continuation - inside a character string. A backslash '\' followed by a newline - character is no longer recognized as a line continuation inside - single-quoted character strings. Inside double-quoted character - strings, a backslash followed by a newline character is still - recognized as a line continuation, but the backslash character must - be followed *immediately* by the newline character. No whitespace or - end-of-line comment may appear between them. - - ** Backslash as a continuation marker outside of double-quoted strings - is now deprecated. - - Using '\' as a continuation marker outside of double quoted strings - is now deprecated and will be removed from a future version of - Octave. When that is done, the behavior of - - (a \ - b) - - will be consistent with other binary operators. - - ** Redundant terminal comma accepted by parser - - A redundant terminal comma is now accepted in matrix - definitions which allows writing code such as - - [a,... - b,... - c,... - ] = deal (1,2,3) - - ** Octave now has limited support for named exceptions - - The following syntax is now accepted: - - try - statements - catch exception-id - statements - end - - The exception-id is a structure with the fields "message" and - "identifier". For example - - try - error ("Octave:error-id", "error message"); - catch myerr - printf ("identifier: %s\n", myerr.identifier); - printf ("message: %s\n", myerr.message); - end_try_catch - - When classdef-style classes are added to Octave, the exception-id - will become an MException object. - - ** Warning states may now be set temporarily, until the end of the - current function, using the syntax - - warning STATE ID "local" + ** The preference - in which STATE may be "on", "off", or "error". Changes to warning - states that are set locally affect the current function and all - functions called from the current scope. The previous warning state - is restored on return from the current function. The "local" - option is ignored if used in the top-level workspace. - - ** Warning IDs renamed: - - Octave:array-as-scalar => Octave:array-to-scalar - Octave:array-as-vector => Octave:array-to-vector - - ** 'emptymatch', 'noemptymatch' options added to regular expressions. - - With this addition Octave now accepts the entire set of Matlab options - for regular expressions. 'noemptymatch' is the default, but 'emptymatch' - has certain uses where you need to match an assertion rather than actual - characters. For example, - - regexprep ('World', '^', 'Hello ', 'emptymatch') - => Hello World - - where the pattern is actually the assertion '^' or start-of-line. - - ** For compatibility with Matlab, the regexp, regexpi, and regexprep - functions now process backslash escape sequences in single-quoted pattern - strings. In addition, the regexprep function now processes backslash - escapes in single-quoted replacement strings. For example, - - regexprep (str, '\t', '\n') - - would search the variable str for a TAB character (escape sequence \t) - and replace it with a NEWLINE (escape sequence \n). Previously the - expression would have searched for a literal '\' followed by 't' and - replaced the two characters with the sequence '\', 'n'. - - ** A TeX parser has been implemented for the FLTK toolkit and is the default - for any text object including titles and axis labels. The TeX parser is - supported only for display on a monitor, not for printing. - - A quick summary of features: - - Code Feature Example Comment - ----------------------------------------------------------------- - _ subscript H_2O formula for water - ^ exponent y=x^2 formula for parabola - \char symbol \beta Greek symbol beta - \fontname font \fontname{Arial} set Arial font - \fontsize fontsize \fontsize{16} set fontsize 16 - \color[rgb] fontcolor \color[rgb]{1 0 1} set magenta color - \bf bold \bfBold Text bold font - \it italic \itItalic Text italic font - \sl slanted \slOblique Text slanted font - \rm normal \bfBold\rmNormal normal font - {} group {\bf Bold}Normal group objects - e^{i*\pi} = -1 group objects - - ** The m-files in the plot directory have been overhauled. - - The plot functions now produce output that is nearly visually compatible - with Matlab. Plot performance has also increased, dramatically for some - functions such as comet and waitbar. Finally, the documentation for most - functions has been updated so it should be clearer both how to use a - function and when a function is appropriate. - - ** The m-files in the image directory have been overhauled. - - The principal benefit is that Octave will now no longer automatically - convert images stored with integers to doubles. Storing images as uint8 - or uint16 requires only 1/8 or 1/4 the memory of an image stored using - doubles. For certain operations, such as fft2, the image must still be - converted to double in order to work. + do_braindead_shortcircuit_evaluation - Other changes include fixes to the way indexed images are read from a - colormap depending on the image class (integer images have a -1 offset to - the colormap row number). - - ** The imread and imwrite functions have been completely rewritten. - - The main changes relate to the alpha channel, support for reading and - writing of floating point images, implemented writing of indexed images, - and appending images to multipage image files. - - The issues that may arise due to backwards incompatibility are: - - * imwrite no longer interprets a length of 2 or 4 in the third dimension - as grayscale or RGB with alpha channel (a length of 4 will be saved - as a CMYK image). Alpha channel must be passed as separate argument. - - * imread will always return the colormap indexes when reading an indexed - image, even if the colormap is not requested as output. - - * transparency values are now inverted from previous Octave versions - (0 is for completely transparent instead of completely opaque). - - In addition, the function imformats has been implemented to expand - reading and writing of images of different formats through imread - and imwrite. - - ** The colormap function now provides new options--"list", "register", - and "unregister"--to list all available colormap functions, and to - add or remove a function name from the list of known colormap - functions. Packages that implement extra colormaps should use these - commands with PKG_ADD and PKG_DEL statements. - - ** strsplit has been modified to be compatible with Matlab. There - are two instances where backward compatibility is broken. - - (1) Delimiters are now string vectors, not scalars. + is now enabled by default. - Octave's legacy behavior - - strsplit ("1 2, 3", ", ") - ans = - { - [1,1] = 1 - [1,2] = 2 - [1,3] = - [1,4] = 3 - } - - Matlab compatible behavior - - strsplit ("1 2, 3", ", ") - ans = - { - [1,1] = 1 2 - [1,2] = 3 - } - - (2) By default, Matlab treats consecutive delimiters as a single - delimiter. By default, Octave's legacy behavior was to return an - empty string for the part between the delmiters. - - Where legacy behavior is desired, the call to strsplit() may be - replaced by ostrsplit(), which is Octave's original implementation of - strsplit(). - - ** The datevec function has been extended for better Matlab compatibility. - It now accepts string inputs in the following numerical formats: 12, 21, - 22, 26, 29, 31. This is undocumented, but verifiable, Matlab behavior. - In addition, the default for formats which do not specify a date is - January 1st of the current year. The previous default was the current day, - month, and year. This may produce changes in existing scripts. - - ** The error function and its derivatives has been extended to accept complex - arguments. The following functions now accept complex inputs: - - erf erfc erfcx + ** The preference - In addition two new error functions erfi (imaginary error function) and - dawson (scaled imaginary error function) have been added. - - ** The glpk function has been modified to reflect changes in the GLPK - library. The "round" and "itcnt" options have been removed. The - "relax" option has been replaced by the "rtest" option. The numeric - values of error codes and of some options have also changed. - - ** The kurtosis function has changed definition to be compatible with - Matlab. It now returns the base kurtosis instead of the "excess kurtosis". - The old behavior can be had by changing scripts to normalize with -3. - - "excess kurtosis" = kurtosis (x) - 3 - - ** The moment function has changed definition to be compatible with - Matlab. It now returns the central moment instead of the raw moment. - The old behavior can be had by passing the type argument "r" for raw. - - ** The default name of the Octave crash dump file is now - "octave-workspace" instead of "octave-core". The exact name can - always be customized with the octave_core_file_name function. - - ** A citation command has been added to display information on how to - cite Octave and packages in publications. The package system will - look for and install CITATION files from packages. - - ** The java package from Octave Forge is now part of core Octave. The - following new functions are available for interacting with Java - directly from Octave: - - debug_java java_matrix_autoconversion - isjava java_unsigned_autoconversion - java2mat javaaddpath - javaArray javaclasspath - javaMethod javamem - javaObject javarmpath - usejava - - In addition, the following functions that use the Java interface - are now available (provided that Octave is compiled with support for - Java enabled): - - helpdlg listdlg questdlg - inputdlg msgbox warndlg - - ** Other new functions added in 3.8.0: - - atan2d erfi lines - base64_decode expint linsolve - base64_encode findfigs missing_component_hook - betaincinv flintmax polyeig - built_in_docstrings_file fminsearch prefdir - cmpermute gallery preferences - cmunique gco readline_re_read_init_file - colorcube hdl2struct readline_read_init_file - copyobj history_save rgbplot - dawson imformats save_default_options - dblist importdata shrinkfaces - desktop isaxes splinefit - doc_cache_create iscolormap stemleaf - ellipj isequaln strjoin - ellipke jit_debug struct2hdl - erfcinv jit_enable tetramesh - jit_startcnt waterfall - - ** Deprecated functions. + allow_noninteger_range_as_index - The following functions were deprecated in Octave 3.4 and have been - removed from Octave 3.8. - - autocor dispatch is_global setstr - autocov fstat krylovb strerror - betai gammai perror values - cellidx glpkmex replot - cquad is_duplicate_entry saveimage - - The following functions have been deprecated in Octave 3.8 and will - be removed from Octave 3.12 (or whatever version is the second major - release after 3.8): - - default_save_options java_new - gen_doc_cache java_set - interp1q java_unsigned_conversion - isequalwithequalnans javafields - java_convert_matrix javamethods - java_debug re_read_readline_init_file - java_get read_readline_init_file - java_invoke saving_history - - - The following keywords have been deprecated in Octave 3.8 and will - be removed from Octave 3.12 (or whatever version is the second major - release after 3.8): - - static - - The following configuration variables have been deprecated in Octave - 3.8 and will be removed from Octave 3.12 (or whatever version is the - second major release after 3.8): + is now enabled by default and the warning ID - CC_VERSION (now GCC_VERSION) - CXX_VERSION (now GXX_VERSION) - - The internal class has been deprecated in Octave 3.8 and will - be removed from Octave 3.12 (or whatever version is the second major - release after 3.8). Replacement classes are (struct array) - or for a single structure. - -Summary of important user-visible changes for version 3.6: ---------------------------------------------------------- - - ** The PCRE library is now required to build Octave. If a pre-compiled - package does not exist for your system, you can find PCRE sources - at http://www.pcre.org - - ** The ARPACK library is no longer distributed with Octave. - If you need the eigs or svds functions you must provide an - external ARPACK through a package manager or by compiling it - yourself. If a pre-compiled package does not exist for your system, - you can find the current ARPACK sources at - http://forge.scilab.org/index.php/p/arpack-ng - - ** Many of Octave's binary operators (.*, .^, +, -, ...) now perform - automatic broadcasting for array operations which allows you to use - operator notation instead of calling bsxfun or expanding arrays (and - unnecessarily wasting memory) with repmat or similar idioms. For - example, to scale the columns of a matrix by the elements of a row - vector, you may now write - - rv .* M - - In this expression, the number of elements of rv must match the - number of columns of M. The following operators are affected: + Octave:noninteger-range-as-index - plus + .+ - minus - .- - times .* - rdivide ./ - ldivide .\ - power .^ .** - lt < - le <= - eq == - gt > - ge >= - ne != ~= - and & - or | - atan2 - hypot - max - min - mod - rem - xor - - additionally, since the A op= B assignment operators are equivalent - to A = A op B, the following operators are also affected: - - += -= .+= .-= .*= ./= .\= .^= .**= &= |= - - See the "Broadcasting" section in the new "Vectorization and Faster - Code Execution" chapter of the manual for more details. - - ** Octave now features a profiler, thanks to the work of Daniel Kraft - under the Google Summer of Code mentorship program. The manual has - been updated to reflect this addition. The new user-visible - functions are profile, profshow, and profexplore. - - ** Overhaul of statistical distribution functions - - Functions now return "single" outputs for inputs of class "single". - - 75% reduction in memory usage through use of logical indexing. - - Random sample functions now use the same syntax as rand and accept - a comma separated list of dimensions or a dimension vector. - - Functions have been made Matlab-compatible with regard to special - cases (probability on boundaries, probabilities for values outside - distribution, etc.). This may cause subtle changes to existing - scripts. - - negative binomial function has been extended to real, non-integer - inputs. The discrete_inv function now returns v(1) for 0 instead of - NaN. The nbincdf function has been recoded to use a closed form - solution with betainc. - - ** strread, textscan, and textread have been completely revamped. - - They now support nearly all Matlab functionality including: - - * Matlab-compatible whitespace and delimiter defaults - - * Matlab-compatible options: 'whitespace', treatasempty', format - string repeat count, user-specified comment style, uneven-length - output arrays, %n and %u conversion specifiers (provisionally) - - ** All .m string functions have been modified for better performance or - greater Matlab compatibility. Performance gains of 15X-30X have - been demonstrated. Operations on cell array of strings no longer pay - quite as high a penalty as those on 2-D character arrays. - - deblank: Now requires character or cellstr input. - - strtrim: Now requires character or cellstr input. - No longer trims nulls ("\0") from string for Matlab - compatibility. + is now set to "on" by default instead of "error" by default and "on" + for --traditional. - strmatch: Follows documentation precisely and ignores trailing spaces - in pattern and in string. Note that this is documented - Matlab behavior but the implementation apparently does - not always follow it. - - substr: Now possible to specify a negative LEN option which - extracts to within LEN of the end of the string. - - strtok: Now accepts cellstr input. - - base2dec, bin2dec, hex2dec: - Now accept cellstr inputs. - - dec2base, dec2bin, dec2hex: - Now accept cellstr inputs. - - index, rindex: - Now accept 2-D character array input. - - strsplit: Now accepts 2-D character array input. - - ** Geometry functions derived from Qhull (convhull, delaunay, voronoi) - have been revamped. The options passed to the underlying qhull - command have been changed for better results or for Matlab - compatibility. - - convhull: Default options are "Qt" for 2D, 3D, 4D inputs - Default options are "Qt Qx" for 5D and higher - - delaunay: Default options are "Qt Qbb Qc Qz" for 2D and 3D inputs - Default options are "Qt Qbb Qc Qx" for 4D and higher - - voronoi: No default arguments - - ** Date/Time functions updated. Millisecond support with FFF format - string now supported. - - datestr: Numerical formats 21, 22, 29 changed to match Matlab. - Now accepts cellstr input. - - ** The following warning IDs have been removed: + ** Other new functions added in 4.0.0: - Octave:associativity-change - Octave:complex-cmp-ops - Octave:empty-list-elements - Octave:fortran-indexing - Octave:precedence-change - - ** The warning ID Octave:string-concat has been renamed to - Octave:mixed-string-concat. - - ** Octave now includes the following Matlab-compatible preference - functions: - - addpref getpref ispref rmpref setpref - - ** The following Matlab-compatible handle graphics functions have been - added: - - guidata uipanel uitoolbar - guihandles uipushtool uiwait - uicontextmenu uiresume waitfor - uicontrol uitoggletool - - The uiXXX functions above are experimental. - - Except for uiwait and uiresume, the uiXXX functions are not - supported with the FLTK+OpenGL graphics toolkit. - - The gnuplot graphics toolkit does not support any of the uiXXX - functions nor the waitfor function. - - ** New keyword parfor (parallel for loop) is now recognized as a valid - keyword. Implementation, however, is still mapped to an ordinary - for loop. - - ** Other new functions added in 3.6.0: - - bicg nthargout usejava - is_dq_string narginchk waitbar - is_sq_string python zscore - is_function_handle register_graphics_toolkit - loaded_graphics_toolkits recycle + validateattributes ** Deprecated functions. - The following functions were deprecated in Octave 3.2 and have been - removed from Octave 3.6. + The following functions were deprecated in Octave 3.6 and have been + removed from Octave 4.0. - create_set spcholinv splu - dmult spcumprod spmax - iscommand spcumsum spmin - israwcommand spdet spprod - lchol spdiag spqr - loadimage spfind spsum - mark_as_command sphcat spsumsq - mark_as_rawcommand spinv spvcat - spatan2 spkron str2mat - spchol splchol unmark_command - spchol2inv split unmark_rawcommand - - The following functions have been deprecated in Octave 3.6 and will - be removed from Octave 3.10 (or whatever version is the second major - release after 3.6): - - cut is_duplicate_entry - cor polyderiv - corrcoef shell_cmd - __error_text__ studentize - error_text sylvester_matrix - - ** The following functions have been modified for Matlab compatibility: - - randperm - -Summary of important user-visible changes for version 3.4.3: ------------------------------------------------------------ - - ** Octave 3.4.3 is a bug fixing release. - -Summary of important user-visible changes for version 3.4.2: ------------------------------------------------------------ - - ** Octave 3.4.2 fixes some minor installation problems that affected - version 3.4.1. - -Summary of important user-visible changes for version 3.4.1: ------------------------------------------------------------ - - ** Octave 3.4.1 is primarily a bug fixing release. + cut polyderiv + cor shell_cmd + corrcoef studentize + __error_text__ sylvester_matrix + error_text - ** IMPORTANT note about binary incompatibility in this release: - - Binary compatibility for all 3.4.x releases was originally planned, - but this is impossible for the 3.4.1 release due to a bug in the way - shared libraries were built in Octave 3.4.0. Because of this bug, - .oct files built for Octave 3.4.0 must be recompiled before they - will work with Octave 3.4.1. - - Given that there would be binary incompatibilities with shared - libraries going from Octave 3.4.0 to 3.4.1, the following - incompatible changes were also made in this release: - - * The Perl Compatible Regular Expression (PCRE) library is now - required to build Octave. - - * Octave's libraries and .oct files are now installed in - subdirectories of $libdir instead of $libexecdir. - - Any future Octave 3.4.x release versions should remain binary - compatible with Octave 3.4.1 as proper library versioning is now - being used as recommended by the libtool manual. + The following functions have been deprecated in Octave 4.0 and will + be removed from Octave 4.4 (or whatever version is the second major + release after 4.0): - ** The following functions have been deprecated in Octave 3.4.1 and will - be removed from Octave 3.8 (or whatever version is the second major - release after 3.4): - - cquad is_duplicate_entry perror strerror - - ** The following functions are new in 3.4.1: - - colstyle gmres iscolumn isrow mgorth nproc rectangle - - ** The get_forge_pkg function is now private. + allow_noninteger_range_as_index + do_braindead_shortcircuit_evaluation - ** The rectangle_lw, rectangle_sw, triangle_lw, and triangle_sw - functions are now private. - - ** The logistic_regression_derivatives and logistic_regression_likelihood - functions are now private. - - ** ChangeLog files in the Octave sources are no longer maintained - by hand. Instead, there is a single ChangeLog file generated from - the Mercurial version control commit messages. Older ChangeLog - information can be found in the etc/OLD-ChangeLogs directory in the - source distribution. - -Summary of important user-visible changes for version 3.4: --------------------------------------------------------- - ** BLAS and LAPACK libraries are now required to build Octave. The - subset of the reference BLAS and LAPACK libraries has been removed - from the Octave sources. - - ** The ARPACK library is now distributed with Octave so it no longer - needs to be available as an external dependency when building - Octave. - - ** The `lookup' function was extended to be more useful for - general-purpose binary searching. Using this improvement, the - ismember function was rewritten for significantly better - performance. - - ** Real, integer and logical matrices, when used in indexing, will now - cache the internal index_vector value (zero-based indices) when - successfully used as indices, eliminating the conversion penalty for - subsequent indexing by the same matrix. In particular, this means it - is no longer needed to avoid repeated indexing by logical arrays - using find for performance reasons. - - ** Logical matrices are now treated more efficiently when used as - indices. Octave will keep the index as a logical mask unless the - ratio of true elements is small enough, using a specialized - code. Previously, all logical matrices were always first converted - to index vectors. This results in savings in both memory and - computing time. - - ** The `sub2ind' and `ind2sub' functions were reimplemented as compiled - functions for better performance. These functions are now faster, - can deliver more economized results for ranges, and can reuse the - index cache mechanism described in previous paragraph. - - ** The built-in function equivalents to associative operators (`plus', - `times', `mtimes', `and', and `or') have been extended to accept - multiple arguments. This is especially useful for summing - (multiplying, etc.) lists of objects (of possibly distinct types): - - matrix_sum = plus (matrix_list{:}); - - ** An FTP object type based on libcurl has been implemented. These - objects allow ftp connections, downloads and uploads to be - managed. For example, - - fp = ftp ("ftp.octave.org); - cd (fp, "gnu/octave"); - mget (fp, "octave-3.2.3.tar.bz2"); - close (fp); - - ** The default behavior of `assert (observed, expected)' has been - relaxed to employ less strict checking that does not require the - internals of the values to match. This avoids previously valid - tests from breaking due to new internal classes introduced in future - Octave versions. - - For instance, all of these assertions were true in Octave 3.0.x - but false in 3.2.x due to new optimizations and improvements: - - assert (2*linspace (1, 5, 5), 2*(1:5)) - assert (zeros (0, 0), []) - assert (2*ones (1, 5), (2) (ones (1,5))) - - ** The behavior of library functions `ismatrix', `issquare', and - `issymmetric' has been changed for better consistency. - - * The `ismatrix' function now returns true for all numeric, - logical and character 2-D or N-D matrices. Previously, `ismatrix' - returned false if the first or second dimension was zero. - Hence, `ismatrix ([])' was false, - while `ismatrix (zeros (1,2,0))' was true. - - * The `issquare' function now returns a logical scalar, and is - equivalent to the expression - - ismatrix (x) && ndims (x) == 2 && rows (x) == columns (x) - - The dimension is no longer returned. As a result, `issquare ([])' - now yields true. - - * The `issymmetric' function now checks for symmetry instead of - Hermitianness. For the latter, ishermitian was created. Also, - logical scalar is returned rather than the dimension, so - `issymmetric ([])' is now true. - - ** Function handles are now aware of overloaded functions. If a - function is overloaded, the handle determines at the time of its - reference which function to call. A non-overloaded version does not - need to exist. - - ** Overloading functions for built-in classes (double, int8, cell, - etc.) is now compatible with Matlab. - - ** Function handles can now be compared with the == and != operators, - as well as the `isequal' function. - - ** Performance of concatenation (using []) and the functions `cat', - `horzcat', and `vertcat' has been improved for multidimensional - arrays. - - ** The operation-assignment operators +=, -=, *= and /= now behave more - efficiently in certain cases. For instance, if M is a matrix and S a - scalar, then the statement - - M += S; - - will operate on M's data in-place if it is not shared by another - variable, usually increasing both time and memory efficiency. - - Only selected common combinations are affected, namely: - - matrix += matrix - matrix -= matrix - matrix .*= matrix - matrix ./= matrix - - matrix += scalar - matrix -= scalar - matrix *= scalar - matrix /= scalar - - logical matrix |= logical matrix - logical matrix &= logical matrix - - where matrix and scalar belong to the same class. The left-hand - side must be a simple variable reference. - - Moreover, when unary operators occur in expressions, Octave will - also try to do the operation in-place if it's argument is a - temporary expression. - - ** The effect of comparison operators (<, >, <=, and >=) applied to - complex numbers has changed to be consistent with the strict - ordering defined by the `max', `min', and `sort' functions. More - specifically, complex numbers are compared by lexicographical - comparison of the pairs `[abs(z), arg(z)]'. Previously, only real - parts were compared; this can be trivially achieved by converting - the operands to real values with the `real' function. - - ** The automatic simplification of complex computation results has - changed. Octave will now simplify any complex number with a zero - imaginary part or any complex matrix with all elements having zero - imaginary part to a real value. Previously, this was done only for - positive zeros. Note that the behavior of the complex function is - unchanged and it still produces a complex value even if the - imaginary part is zero. - - ** As a side effect of code refactoring in liboctave, the binary - logical operations are now more easily amenable to compiler - optimizations and are thus significantly faster. - - ** Octave now allows user-defined `subsasgn' methods to optimize out - redundant copies. For more information, see the manual. - - ** More efficient matrix division handling. Octave is now able to - handle the expressions - - M' \ V - M.' \ V - V / M - - (M is a matrix and V is a vector) more efficiently in certain cases. - In particular, if M is triangular, all three expressions will be - handled by a single call to xTRTRS (from LAPACK), with appropriate - flags. Previously, all three expressions required a physical - transpose of M. - - ** More efficient handling of certain mixed real-complex matrix - operations. For instance, if RM is a real matrix and CM a complex - matrix, - - RM * CM - - can now be evaluated either as - - complex (RM * real (CM), RM * imag (CM)) - - or as - - complex (RM) * CM, - - depending on the dimensions. The first form requires more - temporaries and copying, but halves the FLOP count, which normally - brings better performance if RM has enough rows. Previously, the - second form was always used. - - Matrix division is similarly affected. - - ** More efficient handling of triangular matrix factors returned from - factorizations. The functions for computing QR, LU and Cholesky - factorizations will now automatically return the triangular matrix - factors with proper internal matrix_type set, so that it won't need - to be computed when the matrix is used for division. - - ** The built-in `sum' function now handles the non-native summation - (i.e., double precision sum of single or integer inputs) more - efficiently, avoiding a temporary conversion of the whole input - array to doubles. Further, `sum' can now accept an extra option - argument, using a compensated summation algorithm rather than a - straightforward sum, which significantly improves precision if lots - of cancellation occurs in the summation. - - ** The built-in `bsxfun' function now uses optimized code for certain - cases where built-in operator handles are passed in. Namely, the - optimizations concern the operators `plus', `minus', `times', - `ldivide', `rdivide', `power', `and', `or' (for logical arrays), - the relational operators `eq', `ne', `lt', `le', `gt', `ge', and the - functions `min' and `max'. Optimizations only apply when both - operands are of the same built-in class. Mixed real/complex and - single/double operations will first convert both operands to a - common type. - - ** The `strfind' and `strrep' functions now have compiled - implementations, facilitating significantly more efficient searching - and replacing in strings, especially with longer patterns. The code - of `strcat' has been vectorized and is now much more efficient when - many strings are concatenated. The `strcmpi' and `strncmpi' - functions are now built-in functions, providing better performance. - - ** 'str2double' now has a compiled implementation and the API conforms - to Matlab. The additional Octave-specific features of returning a - boolean matrix indicating which elements were successfully converted - has been removed. - - ** Matlab-style ignoring input and output function arguments using - tilde (~) is now supported. Ignored output arguments may be - detected from a function using the built-in function `isargout'. - For more details, consult the manual. - - ** The list datatype, deprecated since the introduction of cells, has - been removed. - - ** The accumarray function has been optimized and is now significantly - faster in certain important cases. - - ** The behavior of isreal and isnumeric functions was changed to be more - Matlab-compatible. - - ** The integer math & conversion warnings (Octave:int-convert-nan, - Octave:int-convert-non-int-val, Octave:int-convert-overflow, - Octave:int-math-overflow) have been removed. - - ** rem and mod are now built-in functions. They also handle integer - types efficiently using integer arithmetic. - - ** Sparse indexing and indexed assignment has been mostly rewritten. - Since Octave uses compressed column storage for sparse matrices, - major attention is devoted to operations manipulating whole columns. - Such operations are now significantly faster, as well as some other - important cases. - - Further, it is now possible to pre-allocate a sparse matrix and - subsequently fill it by assignments, provided they meet certain - conditions. For more information, consult the `spalloc' function, - which is no longer a mere dummy. Consequently, nzmax and nnz are no - longer always equal in Octave. Octave may also produce a matrix - with nnz < nzmax as a result of other operations, so you should - consistently use nnz unless you really want to use nzmax (i.e., the - space allocated for nonzero elements). - - Sparse concatenation is also affected, and concatenating sparse - matrices, especially larger collections, is now significantly more - efficient. This applies to both the [] operator and the - cat/vertcat/horzcat functions. - - ** It is now possible to optionally employ the xGESDD LAPACK drivers - for computing the singular value decomposition using svd, instead - of the default xGESVD, using the configuration pseudo-variable - svd_driver. The xGESDD driver can be up to 6x times faster when - singular vectors are requested, but is reported to be somewhat less - robust on highly ill-conditioned matrices. - - ** Configuration pseudo-variables, such as page_screen_output or - confirm_recursive_rmdir (or the above mentioned svd_driver), now - accept a "local" option as second argument, requesting the change - to be undone when the current function returns: - - function [status, msg] = rm_rf (dir) - confirm_recursive_rmdir (false, "local"); - [status, msg] = rmdir (dir, "s"); - ... - endfunction - - Upon return, confirm_recursive_rmdir will be restored to the value - it had on entry to the function, even if there were subsequent - changes to the variable in function rm_rf or any of the functions - it calls. - - ** pkg now accepts a -forge option for downloading and installing - packages from Octave Forge automatically. For example, - - pkg install -forge general - - will automatically download the latest release of the general - package and attempt to install it. No automatic resolving of - dependencies is provided. Further, - - pkg list -forge - - can be used to list all available packages. - - ** The internal data representation of structs has been completely - rewritten to make certain optimizations feasible. The field data - can now be shared between structs with equal keys but different - dimensions or values, making operations that preserve the fields - faster. Economized storage is now used for scalar structs (just - like most other scalars), making their usage more - memory-efficient. Certain array-like operations on structs - (concatenation, uniform cellfun, num2cell) have gained a - significant speed-up. Additionally, the octave_scalar_map class - now provides a simpler interface to work with scalar structs within - a C++ DLD function. - - ** Two new formats are available for displaying numbers: - - format short eng - format long eng - - Both display numbers in engineering notation, i.e., mantissa + - exponent where the exponent is a multiple of 3. - - ** The following functions are new in Octave 3.4: - accumdim erfcx nfields pqpnonneg uigetdir - bitpack fileread nth_element quadcc uigetfile - bitunpack fminbnd onCleanup randi uiputfile - blkmm fskipl pbaspect repelems uimenu - cbrt ifelse pie3 reset whitebg - curl ishermitian powerset rsf2csf - chop isindex ppder saveas - daspect luupdate ppint strread - divergence merge ppjumps textread - - ** Using the image function to view images with external programs such - as display, xv, and xloadimage is no longer supported. The - image_viewer function has also been removed. - - ** The behavior of struct assignments to non-struct values has been - changed. Previously, it was possible to overwrite an arbitrary - value: - - a = 1; - a.x = 2; - - This is no longer possible unless a is an empty matrix or cell - array. - - ** The dlmread function has been extended to allow specifying a custom - value for empty fields. - - ** The dlmread and dlmwrite functions have been modified to accept - file IDs (as returned by fopen) in addition to file names. - - ** Octave can now optimize away the interpreter overhead of an - anonymous function handle, if the function simply calls another - function or handle with some of its parameters bound to certain - values. Example: - - f = @(x) sum (x, 1); - - When f is called, the call is forwarded to @sum with the constant 1 - appended, and the anonymous function call does not occur on the - call stack. - - ** For compatibility with Matlab, mu2lin (x) is now equivalent to - mu2lin (x, 0). - - ** The new function `history_control' may be used to control the way - command lines are added to the history list when Octave is using - readline for command-line editing. For example - - history_control ("ignoredups") - - tells Octave to avoid adding duplicate lines to the history list. - - ** Octave now uses the gnulib library for improved portability and to - avoid bugs in operating system functions. - - ** Deprecated functions. - - The following functions were deprecated in Octave 3.0 and have been - removed from Octave 3.4. - - beta_cdf geometric_pdf pascal_pdf - beta_inv geometric_rnd pascal_rnd - beta_pdf hypergeometric_cdf poisson_cdf - beta_rnd hypergeometric_inv poisson_inv - binomial_cdf hypergeometric_pdf poisson_pdf - binomial_inv hypergeometric_rnd poisson_rnd - binomial_pdf intersection polyinteg - binomial_rnd is_bool setstr - chisquare_cdf is_complex struct_contains - chisquare_inv is_list struct_elements - chisquare_pdf is_matrix t_cdf - chisquare_rnd is_scalar t_inv - clearplot is_square t_pdf - clg is_stream t_rnd - com2str is_struct uniform_cdf - exponential_cdf is_symmetric uniform_inv - exponential_inv is_vector uniform_pdf - exponential_pdf isstr uniform_rnd - exponential_rnd lognormal_cdf weibcdf - f_cdf lognormal_inv weibinv - f_inv lognormal_pdf weibpdf - f_pdf lognormal_rnd weibrnd - f_rnd meshdom weibull_cdf - gamma_cdf normal_cdf weibull_inv - gamma_inv normal_inv weibull_pdf - gamma_pdf normal_pdf weibull_rnd - gamma_rnd normal_rnd wiener_rnd - geometric_cdf pascal_cdf - geometric_inv pascal_inv - - The following functions were deprecated in Octave 3.2 and will - be removed from Octave 3.6 (or whatever version is the second major - release after 3.2): - - create_set spcholinv splu - dmult spcumprod spmax - iscommand spcumsum spmin - israwcommand spdet spprod - lchol spdiag spqr - loadimage spfind spsum - mark_as_command sphcat spsumsq - mark_as_rawcommand spinv spvcat - spatan2 spkron str2mat - spchol splchol unmark_command - spchol2inv split unmark_rawcommand - - The following functions have been deprecated in Octave 3.4 and will - be removed from Octave 3.8 (or whatever version is the second major - release after 3.4): - - autocor cellidx gammai is_global replot values - autocov dispatch glpkmex krylovb saveimage - betai fstat intwarning perror strerror - -Summary of important user-visible changes for version 3.2: ---------------------------------------------------------- - - ** Compatibility with Matlab graphics has been improved. - - The hggroup object and associated listener callback functions have - been added allowing the inclusion of group objects. Data sources - have been added to these group objects such that - - x = 0:0.1:10; - y = sin (x); - plot (x, y, "ydatasource", "y"); - for i = 1 : 100 - pause(0.1) - y = sin (x + 0.1 * i); - refreshdata (); - endfor - - works as expected. This capability has be used to introduce - stem-series, bar-series, etc., objects for better Matlab - compatibility. - - ** New graphics functions: - - addlistener ezcontour gcbo refresh - addproperty ezcontourf ginput refreshdata - allchild ezmesh gtext specular - available_graphics_toolkits ezmeshc intwarning surfl - graphics_toolkit ezplot ishghandle trisurf - cla ezplot3 isocolors waitforbuttonpress - clabel ezpolar isonormals - comet ezsurf isosurface - dellistener findall linkprop - diffuse gcbf plotmatrix - - ** New experimental OpenGL/FLTK based plotting system. - - An experimental plotting system based on OpenGL and the FLTK - toolkit is now part of Octave. This graphics toolkit is disabled by - default. You can switch to using it with the command - - graphics_toolkit ("fltk") - - for all future figures or for a particular figure with the command - - graphics_toolkit (h, "fltk") - - where "h" is a valid figure handle. - - ** Functions providing direct access to gnuplot have been removed. - - The functions __gnuplot_plot__, __gnuplot_set__, __gnuplot_raw__, - __gnuplot_show__, __gnuplot_replot__, __gnuplot_splot__, - __gnuplot_save_data__ and __gnuplot_send_inline_data__ have been - removed from Octave. These function were incompatible with the - high level graphics handle code. - - ** The Control, Finance and Quaternion functions have been removed. - - These functions are now available as separate packages from - - http://octave.sourceforge.net/packages.html - - and can be reinstalled using the Octave package manager (see - the pkg function). - - ** Specific sparse matrix functions removed. - - The following functions, which handled only sparse matrices have - been removed. Instead of calling these functions directly, you - should use the corresponding function without the "sp" prefix. - - spatan2 spcumsum spkron spprod - spchol spdet splchol spqr - spchol2inv spdiag splu spsum - spcholinv spfind spmax spsumsqk - spcumprod spinv spmin - - ** Improvements to the debugger. - - The interactive debugging features have been improved. Stopping - on statements with dbstop should work correctly now. Stepping - into and over functions, and stepping one statement at a time - (with dbstep) now works. Moving up and down the call stack with - dbup and dbdown now works. The dbstack function is now available - to print the current function call stack. The new dbquit function - is available to exit the debugging mode. - - ** Improved traceback error messages. - - Traceback error messages are much more concise and easier to - understand. They now display information about the function call - stack instead of the stack of all statements that were active at - the point of the error. - - ** Object Oriented Programming. - - Octave now includes OOP features and the user can create their own - class objects and overloaded functions and operators. For - example, all methods of a class called "myclass" will be found in - a directory "@myclass" on the users path. The class specific - versions of functions and operators take precedence over the - generic versions of these functions. - - New functions related to OOP include - - class inferiorto isobject loadobj methods superiorto - - See the Octave manual for more details. - - ** Parsing of Command-style Functions. - - Octave now parses command-style functions without needing to first - declare them with "mark_as_command". The rules for recognizing a - command-style function calls are - - * A command must appear as the first word in a statement, - followed by a space. - - * The first character after the space must not be '=' or '(' - - * The next token after the space must not look like a binary - operator. - - These rules should be mostly compatible with the way Matlab parses - command-style function calls and allow users to define commands in - .m files without having to mark them as commands. - - Note that previous versions of Octave allowed expressions like - - x = load -text foo.dat - - but an expression like this will now generate a parse error. In - order to assign the value returned by a function to a variable, - you must use the normal function call syntax: - - x = load ("-text", "foo.dat"); - - ** Block comments. - - Commented code can be between matching "#{" and "#}" or "%{" and - "%}" markers, even if the commented code spans several line. This - allows blocks code to be commented, without needing to comment - each line. For example, - - function [s, t] = func (x, y) - s = 2 * x; - #{ - s *= y; - t = y + x; - #} - endfunction - - the lines "s *= y;" and "t = y + x" will not be executed. - - ** If any subfunction in a file ends with "end" or "endfunction", then - they all must end that way. Previously, Octave accepted - - function main () - ... - # no endfunction here. - function sub () - ... - endfunction - - but this is no longer allowed. - - ** Special treatment in the parser of expressions like "a' * b". - - In these cases the transpose is no longer explicitly formed and - BLAS libraries are called with the transpose flagged, - significantly improving performance for these kinds of - operations. - - ** Single Precision data type. - - Octave now includes a single precision data type. Single - precision variables can be created with the "single" command, or - from functions like ones, eye, etc. For example, - - single (1) - ones (2, 2, "single") - zeros (2, 2, "single") - eye (2, 2, "single") - Inf (2, 2, "single") - NaN (2, 2, "single") - NA (2, 2, "single") - - all create single precision variables. For compatibility with - Matlab, mixed double/single precision operators and functions - return single precision types. - - As a consequence of this addition to Octave the internal - representation of the double precision NA value has changed, and - so users that make use of data generated by Octave with R or - visa-versa are warned that compatibility might not be assured. - - ** Improved array indexing. - - The underlying code used for indexing of arrays has been - completely rewritten and indexing is now significantly faster. - - ** Improved memory management. - - Octave will now attempt to share data in some cases where previously - a copy would be made, such as certain array slicing operations or - conversions between cells, structs and cs-lists. This usually reduces - both time and memory consumption. - Also, Octave will now attempt to detect and optimize usage of a vector - as a stack, when elements are being repeatedly inserted at/removed from - the end of the vector. - - ** Improved performance for reduction operations. - - The performance of the sum, prod, sumsq, cumsum, cumprod, any, all, - max and min functions has been significantly improved. - - ** Sorting and searching. - - The performance of sort has been improved, especially when sorting - indices are requested. An efficient built-in issorted - implementation was added. The sortrows function now uses a more - efficient algorithm, especially in the homogeneous case. The lookup - function is now a built-in function performing a binary search, - optimized for long runs of close elements. Lookup also works with - cell arrays of strings. - - ** Range arithmetics - - For some operations on ranges, Octave will attempt to keep the - result as a range. These include negation, adding a scalar, - subtracting a scalar, and multiplying by a scalar. Ranges with zero - increment are allowed and can be constructed using the built-in - function `ones'. - - ** Various performance improvements. - - Performance of a number of other built-in operations and functions - was improved, including: - - * logical operations - * comparison operators - * element-wise power - * accumarray - * cellfun - * isnan - * isinf - * isfinite - * nchoosek - * repmat - * strcmp - - ** 64-bit integer arithmetic. - - Arithmetic with 64-bit integers (int64 and uint64 types) is fully - supported, with saturation semantics like the other integer types. - Performance of most integer arithmetic operations has been - improved by using integer arithmetic directly. Previously, Octave - performed integer math with saturation semantics by converting the - operands to double precision, performing the operation, and then - converting the result back to an integer value, truncating if - necessary. - - ** Diagonal and permutation matrices. - - The interpreter can now treat diagonal and permutation matrices as - special objects that store only the non-zero elements, rather than - general full matrices. Therefore, it is now possible to construct - and use these matrices in linear algebra without suffering a - performance penalty due to storing large numbers of zero elements. - - ** Improvements to fsolve. - - The fsolve function now accepts an option structure argument (see - also the optimset function). The INFO values returned from fsolve - have changed to be compatible with Matlab's fsolve function. - Additionally, fsolve is now able to solve overdetermined systems, - complex-differentiable complex systems, systems with a sparse - jacobian and can work in single precision if given single precision - inputs. It can also be called recursively. - - ** Improvements to the norm function. - - The norm function is now able to compute row or column norms of a - matrix in a single call, as well as general matrix p-norms. - - ** New functions for computing some eigenvalues or singular values. - - The eigs and svds functions have been included in Octave. These - functions require the ARPACK library (now distributed under a - GPL-compatible license). - - ** New QR and Cholesky factorization updating functions. - - choldelete cholshift qrdelete qrshift - cholinsert cholupdate qrinsert qrupdate - - ** New quadrature functions. - - dblquad quadgk quadv triplequad - - ** New functions for reading and writing images. - - The imwrite and imread functions have been included in Octave. - These functions require the GraphicsMagick library. The new - function imfinfo provides information about an image file (size, - type, colors, etc.) - - ** The input_event_hook function has been replaced by the pair of - functions add_input_event_hook and remove_input_event_hook so that - more than one hook function may be installed at a time. - - ** Other miscellaneous new functions. - - addtodate hypot reallog - bicgstab idivide realpow - cellslices info realsqrt - cgs interp1q rectint - command_line_path isdebugmode regexptranslate - contrast isfloat restoredefaultpath - convn isstrprop roundb - cummin log1p rundemos - cummax lsqnonneg runlength - datetick matlabroot saveobj - display namelengthmax spaugment - expm1 nargoutchk strchr - filemarker pathdef strvcat - fstat perl subspace - full prctile symvar - fzero quantile treelayout - genvarname re_read_readline_init_file validatestring - histc - - ** Changes to strcat. - - The strcat function is now compatible with Matlab's strcat - function, which removes trailing whitespace when concatenating - character strings. For example - - strcat ('foo ', 'bar') - ==> 'foobar' - - The new function cstrcat provides the previous behavior of - Octave's strcat. - - ** Improvements to the help functions. - - The help system has been mostly re-implemented in .m files to make - it easier to modify. Performance of the lookfor function has been - greatly improved by caching the help text from all functions that - are distributed with Octave. The pkg function has been modified - to generate cache files for external packages when they are - installed. - - ** Deprecated functions. - - The following functions were deprecated in Octave 3.0 and will be - removed from Octave 3.4 (or whatever version is the second major - release after 3.0): - - beta_cdf geometric_pdf pascal_pdf - beta_inv geometric_rnd pascal_rnd - beta_pdf hypergeometric_cdf poisson_cdf - beta_rnd hypergeometric_inv poisson_inv - binomial_cdf hypergeometric_pdf poisson_pdf - binomial_inv hypergeometric_rnd poisson_rnd - binomial_pdf intersection polyinteg - binomial_rnd is_bool setstr - chisquare_cdf is_complex struct_contains - chisquare_inv is_list struct_elements - chisquare_pdf is_matrix t_cdf - chisquare_rnd is_scalar t_inv - clearplot is_square t_pdf - clg is_stream t_rnd - com2str is_struct uniform_cdf - exponential_cdf is_symmetric uniform_inv - exponential_inv is_vector uniform_pdf - exponential_pdf isstr uniform_rnd - exponential_rnd lognormal_cdf weibcdf - f_cdf lognormal_inv weibinv - f_inv lognormal_pdf weibpdf - f_pdf lognormal_rnd weibrnd - f_rnd meshdom weibull_cdf - gamma_cdf normal_cdf weibull_inv - gamma_inv normal_inv weibull_pdf - gamma_pdf normal_pdf weibull_rnd - gamma_rnd normal_rnd wiener_rnd - geometric_cdf pascal_cdf - geometric_inv pascal_inv - - The following functions are now deprecated in Octave 3.2 and will - be removed from Octave 3.6 (or whatever version is the second major - release after 3.2): - - create_set spcholinv spmax - dmult spcumprod spmin - iscommand spcumsum spprod - israwcommand spdet spqr - lchol spdiag spsum - loadimage spfind spsumsq - mark_as_command spinv str2mat - mark_as_rawcommand spkron unmark_command - spatan2 splchol unmark_rawcommand - spchol split - spchol2inv splu - See NEWS.3 for old news. diff -r a99bbbcf743c -r 7721e78b1337 build-aux/common.mk diff -r a99bbbcf743c -r 7721e78b1337 configure.ac --- a/configure.ac Sun Dec 15 19:31:18 2013 -0800 +++ b/configure.ac Sun Dec 15 19:42:24 2013 -0800 @@ -19,7 +19,7 @@ ### . AC_PREREQ([2.62]) -AC_INIT([GNU Octave], [3.8.0-rc1], [http://octave.org/bugs.html], [octave]) +AC_INIT([GNU Octave], [3.9.0+], [http://octave.org/bugs.html], [octave]) dnl PACKAGE_VERSION is set by the AC_INIT VERSION arg OCTAVE_VERSION="$PACKAGE_VERSION" @@ -2153,7 +2153,7 @@ dnl These checks define/undefine HAVE_FUNCNAME in config.h. dnl Code tests HAVE_FUNCNAME and either uses function or provides workaround. dnl Use multiple AC_CHECKs to avoid line continuations '\' in list -AC_CHECK_FUNCS([canonicalize_file_name ctermid dup2]) +AC_CHECK_FUNCS([ctermid dup2]) AC_CHECK_FUNCS([endgrent endpwent execvp expm1 expm1f fork]) AC_CHECK_FUNCS([getegid geteuid getgid getgrent getgrgid getgrnam]) AC_CHECK_FUNCS([getpgrp getpid getppid getpwent getpwuid getuid]) diff -r a99bbbcf743c -r 7721e78b1337 doc/interpreter/func.txi --- a/doc/interpreter/func.txi Sun Dec 15 19:31:18 2013 -0800 +++ b/doc/interpreter/func.txi Sun Dec 15 19:42:24 2013 -0800 @@ -393,6 +393,8 @@ which stops the function execution and prints a message about the correct way to call the function whenever the number of inputs is wrong. +@DOCSTRING(validateattributes) + For compatibility with @sc{matlab}, @code{nargchk}, @code{narginchk} and @code{nargoutchk} are available which provide similar error checking. diff -r a99bbbcf743c -r 7721e78b1337 doc/interpreter/grammar.txi diff -r a99bbbcf743c -r 7721e78b1337 doc/interpreter/macros.texi --- a/doc/interpreter/macros.texi Sun Dec 15 19:31:18 2013 -0800 +++ b/doc/interpreter/macros.texi Sun Dec 15 19:42:24 2013 -0800 @@ -28,14 +28,14 @@ @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 -@macro qcode{arg} +@rmacro qcode{arg} \arg\ -@end macro +@end rmacro @end ifinfo @ifnotinfo -@macro qcode{arg} +@rmacro qcode{arg} @code{\arg\} -@end macro +@end rmacro @end ifnotinfo @c The following macro is used for the on-line help system, but we don't diff -r a99bbbcf743c -r 7721e78b1337 doc/interpreter/plot.txi --- a/doc/interpreter/plot.txi Sun Dec 15 19:31:18 2013 -0800 +++ b/doc/interpreter/plot.txi Sun Dec 15 19:42:24 2013 -0800 @@ -2631,17 +2631,17 @@ @item linestyle May be one of -@table @code -@item "-" +@table @asis +@item @qcode{"-"} Solid line. [default] -@item "--" +@item @qcode{"--"} Dashed line. -@item ":" +@item @qcode{":"} Dotted line. -@item "-." +@item @qcode{"-."} A dash-dot line. @item @qcode{"none"} diff -r a99bbbcf743c -r 7721e78b1337 doc/interpreter/var.txi diff -r a99bbbcf743c -r 7721e78b1337 etc/NEWS.3 --- a/etc/NEWS.3 Sun Dec 15 19:31:18 2013 -0800 +++ b/etc/NEWS.3 Sun Dec 15 19:42:24 2013 -0800 @@ -1,3 +1,1523 @@ +Summary of important user-visible changes for version 3.8: +--------------------------------------------------------- + + ** One of the biggest new features for Octave 3.8 is a graphical user + interface. It is the one thing that users have requested most + often over the last few years and now it is almost ready. But + because it is not quite as polished as we would like, we have + decided to wait until the 4.0.x release series before making the + GUI the default interface (until then, you can use the --force-gui + option to start the GUI). + + Given the length of time and the number of bug fixes and + improvements since the last major release Octave, we also decided + against delaying the release of all these new improvements any + longer just to perfect the GUI. So please enjoy the 3.8 release of + Octave and the preview of the new GUI. We believe it is working + reasonably well, but we also know that there are some obvious rough + spots and many things that could be improved. + + WE NEED YOUR HELP. There are many ways that you can help us fix + the remaining problems, complete the GUI, and improve the overall + user experience for both novices and experts alike: + + * If you are a skilled software developer, you can help by + contributing your time to help with Octave's development. See + http://octave.org/get-involved.html for more information. + + * If Octave does not work properly, you are encouraged + report the problems you find. See http://octave.org/bugs.html + for more information about how to report problems. + + * Whether you are a user or developer, you can help to fund the + project. Octave development takes a lot of time and expertise. + Your contributions help to ensure that Octave will continue to + improve. See http://octave.org/donate.html for more details. + + We hope you find Octave to be useful. Please help us make it even + better for the future! + + ** Octave now uses OpenGL graphics by default with FLTK widgets. If + OpenGL libraries or FLTK widgets are not available when Octave is + built, gnuplot is used. You may also choose to use gnuplot for + graphics by executing the command + + graphics_toolkit ("gnuplot") + + Adding this command to your ~/.octaverc file will set the default + for each session. + + ** Printing or saving figures with OpenGL graphics requires the + gl2ps library which is no longer distributed with Octave. The + software is widely available in most package managers. If a + pre-compiled package does not exist for your system, you can find + the current sources at http://www.geuz.org/gl2ps/. + + ** Octave now supports nested functions with scoping rules that are + compatible with Matlab. A nested function is one declared and defined + within the body of another function. The nested function is only + accessible from within the enclosing function which makes it one + method for making private functions whose names do not conflict with those + in the global namespace (See also subfunctions and private functions). + In addition, variables in the enclosing function are visible within the + nested function. This makes it possible to have a pseudo-global variable + which can be seen by a group of functions, but which is not visible in + the global namespace. + + Example: + function outerfunc (...) + ... + function nested1 (...) + ... + function nested2 (...) + ... + endfunction + endfunction + + function nested3 (...) + ... + endfunction + endfunction + + ** Line continuations inside character strings have changed. + + The sequence '...' is no longer recognized as a line continuation + inside a character string. A backslash '\' followed by a newline + character is no longer recognized as a line continuation inside + single-quoted character strings. Inside double-quoted character + strings, a backslash followed by a newline character is still + recognized as a line continuation, but the backslash character must + be followed *immediately* by the newline character. No whitespace or + end-of-line comment may appear between them. + + ** Backslash as a continuation marker outside of double-quoted strings + is now deprecated. + + Using '\' as a continuation marker outside of double quoted strings + is now deprecated and will be removed from a future version of + Octave. When that is done, the behavior of + + (a \ + b) + + will be consistent with other binary operators. + + ** Redundant terminal comma accepted by parser + + A redundant terminal comma is now accepted in matrix + definitions which allows writing code such as + + [a,... + b,... + c,... + ] = deal (1,2,3) + + ** Octave now has limited support for named exceptions + + The following syntax is now accepted: + + try + statements + catch exception-id + statements + end + + The exception-id is a structure with the fields "message" and + "identifier". For example + + try + error ("Octave:error-id", "error message"); + catch myerr + printf ("identifier: %s\n", myerr.identifier); + printf ("message: %s\n", myerr.message); + end_try_catch + + When classdef-style classes are added to Octave, the exception-id + will become an MException object. + + ** Warning states may now be set temporarily, until the end of the + current function, using the syntax + + warning STATE ID "local" + + in which STATE may be "on", "off", or "error". Changes to warning + states that are set locally affect the current function and all + functions called from the current scope. The previous warning state + is restored on return from the current function. The "local" + option is ignored if used in the top-level workspace. + + ** Warning IDs renamed: + + Octave:array-as-scalar => Octave:array-to-scalar + Octave:array-as-vector => Octave:array-to-vector + + ** 'emptymatch', 'noemptymatch' options added to regular expressions. + + With this addition Octave now accepts the entire set of Matlab options + for regular expressions. 'noemptymatch' is the default, but 'emptymatch' + has certain uses where you need to match an assertion rather than actual + characters. For example, + + regexprep ('World', '^', 'Hello ', 'emptymatch') + => Hello World + + where the pattern is actually the assertion '^' or start-of-line. + + ** For compatibility with Matlab, the regexp, regexpi, and regexprep + functions now process backslash escape sequences in single-quoted pattern + strings. In addition, the regexprep function now processes backslash + escapes in single-quoted replacement strings. For example, + + regexprep (str, '\t', '\n') + + would search the variable str for a TAB character (escape sequence \t) + and replace it with a NEWLINE (escape sequence \n). Previously the + expression would have searched for a literal '\' followed by 't' and + replaced the two characters with the sequence '\', 'n'. + + ** A TeX parser has been implemented for the FLTK toolkit and is the default + for any text object including titles and axis labels. The TeX parser is + supported only for display on a monitor, not for printing. + + A quick summary of features: + + Code Feature Example Comment + ----------------------------------------------------------------- + _ subscript H_2O formula for water + ^ exponent y=x^2 formula for parabola + \char symbol \beta Greek symbol beta + \fontname font \fontname{Arial} set Arial font + \fontsize fontsize \fontsize{16} set fontsize 16 + \color[rgb] fontcolor \color[rgb]{1 0 1} set magenta color + \bf bold \bfBold Text bold font + \it italic \itItalic Text italic font + \sl slanted \slOblique Text slanted font + \rm normal \bfBold\rmNormal normal font + {} group {\bf Bold}Normal group objects + e^{i*\pi} = -1 group objects + + ** The m-files in the plot directory have been overhauled. + + The plot functions now produce output that is nearly visually compatible + with Matlab. Plot performance has also increased, dramatically for some + functions such as comet and waitbar. Finally, the documentation for most + functions has been updated so it should be clearer both how to use a + function and when a function is appropriate. + + ** The m-files in the image directory have been overhauled. + + The principal benefit is that Octave will now no longer automatically + convert images stored with integers to doubles. Storing images as uint8 + or uint16 requires only 1/8 or 1/4 the memory of an image stored using + doubles. For certain operations, such as fft2, the image must still be + converted to double in order to work. + + Other changes include fixes to the way indexed images are read from a + colormap depending on the image class (integer images have a -1 offset to + the colormap row number). + + ** The imread and imwrite functions have been completely rewritten. + + The main changes relate to the alpha channel, support for reading and + writing of floating point images, implemented writing of indexed images, + and appending images to multipage image files. + + The issues that may arise due to backwards incompatibility are: + + * imwrite no longer interprets a length of 2 or 4 in the third dimension + as grayscale or RGB with alpha channel (a length of 4 will be saved + as a CMYK image). Alpha channel must be passed as separate argument. + + * imread will always return the colormap indexes when reading an indexed + image, even if the colormap is not requested as output. + + * transparency values are now inverted from previous Octave versions + (0 is for completely transparent instead of completely opaque). + + In addition, the function imformats has been implemented to expand + reading and writing of images of different formats through imread + and imwrite. + + ** The colormap function now provides new options--"list", "register", + and "unregister"--to list all available colormap functions, and to + add or remove a function name from the list of known colormap + functions. Packages that implement extra colormaps should use these + commands with PKG_ADD and PKG_DEL statements. + + ** strsplit has been modified to be compatible with Matlab. There + are two instances where backward compatibility is broken. + + (1) Delimiters are now string vectors, not scalars. + + Octave's legacy behavior + + strsplit ("1 2, 3", ", ") + ans = + { + [1,1] = 1 + [1,2] = 2 + [1,3] = + [1,4] = 3 + } + + Matlab compatible behavior + + strsplit ("1 2, 3", ", ") + ans = + { + [1,1] = 1 2 + [1,2] = 3 + } + + (2) By default, Matlab treats consecutive delimiters as a single + delimiter. By default, Octave's legacy behavior was to return an + empty string for the part between the delmiters. + + Where legacy behavior is desired, the call to strsplit() may be + replaced by ostrsplit(), which is Octave's original implementation of + strsplit(). + + ** The datevec function has been extended for better Matlab compatibility. + It now accepts string inputs in the following numerical formats: 12, 21, + 22, 26, 29, 31. This is undocumented, but verifiable, Matlab behavior. + In addition, the default for formats which do not specify a date is + January 1st of the current year. The previous default was the current day, + month, and year. This may produce changes in existing scripts. + + ** The error function and its derivatives has been extended to accept complex + arguments. The following functions now accept complex inputs: + + erf erfc erfcx + + In addition two new error functions erfi (imaginary error function) and + dawson (scaled imaginary error function) have been added. + + ** The glpk function has been modified to reflect changes in the GLPK + library. The "round" and "itcnt" options have been removed. The + "relax" option has been replaced by the "rtest" option. The numeric + values of error codes and of some options have also changed. + + ** The kurtosis function has changed definition to be compatible with + Matlab. It now returns the base kurtosis instead of the "excess kurtosis". + The old behavior can be had by changing scripts to normalize with -3. + + "excess kurtosis" = kurtosis (x) - 3 + + ** The moment function has changed definition to be compatible with + Matlab. It now returns the central moment instead of the raw moment. + The old behavior can be had by passing the type argument "r" for raw. + + ** The default name of the Octave crash dump file is now + "octave-workspace" instead of "octave-core". The exact name can + always be customized with the octave_core_file_name function. + + ** A citation command has been added to display information on how to + cite Octave and packages in publications. The package system will + look for and install CITATION files from packages. + + ** The java package from Octave Forge is now part of core Octave. The + following new functions are available for interacting with Java + directly from Octave: + + debug_java java_matrix_autoconversion + isjava java_unsigned_autoconversion + java2mat javaaddpath + javaArray javaclasspath + javaMethod javamem + javaObject javarmpath + usejava + + In addition, the following functions that use the Java interface + are now available (provided that Octave is compiled with support for + Java enabled): + + helpdlg listdlg questdlg + inputdlg msgbox warndlg + + ** Other new functions added in 3.8.0: + + atan2d erfi lines + base64_decode expint linsolve + base64_encode findfigs missing_component_hook + betaincinv flintmax polyeig + built_in_docstrings_file fminsearch prefdir + cmpermute gallery preferences + cmunique gco readline_re_read_init_file + colorcube hdl2struct readline_read_init_file + copyobj history_save rgbplot + dawson imformats save_default_options + dblist importdata shrinkfaces + desktop isaxes splinefit + doc_cache_create iscolormap stemleaf + ellipj isequaln strjoin + ellipke jit_debug struct2hdl + erfcinv jit_enable tetramesh + jit_startcnt waterfall + + ** Deprecated functions. + + The following functions were deprecated in Octave 3.4 and have been + removed from Octave 3.8. + + autocor dispatch is_global setstr + autocov fstat krylovb strerror + betai gammai perror values + cellidx glpkmex replot + cquad is_duplicate_entry saveimage + + The following functions have been deprecated in Octave 3.8 and will + be removed from Octave 3.12 (or whatever version is the second major + release after 3.8): + + default_save_options java_new + gen_doc_cache java_set + interp1q java_unsigned_conversion + isequalwithequalnans javafields + java_convert_matrix javamethods + java_debug re_read_readline_init_file + java_get read_readline_init_file + java_invoke saving_history + + + The following keywords have been deprecated in Octave 3.8 and will + be removed from Octave 3.12 (or whatever version is the second major + release after 3.8): + + static + + The following configuration variables have been deprecated in Octave + 3.8 and will be removed from Octave 3.12 (or whatever version is the + second major release after 3.8): + + CC_VERSION (now GCC_VERSION) + CXX_VERSION (now GXX_VERSION) + + The internal class has been deprecated in Octave 3.8 and will + be removed from Octave 3.12 (or whatever version is the second major + release after 3.8). Replacement classes are (struct array) + or for a single structure. + +Summary of important user-visible changes for version 3.6: +--------------------------------------------------------- + + ** The PCRE library is now required to build Octave. If a pre-compiled + package does not exist for your system, you can find PCRE sources + at http://www.pcre.org + + ** The ARPACK library is no longer distributed with Octave. + If you need the eigs or svds functions you must provide an + external ARPACK through a package manager or by compiling it + yourself. If a pre-compiled package does not exist for your system, + you can find the current ARPACK sources at + http://forge.scilab.org/index.php/p/arpack-ng + + ** Many of Octave's binary operators (.*, .^, +, -, ...) now perform + automatic broadcasting for array operations which allows you to use + operator notation instead of calling bsxfun or expanding arrays (and + unnecessarily wasting memory) with repmat or similar idioms. For + example, to scale the columns of a matrix by the elements of a row + vector, you may now write + + rv .* M + + In this expression, the number of elements of rv must match the + number of columns of M. The following operators are affected: + + plus + .+ + minus - .- + times .* + rdivide ./ + ldivide .\ + power .^ .** + lt < + le <= + eq == + gt > + ge >= + ne != ~= + and & + or | + atan2 + hypot + max + min + mod + rem + xor + + additionally, since the A op= B assignment operators are equivalent + to A = A op B, the following operators are also affected: + + += -= .+= .-= .*= ./= .\= .^= .**= &= |= + + See the "Broadcasting" section in the new "Vectorization and Faster + Code Execution" chapter of the manual for more details. + + ** Octave now features a profiler, thanks to the work of Daniel Kraft + under the Google Summer of Code mentorship program. The manual has + been updated to reflect this addition. The new user-visible + functions are profile, profshow, and profexplore. + + ** Overhaul of statistical distribution functions + + Functions now return "single" outputs for inputs of class "single". + + 75% reduction in memory usage through use of logical indexing. + + Random sample functions now use the same syntax as rand and accept + a comma separated list of dimensions or a dimension vector. + + Functions have been made Matlab-compatible with regard to special + cases (probability on boundaries, probabilities for values outside + distribution, etc.). This may cause subtle changes to existing + scripts. + + negative binomial function has been extended to real, non-integer + inputs. The discrete_inv function now returns v(1) for 0 instead of + NaN. The nbincdf function has been recoded to use a closed form + solution with betainc. + + ** strread, textscan, and textread have been completely revamped. + + They now support nearly all Matlab functionality including: + + * Matlab-compatible whitespace and delimiter defaults + + * Matlab-compatible options: 'whitespace', treatasempty', format + string repeat count, user-specified comment style, uneven-length + output arrays, %n and %u conversion specifiers (provisionally) + + ** All .m string functions have been modified for better performance or + greater Matlab compatibility. Performance gains of 15X-30X have + been demonstrated. Operations on cell array of strings no longer pay + quite as high a penalty as those on 2-D character arrays. + + deblank: Now requires character or cellstr input. + + strtrim: Now requires character or cellstr input. + No longer trims nulls ("\0") from string for Matlab + compatibility. + + strmatch: Follows documentation precisely and ignores trailing spaces + in pattern and in string. Note that this is documented + Matlab behavior but the implementation apparently does + not always follow it. + + substr: Now possible to specify a negative LEN option which + extracts to within LEN of the end of the string. + + strtok: Now accepts cellstr input. + + base2dec, bin2dec, hex2dec: + Now accept cellstr inputs. + + dec2base, dec2bin, dec2hex: + Now accept cellstr inputs. + + index, rindex: + Now accept 2-D character array input. + + strsplit: Now accepts 2-D character array input. + + ** Geometry functions derived from Qhull (convhull, delaunay, voronoi) + have been revamped. The options passed to the underlying qhull + command have been changed for better results or for Matlab + compatibility. + + convhull: Default options are "Qt" for 2D, 3D, 4D inputs + Default options are "Qt Qx" for 5D and higher + + delaunay: Default options are "Qt Qbb Qc Qz" for 2D and 3D inputs + Default options are "Qt Qbb Qc Qx" for 4D and higher + + voronoi: No default arguments + + ** Date/Time functions updated. Millisecond support with FFF format + string now supported. + + datestr: Numerical formats 21, 22, 29 changed to match Matlab. + Now accepts cellstr input. + + ** The following warning IDs have been removed: + + Octave:associativity-change + Octave:complex-cmp-ops + Octave:empty-list-elements + Octave:fortran-indexing + Octave:precedence-change + + ** The warning ID Octave:string-concat has been renamed to + Octave:mixed-string-concat. + + ** Octave now includes the following Matlab-compatible preference + functions: + + addpref getpref ispref rmpref setpref + + ** The following Matlab-compatible handle graphics functions have been + added: + + guidata uipanel uitoolbar + guihandles uipushtool uiwait + uicontextmenu uiresume waitfor + uicontrol uitoggletool + + The uiXXX functions above are experimental. + + Except for uiwait and uiresume, the uiXXX functions are not + supported with the FLTK+OpenGL graphics toolkit. + + The gnuplot graphics toolkit does not support any of the uiXXX + functions nor the waitfor function. + + ** New keyword parfor (parallel for loop) is now recognized as a valid + keyword. Implementation, however, is still mapped to an ordinary + for loop. + + ** Other new functions added in 3.6.0: + + bicg nthargout usejava + is_dq_string narginchk waitbar + is_sq_string python zscore + is_function_handle register_graphics_toolkit + loaded_graphics_toolkits recycle + + ** Deprecated functions. + + The following functions were deprecated in Octave 3.2 and have been + removed from Octave 3.6. + + create_set spcholinv splu + dmult spcumprod spmax + iscommand spcumsum spmin + israwcommand spdet spprod + lchol spdiag spqr + loadimage spfind spsum + mark_as_command sphcat spsumsq + mark_as_rawcommand spinv spvcat + spatan2 spkron str2mat + spchol splchol unmark_command + spchol2inv split unmark_rawcommand + + The following functions have been deprecated in Octave 3.6 and will + be removed from Octave 3.10 (or whatever version is the second major + release after 3.6): + + cut polyderiv + cor shell_cmd + corrcoef studentize + __error_text__ sylvester_matrix + error_text + + ** The following functions have been modified for Matlab compatibility: + + randperm + +Summary of important user-visible changes for version 3.4.3: +----------------------------------------------------------- + + ** Octave 3.4.3 is a bug fixing release. + +Summary of important user-visible changes for version 3.4.2: +----------------------------------------------------------- + + ** Octave 3.4.2 fixes some minor installation problems that affected + version 3.4.1. + +Summary of important user-visible changes for version 3.4.1: +----------------------------------------------------------- + + ** Octave 3.4.1 is primarily a bug fixing release. + + ** IMPORTANT note about binary incompatibility in this release: + + Binary compatibility for all 3.4.x releases was originally planned, + but this is impossible for the 3.4.1 release due to a bug in the way + shared libraries were built in Octave 3.4.0. Because of this bug, + .oct files built for Octave 3.4.0 must be recompiled before they + will work with Octave 3.4.1. + + Given that there would be binary incompatibilities with shared + libraries going from Octave 3.4.0 to 3.4.1, the following + incompatible changes were also made in this release: + + * The Perl Compatible Regular Expression (PCRE) library is now + required to build Octave. + + * Octave's libraries and .oct files are now installed in + subdirectories of $libdir instead of $libexecdir. + + Any future Octave 3.4.x release versions should remain binary + compatible with Octave 3.4.1 as proper library versioning is now + being used as recommended by the libtool manual. + + ** The following functions have been deprecated in Octave 3.4.1 and will + be removed from Octave 3.8 (or whatever version is the second major + release after 3.4): + + cquad is_duplicate_entry perror strerror + + ** The following functions are new in 3.4.1: + + colstyle gmres iscolumn isrow mgorth nproc rectangle + + ** The get_forge_pkg function is now private. + + ** The rectangle_lw, rectangle_sw, triangle_lw, and triangle_sw + functions are now private. + + ** The logistic_regression_derivatives and logistic_regression_likelihood + functions are now private. + + ** ChangeLog files in the Octave sources are no longer maintained + by hand. Instead, there is a single ChangeLog file generated from + the Mercurial version control commit messages. Older ChangeLog + information can be found in the etc/OLD-ChangeLogs directory in the + source distribution. + +Summary of important user-visible changes for version 3.4: +--------------------------------------------------------- + + ** BLAS and LAPACK libraries are now required to build Octave. The + subset of the reference BLAS and LAPACK libraries has been removed + from the Octave sources. + + ** The ARPACK library is now distributed with Octave so it no longer + needs to be available as an external dependency when building + Octave. + + ** The `lookup' function was extended to be more useful for + general-purpose binary searching. Using this improvement, the + ismember function was rewritten for significantly better + performance. + + ** Real, integer and logical matrices, when used in indexing, will now + cache the internal index_vector value (zero-based indices) when + successfully used as indices, eliminating the conversion penalty for + subsequent indexing by the same matrix. In particular, this means it + is no longer needed to avoid repeated indexing by logical arrays + using find for performance reasons. + + ** Logical matrices are now treated more efficiently when used as + indices. Octave will keep the index as a logical mask unless the + ratio of true elements is small enough, using a specialized + code. Previously, all logical matrices were always first converted + to index vectors. This results in savings in both memory and + computing time. + + ** The `sub2ind' and `ind2sub' functions were reimplemented as compiled + functions for better performance. These functions are now faster, + can deliver more economized results for ranges, and can reuse the + index cache mechanism described in previous paragraph. + + ** The built-in function equivalents to associative operators (`plus', + `times', `mtimes', `and', and `or') have been extended to accept + multiple arguments. This is especially useful for summing + (multiplying, etc.) lists of objects (of possibly distinct types): + + matrix_sum = plus (matrix_list{:}); + + ** An FTP object type based on libcurl has been implemented. These + objects allow ftp connections, downloads and uploads to be + managed. For example, + + fp = ftp ("ftp.octave.org); + cd (fp, "gnu/octave"); + mget (fp, "octave-3.2.3.tar.bz2"); + close (fp); + + ** The default behavior of `assert (observed, expected)' has been + relaxed to employ less strict checking that does not require the + internals of the values to match. This avoids previously valid + tests from breaking due to new internal classes introduced in future + Octave versions. + + For instance, all of these assertions were true in Octave 3.0.x + but false in 3.2.x due to new optimizations and improvements: + + assert (2*linspace (1, 5, 5), 2*(1:5)) + assert (zeros (0, 0), []) + assert (2*ones (1, 5), (2) (ones (1,5))) + + ** The behavior of library functions `ismatrix', `issquare', and + `issymmetric' has been changed for better consistency. + + * The `ismatrix' function now returns true for all numeric, + logical and character 2-D or N-D matrices. Previously, `ismatrix' + returned false if the first or second dimension was zero. + Hence, `ismatrix ([])' was false, + while `ismatrix (zeros (1,2,0))' was true. + + * The `issquare' function now returns a logical scalar, and is + equivalent to the expression + + ismatrix (x) && ndims (x) == 2 && rows (x) == columns (x) + + The dimension is no longer returned. As a result, `issquare ([])' + now yields true. + + * The `issymmetric' function now checks for symmetry instead of + Hermitianness. For the latter, ishermitian was created. Also, + logical scalar is returned rather than the dimension, so + `issymmetric ([])' is now true. + + ** Function handles are now aware of overloaded functions. If a + function is overloaded, the handle determines at the time of its + reference which function to call. A non-overloaded version does not + need to exist. + + ** Overloading functions for built-in classes (double, int8, cell, + etc.) is now compatible with Matlab. + + ** Function handles can now be compared with the == and != operators, + as well as the `isequal' function. + + ** Performance of concatenation (using []) and the functions `cat', + `horzcat', and `vertcat' has been improved for multidimensional + arrays. + + ** The operation-assignment operators +=, -=, *= and /= now behave more + efficiently in certain cases. For instance, if M is a matrix and S a + scalar, then the statement + + M += S; + + will operate on M's data in-place if it is not shared by another + variable, usually increasing both time and memory efficiency. + + Only selected common combinations are affected, namely: + + matrix += matrix + matrix -= matrix + matrix .*= matrix + matrix ./= matrix + + matrix += scalar + matrix -= scalar + matrix *= scalar + matrix /= scalar + + logical matrix |= logical matrix + logical matrix &= logical matrix + + where matrix and scalar belong to the same class. The left-hand + side must be a simple variable reference. + + Moreover, when unary operators occur in expressions, Octave will + also try to do the operation in-place if it's argument is a + temporary expression. + + ** The effect of comparison operators (<, >, <=, and >=) applied to + complex numbers has changed to be consistent with the strict + ordering defined by the `max', `min', and `sort' functions. More + specifically, complex numbers are compared by lexicographical + comparison of the pairs `[abs(z), arg(z)]'. Previously, only real + parts were compared; this can be trivially achieved by converting + the operands to real values with the `real' function. + + ** The automatic simplification of complex computation results has + changed. Octave will now simplify any complex number with a zero + imaginary part or any complex matrix with all elements having zero + imaginary part to a real value. Previously, this was done only for + positive zeros. Note that the behavior of the complex function is + unchanged and it still produces a complex value even if the + imaginary part is zero. + + ** As a side effect of code refactoring in liboctave, the binary + logical operations are now more easily amenable to compiler + optimizations and are thus significantly faster. + + ** Octave now allows user-defined `subsasgn' methods to optimize out + redundant copies. For more information, see the manual. + + ** More efficient matrix division handling. Octave is now able to + handle the expressions + + M' \ V + M.' \ V + V / M + + (M is a matrix and V is a vector) more efficiently in certain cases. + In particular, if M is triangular, all three expressions will be + handled by a single call to xTRTRS (from LAPACK), with appropriate + flags. Previously, all three expressions required a physical + transpose of M. + + ** More efficient handling of certain mixed real-complex matrix + operations. For instance, if RM is a real matrix and CM a complex + matrix, + + RM * CM + + can now be evaluated either as + + complex (RM * real (CM), RM * imag (CM)) + + or as + + complex (RM) * CM, + + depending on the dimensions. The first form requires more + temporaries and copying, but halves the FLOP count, which normally + brings better performance if RM has enough rows. Previously, the + second form was always used. + + Matrix division is similarly affected. + + ** More efficient handling of triangular matrix factors returned from + factorizations. The functions for computing QR, LU and Cholesky + factorizations will now automatically return the triangular matrix + factors with proper internal matrix_type set, so that it won't need + to be computed when the matrix is used for division. + + ** The built-in `sum' function now handles the non-native summation + (i.e., double precision sum of single or integer inputs) more + efficiently, avoiding a temporary conversion of the whole input + array to doubles. Further, `sum' can now accept an extra option + argument, using a compensated summation algorithm rather than a + straightforward sum, which significantly improves precision if lots + of cancellation occurs in the summation. + + ** The built-in `bsxfun' function now uses optimized code for certain + cases where built-in operator handles are passed in. Namely, the + optimizations concern the operators `plus', `minus', `times', + `ldivide', `rdivide', `power', `and', `or' (for logical arrays), + the relational operators `eq', `ne', `lt', `le', `gt', `ge', and the + functions `min' and `max'. Optimizations only apply when both + operands are of the same built-in class. Mixed real/complex and + single/double operations will first convert both operands to a + common type. + + ** The `strfind' and `strrep' functions now have compiled + implementations, facilitating significantly more efficient searching + and replacing in strings, especially with longer patterns. The code + of `strcat' has been vectorized and is now much more efficient when + many strings are concatenated. The `strcmpi' and `strncmpi' + functions are now built-in functions, providing better performance. + + ** 'str2double' now has a compiled implementation and the API conforms + to Matlab. The additional Octave-specific features of returning a + boolean matrix indicating which elements were successfully converted + has been removed. + + ** Matlab-style ignoring input and output function arguments using + tilde (~) is now supported. Ignored output arguments may be + detected from a function using the built-in function `isargout'. + For more details, consult the manual. + + ** The list datatype, deprecated since the introduction of cells, has + been removed. + + ** The accumarray function has been optimized and is now significantly + faster in certain important cases. + + ** The behavior of isreal and isnumeric functions was changed to be more + Matlab-compatible. + + ** The integer math & conversion warnings (Octave:int-convert-nan, + Octave:int-convert-non-int-val, Octave:int-convert-overflow, + Octave:int-math-overflow) have been removed. + + ** rem and mod are now built-in functions. They also handle integer + types efficiently using integer arithmetic. + + ** Sparse indexing and indexed assignment has been mostly rewritten. + Since Octave uses compressed column storage for sparse matrices, + major attention is devoted to operations manipulating whole columns. + Such operations are now significantly faster, as well as some other + important cases. + + Further, it is now possible to pre-allocate a sparse matrix and + subsequently fill it by assignments, provided they meet certain + conditions. For more information, consult the `spalloc' function, + which is no longer a mere dummy. Consequently, nzmax and nnz are no + longer always equal in Octave. Octave may also produce a matrix + with nnz < nzmax as a result of other operations, so you should + consistently use nnz unless you really want to use nzmax (i.e., the + space allocated for nonzero elements). + + Sparse concatenation is also affected, and concatenating sparse + matrices, especially larger collections, is now significantly more + efficient. This applies to both the [] operator and the + cat/vertcat/horzcat functions. + + ** It is now possible to optionally employ the xGESDD LAPACK drivers + for computing the singular value decomposition using svd, instead + of the default xGESVD, using the configuration pseudo-variable + svd_driver. The xGESDD driver can be up to 6x times faster when + singular vectors are requested, but is reported to be somewhat less + robust on highly ill-conditioned matrices. + + ** Configuration pseudo-variables, such as page_screen_output or + confirm_recursive_rmdir (or the above mentioned svd_driver), now + accept a "local" option as second argument, requesting the change + to be undone when the current function returns: + + function [status, msg] = rm_rf (dir) + confirm_recursive_rmdir (false, "local"); + [status, msg] = rmdir (dir, "s"); + ... + endfunction + + Upon return, confirm_recursive_rmdir will be restored to the value + it had on entry to the function, even if there were subsequent + changes to the variable in function rm_rf or any of the functions + it calls. + + ** pkg now accepts a -forge option for downloading and installing + packages from Octave Forge automatically. For example, + + pkg install -forge general + + will automatically download the latest release of the general + package and attempt to install it. No automatic resolving of + dependencies is provided. Further, + + pkg list -forge + + can be used to list all available packages. + + ** The internal data representation of structs has been completely + rewritten to make certain optimizations feasible. The field data + can now be shared between structs with equal keys but different + dimensions or values, making operations that preserve the fields + faster. Economized storage is now used for scalar structs (just + like most other scalars), making their usage more + memory-efficient. Certain array-like operations on structs + (concatenation, uniform cellfun, num2cell) have gained a + significant speed-up. Additionally, the octave_scalar_map class + now provides a simpler interface to work with scalar structs within + a C++ DLD function. + + ** Two new formats are available for displaying numbers: + + format short eng + format long eng + + Both display numbers in engineering notation, i.e., mantissa + + exponent where the exponent is a multiple of 3. + + ** The following functions are new in Octave 3.4: + accumdim erfcx nfields pqpnonneg uigetdir + bitpack fileread nth_element quadcc uigetfile + bitunpack fminbnd onCleanup randi uiputfile + blkmm fskipl pbaspect repelems uimenu + cbrt ifelse pie3 reset whitebg + curl ishermitian powerset rsf2csf + chop isindex ppder saveas + daspect luupdate ppint strread + divergence merge ppjumps textread + + ** Using the image function to view images with external programs such + as display, xv, and xloadimage is no longer supported. The + image_viewer function has also been removed. + + ** The behavior of struct assignments to non-struct values has been + changed. Previously, it was possible to overwrite an arbitrary + value: + + a = 1; + a.x = 2; + + This is no longer possible unless a is an empty matrix or cell + array. + + ** The dlmread function has been extended to allow specifying a custom + value for empty fields. + + ** The dlmread and dlmwrite functions have been modified to accept + file IDs (as returned by fopen) in addition to file names. + + ** Octave can now optimize away the interpreter overhead of an + anonymous function handle, if the function simply calls another + function or handle with some of its parameters bound to certain + values. Example: + + f = @(x) sum (x, 1); + + When f is called, the call is forwarded to @sum with the constant 1 + appended, and the anonymous function call does not occur on the + call stack. + + ** For compatibility with Matlab, mu2lin (x) is now equivalent to + mu2lin (x, 0). + + ** The new function `history_control' may be used to control the way + command lines are added to the history list when Octave is using + readline for command-line editing. For example + + history_control ("ignoredups") + + tells Octave to avoid adding duplicate lines to the history list. + + ** Octave now uses the gnulib library for improved portability and to + avoid bugs in operating system functions. + + ** Deprecated functions. + + The following functions were deprecated in Octave 3.0 and have been + removed from Octave 3.4. + + beta_cdf geometric_pdf pascal_pdf + beta_inv geometric_rnd pascal_rnd + beta_pdf hypergeometric_cdf poisson_cdf + beta_rnd hypergeometric_inv poisson_inv + binomial_cdf hypergeometric_pdf poisson_pdf + binomial_inv hypergeometric_rnd poisson_rnd + binomial_pdf intersection polyinteg + binomial_rnd is_bool setstr + chisquare_cdf is_complex struct_contains + chisquare_inv is_list struct_elements + chisquare_pdf is_matrix t_cdf + chisquare_rnd is_scalar t_inv + clearplot is_square t_pdf + clg is_stream t_rnd + com2str is_struct uniform_cdf + exponential_cdf is_symmetric uniform_inv + exponential_inv is_vector uniform_pdf + exponential_pdf isstr uniform_rnd + exponential_rnd lognormal_cdf weibcdf + f_cdf lognormal_inv weibinv + f_inv lognormal_pdf weibpdf + f_pdf lognormal_rnd weibrnd + f_rnd meshdom weibull_cdf + gamma_cdf normal_cdf weibull_inv + gamma_inv normal_inv weibull_pdf + gamma_pdf normal_pdf weibull_rnd + gamma_rnd normal_rnd wiener_rnd + geometric_cdf pascal_cdf + geometric_inv pascal_inv + + The following functions were deprecated in Octave 3.2 and will + be removed from Octave 3.6 (or whatever version is the second major + release after 3.2): + + create_set spcholinv splu + dmult spcumprod spmax + iscommand spcumsum spmin + israwcommand spdet spprod + lchol spdiag spqr + loadimage spfind spsum + mark_as_command sphcat spsumsq + mark_as_rawcommand spinv spvcat + spatan2 spkron str2mat + spchol splchol unmark_command + spchol2inv split unmark_rawcommand + + The following functions have been deprecated in Octave 3.4 and will + be removed from Octave 3.8 (or whatever version is the second major + release after 3.4): + + autocor cellidx gammai is_global replot values + autocov dispatch glpkmex krylovb saveimage + betai fstat intwarning perror strerror + +Summary of important user-visible changes for version 3.2: +--------------------------------------------------------- + + ** Compatibility with Matlab graphics has been improved. + + The hggroup object and associated listener callback functions have + been added allowing the inclusion of group objects. Data sources + have been added to these group objects such that + + x = 0:0.1:10; + y = sin (x); + plot (x, y, "ydatasource", "y"); + for i = 1 : 100 + pause(0.1) + y = sin (x + 0.1 * i); + refreshdata (); + endfor + + works as expected. This capability has be used to introduce + stem-series, bar-series, etc., objects for better Matlab + compatibility. + + ** New graphics functions: + + addlistener ezcontour gcbo refresh + addproperty ezcontourf ginput refreshdata + allchild ezmesh gtext specular + available_graphics_toolkits ezmeshc intwarning surfl + graphics_toolkit ezplot ishghandle trisurf + cla ezplot3 isocolors waitforbuttonpress + clabel ezpolar isonormals + comet ezsurf isosurface + dellistener findall linkprop + diffuse gcbf plotmatrix + + ** New experimental OpenGL/FLTK based plotting system. + + An experimental plotting system based on OpenGL and the FLTK + toolkit is now part of Octave. This graphics toolkit is disabled by + default. You can switch to using it with the command + + graphics_toolkit ("fltk") + + for all future figures or for a particular figure with the command + + graphics_toolkit (h, "fltk") + + where "h" is a valid figure handle. + + ** Functions providing direct access to gnuplot have been removed. + + The functions __gnuplot_plot__, __gnuplot_set__, __gnuplot_raw__, + __gnuplot_show__, __gnuplot_replot__, __gnuplot_splot__, + __gnuplot_save_data__ and __gnuplot_send_inline_data__ have been + removed from Octave. These function were incompatible with the + high level graphics handle code. + + ** The Control, Finance and Quaternion functions have been removed. + + These functions are now available as separate packages from + + http://octave.sourceforge.net/packages.html + + and can be reinstalled using the Octave package manager (see + the pkg function). + + ** Specific sparse matrix functions removed. + + The following functions, which handled only sparse matrices have + been removed. Instead of calling these functions directly, you + should use the corresponding function without the "sp" prefix. + + spatan2 spcumsum spkron spprod + spchol spdet splchol spqr + spchol2inv spdiag splu spsum + spcholinv spfind spmax spsumsqk + spcumprod spinv spmin + + ** Improvements to the debugger. + + The interactive debugging features have been improved. Stopping + on statements with dbstop should work correctly now. Stepping + into and over functions, and stepping one statement at a time + (with dbstep) now works. Moving up and down the call stack with + dbup and dbdown now works. The dbstack function is now available + to print the current function call stack. The new dbquit function + is available to exit the debugging mode. + + ** Improved traceback error messages. + + Traceback error messages are much more concise and easier to + understand. They now display information about the function call + stack instead of the stack of all statements that were active at + the point of the error. + + ** Object Oriented Programming. + + Octave now includes OOP features and the user can create their own + class objects and overloaded functions and operators. For + example, all methods of a class called "myclass" will be found in + a directory "@myclass" on the users path. The class specific + versions of functions and operators take precedence over the + generic versions of these functions. + + New functions related to OOP include + + class inferiorto isobject loadobj methods superiorto + + See the Octave manual for more details. + + ** Parsing of Command-style Functions. + + Octave now parses command-style functions without needing to first + declare them with "mark_as_command". The rules for recognizing a + command-style function calls are + + * A command must appear as the first word in a statement, + followed by a space. + + * The first character after the space must not be '=' or '(' + + * The next token after the space must not look like a binary + operator. + + These rules should be mostly compatible with the way Matlab parses + command-style function calls and allow users to define commands in + .m files without having to mark them as commands. + + Note that previous versions of Octave allowed expressions like + + x = load -text foo.dat + + but an expression like this will now generate a parse error. In + order to assign the value returned by a function to a variable, + you must use the normal function call syntax: + + x = load ("-text", "foo.dat"); + + ** Block comments. + + Commented code can be between matching "#{" and "#}" or "%{" and + "%}" markers, even if the commented code spans several line. This + allows blocks code to be commented, without needing to comment + each line. For example, + + function [s, t] = func (x, y) + s = 2 * x; + #{ + s *= y; + t = y + x; + #} + endfunction + + the lines "s *= y;" and "t = y + x" will not be executed. + + ** If any subfunction in a file ends with "end" or "endfunction", then + they all must end that way. Previously, Octave accepted + + function main () + ... + # no endfunction here. + function sub () + ... + endfunction + + but this is no longer allowed. + + ** Special treatment in the parser of expressions like "a' * b". + + In these cases the transpose is no longer explicitly formed and + BLAS libraries are called with the transpose flagged, + significantly improving performance for these kinds of + operations. + + ** Single Precision data type. + + Octave now includes a single precision data type. Single + precision variables can be created with the "single" command, or + from functions like ones, eye, etc. For example, + + single (1) + ones (2, 2, "single") + zeros (2, 2, "single") + eye (2, 2, "single") + Inf (2, 2, "single") + NaN (2, 2, "single") + NA (2, 2, "single") + + all create single precision variables. For compatibility with + Matlab, mixed double/single precision operators and functions + return single precision types. + + As a consequence of this addition to Octave the internal + representation of the double precision NA value has changed, and + so users that make use of data generated by Octave with R or + visa-versa are warned that compatibility might not be assured. + + ** Improved array indexing. + + The underlying code used for indexing of arrays has been + completely rewritten and indexing is now significantly faster. + + ** Improved memory management. + + Octave will now attempt to share data in some cases where previously + a copy would be made, such as certain array slicing operations or + conversions between cells, structs and cs-lists. This usually reduces + both time and memory consumption. + Also, Octave will now attempt to detect and optimize usage of a vector + as a stack, when elements are being repeatedly inserted at/removed from + the end of the vector. + + ** Improved performance for reduction operations. + + The performance of the sum, prod, sumsq, cumsum, cumprod, any, all, + max and min functions has been significantly improved. + + ** Sorting and searching. + + The performance of sort has been improved, especially when sorting + indices are requested. An efficient built-in issorted + implementation was added. The sortrows function now uses a more + efficient algorithm, especially in the homogeneous case. The lookup + function is now a built-in function performing a binary search, + optimized for long runs of close elements. Lookup also works with + cell arrays of strings. + + ** Range arithmetics + + For some operations on ranges, Octave will attempt to keep the + result as a range. These include negation, adding a scalar, + subtracting a scalar, and multiplying by a scalar. Ranges with zero + increment are allowed and can be constructed using the built-in + function `ones'. + + ** Various performance improvements. + + Performance of a number of other built-in operations and functions + was improved, including: + + * logical operations + * comparison operators + * element-wise power + * accumarray + * cellfun + * isnan + * isinf + * isfinite + * nchoosek + * repmat + * strcmp + + ** 64-bit integer arithmetic. + + Arithmetic with 64-bit integers (int64 and uint64 types) is fully + supported, with saturation semantics like the other integer types. + Performance of most integer arithmetic operations has been + improved by using integer arithmetic directly. Previously, Octave + performed integer math with saturation semantics by converting the + operands to double precision, performing the operation, and then + converting the result back to an integer value, truncating if + necessary. + + ** Diagonal and permutation matrices. + + The interpreter can now treat diagonal and permutation matrices as + special objects that store only the non-zero elements, rather than + general full matrices. Therefore, it is now possible to construct + and use these matrices in linear algebra without suffering a + performance penalty due to storing large numbers of zero elements. + + ** Improvements to fsolve. + + The fsolve function now accepts an option structure argument (see + also the optimset function). The INFO values returned from fsolve + have changed to be compatible with Matlab's fsolve function. + Additionally, fsolve is now able to solve overdetermined systems, + complex-differentiable complex systems, systems with a sparse + jacobian and can work in single precision if given single precision + inputs. It can also be called recursively. + + ** Improvements to the norm function. + + The norm function is now able to compute row or column norms of a + matrix in a single call, as well as general matrix p-norms. + + ** New functions for computing some eigenvalues or singular values. + + The eigs and svds functions have been included in Octave. These + functions require the ARPACK library (now distributed under a + GPL-compatible license). + + ** New QR and Cholesky factorization updating functions. + + choldelete cholshift qrdelete qrshift + cholinsert cholupdate qrinsert qrupdate + + ** New quadrature functions. + + dblquad quadgk quadv triplequad + + ** New functions for reading and writing images. + + The imwrite and imread functions have been included in Octave. + These functions require the GraphicsMagick library. The new + function imfinfo provides information about an image file (size, + type, colors, etc.) + + ** The input_event_hook function has been replaced by the pair of + functions add_input_event_hook and remove_input_event_hook so that + more than one hook function may be installed at a time. + + ** Other miscellaneous new functions. + + addtodate hypot reallog + bicgstab idivide realpow + cellslices info realsqrt + cgs interp1q rectint + command_line_path isdebugmode regexptranslate + contrast isfloat restoredefaultpath + convn isstrprop roundb + cummin log1p rundemos + cummax lsqnonneg runlength + datetick matlabroot saveobj + display namelengthmax spaugment + expm1 nargoutchk strchr + filemarker pathdef strvcat + fstat perl subspace + full prctile symvar + fzero quantile treelayout + genvarname re_read_readline_init_file validatestring + histc + + ** Changes to strcat. + + The strcat function is now compatible with Matlab's strcat + function, which removes trailing whitespace when concatenating + character strings. For example + + strcat ('foo ', 'bar') + ==> 'foobar' + + The new function cstrcat provides the previous behavior of + Octave's strcat. + + ** Improvements to the help functions. + + The help system has been mostly re-implemented in .m files to make + it easier to modify. Performance of the lookfor function has been + greatly improved by caching the help text from all functions that + are distributed with Octave. The pkg function has been modified + to generate cache files for external packages when they are + installed. + + ** Deprecated functions. + + The following functions were deprecated in Octave 3.0 and will be + removed from Octave 3.4 (or whatever version is the second major + release after 3.0): + + beta_cdf geometric_pdf pascal_pdf + beta_inv geometric_rnd pascal_rnd + beta_pdf hypergeometric_cdf poisson_cdf + beta_rnd hypergeometric_inv poisson_inv + binomial_cdf hypergeometric_pdf poisson_pdf + binomial_inv hypergeometric_rnd poisson_rnd + binomial_pdf intersection polyinteg + binomial_rnd is_bool setstr + chisquare_cdf is_complex struct_contains + chisquare_inv is_list struct_elements + chisquare_pdf is_matrix t_cdf + chisquare_rnd is_scalar t_inv + clearplot is_square t_pdf + clg is_stream t_rnd + com2str is_struct uniform_cdf + exponential_cdf is_symmetric uniform_inv + exponential_inv is_vector uniform_pdf + exponential_pdf isstr uniform_rnd + exponential_rnd lognormal_cdf weibcdf + f_cdf lognormal_inv weibinv + f_inv lognormal_pdf weibpdf + f_pdf lognormal_rnd weibrnd + f_rnd meshdom weibull_cdf + gamma_cdf normal_cdf weibull_inv + gamma_inv normal_inv weibull_pdf + gamma_pdf normal_pdf weibull_rnd + gamma_rnd normal_rnd wiener_rnd + geometric_cdf pascal_cdf + geometric_inv pascal_inv + + The following functions are now deprecated in Octave 3.2 and will + be removed from Octave 3.6 (or whatever version is the second major + release after 3.2): + + create_set spcholinv spmax + dmult spcumprod spmin + iscommand spcumsum spprod + israwcommand spdet spqr + lchol spdiag spsum + loadimage spfind spsumsq + mark_as_command spinv str2mat + mark_as_rawcommand spkron unmark_command + spatan2 splchol unmark_rawcommand + spchol split + spchol2inv splu + Summary of important user-visible changes for version 3.0: --------------------------------------------------------- @@ -196,5 +1716,6 @@ the distributions using the standard scale factor rather than one over the scale factor. +--------------------------------------------------------- See NEWS.2 for old news. diff -r a99bbbcf743c -r 7721e78b1337 etc/RELEASE.PROCESS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/etc/RELEASE.PROCESS Sun Dec 15 19:42:24 2013 -0800 @@ -0,0 +1,84 @@ + + +==3.8 Release Tasks== + +This page shows the tasks to be completed before the 3.8 release is finalized. + + +# File bug reports for all outstanding bugs known, but not reported +#: Completion Date: 10/16/2013 +## Put out a general call for reports on Octave-Maintainers and Octave-Help list +##: Completion Date: 10/9/2013 + +# Review patch tracker/bug list for any patches submitted that may be included before release +#: Completion Date: 10/24/2013 + +# Identify Bugs which *must* be fixed prior to release +#: Completion Date: 10/20/2013 +## Start discussion about criteria on octave-maintainers list +## Possible Criteria: +##* Severity >= 4 +##* Item Group == ("Crash" or "Regression") +##* Item Group == "Build Failure" +## Review bugs on tracker for possible inclusion in list +## Review bugs and update to correct category, such as Patch Submitted. + +# Clear all bugs identified as must-fix +#: Completion Date: 10/26/2013 +## See [[3.8 Bug Fix List]] + +# GPL License activities +## Update Copyright statements for all source controlled files +## Add any new contributors to contributors.in + +# Style-check code base +## This will produce lots of whitespace changes, but no behavior changes. +## Must occur after patches have been added since whitespace changes will often prevent patches from applying. + +# Run lint checker on code base +## cppcheck, Clang sanitize, etc. + +# Verify 'make check' is passing +## Start discussion on octave-maintainers list about which failing tests must be fixed +## Identify and fix any tests determined critical in step above + +# Run Octave test suite under Valgrind to check for memory leaks +## Done: 10/17/13 + +# Review documentation +## Grammar check documentation so that it conforms to Octave standards +## Spellcheck documentation +## Verify no functions missing from manual +## Verify deprecated functions removed from seealso links +## Verify all formats (Info, HTML, pdf) build correctly +## Review NEWS for any features which should be announced + +# Localization and Internationalization +## Submit call for translations for GUI strings. +## Completion Date: 11/1/13 + +# Verify build process and create release candidates +## Update version information in configure.ac/Makefile.am +## Verify 'make distcheck' passes +## Create release candidate +### 'make dist' +### hg tag repository with release candidate ID +### For Windows, create installer [[Windows Installer]] +### Upload release candidate +### Announce release candidate to Octave-Maintainers, Octave-Help, on web page +### Repeat release candidate cycle until clean + +# Final Release +## hg tag repository with release +## merge default onto stable to become the current stable release +## add new release version to Savannah bug tracker +## Announce final release on Octave mailing lists and web site + +# Post-Release +## Update configure.ac/Makefile.am versioning to next release cycle +## Remove all deprecated functions scheduled for deletion in 4.0 from default branch + +[[Category:Releases]] diff -r a99bbbcf743c -r 7721e78b1337 libinterp/corefcn/error.cc --- a/libinterp/corefcn/error.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/corefcn/error.cc Sun Dec 15 19:42:24 2013 -0800 @@ -61,7 +61,7 @@ // TRUE means that Octave will try to display a stack trace when a // warning is encountered. -static bool Vbacktrace_on_warning = false; +static bool Vbacktrace_on_warning = true; // TRUE means that Octave will print a verbose warning. Currently unused. static bool Vverbose_warning; @@ -1225,6 +1225,7 @@ @deftypefnx {Built-in Function} {} warning (\"off\", @var{id})\n\ @deftypefnx {Built-in Function} {} warning (\"query\", @var{id})\n\ @deftypefnx {Built-in Function} {} warning (\"error\", @var{id})\n\ +@deftypefnx {Built-in Function} {} warning (@var{state}, \"backtrace\")\n\ @deftypefnx {Built-in Function} {} warning (@var{state}, @var{id}, \"local\")\n\ Format the optional arguments under the control of the template string\n\ @var{template} using the same rules as the @code{printf} family of\n\ @@ -1255,6 +1256,11 @@ @end group\n\ @end example\n\ \n\ +If the state is @qcode{\"on\"} or @qcode{\"off\"} and the third argument\n\ +is @qcode{\"backtrace\"}, then a stack trace is printed along with the\n\ +warning message when warnings occur inside function calls. This option\n\ +is enabled by default.\n\ +\n\ If the state is @qcode{\"on\"}, @qcode{\"off\"}, or @qcode{\"error\"}\n\ and the third argument is @qcode{\"local\"}, then the warning state\n\ will be set temporarily, until the end of the current function.\n\ @@ -1636,9 +1642,6 @@ disable_warning ("Octave:str-to-num"); disable_warning ("Octave:mixed-string-concat"); disable_warning ("Octave:variable-switch-label"); - - // This should be an error unless we are in maximum braindamage mode. - set_warning_state ("Octave:noninteger-range-as-index", "error"); } DEFUN (lasterror, args, , diff -r a99bbbcf743c -r 7721e78b1337 libinterp/corefcn/file-io.cc --- a/libinterp/corefcn/file-io.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/corefcn/file-io.cc Sun Dec 15 19:42:24 2013 -0800 @@ -1548,14 +1548,14 @@ The optional argument @var{arch} is a string specifying the data format\n\ for the file. Valid values are\n\ \n\ -@table @code\n\ +@table @asis\n\ @item @qcode{\"native\"}\n\ The format of the current machine.\n\ \n\ -@item \"ieee-be\"\n\ +@item @qcode{\"ieee-be\"}\n\ IEEE big endian.\n\ \n\ -@item \"ieee-le\"\n\ +@item @qcode{\"ieee-le\"}\n\ IEEE little endian.\n\ @end table\n\ \n\ diff -r a99bbbcf743c -r 7721e78b1337 libinterp/corefcn/max.cc --- a/libinterp/corefcn/max.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/corefcn/max.cc Sun Dec 15 19:42:24 2013 -0800 @@ -560,6 +560,10 @@ %! assert (ndims(i), 2); %! assert (i, [1, 1; 1, 1]); +## Test for bug #40743 +%!assert (max (zeros (1,0), ones (1,1)), zeros (1,0)) +%!assert (max (sparse (zeros (1,0)), sparse (ones (1,1))), sparse (zeros (1,0))) + %!error max () %!error max (1, 2, 3, 4) */ diff -r a99bbbcf743c -r 7721e78b1337 libinterp/corefcn/toplev.cc diff -r a99bbbcf743c -r 7721e78b1337 libinterp/corefcn/utils.cc --- a/libinterp/corefcn/utils.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/corefcn/utils.cc Sun Dec 15 19:42:24 2013 -0800 @@ -1306,9 +1306,6 @@ { unwind_protect frame; - frame.protect_var (Vallow_noninteger_range_as_index); - Vallow_noninteger_range_as_index = false; - frame.protect_var (error_state); frame.protect_var (discard_error_messages); @@ -1316,7 +1313,8 @@ try { - idx_vector idx = args(0).index_vector (); + idx_vector idx = args(0).index_vector (true); + if (! error_state) { if (nargin == 2) diff -r a99bbbcf743c -r 7721e78b1337 libinterp/corefcn/variables.cc diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-base-diag.cc --- a/libinterp/octave-value/ov-base-diag.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-base-diag.cc Sun Dec 15 19:42:24 2013 -0800 @@ -412,9 +412,9 @@ template idx_vector -octave_base_diag::index_vector (void) const +octave_base_diag::index_vector (bool require_integers) const { - return to_dense ().index_vector (); + return to_dense ().index_vector (require_integers); } template diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-base-diag.h --- a/libinterp/octave-value/ov-base-diag.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-base-diag.h Sun Dec 15 19:42:24 2013 -0800 @@ -133,7 +133,7 @@ double scalar_value (bool frc_str_conv = false) const { return double_value (frc_str_conv); } - idx_vector index_vector (void) const; + idx_vector index_vector (bool /* require_integers */ = false) const; Matrix matrix_value (bool = false) const; diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-base.cc --- a/libinterp/octave-value/ov-base.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-base.cc Sun Dec 15 19:42:24 2013 -0800 @@ -214,7 +214,7 @@ } idx_vector -octave_base_value::index_vector (void) const +octave_base_value::index_vector (bool /* require_integers */) const { std::string nm = type_name (); error ("%s type invalid as index value", nm.c_str ()); diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-base.h --- a/libinterp/octave-value/ov-base.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-base.h Sun Dec 15 19:42:24 2013 -0800 @@ -287,7 +287,7 @@ const std::list& idx, const octave_value& rhs); - virtual idx_vector index_vector (void) const; + virtual idx_vector index_vector (bool require_integers = false) const; virtual dim_vector dims (void) const { return dim_vector (); } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-bool-mat.h --- a/libinterp/octave-value/ov-bool-mat.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-bool-mat.h Sun Dec 15 19:42:24 2013 -0800 @@ -88,8 +88,10 @@ octave_base_value *try_narrowing_conversion (void); - idx_vector index_vector (void) const - { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } + idx_vector index_vector (bool /* require_integers */ = false) const + { + return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); + } builtin_type_t builtin_type (void) const { return btyp_bool; } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-bool-sparse.h --- a/libinterp/octave-value/ov-bool-sparse.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-bool-sparse.h Sun Dec 15 19:42:24 2013 -0800 @@ -86,8 +86,10 @@ octave_base_value *try_narrowing_conversion (void); // FIXME Adapt idx_vector to allow sparse logical indexing without overflow!! - idx_vector index_vector (void) const - { return idx_vector (matrix); } + idx_vector index_vector (bool /* require_integers */ = false) const + { + return idx_vector (matrix); + } builtin_type_t builtin_type (void) const { return btyp_bool; } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-bool.h --- a/libinterp/octave-value/ov-bool.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-bool.h Sun Dec 15 19:42:24 2013 -0800 @@ -72,7 +72,7 @@ octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false); - idx_vector index_vector (void) const { return idx_vector (scalar); } + idx_vector index_vector (bool /* require_integers */ = false) const { return idx_vector (scalar); } builtin_type_t builtin_type (void) const { return btyp_bool; } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-ch-mat.cc --- a/libinterp/octave-value/ov-ch-mat.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-ch-mat.cc Sun Dec 15 19:42:24 2013 -0800 @@ -42,7 +42,7 @@ template class octave_base_matrix; idx_vector -octave_char_matrix::index_vector (void) const +octave_char_matrix::index_vector (bool /* require_integers */) const { const char *p = matrix.data (); if (numel () == 1 && *p == ':') diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-ch-mat.h --- a/libinterp/octave-value/ov-ch-mat.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-ch-mat.h Sun Dec 15 19:42:24 2013 -0800 @@ -87,7 +87,7 @@ octave_base_value *empty_clone (void) const { return new octave_char_matrix (); } - idx_vector index_vector (void) const; + idx_vector index_vector (bool require_integers = false) const; builtin_type_t builtin_type (void) const { return btyp_char; } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-class.cc --- a/libinterp/octave-value/ov-class.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-class.cc Sun Dec 15 19:42:24 2013 -0800 @@ -991,7 +991,7 @@ } idx_vector -octave_class::index_vector (void) const +octave_class::index_vector (bool require_integers) const { idx_vector retval; @@ -1014,7 +1014,7 @@ // add one to the value returned as the index_vector method // expects it to be one based. retval = do_binary_op (octave_value::op_add, tmp (0), - octave_value (1.0)).index_vector (); + octave_value (1.0)).index_vector (require_integers); } } else @@ -2016,33 +2016,113 @@ %!error class () */ -DEFUN (__isa_parent__, args, , +DEFUN (isa, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} __isa_parent__ (@var{class}, @var{name})\n\ -Undocumented internal function.\n\ +@deftypefn {Function File} {} isa (@var{obj}, @var{classname})\n\ +Return true if @var{obj} is an object from the class @var{classname}.\n\ +\n\ +@var{classname} may also be one of the following class categories:\n\ +\n\ +@table @asis\n\ +@item @qcode{\"float\"}\n\ +Floating point value comprising classes @qcode{\"double\"} and\n\ +@qcode{\"single\"}.\n\ +\n\ +@item @qcode{\"integer\"}\n\ +Integer value comprising classes (u)int8, (u)int16, (u)int32, (u)int64.\n\ +\n\ +@item @qcode{\"numeric\"}\n\ +Numeric value comprising either a floating point or integer value.\n\ +@end table\n\ +\n\ +If @var{classname} is a cell array of string, a logical array of the same\n\ +size is returned, containing true for each class to which @var{obj}\n\ +belongs to.\n\ +\n\ +@seealso{class, typeinfo}\n\ @end deftypefn") { - octave_value retval = false; - - if (args.length () == 2) + octave_value retval; + + if (args.length () != 2) + { + print_usage (); + return retval; + } + + octave_value obj = args(0); // not const because of find_parent_class () + const Array cls = args(1).cellstr_value (); + if (error_state) + { + error ("isa: CLASSNAME must be a string or cell attay of strings"); + return retval; + } + + boolNDArray matches (cls.dims (), false); + const octave_idx_type n = cls.numel (); + for (octave_idx_type idx = 0; idx < n; idx++) { - octave_value cls = args(0); - octave_value nm = args(1); - - if (! error_state) - { - if (cls.find_parent_class (nm.string_value ())) - retval = true; - } - else - error ("__isa_parent__: expecting arguments to be character strings"); + const std::string cl = cls(idx); + if ((cl == "float" && obj.is_float_type ()) || + (cl == "integer" && obj.is_integer_type ()) || + (cl == "numeric" && obj.is_numeric_type ()) || + obj.class_name () == cl || obj.find_parent_class (cl)) + matches(idx) = true; } - else - print_usage (); - - return retval; + return octave_value (matches); } +/* +%!assert (isa ("char", "float"), false) +%!assert (isa (logical (1), "float"), false) +%!assert (isa (double (13), "float"), true) +%!assert (isa (single (13), "float"), true) +%!assert (isa (int8 (13), "float"), false) +%!assert (isa (int16 (13), "float"), false) +%!assert (isa (int32 (13), "float"), false) +%!assert (isa (int64 (13), "float"), false) +%!assert (isa (uint8 (13), "float"), false) +%!assert (isa (uint16 (13), "float"), false) +%!assert (isa (uint32 (13), "float"), false) +%!assert (isa (uint64 (13), "float"), false) +%!assert (isa ("char", "numeric"), false) +%!assert (isa (logical (1), "numeric"), false) +%!assert (isa (double (13), "numeric"), true) +%!assert (isa (single (13), "numeric"), true) +%!assert (isa (int8 (13), "numeric"), true) +%!assert (isa (int16 (13), "numeric"), true) +%!assert (isa (int32 (13), "numeric"), true) +%!assert (isa (int64 (13), "numeric"), true) +%!assert (isa (uint8 (13), "numeric"), true) +%!assert (isa (uint16 (13), "numeric"), true) +%!assert (isa (uint32 (13), "numeric"), true) +%!assert (isa (uint64 (13), "numeric"), true) +%!assert (isa (uint8 (13), "integer"), true) +%!assert (isa (double (13), "integer"), false) +%!assert (isa (single (13), "integer"), false) +%!assert (isa (single (13), {"integer", "float", "single"}), [false true true]) + +%!assert (isa (double (13), "double")) +%!assert (isa (single (13), "single")) +%!assert (isa (int8 (13), "int8")) +%!assert (isa (int16 (13), "int16")) +%!assert (isa (int32 (13), "int32")) +%!assert (isa (int64 (13), "int64")) +%!assert (isa (uint8 (13), "uint8")) +%!assert (isa (uint16 (13), "uint16")) +%!assert (isa (uint32 (13), "uint32")) +%!assert (isa (uint64 (13), "uint64")) +%!assert (isa ("string", "char")) +%!assert (isa (true, "logical")) +%!assert (isa (false, "logical")) +%!assert (isa ({1, 2}, "cell")) +%!assert (isa ({1, 2}, {"numeric", "integer", "cell"}), [false false true]) + +%!test +%! a.b = 1; +%! assert (isa (a, "struct")); +*/ + DEFUN (__parent_classes__, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __parent_classes__ (@var{x})\n\ diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-class.h --- a/libinterp/octave-value/ov-class.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-class.h Sun Dec 15 19:42:24 2013 -0800 @@ -115,7 +115,7 @@ const std::list& idx, const octave_value& rhs); - idx_vector index_vector (void) const; + idx_vector index_vector (bool require_integers = false) const; dim_vector dims (void) const { return map.dims (); } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-colon.h --- a/libinterp/octave-value/ov-colon.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-colon.h Sun Dec 15 19:42:24 2013 -0800 @@ -59,7 +59,7 @@ octave_base_value *empty_clone (void) const { return new octave_magic_colon (); } - idx_vector index_vector (void) const { return idx_vector (':'); } + idx_vector index_vector (bool /* require_integers */ = false) const { return idx_vector (':'); } bool is_defined (void) const { return true; } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-complex.h --- a/libinterp/octave-value/ov-complex.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-complex.h Sun Dec 15 19:42:24 2013 -0800 @@ -80,7 +80,7 @@ bool resize_ok = false); // Use this to give a more specific error message - idx_vector index_vector (void) const + idx_vector index_vector (bool /* require_integers */ = false) const { error ("attempted to use a complex scalar as an index\n" " (forgot to initialize i or j?)"); diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-float.h --- a/libinterp/octave-value/ov-float.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-float.h Sun Dec 15 19:42:24 2013 -0800 @@ -77,7 +77,7 @@ octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false); - idx_vector index_vector (void) const { return idx_vector (scalar); } + idx_vector index_vector (bool /* require_integers */ = false) const { return idx_vector (scalar); } octave_value any (int = 0) const { return (scalar != 0 && ! lo_ieee_isnan (scalar)); } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-flt-re-mat.h --- a/libinterp/octave-value/ov-flt-re-mat.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-flt-re-mat.h Sun Dec 15 19:42:24 2013 -0800 @@ -89,8 +89,10 @@ octave_base_value *try_narrowing_conversion (void); - idx_vector index_vector (void) const - { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } + idx_vector index_vector (bool /* require_integers */ = false) const + { + return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); + } builtin_type_t builtin_type (void) const { return btyp_float; } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-intx.h --- a/libinterp/octave-value/ov-intx.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-intx.h Sun Dec 15 19:42:24 2013 -0800 @@ -303,8 +303,10 @@ matrix_ref ().changesign (); } - idx_vector index_vector (void) const - { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } + idx_vector index_vector (bool /* require_integers */ = false) const + { + return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); + } int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, @@ -606,7 +608,7 @@ scalar -= OCTAVE_INT_T (1); } - idx_vector index_vector (void) const { return idx_vector (scalar); } + idx_vector index_vector (bool /* require_integers */ = false) const { return idx_vector (scalar); } int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, octave_idx_type skip, diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-lazy-idx.h --- a/libinterp/octave-value/ov-lazy-idx.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-lazy-idx.h Sun Dec 15 19:42:24 2013 -0800 @@ -59,8 +59,7 @@ octave_value full_value (void) const { return make_value (); } - idx_vector index_vector (void) const - { return index; } + idx_vector index_vector (bool /* require_integers */ = false) const { return index; } builtin_type_t builtin_type (void) const { return btyp_double; } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-perm.cc --- a/libinterp/octave-value/ov-perm.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-perm.cc Sun Dec 15 19:42:24 2013 -0800 @@ -245,9 +245,9 @@ FORWARD_MATRIX_VALUE (charNDArray, char_array) idx_vector -octave_perm_matrix::index_vector (void) const +octave_perm_matrix::index_vector (bool require_integers) const { - return to_dense ().index_vector (); + return to_dense ().index_vector (require_integers); } octave_value diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-perm.h --- a/libinterp/octave-value/ov-perm.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-perm.h Sun Dec 15 19:42:24 2013 -0800 @@ -131,7 +131,7 @@ double scalar_value (bool frc_str_conv = false) const { return double_value (frc_str_conv); } - idx_vector index_vector (void) const; + idx_vector index_vector (bool require_integers = false) const; PermMatrix perm_matrix_value (void) const { return matrix; } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-range.cc --- a/libinterp/octave-value/ov-range.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-range.cc Sun Dec 15 19:42:24 2013 -0800 @@ -46,7 +46,7 @@ #include "ls-utils.h" // If TRUE, allow ranges with non-integer elements as array indices. -bool Vallow_noninteger_range_as_index = false; +static bool Vallow_noninteger_range_as_index = true; DEFINE_OCTAVE_ALLOCATOR (octave_range); @@ -148,13 +148,14 @@ } idx_vector -octave_range::index_vector (void) const +octave_range::index_vector (bool require_integers) const { if (idx_cache) return *idx_cache; else { - if (! Vallow_noninteger_range_as_index + if (require_integers + || ! Vallow_noninteger_range_as_index || range.all_elements_are_ints ()) return set_idx_cache (idx_vector (range)); else @@ -690,6 +691,14 @@ The original variable value is restored when exiting the function.\n\ @end deftypefn") { + static bool warned = false; + if (! warned) + { + warned = true; + warning_with_id ("Octave:deprecated-function", + "allow_noninteger_range_as_index is obsolete and will be removed from a future version of Octave"); + } + return SET_INTERNAL_VARIABLE (allow_noninteger_range_as_index); } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-range.h --- a/libinterp/octave-value/ov-range.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-range.h Sun Dec 15 19:42:24 2013 -0800 @@ -104,7 +104,7 @@ octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false); - idx_vector index_vector (void) const; + idx_vector index_vector (bool require_integers = false) const; dim_vector dims (void) const { @@ -317,7 +317,4 @@ DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA }; -// If TRUE, allow ranges with non-integer elements as array indices. -extern bool Vallow_noninteger_range_as_index; - #endif diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-re-mat.h --- a/libinterp/octave-value/ov-re-mat.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-re-mat.h Sun Dec 15 19:42:24 2013 -0800 @@ -104,7 +104,7 @@ octave_base_value *try_narrowing_conversion (void); - idx_vector index_vector (void) const + idx_vector index_vector (bool /* require_integers */ = false) const { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } builtin_type_t builtin_type (void) const { return btyp_double; } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-re-sparse.cc --- a/libinterp/octave-value/ov-re-sparse.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-re-sparse.cc Sun Dec 15 19:42:24 2013 -0800 @@ -55,7 +55,7 @@ "double"); idx_vector -octave_sparse_matrix::index_vector (void) const +octave_sparse_matrix::index_vector (bool /* require_integers */) const { if (matrix.numel () == matrix.nnz ()) return idx_vector (array_value ()); diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-re-sparse.h --- a/libinterp/octave-value/ov-re-sparse.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-re-sparse.h Sun Dec 15 19:42:24 2013 -0800 @@ -92,7 +92,7 @@ octave_base_value *try_narrowing_conversion (void); - idx_vector index_vector (void) const; + idx_vector index_vector (bool require_integers = false) const; builtin_type_t builtin_type (void) const { return btyp_double; } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov-scalar.h --- a/libinterp/octave-value/ov-scalar.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov-scalar.h Sun Dec 15 19:42:24 2013 -0800 @@ -76,7 +76,7 @@ type_conv_info numeric_demotion_function (void) const; - idx_vector index_vector (void) const { return idx_vector (scalar); } + idx_vector index_vector (bool /* require_integers */ = false) const { return idx_vector (scalar); } octave_value any (int = 0) const { return (scalar != 0 && ! lo_ieee_isnan (scalar)); } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave-value/ov.h --- a/libinterp/octave-value/ov.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave-value/ov.h Sun Dec 15 19:42:24 2013 -0800 @@ -455,8 +455,10 @@ octave_value& assign (assign_op, const octave_value& rhs); - idx_vector index_vector (void) const - { return rep->index_vector (); } + idx_vector index_vector (bool require_integers = false) const + { + return rep->index_vector (require_integers); + } // Size. diff -r a99bbbcf743c -r 7721e78b1337 libinterp/octave.cc --- a/libinterp/octave.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/octave.cc Sun Dec 15 19:42:24 2013 -0800 @@ -482,12 +482,10 @@ FPS1 (octave_value (">> ")); FPS2 (octave_value ("")); FPS4 (octave_value ("")); - Fallow_noninteger_range_as_index (octave_value (true)); Fbeep_on_error (octave_value (true)); Fconfirm_recursive_rmdir (octave_value (false)); Fcrash_dumps_octave_core (octave_value (false)); Fsave_default_options (octave_value ("-mat-binary")); - Fdo_braindead_shortcircuit_evaluation (octave_value (true)); Ffixed_point_format (octave_value (true)); Fhistory_timestamp_format_string (octave_value ("%%-- %D %I:%M %p --%%")); Fpage_screen_output (octave_value (false)); @@ -498,9 +496,6 @@ disable_warning ("Octave:function-name-clash"); disable_warning ("Octave:load-file-in-path"); disable_warning ("Octave:possible-matlab-short-circuit-operator"); - - // Initialized to "error" by default. - set_warning_state ("Octave:noninteger-range-as-index", "on"); } // EMBEDDED is declared int instead of bool because this function is diff -r a99bbbcf743c -r 7721e78b1337 libinterp/parse-tree/lex.ll diff -r a99bbbcf743c -r 7721e78b1337 libinterp/parse-tree/oct-parse.in.yy --- a/libinterp/parse-tree/oct-parse.in.yy Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/parse-tree/oct-parse.in.yy Sun Dec 15 19:42:24 2013 -0800 @@ -943,7 +943,7 @@ if_cmd_list1 : expression stmt_begin opt_sep opt_list { - $1->mark_braindead_shortcircuit (lexer.fcn_file_full_name); + $1->mark_braindead_shortcircuit (); $$ = parser.start_if_command ($1, $4); } @@ -956,7 +956,7 @@ elseif_clause : ELSEIF stash_comment opt_sep expression stmt_begin opt_sep opt_list { - $4->mark_braindead_shortcircuit (lexer.fcn_file_full_name); + $4->mark_braindead_shortcircuit (); $$ = parser.make_elseif_clause ($1, $4, $7, $2); } @@ -1018,7 +1018,7 @@ loop_command : WHILE stash_comment expression stmt_begin opt_sep opt_list END { - $3->mark_braindead_shortcircuit (lexer.fcn_file_full_name); + $3->mark_braindead_shortcircuit (); if (! ($$ = parser.make_while_command ($1, $3, $6, $7, $2))) { diff -r a99bbbcf743c -r 7721e78b1337 libinterp/parse-tree/octave.gperf diff -r a99bbbcf743c -r 7721e78b1337 libinterp/parse-tree/pt-binop.cc --- a/libinterp/parse-tree/pt-binop.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/parse-tree/pt-binop.cc Sun Dec 15 19:42:24 2013 -0800 @@ -36,7 +36,7 @@ // TRUE means we mark | and & expressions for braindead short-circuit // behavior. -static bool Vdo_braindead_shortcircuit_evaluation; +static bool Vdo_braindead_shortcircuit_evaluation = true; // Binary expressions. @@ -54,6 +54,16 @@ return retval; } +void +tree_binary_expression::matlab_style_short_circuit_warning (const char *op) +{ + warning_with_id ("Octave:possible-matlab-short-circuit-operator", + "Matlab-style short-circuit operation performed for operator %s", + op); + + braindead_shortcircuit_warning_issued = true; +} + octave_value tree_binary_expression::rvalue1 (int) { @@ -83,6 +93,7 @@ { if (etype == octave_value::op_el_or) { + matlab_style_short_circuit_warning ("|"); result = true; goto done; } @@ -90,7 +101,10 @@ else { if (etype == octave_value::op_el_and) - goto done; + { + matlab_style_short_circuit_warning ("&"); + goto done; + } } if (op_rhs) @@ -298,6 +312,14 @@ The original variable value is restored when exiting the function.\n\ @end deftypefn") { + static bool warned = false; + if (! warned) + { + warned = true; + warning_with_id ("Octave:deprecated-function", + "do_braindead_shortcircuit_evaluation is obsolete and will be removed from a future version of Octave"); + } + return SET_INTERNAL_VARIABLE (do_braindead_shortcircuit_evaluation); } diff -r a99bbbcf743c -r 7721e78b1337 libinterp/parse-tree/pt-binop.h --- a/libinterp/parse-tree/pt-binop.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/parse-tree/pt-binop.h Sun Dec 15 19:42:24 2013 -0800 @@ -46,14 +46,16 @@ octave_value::binary_op t = octave_value::unknown_binary_op) : tree_expression (l, c), op_lhs (0), op_rhs (0), etype (t), - eligible_for_braindead_shortcircuit (false) { } + eligible_for_braindead_shortcircuit (false), + braindead_shortcircuit_warning_issued (false) { } tree_binary_expression (tree_expression *a, tree_expression *b, int l = -1, int c = -1, octave_value::binary_op t = octave_value::unknown_binary_op) : tree_expression (l, c), op_lhs (a), op_rhs (b), etype (t), - eligible_for_braindead_shortcircuit (false) { } + eligible_for_braindead_shortcircuit (false), + braindead_shortcircuit_warning_issued (false) { } ~tree_binary_expression (void) { @@ -61,23 +63,14 @@ delete op_rhs; } - void mark_braindead_shortcircuit (const std::string& file) + void mark_braindead_shortcircuit (void) { if (etype == octave_value::op_el_and || etype == octave_value::op_el_or) { - if (file.empty ()) - warning_with_id ("Octave:possible-matlab-short-circuit-operator", - "possible Matlab-style short-circuit operator at line %d, column %d", - line (), column ()); - else - warning_with_id ("Octave:possible-matlab-short-circuit-operator", - "%s: possible Matlab-style short-circuit operator at line %d, column %d", - file.c_str (), line (), column ()); - eligible_for_braindead_shortcircuit = true; - op_lhs->mark_braindead_shortcircuit (file); - op_rhs->mark_braindead_shortcircuit (file); + op_lhs->mark_braindead_shortcircuit (); + op_rhs->mark_braindead_shortcircuit (); } } @@ -122,6 +115,12 @@ // or WHILE statement. bool eligible_for_braindead_shortcircuit; + // TRUE if we have already issued a warning about short circuiting + // for this operator. + bool braindead_shortcircuit_warning_issued; + + void matlab_style_short_circuit_warning (const char *op); + // No copying! tree_binary_expression (const tree_binary_expression&); diff -r a99bbbcf743c -r 7721e78b1337 libinterp/parse-tree/pt-exp.h --- a/libinterp/parse-tree/pt-exp.h Sun Dec 15 19:31:18 2013 -0800 +++ b/libinterp/parse-tree/pt-exp.h Sun Dec 15 19:42:24 2013 -0800 @@ -100,7 +100,7 @@ virtual std::string original_text (void) const; - virtual void mark_braindead_shortcircuit (const std::string&) { } + virtual void mark_braindead_shortcircuit (void) { } tree_expression *mark_in_parens (void) { diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/Array-b.cc --- a/liboctave/array/Array-b.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/Array-b.cc Sun Dec 15 19:42:24 2013 -0800 @@ -52,7 +52,8 @@ // FIXME: This is essentially a simple bucket sort. // Can it be efficiently done by std::partition? OCTAVE_LOCAL_BUFFER (octave_idx_type, jdx, nel); - octave_idx_type k = 0, l = 0; + octave_idx_type k = 0; + octave_idx_type l = 0; for (octave_idx_type i = 0; i < nel; i++) { if (data[i] == desc) diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/Array-util.cc --- a/liboctave/array/Array-util.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/Array-util.cc Sun Dec 15 19:42:24 2013 -0800 @@ -423,9 +423,11 @@ dim_vector zero_dims_inquire (const Array& ia, const dim_vector& rhdv) { - int ial = ia.length (), rhdvl = rhdv.length (); + int ial = ia.length (); + int rhdvl = rhdv.length (); dim_vector rdv = dim_vector::alloc (ial); - bool *scalar = new bool [ial], *colon = new bool [ial]; + bool *scalar = new bool [ial]; + bool *colon = new bool [ial]; // Mark scalars and colons, count non-scalar indices. int nonsc = 0; bool all_colons = true; @@ -479,7 +481,8 @@ zero_dims_inquire (const idx_vector& i, const idx_vector& j, const dim_vector& rhdv) { - bool icol = i.is_colon (), jcol = j.is_colon (); + bool icol = i.is_colon (); + bool jcol = j.is_colon (); dim_vector rdv; if (icol && jcol && rhdv.length () == 2) { @@ -563,10 +566,12 @@ else if (all_ranges && clen != 0) { // All ranges case - the result is a range. - octave_idx_type start = 0, step = 0; + octave_idx_type start = 0; + octave_idx_type step = 0; for (octave_idx_type i = len - 1; i >= 0; i--) { - octave_idx_type xstart = idxa(i)(0), xstep = idxa(i)(1) - xstart; + octave_idx_type xstart = idxa(i)(0); + octave_idx_type xstep = idxa(i)(1) - xstart; start = start * dvx(i) + xstart; step = step * dvx(i) + xstep; } @@ -597,7 +602,8 @@ Array ind2sub (const dim_vector& dv, const idx_vector& idx) { - octave_idx_type len = idx.length (0), n = dv.length (); + octave_idx_type len = idx.length (0); + octave_idx_type n = dv.length (); Array retval (dim_vector (n, 1)); octave_idx_type numel = dv.numel (); diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/Array.cc --- a/liboctave/array/Array.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/Array.cc Sun Dec 15 19:42:24 2013 -0800 @@ -270,7 +270,9 @@ Array Array::page (octave_idx_type k) const { - octave_idx_type r = dimensions(0), c = dimensions (1), p = r*c; + octave_idx_type r = dimensions(0); + octave_idx_type c = dimensions(1); + octave_idx_type p = r*c; #ifdef BOUNDS_CHECKING if (k < 0 || k > dimensions.numel (2)) gripe_index_out_of_range (3, 3, k+1, dimensions.numel (2)); @@ -393,7 +395,8 @@ { if (lev == 0) { - octave_idx_type step = stride[0], len = dim[0]; + octave_idx_type step = stride[0]; + octave_idx_type len = dim[0]; if (step == 1) { copy_or_memcpy (len, src, dest); @@ -411,7 +414,8 @@ dest = blk_trans (src, dest, dim[1], dim[0]); else { - octave_idx_type step = stride[lev], len = dim[lev]; + octave_idx_type step = stride[lev]; + octave_idx_type len = dim[lev]; for (octave_idx_type i = 0, j = 0; i < len; i++, j+= step) dest = do_permute (src + i * step, dest, lev-1); } @@ -568,7 +572,8 @@ dest += idx[0].index (src, dim[0], dest); else { - octave_idx_type nn = idx[lev].length (dim[lev]), d = cdim[lev]; + octave_idx_type nn = idx[lev].length (dim[lev]); + octave_idx_type d = cdim[lev]; for (octave_idx_type i = 0; i < nn; i++) dest = do_index (src + d*idx[lev].xelem (i), dest, lev-1); } @@ -584,7 +589,8 @@ src += idx[0].assign (src, dim[0], dest); else { - octave_idx_type nn = idx[lev].length (dim[lev]), d = cdim[lev]; + octave_idx_type nn = idx[lev].length (dim[lev]); + octave_idx_type d = cdim[lev]; for (octave_idx_type i = 0; i < nn; i++) src = do_assign (src, dest + d*idx[lev].xelem (i), lev-1); } @@ -600,7 +606,8 @@ idx[0].fill (val, dim[0], dest); else { - octave_idx_type nn = idx[lev].length (dim[lev]), d = cdim[lev]; + octave_idx_type nn = idx[lev].length (dim[lev]); + octave_idx_type d = cdim[lev]; for (octave_idx_type i = 0; i < nn; i++) do_fill (val, dest + d*idx[lev].xelem (i), lev-1); } @@ -655,7 +662,8 @@ sext = cext + n; dext = sext + n; - octave_idx_type sld = ld, dld = ld; + octave_idx_type sld = ld; + octave_idx_type dld = ld; for (int j = 0; j < n; j++) { cext[j] = std::min (ndv(i+j), odv(i+j)); @@ -680,7 +688,9 @@ } else { - octave_idx_type sd = sext[lev-1], dd = dext[lev-1], k; + octave_idx_type sd = sext[lev-1]; + octave_idx_type dd = dext[lev-1]; + octave_idx_type k; for (k = 0; k < cext[lev]; k++) do_resize_fill (src + k * sd, dest + k * dd, rfv, lev - 1); @@ -771,7 +781,8 @@ { // Get dimensions, allowing Fortran indexing in the 2nd dim. dim_vector dv = dimensions.redim (2); - octave_idx_type r = dv(0), c = dv(1); + octave_idx_type r = dv(0); + octave_idx_type c = dv(1); Array retval; if (i.is_colon () && j.is_colon ()) @@ -786,7 +797,9 @@ if (j.extent (c) != c) gripe_index_out_of_range (2, 2, j.extent (c), c); // throws - octave_idx_type n = numel (), il = i.length (r), jl = j.length (c); + octave_idx_type n = numel (); + octave_idx_type il = i.length (r); + octave_idx_type jl = j.length (c); idx_vector ii (i); @@ -957,7 +970,8 @@ Array tmp = Array (dv); T *dest = tmp.fortran_vec (); - octave_idx_type n0 = std::min (n, nx), n1 = n - n0; + octave_idx_type n0 = std::min (n, nx); + octave_idx_type n1 = n - n0; copy_or_memcpy (n0, data (), dest); fill_or_memset (n1, rfv, dest + n0); @@ -975,14 +989,17 @@ { if (r >= 0 && c >= 0 && ndims () == 2) { - octave_idx_type rx = rows (), cx = columns (); + octave_idx_type rx = rows (); + octave_idx_type cx = columns (); if (r != rx || c != cx) { Array tmp = Array (dim_vector (r, c)); T *dest = tmp.fortran_vec (); - octave_idx_type r0 = std::min (r, rx), r1 = r - r0; - octave_idx_type c0 = std::min (c, cx), c1 = c - c0; + octave_idx_type r0 = std::min (r, rx); + octave_idx_type r1 = r - r0; + octave_idx_type c0 = std::min (c, cx); + octave_idx_type c1 = c - c0; const T *src = data (); if (r == rx) { @@ -1042,7 +1059,8 @@ Array tmp = *this; if (resize_ok) { - octave_idx_type n = numel (), nx = i.extent (n); + octave_idx_type n = numel (); + octave_idx_type nx = i.extent (n); if (n != nx) { if (i.is_scalar ()) @@ -1067,8 +1085,10 @@ if (resize_ok) { dim_vector dv = dimensions.redim (2); - octave_idx_type r = dv(0), c = dv(1); - octave_idx_type rx = i.extent (r), cx = j.extent (c); + octave_idx_type r = dv(0); + octave_idx_type c = dv(1); + octave_idx_type rx = i.extent (r); + octave_idx_type cx = j.extent (c); if (r != rx || c != cx) { if (i.is_scalar () && j.is_scalar ()) @@ -1119,7 +1139,8 @@ void Array::assign (const idx_vector& i, const Array& rhs, const T& rfv) { - octave_idx_type n = numel (), rhl = rhs.numel (); + octave_idx_type n = numel (); + octave_idx_type rhl = rhs.numel (); if (rhl == 1 || i.length (n) == rhl) { @@ -1190,7 +1211,8 @@ } bool isfill = rhs.numel () == 1; - octave_idx_type il = i.length (rdv(0)), jl = j.length (rdv(1)); + octave_idx_type il = i.length (rdv(0)); + octave_idx_type jl = j.length (rdv(1)); rhdv.chop_all_singletons (); bool match = (isfill || (rhdv.length () == 2 && il == rhdv(0) && jl == rhdv(1))); @@ -1228,7 +1250,9 @@ else { // The actual work. - octave_idx_type n = numel (), r = dv (0), c = dv (1); + octave_idx_type n = numel (); + octave_idx_type r = dv(0); + octave_idx_type c = dv(1); idx_vector ii (i); const T* src = rhs.data (); @@ -1299,10 +1323,13 @@ } // Check whether LHS and RHS match, up to singleton dims. - bool match = true, all_colons = true, isfill = rhs.numel () == 1; + bool match = true; + bool all_colons = true; + bool isfill = rhs.numel () == 1; rhdv.chop_all_singletons (); - int j = 0, rhdvl = rhdv.length (); + int j = 0; + int rhdvl = rhdv.length (); for (int i = 0; i < ial; i++) { all_colons = all_colons && ia(i).is_colon_equiv (rdv(i)); @@ -1427,7 +1454,9 @@ if (i.is_cont_range (n, l, u)) { // Special case deleting a contiguous range. - octave_idx_type nd = n + l - u, dl = 1, du = 1; + octave_idx_type nd = n + l - u; + octave_idx_type dl = 1; + octave_idx_type du = 1; dim_vector rdv = dimensions; rdv(dim) = nd; for (int k = 0; k < dim; k++) dl *= dimensions(k); @@ -1776,7 +1805,8 @@ { // copy and partition out NaNs. // FIXME: impact on integer types noticeable? - octave_idx_type kl = 0, ku = ns; + octave_idx_type kl = 0; + octave_idx_type ku = ns; for (octave_idx_type i = 0; i < ns; i++) { T tmp = ov[i]; @@ -1820,7 +1850,8 @@ // gather and partition out NaNs. // FIXME: impact on integer types noticeable? - octave_idx_type kl = 0, ku = ns; + octave_idx_type kl = 0; + octave_idx_type ku = ns; for (octave_idx_type i = 0; i < ns; i++) { T tmp = ov[i*stride + offset]; @@ -1898,7 +1929,8 @@ { // copy and partition out NaNs. // FIXME: impact on integer types noticeable? - octave_idx_type kl = 0, ku = ns; + octave_idx_type kl = 0; + octave_idx_type ku = ns; for (octave_idx_type i = 0; i < ns; i++) { T tmp = ov[i]; @@ -1956,7 +1988,8 @@ // gather and partition out NaNs. // FIXME: impact on integer types noticeable? - octave_idx_type kl = 0, ku = ns; + octave_idx_type kl = 0; + octave_idx_type ku = ns; for (octave_idx_type i = 0; i < ns; i++) { T tmp = ov[i*stride + offset]; @@ -2056,7 +2089,8 @@ octave_sort lsort (safe_comparator (mode, *this, true)); - octave_idx_type r = rows (), c = cols (); + octave_idx_type r = rows (); + octave_idx_type c = cols (); idx = Array (dim_vector (r, 1)); @@ -2072,7 +2106,8 @@ { octave_sort lsort; - octave_idx_type r = rows (), c = cols (); + octave_idx_type r = rows (); + octave_idx_type c = cols (); if (r <= 1 || c == 0) return mode ? mode : ASCENDING; @@ -2086,7 +2121,8 @@ octave_idx_type i; for (i = 0; i < cols (); i++) { - T l = elem (0, i), u = elem (rows () - 1, i); + T l = elem (0, i); + T u = elem (rows () - 1, i); if (compare (l, u)) { if (mode == DESCENDING) @@ -2150,7 +2186,8 @@ Array Array::lookup (const Array& values, sortmode mode) const { - octave_idx_type n = numel (), nval = values.numel (); + octave_idx_type n = numel (); + octave_idx_type nval = values.numel (); octave_sort lsort; Array idx (values.dims ()); @@ -2194,7 +2231,8 @@ Array::nnz (void) const { const T *src = data (); - octave_idx_type nel = nelem (), retval = 0; + octave_idx_type nel = nelem (); + octave_idx_type retval = 0; const T zero = T (); for (octave_idx_type i = 0; i < nel; i++) if (src[i] != zero) @@ -2233,7 +2271,8 @@ if (backward) { // Do the search as a series of successive single-element searches. - octave_idx_type k = 0, l = nel - 1; + octave_idx_type k = 0; + octave_idx_type l = nel - 1; for (; k < n; k++) { for (; l >= 0 && src[l] == zero; l--) ; @@ -2250,7 +2289,8 @@ else { // Do the search as a series of successive single-element searches. - octave_idx_type k = 0, l = 0; + octave_idx_type k = 0; + octave_idx_type l = 0; for (; k < n; k++) { for (; l != nel && src[l] == zero; l++) ; @@ -2369,7 +2409,8 @@ for (octave_idx_type j = 0; j < iter; j++) { - octave_idx_type kl = 0, ku = ns; + octave_idx_type kl = 0; + octave_idx_type ku = ns; if (stride == 1) { diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/CDiagMatrix.cc --- a/liboctave/array/CDiagMatrix.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/CDiagMatrix.cc Sun Dec 15 19:42:24 2013 -0800 @@ -448,7 +448,8 @@ ComplexDiagMatrix c (a_nr, b_nc); - octave_idx_type len = c.length (), lenm = len < a_nc ? len : a_nc; + octave_idx_type len = c.length (); + octave_idx_type lenm = len < a_nc ? len : a_nc; for (octave_idx_type i = 0; i < lenm; i++) c.dgxelem (i) = a.dgelem (i) * b.dgelem (i); @@ -549,7 +550,8 @@ ComplexDiagMatrix::rcond (void) const { ColumnVector av = extract_diag (0).map (std::abs); - double amx = av.max (), amn = av.min (); + double amx = av.max (); + double amn = av.min (); return amx == 0 ? 0.0 : amn / amx; } diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/CMatrix.cc --- a/liboctave/array/CMatrix.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/CMatrix.cc Sun Dec 15 19:42:24 2013 -0800 @@ -3771,8 +3771,10 @@ { ComplexMatrix retval; - bool tra = transa != blas_no_trans, trb = transb != blas_no_trans; - bool cja = transa == blas_conj_trans, cjb = transb == blas_conj_trans; + bool tra = transa != blas_no_trans; + bool trb = transb != blas_no_trans; + bool cja = transa == blas_conj_trans; + bool cjb = transb == blas_conj_trans; octave_idx_type a_nr = tra ? a.cols () : a.rows (); octave_idx_type a_nc = tra ? a.rows () : a.cols (); @@ -3828,8 +3830,10 @@ } else { - octave_idx_type lda = a.rows (), tda = a.cols (); - octave_idx_type ldb = b.rows (), tdb = b.cols (); + octave_idx_type lda = a.rows (); + octave_idx_type tda = a.cols (); + octave_idx_type ldb = b.rows (); + octave_idx_type tdb = b.cols (); retval = ComplexMatrix (a_nr, b_nc, 0.0); Complex *c = retval.fortran_vec (); @@ -3908,7 +3912,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmin (c, m (i, j)); + result(i, j) = xmin (c, m(i, j)); } return result; @@ -3928,7 +3932,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmin (m (i, j), c); + result(i, j) = xmin (m(i, j), c); } return result; @@ -3957,7 +3961,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - if (std::imag (a (i, j)) != 0.0 || std::imag (b (i, j)) != 0.0) + if (std::imag (a(i, j)) != 0.0 || std::imag (b(i, j)) != 0.0) { columns_are_real_only = 0; break; @@ -3967,14 +3971,14 @@ if (columns_are_real_only) { for (octave_idx_type i = 0; i < nr; i++) - result (i, j) = xmin (std::real (a (i, j)), std::real (b (i, j))); + result(i, j) = xmin (std::real (a(i, j)), std::real (b(i, j))); } else { for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmin (a (i, j), b (i, j)); + result(i, j) = xmin (a(i, j), b(i, j)); } } } @@ -3996,7 +4000,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (c, m (i, j)); + result(i, j) = xmax (c, m(i, j)); } return result; @@ -4016,7 +4020,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (m (i, j), c); + result(i, j) = xmax (m(i, j), c); } return result; @@ -4045,7 +4049,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - if (std::imag (a (i, j)) != 0.0 || std::imag (b (i, j)) != 0.0) + if (std::imag (a(i, j)) != 0.0 || std::imag (b(i, j)) != 0.0) { columns_are_real_only = 0; break; @@ -4057,7 +4061,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (std::real (a (i, j)), std::real (b (i, j))); + result(i, j) = xmax (std::real (a(i, j)), std::real (b(i, j))); } } else @@ -4065,7 +4069,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (a (i, j), b (i, j)); + result(i, j) = xmax (a(i, j), b(i, j)); } } } diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/CSparse.cc --- a/liboctave/array/CSparse.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/CSparse.cc Sun Dec 15 19:42:24 2013 -0800 @@ -160,7 +160,8 @@ SparseComplexMatrix::SparseComplexMatrix (const ComplexDiagMatrix& a) : MSparse (a.rows (), a.cols (), a.length ()) { - octave_idx_type j = 0, l = a.length (); + octave_idx_type j = 0; + octave_idx_type l = a.length (); for (octave_idx_type i = 0; i < l; i++) { cidx (i) = j; @@ -348,7 +349,7 @@ found[i] = 0; for (octave_idx_type j = 0; j < nc; j++) - for (octave_idx_type i = cidx(j); i < cidx(j+1); i++) + for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) if (found[ridx (i)] == -j) found[ridx (i)] = -j - 1; @@ -505,7 +506,7 @@ found[i] = 0; for (octave_idx_type j = 0; j < nc; j++) - for (octave_idx_type i = cidx(j); i < cidx(j+1); i++) + for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) if (found[ridx (i)] == -j) found[ridx (i)] = -j - 1; @@ -777,7 +778,8 @@ if (calccond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nr; i++) { double tmp = std::abs (v[i]); @@ -1321,7 +1323,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = std::abs (data (i)); @@ -1412,7 +1415,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = std::abs (data (i)); @@ -1473,7 +1477,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nr; i++) { double tmp = std::abs (data (i)); @@ -1564,7 +1569,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = std::abs (data (i)); @@ -4320,7 +4326,7 @@ { for (octave_idx_type i = 0; i < b_nr; i++) - Bx[i] = b (i,j); + Bx[i] = b(i,j); F77_XFCN (zgttrs, ZGTTRS, (F77_CONST_CHAR_ARG2 (&job, 1), @@ -5307,7 +5313,7 @@ { for (octave_idx_type i = 0; i < b_nr; i++) - Bx[i] = b (i,j); + Bx[i] = b(i,j); F77_XFCN (zpbtrs, ZPBTRS, (F77_CONST_CHAR_ARG2 (&job, 1), @@ -6589,7 +6595,7 @@ for (octave_idx_type j = 0; j < b_nc; j++) { for (octave_idx_type i = 0; i < b_nr; i++) - Bx[i] = b (i,j); + Bx[i] = b(i,j); status = UMFPACK_ZNAME (solve) (UMFPACK_A, Ap, Ai, diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/MDiagArray2.cc --- a/liboctave/array/MDiagArray2.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/MDiagArray2.cc Sun Dec 15 19:42:24 2013 -0800 @@ -38,7 +38,8 @@ bool retval = this->rows () == this->cols (); if (retval) { - octave_idx_type len = this->length (), i = 0; + octave_idx_type len = this->length (); + octave_idx_type i = 0; for (; i < len; i++) if (DiagArray2::elem (i, i) != val) break; retval = i == len; diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/MatrixType.cc --- a/liboctave/array/MatrixType.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/MatrixType.cc Sun Dec 15 19:42:24 2013 -0800 @@ -91,7 +91,8 @@ { for (octave_idx_type i = 0; i < j; i++) { - double aij = a.elem (i,j), aji = a.elem (j,i); + double aij = a.elem (i,j); + double aji = a.elem (j,i); lower = lower && (aij == zero); upper = upper && (aji == zero); hermitian = hermitian && (aij == aji @@ -149,7 +150,8 @@ { for (octave_idx_type i = 0; i < j; i++) { - std::complex aij = a.elem (i,j), aji = a.elem (j,i); + std::complex aij = a.elem (i,j); + std::complex aji = a.elem (j,i); lower = lower && (aij == zero); upper = upper && (aji == zero); hermitian = hermitian && (aij == std::conj (aji) diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/PermMatrix.cc --- a/liboctave/array/PermMatrix.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/PermMatrix.cc Sun Dec 15 19:42:24 2013 -0800 @@ -119,7 +119,8 @@ for (octave_idx_type i = 0; i < len; i++) { - octave_idx_type j = p[i], k = q[i]; + octave_idx_type j = p[i]; + octave_idx_type k = q[i]; if (j != i) { p[k] = p[i]; @@ -191,7 +192,8 @@ PermMatrix operator *(const PermMatrix& a, const PermMatrix& b) { - const Array ia = a.pvec (), ib = b.pvec (); + const Array ia = a.pvec (); + const Array ib = b.pvec (); PermMatrix r; octave_idx_type n = a.columns (); if (n != b.rows ()) diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/Sparse.cc --- a/liboctave/array/Sparse.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/Sparse.cc Sun Dec 15 19:42:24 2013 -0800 @@ -144,7 +144,8 @@ { if (remove_zeros) { - octave_idx_type i = 0, k = 0; + octave_idx_type i = 0; + octave_idx_type k = 0; for (octave_idx_type j = 1; j <= ncols; j++) { octave_idx_type u = c[j]; @@ -303,7 +304,9 @@ dimensions = dim_vector (nr, nc); - octave_idx_type n = a.numel (), rl = r.length (nr), cl = c.length (nc); + octave_idx_type n = a.numel (); + octave_idx_type rl = r.length (nr); + octave_idx_type cl = c.length (nc); bool a_scalar = n == 1; if (a_scalar) { @@ -324,9 +327,9 @@ if (n == 1 && a(0) != T ()) { change_capacity (nzm > 1 ? nzm : 1); - xcidx(0) = 0; - xridx(0) = r(0); - xdata(0) = a(0); + xcidx (0) = 0; + xridx (0) = r(0); + xdata (0) = a(0); for (octave_idx_type j = 0; j < nc; j++) xcidx (j+1) = j >= c(0); @@ -361,7 +364,8 @@ octave_quit (); - octave_idx_type k = -1, l = -1; + octave_idx_type k = -1; + octave_idx_type l = -1; if (sum_terms) { @@ -395,8 +399,10 @@ } else { - idx_vector rr = r, cc = c; - const octave_idx_type *rd = rr.raw (), *cd = cc.raw (); + idx_vector rr = r; + idx_vector cc = c; + const octave_idx_type *rd = rr.raw (); + const octave_idx_type *cd = cc.raw (); OCTAVE_LOCAL_BUFFER_INIT (octave_idx_type, ci, nc+1, 0); ci[0] = 0; // Bin counts of column indices. @@ -425,7 +431,8 @@ for (octave_idx_type j = 0; j < nc; j++) { std::sort (sidx + ci[j], sidx + ci[j+1]); - octave_idx_type l = -1, nzj = 0; + octave_idx_type l = -1; + octave_idx_type nzj = 0; // Count. for (octave_idx_type i = ci[j]; i < ci[j+1]; i++) { @@ -490,15 +497,16 @@ octave_quit (); - const octave_idx_type *rd = rs.raw (), *rdi = rsi.data (); + const octave_idx_type *rd = rs.raw (); + const octave_idx_type *rdi = rsi.data (); // Count unique indices. octave_idx_type new_nz = 1; for (octave_idx_type i = 1; i < n; i++) new_nz += rd[i-1] != rd[i]; // Allocate result. change_capacity (nzm > new_nz ? nzm : new_nz); - xcidx(0) = 0; - xcidx(1) = new_nz; + xcidx (0) = 0; + xcidx (1) = new_nz; octave_idx_type *rri = ridx (); T *rrd = data (); @@ -537,8 +545,10 @@ } else { - idx_vector rr = r, cc = c; - const octave_idx_type *rd = rr.raw (), *cd = cc.raw (); + idx_vector rr = r; + idx_vector cc = c; + const octave_idx_type *rd = rr.raw (); + const octave_idx_type *cd = cc.raw (); OCTAVE_LOCAL_BUFFER_INIT (octave_idx_type, ci, nc+1, 0); ci[0] = 0; // Bin counts of column indices. @@ -572,7 +582,8 @@ for (octave_idx_type j = 0; j < nc; j++) { std::sort (spairs + ci[j], spairs + ci[j+1]); - octave_idx_type l = -1, nzj = 0; + octave_idx_type l = -1; + octave_idx_type nzj = 0; // Count. for (octave_idx_type i = ci[j]; i < ci[j+1]; i++) { @@ -901,7 +912,8 @@ void Sparse::resize1 (octave_idx_type n) { - octave_idx_type nr = rows (), nc = cols (); + octave_idx_type nr = rows (); + octave_idx_type nc = cols (); if (nr == 0) resize (1, std::max (nc, n)); @@ -950,7 +962,8 @@ if (r < rows ()) { - octave_idx_type i = 0, k = 0; + octave_idx_type i = 0; + octave_idx_type k = 0; for (octave_idx_type j = 1; j <= rep->ncols; j++) { octave_idx_type u = xcidx (j); @@ -1183,7 +1196,9 @@ OCTAVE_LOCAL_BUFFER (T, data_new, nz); idx_vector sidx = idx.sorted (true); const octave_idx_type *sj = sidx.raw (); - octave_idx_type sl = sidx.length (nel), nz_new = 0, j = 0; + octave_idx_type sl = sidx.length (nel); + octave_idx_type nz_new = 0; + octave_idx_type j = 0; for (octave_idx_type i = 0; i < nz; i++) { octave_idx_type r = tmp.ridx (i); @@ -1266,8 +1281,8 @@ else { const Sparse tmp = *this; - octave_idx_type lbi = tmp.cidx(lb); - octave_idx_type ubi = tmp.cidx(ub); + octave_idx_type lbi = tmp.cidx (lb); + octave_idx_type ubi = tmp.cidx (ub); octave_idx_type new_nz = nz - (ubi - lbi); *this = Sparse (nr, nc - (ub - lb), new_nz); @@ -1310,20 +1325,20 @@ tmpl.nnz () + tmpu.nnz ()); for (octave_idx_type j = 0, k = 0; j < nc; j++) { - for (octave_idx_type i = tmpl.cidx(j); i < tmpl.cidx(j+1); + for (octave_idx_type i = tmpl.cidx (j); i < tmpl.cidx (j+1); i++) { - xdata(k) = tmpl.data(i); - xridx(k++) = tmpl.ridx(i); + xdata (k) = tmpl.data (i); + xridx (k++) = tmpl.ridx (i); } - for (octave_idx_type i = tmpu.cidx(j); i < tmpu.cidx(j+1); + for (octave_idx_type i = tmpu.cidx (j); i < tmpu.cidx (j+1); i++) { - xdata(k) = tmpu.data(i); - xridx(k++) = tmpu.ridx(i) + lb; + xdata (k) = tmpu.data (i); + xridx (k++) = tmpu.ridx (i) + lb; } - xcidx(j+1) = k; + xcidx (j+1) = k; } } } @@ -1488,7 +1503,8 @@ ? idx.as_array ().transpose () : idx.as_array ()); - octave_idx_type new_nr = idxa.rows (), new_nc = idxa.cols (); + octave_idx_type new_nr = idxa.rows (); + octave_idx_type new_nc = idxa.cols (); // Lookup. // FIXME: Could specialize for sorted idx? @@ -1536,7 +1552,9 @@ else if (idx.is_cont_range (nel, lb, ub)) { // Special-case a contiguous range. - octave_idx_type lbi = cidx (lb), ubi = cidx (ub), new_nz = ubi - lbi; + octave_idx_type lbi = cidx (lb); + octave_idx_type ubi = cidx (ub); + octave_idx_type new_nz = ubi - lbi; retval = Sparse (1, ub - lb, new_nz); copy_or_memcpy (new_nz, data () + lbi, retval.data ()); fill_or_memset (new_nz, static_cast (0), @@ -1621,7 +1639,9 @@ else if (idx_j.is_cont_range (nc, lb, ub)) { // Special-case a contiguous range. - octave_idx_type lbi = cidx (lb), ubi = cidx (ub), new_nz = ubi - lbi; + octave_idx_type lbi = cidx (lb); + octave_idx_type ubi = cidx (ub); + octave_idx_type new_nz = ubi - lbi; retval = Sparse (nr, ub - lb, new_nz); copy_or_memcpy (new_nz, data () + lbi, retval.data ()); copy_or_memcpy (new_nz, ridx () + lbi, retval.ridx ()); @@ -1752,7 +1772,8 @@ octave_idx_type jj = idx_j(j); octave_idx_type lj = cidx (jj); octave_idx_type nzj = cidx (jj+1) - cidx (jj); - octave_idx_type li = retval.xcidx (j), uj = lj + nzj - 1; + octave_idx_type li = retval.xcidx (j); + octave_idx_type uj = lj + nzj - 1; for (octave_idx_type i = 0; i < nzj; i++) { retval.xdata (li + i) = data (uj - i); // Copy in reverse order. @@ -1859,7 +1880,8 @@ // Look-up indices first. octave_idx_type li = lblookup (ridx (), nz, lb); octave_idx_type ui = lblookup (ridx (), nz, ub); - octave_idx_type rnz = rhs.nnz (), new_nz = nz - (ui - li) + rnz; + octave_idx_type rnz = rhs.nnz (); + octave_idx_type new_nz = nz - (ui - li) + rnz; if (new_nz >= nz && new_nz <= capacity ()) { @@ -2039,8 +2061,10 @@ else if (idx_j.is_cont_range (nc, lb, ub)) { // Special-case a contiguous range. - octave_idx_type li = cidx (lb), ui = cidx (ub); - octave_idx_type rnz = rhs.nnz (), new_nz = nz - (ui - li) + rnz; + octave_idx_type li = cidx (lb); + octave_idx_type ui = cidx (ub); + octave_idx_type rnz = rhs.nnz (); + octave_idx_type new_nz = nz - (ui - li) + rnz; if (new_nz >= nz && new_nz <= capacity ()) { @@ -2129,7 +2153,9 @@ // Merge columns. for (octave_idx_type i = 0; i < nc; i++) { - octave_idx_type l = xcidx (i), u = xcidx (i+1), j = jsav[i]; + octave_idx_type l = xcidx (i); + octave_idx_type u = xcidx (i+1); + octave_idx_type j = jsav[i]; if (j >= 0) { // from rhs @@ -2605,7 +2631,8 @@ if (spi.is_empty ()) continue; - octave_idx_type kl = spi.cidx (j), ku = spi.cidx (j+1); + octave_idx_type kl = spi.cidx (j); + octave_idx_type ku = spi.cidx (j+1); for (octave_idx_type k = kl; k < ku; k++, l++) { retval.xridx (l) = spi.ridx (k) + rcum; diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/Sparse.h --- a/liboctave/array/Sparse.h Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/Sparse.h Sun Dec 15 19:42:24 2013 -0800 @@ -300,13 +300,15 @@ T& xelem (octave_idx_type n) { - octave_idx_type i = n % rows (), j = n / rows (); + octave_idx_type i = n % rows (); + octave_idx_type j = n / rows (); return xelem (i, j); } T xelem (octave_idx_type n) const { - octave_idx_type i = n % rows (), j = n / rows (); + octave_idx_type i = n % rows (); + octave_idx_type j = n / rows (); return xelem (i, j); } diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/boolSparse.cc --- a/liboctave/array/boolSparse.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/boolSparse.cc Sun Dec 15 19:42:24 2013 -0800 @@ -143,7 +143,9 @@ SparseBoolMatrix::any (int dim) const { Sparse retval; - octave_idx_type nr = rows (), nc = cols (), nz = nnz (); + octave_idx_type nr = rows (); + octave_idx_type nc = cols (); + octave_idx_type nz = nnz (); if (dim == -1) dim = (nr == 1 && nc != 1) ? 1 : 0; @@ -188,7 +190,9 @@ SparseBoolMatrix::sum (int dim) const { Sparse retval; - octave_idx_type nr = rows (), nc = cols (), nz = nnz (); + octave_idx_type nr = rows (); + octave_idx_type nc = cols (); + octave_idx_type nz = nnz (); if (dim == -1) dim = (nr == 1 && nc != 1) ? 1 : 0; diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/dDiagMatrix.cc --- a/liboctave/array/dDiagMatrix.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/dDiagMatrix.cc Sun Dec 15 19:42:24 2013 -0800 @@ -329,7 +329,8 @@ DiagMatrix c (a_nr, b_nc); - octave_idx_type len = c.length (), lenm = len < a_nc ? len : a_nc; + octave_idx_type len = c.length (); + octave_idx_type lenm = len < a_nc ? len : a_nc; for (octave_idx_type i = 0; i < lenm; i++) c.dgxelem (i) = a.dgelem (i) * b.dgelem (i); @@ -364,7 +365,8 @@ DiagMatrix::rcond (void) const { ColumnVector av = extract_diag (0).map (fabs); - double amx = av.max (), amn = av.min (); + double amx = av.max (); + double amn = av.min (); return amx == 0 ? 0.0 : amn / amx; } diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/dMatrix.cc --- a/liboctave/array/dMatrix.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/dMatrix.cc Sun Dec 15 19:42:24 2013 -0800 @@ -2012,7 +2012,9 @@ static Matrix stack_complex_matrix (const ComplexMatrix& cm) { - octave_idx_type m = cm.rows (), n = cm.cols (), nel = m*n; + octave_idx_type m = cm.rows (); + octave_idx_type n = cm.cols (); + octave_idx_type nel = m*n; Matrix retval (m, 2*n); const Complex *cmd = cm.data (); double *rd = retval.fortran_vec (); @@ -2027,7 +2029,9 @@ static ComplexMatrix unstack_complex_matrix (const Matrix& sm) { - octave_idx_type m = sm.rows (), n = sm.cols () / 2, nel = m*n; + octave_idx_type m = sm.rows (); + octave_idx_type n = sm.cols () / 2; + octave_idx_type nel = m*n; ComplexMatrix retval (m, n); const double *smd = sm.data (); Complex *rd = retval.fortran_vec (); @@ -3186,7 +3190,8 @@ { Matrix retval; - bool tra = transa != blas_no_trans, trb = transb != blas_no_trans; + bool tra = transa != blas_no_trans; + bool trb = transb != blas_no_trans; octave_idx_type a_nr = tra ? a.cols () : a.rows (); octave_idx_type a_nc = tra ? a.rows () : a.cols (); @@ -3221,8 +3226,10 @@ } else { - octave_idx_type lda = a.rows (), tda = a.cols (); - octave_idx_type ldb = b.rows (), tdb = b.cols (); + octave_idx_type lda = a.rows (); + octave_idx_type tda = a.cols (); + octave_idx_type ldb = b.rows (); + octave_idx_type tdb = b.cols (); retval = Matrix (a_nr, b_nc); double *c = retval.fortran_vec (); @@ -3291,7 +3298,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmin (d, m (i, j)); + result(i, j) = xmin (d, m(i, j)); } return result; @@ -3311,7 +3318,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmin (m (i, j), d); + result(i, j) = xmin (m(i, j), d); } return result; @@ -3338,7 +3345,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmin (a (i, j), b (i, j)); + result(i, j) = xmin (a(i, j), b(i, j)); } return result; @@ -3358,7 +3365,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (d, m (i, j)); + result(i, j) = xmax (d, m(i, j)); } return result; @@ -3378,7 +3385,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (m (i, j), d); + result(i, j) = xmax (m(i, j), d); } return result; @@ -3405,7 +3412,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (a (i, j), b (i, j)); + result(i, j) = xmax (a(i, j), b(i, j)); } return result; diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/dSparse.cc --- a/liboctave/array/dSparse.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/dSparse.cc Sun Dec 15 19:42:24 2013 -0800 @@ -165,7 +165,8 @@ SparseMatrix::SparseMatrix (const DiagMatrix& a) : MSparse (a.rows (), a.cols (), a.length ()) { - octave_idx_type j = 0, l = a.length (); + octave_idx_type j = 0; + octave_idx_type l = a.length (); for (octave_idx_type i = 0; i < l; i++) { cidx (i) = j; @@ -360,7 +361,7 @@ found[i] = 0; for (octave_idx_type j = 0; j < nc; j++) - for (octave_idx_type i = cidx(j); i < cidx(j+1); i++) + for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) if (found[ridx (i)] == -j) found[ridx (i)] = -j - 1; @@ -511,7 +512,7 @@ found[i] = 0; for (octave_idx_type j = 0; j < nc; j++) - for (octave_idx_type i = cidx(j); i < cidx(j+1); i++) + for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) if (found[ridx (i)] == -j) found[ridx (i)] = -j - 1; @@ -877,7 +878,8 @@ if (calccond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nr; i++) { double tmp = fabs (v[i]); @@ -1412,7 +1414,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = fabs (data (i)); @@ -1502,7 +1505,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = fabs (data (i)); @@ -1562,7 +1566,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = fabs (data (i)); @@ -1652,7 +1657,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = fabs (data (i)); @@ -4418,7 +4424,7 @@ for (octave_idx_type i = 0; i < b_nr; i++) { - Complex c = b (i,j); + Complex c = b(i,j); Bx[i] = std::real (c); Bz[i] = std::imag (c); } @@ -5175,7 +5181,7 @@ { for (octave_idx_type i = 0; i < b_nr; i++) { - Complex c = b (i,j); + Complex c = b(i,j); Bx[i] = std::real (c); Bz[i] = std::imag (c); } @@ -5325,7 +5331,7 @@ { for (octave_idx_type i = 0; i < nr; i++) { - Complex c = b (i, j); + Complex c = b(i, j); Bx[i] = std::real (c); Bz[i] = std::imag (c); } @@ -5480,7 +5486,7 @@ for (octave_idx_type i = 0; i < b_nr; i++) { - Complex c = b (i,j); + Complex c = b(i,j); Bx[i] = std::real (c); Bz[i] = std::imag (c); } @@ -6496,7 +6502,7 @@ { for (octave_idx_type i = 0; i < b_nr; i++) { - Complex c = b (i,j); + Complex c = b(i,j); Bx[i] = std::real (c); Bz[i] = std::imag (c); } @@ -6751,7 +6757,7 @@ { for (octave_idx_type i = 0; i < b_nr; i++) { - Complex c = b (i,j); + Complex c = b(i,j); Bx[i] = std::real (c); Bz[i] = std::imag (c); } diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/dim-vector.cc --- a/liboctave/array/dim-vector.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/dim-vector.cc Sun Dec 15 19:42:24 2013 -0800 @@ -176,7 +176,8 @@ bool dim_vector::concat (const dim_vector& dvb, int dim) { - int orig_nd = ndims (), ndb = dvb.ndims (); + int orig_nd = ndims (); + int ndb = dvb.ndims (); int new_nd = dim < ndb ? ndb : dim + 1; if (new_nd > orig_nd) resize (new_nd, 1); diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/fCDiagMatrix.cc --- a/liboctave/array/fCDiagMatrix.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/fCDiagMatrix.cc Sun Dec 15 19:42:24 2013 -0800 @@ -452,7 +452,8 @@ FloatComplexDiagMatrix c (a_nr, b_nc); - octave_idx_type len = c.length (), lenm = len < a_nc ? len : a_nc; + octave_idx_type len = c.length (); + octave_idx_type lenm = len < a_nc ? len : a_nc; for (octave_idx_type i = 0; i < lenm; i++) c.dgxelem (i) = a.dgelem (i) * b.dgelem (i); @@ -553,7 +554,8 @@ FloatComplexDiagMatrix::rcond (void) const { FloatColumnVector av = extract_diag (0).map (std::abs); - float amx = av.max (), amn = av.min (); + float amx = av.max (); + float amn = av.min (); return amx == 0 ? 0.0f : amn / amx; } diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/fCMatrix.cc --- a/liboctave/array/fCMatrix.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/fCMatrix.cc Sun Dec 15 19:42:24 2013 -0800 @@ -3795,8 +3795,10 @@ { FloatComplexMatrix retval; - bool tra = transa != blas_no_trans, trb = transb != blas_no_trans; - bool cja = transa == blas_conj_trans, cjb = transb == blas_conj_trans; + bool tra = transa != blas_no_trans; + bool trb = transb != blas_no_trans; + bool cja = transa == blas_conj_trans; + bool cjb = transb == blas_conj_trans; octave_idx_type a_nr = tra ? a.cols () : a.rows (); octave_idx_type a_nc = tra ? a.rows () : a.cols (); @@ -3852,8 +3854,10 @@ } else { - octave_idx_type lda = a.rows (), tda = a.cols (); - octave_idx_type ldb = b.rows (), tdb = b.cols (); + octave_idx_type lda = a.rows (); + octave_idx_type tda = a.cols (); + octave_idx_type ldb = b.rows (); + octave_idx_type tdb = b.cols (); retval = FloatComplexMatrix (a_nr, b_nc, 0.0); FloatComplex *c = retval.fortran_vec (); @@ -3933,7 +3937,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmin (c, m (i, j)); + result(i, j) = xmin (c, m(i, j)); } return result; @@ -3953,7 +3957,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmin (m (i, j), c); + result(i, j) = xmin (m(i, j), c); } return result; @@ -3982,7 +3986,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - if (std::imag (a (i, j)) != 0.0 || std::imag (b (i, j)) != 0.0) + if (std::imag (a(i, j)) != 0.0 || std::imag (b(i, j)) != 0.0) { columns_are_real_only = 0; break; @@ -3992,14 +3996,14 @@ if (columns_are_real_only) { for (octave_idx_type i = 0; i < nr; i++) - result (i, j) = xmin (std::real (a (i, j)), std::real (b (i, j))); + result(i, j) = xmin (std::real (a(i, j)), std::real (b(i, j))); } else { for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmin (a (i, j), b (i, j)); + result(i, j) = xmin (a(i, j), b(i, j)); } } } @@ -4021,7 +4025,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (c, m (i, j)); + result(i, j) = xmax (c, m(i, j)); } return result; @@ -4041,7 +4045,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (m (i, j), c); + result(i, j) = xmax (m(i, j), c); } return result; @@ -4070,7 +4074,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - if (std::imag (a (i, j)) != 0.0 || std::imag (b (i, j)) != 0.0) + if (std::imag (a(i, j)) != 0.0 || std::imag (b(i, j)) != 0.0) { columns_are_real_only = 0; break; @@ -4082,7 +4086,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (std::real (a (i, j)), std::real (b (i, j))); + result(i, j) = xmax (std::real (a(i, j)), std::real (b(i, j))); } } else @@ -4090,7 +4094,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (a (i, j), b (i, j)); + result(i, j) = xmax (a(i, j), b(i, j)); } } } diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/fDiagMatrix.cc --- a/liboctave/array/fDiagMatrix.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/fDiagMatrix.cc Sun Dec 15 19:42:24 2013 -0800 @@ -329,7 +329,8 @@ FloatDiagMatrix c (a_nr, b_nc); - octave_idx_type len = c.length (), lenm = len < a_nc ? len : a_nc; + octave_idx_type len = c.length (); + octave_idx_type lenm = len < a_nc ? len : a_nc; for (octave_idx_type i = 0; i < lenm; i++) c.dgxelem (i) = a.dgelem (i) * b.dgelem (i); @@ -364,7 +365,8 @@ FloatDiagMatrix::rcond (void) const { FloatColumnVector av = extract_diag (0).map (fabsf); - float amx = av.max (), amn = av.min (); + float amx = av.max (); + float amn = av.min (); return amx == 0 ? 0.0f : amn / amx; } diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/fMatrix.cc --- a/liboctave/array/fMatrix.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/fMatrix.cc Sun Dec 15 19:42:24 2013 -0800 @@ -2026,7 +2026,9 @@ static FloatMatrix stack_complex_matrix (const FloatComplexMatrix& cm) { - octave_idx_type m = cm.rows (), n = cm.cols (), nel = m*n; + octave_idx_type m = cm.rows (); + octave_idx_type n = cm.cols (); + octave_idx_type nel = m*n; FloatMatrix retval (m, 2*n); const FloatComplex *cmd = cm.data (); float *rd = retval.fortran_vec (); @@ -2041,7 +2043,9 @@ static FloatComplexMatrix unstack_complex_matrix (const FloatMatrix& sm) { - octave_idx_type m = sm.rows (), n = sm.cols () / 2, nel = m*n; + octave_idx_type m = sm.rows (); + octave_idx_type n = sm.cols () / 2; + octave_idx_type nel = m*n; FloatComplexMatrix retval (m, n); const float *smd = sm.data (); FloatComplex *rd = retval.fortran_vec (); @@ -3203,7 +3207,8 @@ { FloatMatrix retval; - bool tra = transa != blas_no_trans, trb = transb != blas_no_trans; + bool tra = transa != blas_no_trans; + bool trb = transb != blas_no_trans; octave_idx_type a_nr = tra ? a.cols () : a.rows (); octave_idx_type a_nc = tra ? a.rows () : a.cols (); @@ -3238,8 +3243,10 @@ } else { - octave_idx_type lda = a.rows (), tda = a.cols (); - octave_idx_type ldb = b.rows (), tdb = b.cols (); + octave_idx_type lda = a.rows (); + octave_idx_type tda = a.cols (); + octave_idx_type ldb = b.rows (); + octave_idx_type tdb = b.cols (); retval = FloatMatrix (a_nr, b_nc); float *c = retval.fortran_vec (); @@ -3308,7 +3315,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmin (d, m (i, j)); + result(i, j) = xmin (d, m(i, j)); } return result; @@ -3328,7 +3335,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmin (m (i, j), d); + result(i, j) = xmin (m(i, j), d); } return result; @@ -3355,7 +3362,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmin (a (i, j), b (i, j)); + result(i, j) = xmin (a(i, j), b(i, j)); } return result; @@ -3375,7 +3382,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (d, m (i, j)); + result(i, j) = xmax (d, m(i, j)); } return result; @@ -3395,7 +3402,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (m (i, j), d); + result(i, j) = xmax (m(i, j), d); } return result; @@ -3422,7 +3429,7 @@ for (octave_idx_type i = 0; i < nr; i++) { octave_quit (); - result (i, j) = xmax (a (i, j), b (i, j)); + result(i, j) = xmax (a(i, j), b(i, j)); } return result; diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/idx-vector.cc --- a/liboctave/array/idx-vector.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/idx-vector.cc Sun Dec 15 19:42:24 2013 -0800 @@ -440,7 +440,7 @@ octave_idx_type nr = bnda.rows (); for (octave_idx_type j = 0; j < nc; j++) - for (octave_idx_type i = bnda.cidx(j); i < bnda.cidx(j+1); i++) + for (octave_idx_type i = bnda.cidx (j); i < bnda.cidx (j+1); i++) if (bnda.data (i)) d[k++] = j * nr + bnda.ridx (i); @@ -595,7 +595,8 @@ for (octave_idx_type i = 0; i < len; i++) { - octave_idx_type j = data[i], k = cnt[j]++; + octave_idx_type j = data[i]; + octave_idx_type k = cnt[j]++; new_data[k] = j; idx_data[k] = i; } @@ -836,7 +837,8 @@ { // (i:k:end,:) reduces to a range if i <= k and k divides n. idx_range_rep * r = dynamic_cast (rep); - octave_idx_type s = r->get_start (), l = r->length (n); + octave_idx_type s = r->get_start (); + octave_idx_type l = r->length (n); octave_idx_type t = r->get_step (); if (l*t == n) { @@ -860,7 +862,8 @@ idx_range_rep * rj = dynamic_cast (j.rep); if (rj->get_step () == 1) { - octave_idx_type sj = rj->get_start (), lj = rj->length (nj); + octave_idx_type sj = rj->get_start (); + octave_idx_type lj = rj->length (nj); *this = new idx_range_rep (sj * n, lj * n, 1, DIRECT); reduced = true; } @@ -873,7 +876,8 @@ idx_scalar_rep * r = dynamic_cast (rep); idx_range_rep * rj = dynamic_cast (j.rep); octave_idx_type k = r->get_data (); - octave_idx_type sj = rj->get_start (), lj = rj->length (nj); + octave_idx_type sj = rj->get_start (); + octave_idx_type lj = rj->length (nj); octave_idx_type tj = rj->get_step (); *this = new idx_range_rep (n * sj + k, lj, n * tj, DIRECT); reduced = true; @@ -885,10 +889,12 @@ // (i:k:end,p:q) reduces to a range if i <= k and k divides n. // (ones (1, m), ones (1, n)) reduces to (ones (1, m*n)) idx_range_rep * r = dynamic_cast (rep); - octave_idx_type s = r->get_start (), l = r->length (n); + octave_idx_type s = r->get_start (); + octave_idx_type l = r->length (n); octave_idx_type t = r->get_step (); idx_range_rep * rj = dynamic_cast (j.rep); - octave_idx_type sj = rj->get_start (), lj = rj->length (nj); + octave_idx_type sj = rj->get_start (); + octave_idx_type lj = rj->length (nj); octave_idx_type tj = rj->get_step (); if ((l*t == n && tj == 1) || (t == 0 && tj == 0)) { @@ -922,7 +928,8 @@ // (i:d:j,k) reduces to a range. idx_range_rep * r = dynamic_cast (rep); idx_scalar_rep * rj = dynamic_cast (j.rep); - octave_idx_type s = r->get_start (), l = r->length (nj); + octave_idx_type s = r->get_start (); + octave_idx_type l = r->length (nj); octave_idx_type t = r->get_step (); octave_idx_type k = rj->get_data (); *this = new idx_range_rep (n * k + s, l, t, DIRECT); @@ -989,7 +996,8 @@ case class_mask: { idx_mask_rep * r = dynamic_cast (rep); - octave_idx_type ext = r->extent (0), len = r->length (0); + octave_idx_type ext = r->extent (0); + octave_idx_type len = r->length (0); if (ext == len) { l = 0; @@ -1062,7 +1070,8 @@ case class_range: { idx_range_rep * r = dynamic_cast (rep); - octave_idx_type start = r->get_start (), step = r->get_step (); + octave_idx_type start = r->get_start (); + octave_idx_type step = r->get_step (); octave_idx_type i, j; if (step == 1) for (i = start, j = start + len; i < j; i++) *data++ = i; @@ -1116,7 +1125,8 @@ if (idx_class () == class_mask) { idx_mask_rep * r = dynamic_cast (rep); - octave_idx_type nz = r->length (0), ext = r->extent (0); + octave_idx_type nz = r->length (0); + octave_idx_type ext = r->extent (0); Array mask (dim_vector (n, 1)); const bool *data = r->get_data (); bool *ndata = mask.fortran_vec (); @@ -1207,7 +1217,8 @@ { idx_mask_rep * r = dynamic_cast (rep); const bool *data = r->get_data (); - octave_idx_type ext = r->extent (0), len = r->length (0); + octave_idx_type ext = r->extent (0); + octave_idx_type len = r->length (0); octave_idx_type *idata = new octave_idx_type [len]; for (octave_idx_type i = 0, j = 0; i < ext; i++) diff -r a99bbbcf743c -r 7721e78b1337 liboctave/array/idx-vector.h --- a/liboctave/array/idx-vector.h Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/array/idx-vector.h Sun Dec 15 19:42:24 2013 -0800 @@ -637,7 +637,8 @@ case class_range: { idx_range_rep * r = dynamic_cast (rep); - octave_idx_type start = r->get_start (), step = r->get_step (); + octave_idx_type start = r->get_start (); + octave_idx_type step = r->get_step (); const T *ssrc = src + start; if (step == 1) copy_or_memcpy (len, ssrc, dest); @@ -710,7 +711,8 @@ case class_range: { idx_range_rep * r = dynamic_cast (rep); - octave_idx_type start = r->get_start (), step = r->get_step (); + octave_idx_type start = r->get_start (); + octave_idx_type step = r->get_step (); T *sdest = dest + start; if (step == 1) copy_or_memcpy (len, src, sdest); @@ -781,7 +783,8 @@ case class_range: { idx_range_rep * r = dynamic_cast (rep); - octave_idx_type start = r->get_start (), step = r->get_step (); + octave_idx_type start = r->get_start (); + octave_idx_type step = r->get_step (); T *sdest = dest + start; if (step == 1) std::fill (sdest, sdest + len, val); @@ -850,7 +853,8 @@ case class_range: { idx_range_rep * r = dynamic_cast (rep); - octave_idx_type start = r->get_start (), step = r->get_step (); + octave_idx_type start = r->get_start (); + octave_idx_type step = r->get_step (); octave_idx_type i, j; if (step == 1) for (i = start, j = start + len; i < j; i++) body (i); @@ -921,7 +925,8 @@ case class_range: { idx_range_rep * r = dynamic_cast (rep); - octave_idx_type start = r->get_start (), step = r->get_step (); + octave_idx_type start = r->get_start (); + octave_idx_type step = r->get_step (); octave_idx_type i, j; if (step == 1) for (i = start, j = start + len; i < j && body (i); i++) ; @@ -954,7 +959,8 @@ { idx_mask_rep * r = dynamic_cast (rep); const bool *data = r->get_data (); - octave_idx_type ext = r->extent (0), j = 0; + octave_idx_type ext = r->extent (0); + octave_idx_type j = 0; for (octave_idx_type i = 0; i < ext; i++) { if (data[i]) diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/CmplxLU.cc --- a/liboctave/numeric/CmplxLU.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/CmplxLU.cc Sun Dec 15 19:42:24 2013 -0800 @@ -100,7 +100,8 @@ if (u.length () == m && v.length () == n) { - ComplexColumnVector utmp = u, vtmp = v; + ComplexColumnVector utmp = u; + ComplexColumnVector vtmp = v; F77_XFCN (zlu1up, ZLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); } @@ -124,7 +125,8 @@ { for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - ComplexColumnVector utmp = u.column (i), vtmp = v.column (i); + ComplexColumnVector utmp = u.column (i); + ComplexColumnVector vtmp = v.column (i); F77_XFCN (zlu1up, ZLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); @@ -149,7 +151,8 @@ if (u.length () == m && v.length () == n) { - ComplexColumnVector utmp = u, vtmp = v; + ComplexColumnVector utmp = u; + ComplexColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (Complex, w, m); for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment F77_XFCN (zlup1up, ZLUP1UP, (m, n, l.fortran_vec (), @@ -180,7 +183,8 @@ for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - ComplexColumnVector utmp = u.column (i), vtmp = v.column (i); + ComplexColumnVector utmp = u.column (i); + ComplexColumnVector vtmp = v.column (i); F77_XFCN (zlup1up, ZLUP1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, ipvt.fortran_vec (), diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/CmplxQR.cc --- a/liboctave/numeric/CmplxQR.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/CmplxQR.cc Sun Dec 15 19:42:24 2013 -0800 @@ -137,7 +137,8 @@ void ComplexQR::form (octave_idx_type n, ComplexMatrix& afact, Complex *tau, qr_type_t qr_type) { - octave_idx_type m = afact.rows (), min_mn = std::min (m, n); + octave_idx_type m = afact.rows (); + octave_idx_type min_mn = std::min (m, n); octave_idx_type info; if (qr_type == qr_type_raw) @@ -213,7 +214,8 @@ if (u.length () == m && v.length () == n) { - ComplexColumnVector utmp = u, vtmp = v; + ComplexColumnVector utmp = u; + ComplexColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (Complex, w, k); OCTAVE_LOCAL_BUFFER (double, rw, k); F77_XFCN (zqr1up, ZQR1UP, (m, n, k, q.fortran_vec (), @@ -238,7 +240,8 @@ OCTAVE_LOCAL_BUFFER (double, rw, k); for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - ComplexColumnVector utmp = u.column (i), vtmp = v.column (i); + ComplexColumnVector utmp = u.column (i); + ComplexColumnVector vtmp = v.column (i); F77_XFCN (zqr1up, ZQR1UP, (m, n, k, q.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec (), diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/base-qr.cc --- a/liboctave/numeric/base-qr.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/base-qr.cc Sun Dec 15 19:42:24 2013 -0800 @@ -30,8 +30,10 @@ base_qr::base_qr (const qr_type& q_arg, const qr_type& r_arg) : q (q_arg), r (r_arg) { - octave_idx_type q_nr = q.rows (), q_nc = q.columns (); - octave_idx_type r_nr = r.rows (), r_nc = r.columns (); + octave_idx_type q_nr = q.rows (); + octave_idx_type q_nc = q.columns (); + octave_idx_type r_nr = r.rows (); + octave_idx_type r_nc = r.columns (); if (! (q_nc == r_nr && (q_nr == q_nc || (q_nr > q_nc && r_nr == r_nc)))) { diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/bsxfun-defs.cc --- a/liboctave/numeric/bsxfun-defs.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/bsxfun-defs.cc Sun Dec 15 19:42:24 2013 -0800 @@ -41,14 +41,16 @@ void (*op_vs) (size_t, R *, const X *, Y)) { int nd = std::max (x.ndims (), y.ndims ()); - dim_vector dvx = x.dims ().redim (nd), dvy = y.dims ().redim (nd); + dim_vector dvx = x.dims ().redim (nd); + dim_vector dvy = y.dims ().redim (nd); // Construct the result dimensions. dim_vector dvr; dvr.resize (nd); for (int i = 0; i < nd; i++) { - octave_idx_type xk = dvx(i), yk = dvy(i); + octave_idx_type xk = dvx(i); + octave_idx_type yk = dvy(i); if (xk == 1) dvr(i) = yk; else if (yk == 1 || xk == yk) @@ -84,7 +86,8 @@ else { // Determine the type of the low-level loop. - bool xsing = false, ysing = false; + bool xsing = false; + bool ysing = false; if (ldr == 1) { xsing = dvx(start) == 1; @@ -95,7 +98,8 @@ start++; } } - dim_vector cdvx = dvx.cumulative (), cdvy = dvy.cumulative (); + dim_vector cdvx = dvx.cumulative (); + dim_vector cdvy = dvy.cumulative (); // Nullify singleton dims to achieve a spread effect. for (int i = std::max (start, octave_idx_type (1)); i < nd; i++) { @@ -139,7 +143,8 @@ void (*op_vv) (size_t, R *, const X *), void (*op_vs) (size_t, R *, X)) { - dim_vector dvr = r.dims (), dvx = x.dims (); + dim_vector dvr = r.dims (); + dim_vector dvx = x.dims (); octave_idx_type nd = r.ndims (); dvx.redim (nd); diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/bsxfun.h --- a/liboctave/numeric/bsxfun.h Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/bsxfun.h Sun Dec 15 19:42:24 2013 -0800 @@ -38,7 +38,8 @@ { for (int i = 0; i < std::min (dx.length (), dy.length ()); i++) { - octave_idx_type xk = dx(i), yk = dy(i); + octave_idx_type xk = dx(i); + octave_idx_type yk = dy(i); // Check the three conditions for valid bsxfun dims if (! ( (xk == yk) || (xk == 1 && yk > 1) || (xk > 1 && yk == 1))) return false; @@ -59,13 +60,15 @@ is_valid_inplace_bsxfun (const std::string& name, const dim_vector& dr, const dim_vector& dx) { - octave_idx_type drl = dr.length (), dxl = dx.length (); + octave_idx_type drl = dr.length (); + octave_idx_type dxl = dx.length (); if (drl < dxl) return false; for (int i = 0; i < drl; i++) { - octave_idx_type rk = dr(i), xk = dx(i); + octave_idx_type rk = dr(i); + octave_idx_type xk = dx(i); // Only two valid canditions to check; can't stretch rk if (! ( (rk == xk) || (rk > 1 && xk == 1))) diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/dbleLU.cc --- a/liboctave/numeric/dbleLU.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/dbleLU.cc Sun Dec 15 19:42:24 2013 -0800 @@ -99,7 +99,8 @@ if (u.length () == m && v.length () == n) { - ColumnVector utmp = u, vtmp = v; + ColumnVector utmp = u; + ColumnVector vtmp = v; F77_XFCN (dlu1up, DLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); } @@ -123,7 +124,8 @@ { for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - ColumnVector utmp = u.column (i), vtmp = v.column (i); + ColumnVector utmp = u.column (i); + ColumnVector vtmp = v.column (i); F77_XFCN (dlu1up, DLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); @@ -147,7 +149,8 @@ if (u.length () == m && v.length () == n) { - ColumnVector utmp = u, vtmp = v; + ColumnVector utmp = u; + ColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (double, w, m); for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment F77_XFCN (dlup1up, DLUP1UP, (m, n, l.fortran_vec (), @@ -178,7 +181,8 @@ for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - ColumnVector utmp = u.column (i), vtmp = v.column (i); + ColumnVector utmp = u.column (i); + ColumnVector vtmp = v.column (i); F77_XFCN (dlup1up, DLUP1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, ipvt.fortran_vec (), diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/dbleQR.cc --- a/liboctave/numeric/dbleQR.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/dbleQR.cc Sun Dec 15 19:42:24 2013 -0800 @@ -138,7 +138,8 @@ void QR::form (octave_idx_type n, Matrix& afact, double *tau, qr_type_t qr_type) { - octave_idx_type m = afact.rows (), min_mn = std::min (m, n); + octave_idx_type m = afact.rows (); + octave_idx_type min_mn = std::min (m, n); octave_idx_type info; if (qr_type == qr_type_raw) @@ -214,7 +215,8 @@ if (u.length () == m && v.length () == n) { - ColumnVector utmp = u, vtmp = v; + ColumnVector utmp = u; + ColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (double, w, 2*k); F77_XFCN (dqr1up, DQR1UP, (m, n, k, q.fortran_vec (), m, r.fortran_vec (), k, @@ -236,7 +238,8 @@ OCTAVE_LOCAL_BUFFER (double, w, 2*k); for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - ColumnVector utmp = u.column (i), vtmp = v.column (i); + ColumnVector utmp = u.column (i); + ColumnVector vtmp = v.column (i); F77_XFCN (dqr1up, DQR1UP, (m, n, k, q.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec (), diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/fCmplxLU.cc --- a/liboctave/numeric/fCmplxLU.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/fCmplxLU.cc Sun Dec 15 19:42:24 2013 -0800 @@ -100,7 +100,8 @@ if (u.length () == m && v.length () == n) { - FloatComplexColumnVector utmp = u, vtmp = v; + FloatComplexColumnVector utmp = u; + FloatComplexColumnVector vtmp = v; F77_XFCN (clu1up, CLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); } @@ -125,7 +126,8 @@ { for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - FloatComplexColumnVector utmp = u.column (i), vtmp = v.column (i); + FloatComplexColumnVector utmp = u.column (i); + FloatComplexColumnVector vtmp = v.column (i); F77_XFCN (clu1up, CLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); @@ -150,7 +152,8 @@ if (u.length () == m && v.length () == n) { - FloatComplexColumnVector utmp = u, vtmp = v; + FloatComplexColumnVector utmp = u; + FloatComplexColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (FloatComplex, w, m); for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment F77_XFCN (clup1up, CLUP1UP, (m, n, l.fortran_vec (), @@ -182,7 +185,8 @@ for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - FloatComplexColumnVector utmp = u.column (i), vtmp = v.column (i); + FloatComplexColumnVector utmp = u.column (i); + FloatComplexColumnVector vtmp = v.column (i); F77_XFCN (clup1up, CLUP1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, ipvt.fortran_vec (), diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/fCmplxQR.cc --- a/liboctave/numeric/fCmplxQR.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/fCmplxQR.cc Sun Dec 15 19:42:24 2013 -0800 @@ -140,7 +140,8 @@ void FloatComplexQR::form (octave_idx_type n, FloatComplexMatrix& afact, FloatComplex *tau, qr_type_t qr_type) { - octave_idx_type m = afact.rows (), min_mn = std::min (m, n); + octave_idx_type m = afact.rows (); + octave_idx_type min_mn = std::min (m, n); octave_idx_type info; if (qr_type == qr_type_raw) @@ -217,7 +218,8 @@ if (u.length () == m && v.length () == n) { - FloatComplexColumnVector utmp = u, vtmp = v; + FloatComplexColumnVector utmp = u; + FloatComplexColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (FloatComplex, w, k); OCTAVE_LOCAL_BUFFER (float, rw, k); F77_XFCN (cqr1up, CQR1UP, (m, n, k, q.fortran_vec (), @@ -243,7 +245,8 @@ OCTAVE_LOCAL_BUFFER (float, rw, k); for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - FloatComplexColumnVector utmp = u.column (i), vtmp = v.column (i); + FloatComplexColumnVector utmp = u.column (i); + FloatComplexColumnVector vtmp = v.column (i); F77_XFCN (cqr1up, CQR1UP, (m, n, k, q.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec (), diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/floatLU.cc --- a/liboctave/numeric/floatLU.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/floatLU.cc Sun Dec 15 19:42:24 2013 -0800 @@ -99,7 +99,8 @@ if (u.length () == m && v.length () == n) { - FloatColumnVector utmp = u, vtmp = v; + FloatColumnVector utmp = u; + FloatColumnVector vtmp = v; F77_XFCN (slu1up, SLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); @@ -124,7 +125,8 @@ { for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - FloatColumnVector utmp = u.column (i), vtmp = v.column (i); + FloatColumnVector utmp = u.column (i); + FloatColumnVector vtmp = v.column (i); F77_XFCN (slu1up, SLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); @@ -149,7 +151,8 @@ if (u.length () == m && v.length () == n) { - FloatColumnVector utmp = u, vtmp = v; + FloatColumnVector utmp = u; + FloatColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (float, w, m); for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment F77_XFCN (slup1up, SLUP1UP, (m, n, l.fortran_vec (), @@ -180,7 +183,8 @@ for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - FloatColumnVector utmp = u.column (i), vtmp = v.column (i); + FloatColumnVector utmp = u.column (i); + FloatColumnVector vtmp = v.column (i); F77_XFCN (slup1up, SLUP1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, ipvt.fortran_vec (), diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/floatQR.cc --- a/liboctave/numeric/floatQR.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/floatQR.cc Sun Dec 15 19:42:24 2013 -0800 @@ -136,7 +136,8 @@ void FloatQR::form (octave_idx_type n, FloatMatrix& afact, float *tau, qr_type_t qr_type) { - octave_idx_type m = afact.rows (), min_mn = std::min (m, n); + octave_idx_type m = afact.rows (); + octave_idx_type min_mn = std::min (m, n); octave_idx_type info; if (qr_type == qr_type_raw) @@ -212,7 +213,8 @@ if (u.length () == m && v.length () == n) { - FloatColumnVector utmp = u, vtmp = v; + FloatColumnVector utmp = u; + FloatColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (float, w, 2*k); F77_XFCN (sqr1up, SQR1UP, (m, n, k, q.fortran_vec (), m, r.fortran_vec (), k, @@ -234,7 +236,8 @@ OCTAVE_LOCAL_BUFFER (float, w, 2*k); for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - FloatColumnVector utmp = u.column (i), vtmp = v.column (i); + FloatColumnVector utmp = u.column (i); + FloatColumnVector vtmp = v.column (i); F77_XFCN (sqr1up, SQR1UP, (m, n, k, q.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec (), diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/lo-specfun.cc --- a/liboctave/numeric/lo-specfun.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/lo-specfun.cc Sun Dec 15 19:42:24 2013 -0800 @@ -2696,7 +2696,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - result (i) = gammainc (x, a(i), err); + result(i) = gammainc (x, a(i), err); if (err) goto done; @@ -2722,7 +2722,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - result (i) = gammainc (x(i), a, err); + result(i) = gammainc (x(i), a, err); if (err) goto done; @@ -2752,7 +2752,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - result (i) = gammainc (x(i), a(i), err); + result(i) = gammainc (x(i), a(i), err); if (err) goto done; @@ -2901,7 +2901,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - result (i) = gammainc (x, a(i), err); + result(i) = gammainc (x, a(i), err); if (err) goto done; @@ -2927,7 +2927,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - result (i) = gammainc (x(i), a, err); + result(i) = gammainc (x(i), a, err); if (err) goto done; @@ -2957,7 +2957,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - result (i) = gammainc (x(i), a(i), err); + result(i) = gammainc (x(i), a(i), err); if (err) goto done; diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/oct-convn.cc --- a/liboctave/numeric/oct-convn.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/oct-convn.cc Sun Dec 15 19:42:24 2013 -0800 @@ -116,7 +116,8 @@ return MArray (); int nd = std::max (a.ndims (), b.ndims ()); - const dim_vector adims = a.dims ().redim (nd), bdims = b.dims ().redim (nd); + const dim_vector adims = a.dims ().redim (nd); + const dim_vector bdims = b.dims ().redim (nd); dim_vector cdims = dim_vector::alloc (nd); for (int i = 0; i < nd; i++) diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/oct-norm.cc --- a/liboctave/numeric/oct-norm.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/oct-norm.cc Sun Dec 15 19:42:24 2013 -0800 @@ -327,7 +327,9 @@ for (octave_idx_type i = 0; i < nsamp; i++) { octave_quit (); - R fi = i*M_PI/nsamp, lambda1 = cos (fi), mu1 = sin (fi); + R fi = i*M_PI/nsamp; + R lambda1 = cos (fi); + R mu1 = sin (fi); R lmnr = std::pow (std::pow (std::abs (lambda1), p) + std::pow (std::abs (mu1), p), 1/p); lambda1 /= lmnr; mu1 /= lmnr; @@ -358,7 +360,9 @@ for (octave_idx_type i = 0; i < nsamp; i++) { octave_quit (); - R fi = i*M_PI/nsamp, lambda1 = cos (fi), mu1 = sin (fi); + R fi = i*M_PI/nsamp; + R lambda1 = cos (fi); + R mu1 = sin (fi); R lmnr = std::pow (std::pow (std::abs (lambda1), p) + std::pow (std::abs (mu1), p), 1/p); lambda1 /= lmnr; mu1 /= lmnr; @@ -415,7 +419,8 @@ // the OSE part VectorT y(m.rows (), 1, 0), z(m.rows (), 1); typedef typename VectorT::element_type RR; - RR lambda = 0, mu = 1; + RR lambda = 0; + RR mu = 1; for (octave_idx_type k = 0; k < m.columns (); k++) { octave_quit (); diff -r a99bbbcf743c -r 7721e78b1337 liboctave/numeric/sparse-dmsolve.cc --- a/liboctave/numeric/sparse-dmsolve.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/numeric/sparse-dmsolve.cc Sun Dec 15 19:42:24 2013 -0800 @@ -43,7 +43,8 @@ octave_idx_type cend, octave_idx_type maxnz = -1, bool lazy = false) { - octave_idx_type nr = rend - rst, nc = cend - cst; + octave_idx_type nr = rend - rst; + octave_idx_type nc = cend - cst; maxnz = (maxnz < 0 ? A.nnz () : maxnz); octave_idx_type nz; diff -r a99bbbcf743c -r 7721e78b1337 liboctave/operators/mx-inlines.cc --- a/liboctave/operators/mx-inlines.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/operators/mx-inlines.cc Sun Dec 15 19:42:24 2013 -0800 @@ -365,7 +365,8 @@ void (*op2) (size_t, R *, const X *, Y) throw (), const char *opname) { - dim_vector dx = x.dims (), dy = y.dims (); + dim_vector dx = x.dims (); + dim_vector dy = y.dims (); if (dx == dy) { Array r (dx); @@ -410,7 +411,8 @@ void (*op1) (size_t, R *, X) throw (), const char *opname) { - dim_vector dr = r.dims (), dx = x.dims (); + dim_vector dr = r.dims (); + dim_vector dx = x.dims (); if (dr == dx) { op (r.length (), r.fortran_vec (), x.data ()); @@ -856,7 +858,8 @@ { \ if (! n) return; \ T tmp = v[0]; \ - octave_idx_type i = 1, j = 0; \ + octave_idx_type i = 1; \ + octave_idx_type j = 0; \ if (xisnan (tmp)) \ { \ for (; i < n && xisnan (v[i]); i++) ; \ @@ -876,7 +879,8 @@ { \ if (! n) return; \ T tmp = v[0]; octave_idx_type tmpi = 0; \ - octave_idx_type i = 1, j = 0; \ + octave_idx_type i = 1; \ + octave_idx_type j = 0; \ if (xisnan (tmp)) \ { \ for (; i < n && xisnan (v[i]); i++) ; \ @@ -1330,7 +1334,9 @@ inline void twosum_accum (T& s, T& e, const T& x) { - T s1 = s + x, t = s1 - s, e1 = (s - (s1 - t)) + (x - t); + T s1 = s + x; + T t = s1 - s; + T e1 = (s - (s1 - t)) + (x - t); s = s1; e += e1; } @@ -1339,7 +1345,8 @@ inline T mx_inline_xsum (const T *v, octave_idx_type n) { - T s = 0, e = 0; + T s = 0; + T e = 0; for (octave_idx_type i = 0; i < n; i++) twosum_accum (s, e, v[i]); diff -r a99bbbcf743c -r 7721e78b1337 liboctave/operators/mx-op-defs.h --- a/liboctave/operators/mx-op-defs.h Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/operators/mx-op-defs.h Sun Dec 15 19:42:24 2013 -0800 @@ -599,7 +599,8 @@ #define PMM_MULTIPLY_OP(PM, M) \ M operator * (const PM& p, const M& x) \ { \ - octave_idx_type nr = x.rows (), nc = x.columns (); \ + octave_idx_type nr = x.rows (); \ + octave_idx_type nc = x.columns (); \ M result; \ if (p.columns () != nr) \ gripe_nonconformant ("operator *", p.rows (), p.columns (), nr, nc); \ @@ -620,7 +621,8 @@ #define MPM_MULTIPLY_OP(M, PM) \ M operator * (const M& x, const PM& p) \ { \ - octave_idx_type nr = x.rows (), nc = x.columns (); \ + octave_idx_type nr = x.rows (); \ + octave_idx_type nc = x.columns (); \ M result; \ if (p.rows () != nc) \ gripe_nonconformant ("operator *", nr, nc, p.rows (), p.columns ()); \ diff -r a99bbbcf743c -r 7721e78b1337 liboctave/system/file-ops.cc --- a/liboctave/system/file-ops.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/system/file-ops.cc Sun Dec 15 19:42:24 2013 -0800 @@ -689,8 +689,6 @@ std::string retval; -#if defined (HAVE_CANONICALIZE_FILE_NAME) - char *tmp = gnulib::canonicalize_file_name (name.c_str ()); if (tmp) @@ -699,98 +697,6 @@ free (tmp); } -#elif defined (HAVE_RESOLVEPATH) - -#if !defined (errno) -extern int errno; -#endif - -#if !defined (__set_errno) -# define __set_errno(Val) errno = (Val) -#endif - - if (name.empty ()) - { - __set_errno (ENOENT); - return retval; - } - - // All known hosts with resolvepath (e.g. Solaris 7) don't turn - // relative names into absolute ones, so prepend the working - // directory if the path is not absolute. - - std::string absolute_name = octave_env::make_absolute (name); - - size_t resolved_size = absolute_name.length (); - - while (true) - { - resolved_size = 2 * resolved_size + 1; - - OCTAVE_LOCAL_BUFFER (char, resolved, resolved_size); - - int resolved_len - = resolvepath (absolute_name.c_str (), resolved, resolved_size); - - if (resolved_len < 0) - break; - - if (resolved_len < resolved_size) - { - retval = resolved; - break; - } - } - -#elif defined (__WIN32__) - - int n = 1024; - - std::string win_path (n, '\0'); - - while (true) - { - int status = GetFullPathName (name.c_str (), n, &win_path[0], 0); - - if (status == 0) - break; - else if (status < n) - { - win_path.resize (status); - retval = win_path; - break; - } - else - { - n *= 2; - win_path.resize (n); - } - } - -#elif defined (HAVE_REALPATH) - -#if !defined (__set_errno) -# define __set_errno(Val) errno = (Val) -#endif - - if (name.empty ()) - { - __set_errno (ENOENT); - return retval; - } - - OCTAVE_LOCAL_BUFFER (char, buf, PATH_MAX); - - if (::realpath (name.c_str (), buf)) - retval = buf; - -#else - - // FIXME: provide replacement here... - retval = name; - -#endif - if (retval.empty ()) msg = gnulib::strerror (errno); diff -r a99bbbcf743c -r 7721e78b1337 liboctave/util/caseless-str.h --- a/liboctave/util/caseless-str.h Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/util/caseless-str.h Sun Dec 15 19:42:24 2013 -0800 @@ -54,7 +54,8 @@ while (p1 != end () && p2 != s.end ()) { - char lp1 = std::tolower (*p1), lp2 = std::tolower (*p2); + char lp1 = std::tolower (*p1); + char lp2 = std::tolower (*p2); if ( lp1 > lp2 ) return false; diff -r a99bbbcf743c -r 7721e78b1337 liboctave/util/kpse.cc --- a/liboctave/util/kpse.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/util/kpse.cc Sun Dec 15 19:42:24 2013 -0800 @@ -1612,7 +1612,10 @@ static int brace_gobbler (const std::string& text, int& indx, int satisfy) { - int c = 0, level = 0, quoted = 0, pass_next = 0; + int c = 0; + int level = 0; + int quoted = 0; + int pass_next = 0; size_t text_len = text.length (); diff -r a99bbbcf743c -r 7721e78b1337 liboctave/util/lo-utils.cc --- a/liboctave/util/lo-utils.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/util/lo-utils.cc Sun Dec 15 19:42:24 2013 -0800 @@ -322,7 +322,8 @@ std::complex octave_read_cx_fp_value (std::istream& is) { - T re = 0.0, im = 0.0; + T re = 0.0; + T im = 0.0; std::complex cx = 0.0; diff -r a99bbbcf743c -r 7721e78b1337 liboctave/util/oct-binmap.h --- a/liboctave/util/oct-binmap.h Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/util/oct-binmap.h Sun Dec 15 19:42:24 2013 -0800 @@ -167,7 +167,8 @@ Array binmap (const Array& xa, const Array& ya, F fcn, const char *name) { - dim_vector xad = xa.dims (), yad = ya.dims (); + dim_vector xad = xa.dims (); + dim_vector yad = ya.dims (); if (xa.numel () == 1) return binmap (xa(0), ya, fcn); else if (ya.numel () == 1) @@ -268,7 +269,8 @@ if (fz == U ()) { // Sparsity-preserving function. Do it efficiently. - octave_idx_type nr = xs.rows (), nc = xs.cols (); + octave_idx_type nr = xs.rows (); + octave_idx_type nc = xs.cols (); Sparse retval (nr, nc); octave_idx_type nz = 0; @@ -276,11 +278,14 @@ for (octave_idx_type j = 0; j < nc; j++) { octave_quit (); - octave_idx_type ix = xs.cidx (j), iy = ys.cidx (j); - octave_idx_type ux = xs.cidx (j+1), uy = ys.cidx (j+1); + octave_idx_type ix = xs.cidx (j); + octave_idx_type iy = ys.cidx (j); + octave_idx_type ux = xs.cidx (j+1); + octave_idx_type uy = ys.cidx (j+1); while (ix != ux || iy != uy) { - octave_idx_type rx = xs.ridx (ix), ry = ys.ridx (ix); + octave_idx_type rx = xs.ridx (ix); + octave_idx_type ry = ys.ridx (ix); ix += rx <= ry; iy += ry <= rx; nz++; @@ -297,11 +302,14 @@ for (octave_idx_type j = 0; j < nc; j++) { octave_quit (); - octave_idx_type ix = xs.cidx (j), iy = ys.cidx (j); - octave_idx_type ux = xs.cidx (j+1), uy = ys.cidx (j+1); + octave_idx_type ix = xs.cidx (j); + octave_idx_type iy = ys.cidx (j); + octave_idx_type ux = xs.cidx (j+1); + octave_idx_type uy = ys.cidx (j+1); while (ix != ux || iy != uy) { - octave_idx_type rx = xs.ridx (ix), ry = ys.ridx (ix); + octave_idx_type rx = xs.ridx (ix); + octave_idx_type ry = ys.ridx (ix); if (rx == ry) { retval.xridx (nz) = rx; diff -r a99bbbcf743c -r 7721e78b1337 liboctave/util/oct-cmplx.h --- a/liboctave/util/oct-cmplx.h Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/util/oct-cmplx.h Sun Dec 15 19:42:24 2013 -0800 @@ -40,10 +40,12 @@ template \ inline bool operator OP (const std::complex& a, const std::complex& b) \ { \ - FLOAT_TRUNCATE const T ax = std::abs (a), bx = std::abs (b); \ + FLOAT_TRUNCATE const T ax = std::abs (a); \ + FLOAT_TRUNCATE const T bx = std::abs (b); \ if (ax == bx) \ { \ - FLOAT_TRUNCATE const T ay = std::arg (a), by = std::arg (b); \ + FLOAT_TRUNCATE const T ay = std::arg (a); \ + FLOAT_TRUNCATE const T by = std::arg (b); \ return ay OP by; \ } \ else \ @@ -52,7 +54,8 @@ template \ inline bool operator OP (const std::complex& a, T b) \ { \ - FLOAT_TRUNCATE const T ax = std::abs (a), bx = std::abs (b); \ + FLOAT_TRUNCATE const T ax = std::abs (a); \ + FLOAT_TRUNCATE const T bx = std::abs (b); \ if (ax == bx) \ { \ FLOAT_TRUNCATE const T ay = std::arg (a); \ @@ -64,7 +67,8 @@ template \ inline bool operator OP (T a, const std::complex& b) \ { \ - FLOAT_TRUNCATE const T ax = std::abs (a), bx = std::abs (b); \ + FLOAT_TRUNCATE const T ax = std::abs (a); \ + FLOAT_TRUNCATE const T bx = std::abs (b); \ if (ax == bx) \ { \ FLOAT_TRUNCATE const T by = std::arg (b); \ diff -r a99bbbcf743c -r 7721e78b1337 liboctave/util/oct-inttypes.cc --- a/liboctave/util/oct-inttypes.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/util/oct-inttypes.cc Sun Dec 15 19:42:24 2013 -0800 @@ -280,7 +280,8 @@ octave_int_arith_base::mul_internal (uint64_t x, uint64_t y) { // Get upper words - uint64_t ux = x >> 32, uy = y >> 32; + uint64_t ux = x >> 32; + uint64_t uy = y >> 32; uint64_t res; if (ux) { @@ -288,21 +289,25 @@ goto overflow; else { - uint64_t ly = static_cast (y), uxly = ux*ly; + uint64_t ly = static_cast (y); + uint64_t uxly = ux*ly; if (uxly >> 32) goto overflow; uxly <<= 32; // never overflows - uint64_t lx = static_cast (x), lxly = lx*ly; + uint64_t lx = static_cast (x); + uint64_t lxly = lx*ly; res = add (uxly, lxly); } } else if (uy) { - uint64_t lx = static_cast (x), uylx = uy*lx; + uint64_t lx = static_cast (x); + uint64_t uylx = uy*lx; if (uylx >> 32) goto overflow; uylx <<= 32; // never overflows - uint64_t ly = static_cast (y), lylx = ly*lx; + uint64_t ly = static_cast (y); + uint64_t lylx = ly*lx; res = add (uylx, lylx); } else @@ -330,11 +335,13 @@ // (as above) and impose the sign. // FIXME: can we do something faster if we HAVE_FAST_INT_OPS? - uint64_t usx = octave_int_abs (x), usy = octave_int_abs (y); + uint64_t usx = octave_int_abs (x); + uint64_t usy = octave_int_abs (y); bool positive = (x < 0) == (y < 0); // Get upper words - uint64_t ux = usx >> 32, uy = usy >> 32; + uint64_t ux = usx >> 32; + uint64_t uy = usy >> 32; uint64_t res; if (ux) { @@ -342,11 +349,13 @@ goto overflow; else { - uint64_t ly = static_cast (usy), uxly = ux*ly; + uint64_t ly = static_cast (usy); + uint64_t uxly = ux*ly; if (uxly >> 32) goto overflow; uxly <<= 32; // never overflows - uint64_t lx = static_cast (usx), lxly = lx*ly; + uint64_t lx = static_cast (usx); + uint64_t lxly = lx*ly; res = uxly + lxly; if (res < uxly) goto overflow; @@ -354,11 +363,13 @@ } else if (uy) { - uint64_t lx = static_cast (usx), uylx = uy*lx; + uint64_t lx = static_cast (usx); + uint64_t uylx = uy*lx; if (uylx >> 32) goto overflow; uylx <<= 32; // never overflows - uint64_t ly = static_cast (usy), lylx = ly*lx; + uint64_t ly = static_cast (usy); + uint64_t lylx = ly*lx; res = uylx + lylx; if (res < uylx) goto overflow; @@ -496,11 +507,14 @@ static void umul128 (uint64_t x, uint64_t y, uint32_t w[4]) { - uint64_t lx = static_cast (x), ux = x >> 32; - uint64_t ly = static_cast (y), uy = y >> 32; + uint64_t lx = static_cast (x); + uint64_t ux = x >> 32; + uint64_t ly = static_cast (y); + uint64_t uy = y >> 32; uint64_t a = lx * ly; w[0] = a; a >>= 32; - uint64_t uxly = ux*ly, uylx = uy*lx; + uint64_t uxly = ux*ly; + uint64_t uylx = uy*lx; a += static_cast (uxly); uxly >>= 32; a += static_cast (uylx); uylx >>= 32; w[1] = a; a >>= 32; diff -r a99bbbcf743c -r 7721e78b1337 liboctave/util/oct-inttypes.h --- a/liboctave/util/oct-inttypes.h Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/util/oct-inttypes.h Sun Dec 15 19:42:24 2013 -0800 @@ -81,7 +81,8 @@ class NM \ { \ public: \ - static const bool ltval = (0 OP 1), gtval = (1 OP 0); \ + static const bool ltval = (0 OP 1); \ + static const bool gtval = (1 OP 0); \ template \ static bool op (T x, T y) { return x OP y; } \ } @@ -92,7 +93,8 @@ class NM \ { \ public: \ - static const bool ltval = value, gtval = value; \ + static const bool ltval = value; \ + static const bool gtval = value; \ template \ static bool op (T, T) { return value; } \ } @@ -268,7 +270,9 @@ // An exhaustive test whether the max and/or min check can be omitted. static const bool t_is_signed = std::numeric_limits::is_signed; static const bool s_is_signed = std::numeric_limits::is_signed; - static const int t_size = sizeof (T), s_size = sizeof (S); + static const int t_size = sizeof (T); + static const int s_size = sizeof (S); + static const bool omit_chk_min = (! s_is_signed || (t_is_signed && t_size >= s_size)); static const bool omit_chk_max = @@ -420,7 +424,8 @@ { if (y != 0) { - T z = x / y, w = x % y; + T z = x / y; + T w = x % y; if (w >= y-w) z += 1; return z; } @@ -610,7 +615,8 @@ // compiler from interfering. Also, the signed operations on small types // actually return int. T u = static_cast (x) + static_cast (y); - T ux = u ^ x, uy = u ^ y; + T ux = u ^ x; + T uy = u ^ y; if ((ux & uy) < 0) { u = octave_int_base::max_val () + __signbit (~u); @@ -651,7 +657,8 @@ // compiler from interfering. Also, the signed operations on small types // actually return int. T u = static_cast (x) - static_cast (y); - T ux = u ^ x, uy = u ^ ~y; + T ux = u ^ x; + T uy = u ^ ~y; if ((ux & uy) < 0) { u = octave_int_base::max_val () + __signbit (~u); @@ -1237,7 +1244,8 @@ octave_int xmax (const octave_int& x, const octave_int& y) { - const T xv = x.value (), yv = y.value (); + const T xv = x.value (); + const T yv = y.value (); return octave_int (xv >= yv ? xv : yv); } @@ -1245,7 +1253,8 @@ octave_int xmin (const octave_int& x, const octave_int& y) { - const T xv = x.value (), yv = y.value (); + const T xv = x.value (); + const T yv = y.value (); return octave_int (xv <= yv ? xv : yv); } diff -r a99bbbcf743c -r 7721e78b1337 liboctave/util/oct-sort.cc --- a/liboctave/util/oct-sort.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/liboctave/util/oct-sort.cc Sun Dec 15 19:42:24 2013 -0800 @@ -158,7 +158,8 @@ for (; start < nel; ++start) { /* set l to where *start belongs */ - octave_idx_type l = 0, r = start; + octave_idx_type l = 0; + octave_idx_type r = start; T pivot = data[start]; /* Invariants: * pivot >= all in [lo, l). @@ -202,7 +203,8 @@ for (; start < nel; ++start) { /* set l to where *start belongs */ - octave_idx_type l = 0, r = start; + octave_idx_type l = 0; + octave_idx_type r = start; T pivot = data[start]; /* Invariants: * pivot >= all in [lo, l). @@ -1694,7 +1696,8 @@ { // Not the final column. assert (n > 1); - const T *hi = lo + n, *lst = lo; + const T *hi = lo + n; + const T *lst = lo; for (lo++; lo < hi; lo++) { if (comp (*lst, *lo)) @@ -1756,7 +1759,8 @@ octave_sort::lookup (const T *data, octave_idx_type nel, const T& value, Comp comp) { - octave_idx_type lo = 0, hi = nel; + octave_idx_type lo = 0; + octave_idx_type hi = nel; while (lo < hi) { @@ -1834,7 +1838,8 @@ { if (rev) { - octave_idx_type i = 0, j = nvalues - 1; + octave_idx_type i = 0; + octave_idx_type j = nvalues - 1; if (nvalues > 0 && nel > 0) { @@ -1856,7 +1861,8 @@ } else { - octave_idx_type i = 0, j = 0; + octave_idx_type i = 0; + octave_idx_type j = 0; if (nvalues > 0 && nel > 0) { diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/__error_text__.m --- a/scripts/deprecated/__error_text__.m Sun Dec 15 19:31:18 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -## 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 -## . - -## -*- texinfo -*- -## @deftypefn {Built-in Function} {[@var{msg}, @var{msgid}] =} __error_text__ (@var{msg}, @var{msgid}) -## This function has been deprecated. Use @code{lasterr} instead. -## @seealso{lasterr} -## @end deftypefn - -function [msg, msgid] = __error_text__ (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "__error_text__ is obsolete and will be removed from a future version of Octave, please use lasterr instead"); - endif - - [msg, msgid] = lasterr (varargin{:}); - -endfunction - diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/cor.m --- a/scripts/deprecated/cor.m Sun Dec 15 19:31:18 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -## Copyright (C) 1995-2013 Kurt Hornik -## -## 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 -## . - -## -*- texinfo -*- -## @deftypefn {Function File} {} cor (@var{x}) -## @deftypefnx {Function File} {} cor (@var{x}, @var{y}) -## Compute matrix of correlation coefficients. -## -## This is an alias for @code{corrcoef}. -## @seealso{corrcoef} -## @end deftypefn - -function retval = cor (x, y = x) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "cor is obsolete and will be removed from a future version of Octave; please use corr instead"); - endif - - if (nargin < 1 || nargin > 2) - print_usage (); - endif - - retval = corrcoef (x, y); - -endfunction - - -%!test -%! x = rand (10, 2); -%! assert (cor (x), corrcoef (x), 5*eps); -%! assert (cor (x(:,1), x(:,2)) == corrcoef (x(:,1), x(:,2))); - -%% Test input validation -%!error corrcoef (); -%!error corrcoef (1, 2, 3); - diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/corrcoef.m --- a/scripts/deprecated/corrcoef.m Sun Dec 15 19:31:18 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -## 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 -## . - -## -*- texinfo -*- -## @deftypefn {Function File} {} corrcoef (@var{x}) -## @deftypefnx {Function File} {} corrcoef (@var{x}, @var{y}) -## Compute matrix of correlation coefficients. -## -## If each row of @var{x} and @var{y} is an observation and each column is -## a variable, then the @w{(@var{i}, @var{j})-th} entry of -## @code{corrcoef (@var{x}, @var{y})} is the correlation between the -## @var{i}-th variable in @var{x} and the @var{j}-th variable in @var{y}. -## @tex -## $$ -## {\rm corrcoef}(x,y) = {{\rm cov}(x,y) \over {\rm std}(x) {\rm std}(y)} -## $$ -## @end tex -## @ifnottex -## -## @example -## corrcoef(x,y) = cov(x,y)/(std(x)*std(y)) -## @end example -## -## @end ifnottex -## If called with one argument, compute @code{corrcoef (@var{x}, @var{x})}, -## the correlation between the columns of @var{x}. -## @seealso{cov} -## @end deftypefn - -## Author: Kurt Hornik -## Created: March 1993 -## Adapted-By: jwe - -function retval = corrcoef (x, y = []) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "corrcoef is not equivalent to Matlab and will be removed from a future version of Octave; for similar functionality see corr"); - endif - - if (nargin < 1 || nargin > 2) - print_usage (); - endif - - ## Input validation is done by cov.m. Don't repeat tests here - - ## Special case, scalar is always 100% correlated with itself - if (isscalar (x)) - if (isa (x, 'single')) - retval = single (1); - else - retval = 1; - endif - return; - endif - - ## No check for division by zero error, which happens only when - ## there is a constant vector and should be rare. - if (nargin == 2) - c = cov (x, y); - s = std (x)' * std (y); - retval = c ./ s; - else - c = cov (x); - s = sqrt (diag (c)); - retval = c ./ (s * s'); - endif - -endfunction - - -%!test -%! x = rand (10); -%! cc1 = corrcoef (x); -%! cc2 = corrcoef (x, x); -%! assert (size (cc1) == [10, 10] && size (cc2) == [10, 10]); -%! assert (cc1, cc2, sqrt (eps)); - -%!test -%! x = [1:3]'; -%! y = [3:-1:1]'; -%! assert (corrcoef (x,y), -1, 5*eps) -%! assert (corrcoef (x,flipud (y)), 1, 5*eps) -%! assert (corrcoef ([x, y]), [1 -1; -1 1], 5*eps) - -%!test -%! x = single ([1:3]'); -%! y = single ([3:-1:1]'); -%! assert (corrcoef (x,y), single (-1), 5*eps) -%! assert (corrcoef (x,flipud (y)), single (1), 5*eps) -%! assert (corrcoef ([x, y]), single ([1 -1; -1 1]), 5*eps) - -%!assert (corrcoef (5), 1); -%!assert (corrcoef (single(5)), single(1)); - -%% Test input validation -%!error corrcoef (); -%!error corrcoef (1, 2, 3); -%!error corrcoef ([1; 2], ["A", "B"]); -%!error corrcoef (ones (2,2,2)); -%!error corrcoef (ones (2,2), ones (2,2,2)); - diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/cut.m --- a/scripts/deprecated/cut.m Sun Dec 15 19:31:18 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -## Copyright (C) 1996-2013 Kurt Hornik -## -## 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 -## . - -## -*- texinfo -*- -## @deftypefn {Function File} {} cut (@var{x}, @var{breaks}) -## Create categorical data from numerical or continuous data by -## cutting into intervals. -## -## If @var{breaks} is a scalar, the data is cut into that many -## equal-width intervals. If @var{breaks} is a vector of break points, -## the category has @code{length (@var{breaks}) - 1} groups. -## -## The returned value is a vector of the same size as @var{x} telling -## which group each point in @var{x} belongs to. Groups are labelled -## from 1 to the number of groups; points outside the range of -## @var{breaks} are labelled by @code{NaN}. -## @seealso{histc} -## @end deftypefn - -## Author: KH -## Description: Cut data into intervals - -function group = cut (x, breaks) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "cut is obsolete and will be removed from a future version of Octave; please use histc instead"); - endif - - if (nargin != 2) - print_usage (); - endif - - if (!isvector (x)) - error ("cut: X must be a vector"); - endif - if (isscalar (breaks)) - breaks = linspace (min (x), max (x), breaks + 1); - breaks(1) = breaks(1) - 1; - elseif (isvector (breaks)) - breaks = sort (breaks); - else - error ("cut: BREAKS must be a scalar or vector"); - endif - - group = NaN (size (x)); - m = length (breaks); - if (any (k = find ((x >= min (breaks)) & (x < max (breaks))))) - n = length (k); - group(k) = sum ((ones (m, 1) * reshape (x(k), 1, n)) - >= (reshape (breaks, m, 1) * ones (1, n))); - endif - -endfunction - diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/default_save_options.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/error_text.m --- a/scripts/deprecated/error_text.m Sun Dec 15 19:31:18 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -## 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 -## . - -## -*- texinfo -*- -## @deftypefn {Built-in Function} {[@var{msg}, @var{msgid}] =} error_text (@var{msg}, @var{msgid}) -## This function has been deprecated. Use @code{lasterr} instead. -## @seealso{lasterr} -## @end deftypefn - -function [msg, msgid] = error_text (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "error_text is obsolete and will be removed from a future version of Octave, please use lasterr instead"); - endif - - [msg, msgid] = lasterr (varargin{:}); - -endfunction - diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/interp1q.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/isequalwithequalnans.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/java_convert_matrix.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/java_debug.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/java_get.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/java_invoke.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/java_set.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/java_unsigned_conversion.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/javafields.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/javamethods.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/module.mk --- a/scripts/deprecated/module.mk Sun Dec 15 19:31:18 2013 -0800 +++ b/scripts/deprecated/module.mk Sun Dec 15 19:42:24 2013 -0800 @@ -1,12 +1,7 @@ FCN_FILE_DIRS += deprecated deprecated_FCN_FILES = \ - deprecated/__error_text__.m \ - deprecated/cor.m \ - deprecated/corrcoef.m \ - deprecated/cut.m \ deprecated/default_save_options.m \ - deprecated/error_text.m \ deprecated/gen_doc_cache.m \ deprecated/interp1q.m \ deprecated/isequalwithequalnans.m \ @@ -20,13 +15,9 @@ deprecated/java_set.m \ deprecated/javafields.m \ deprecated/javamethods.m \ - deprecated/polyderiv.m \ deprecated/re_read_readline_init_file.m \ deprecated/read_readline_init_file.m \ - deprecated/saving_history.m \ - deprecated/shell_cmd.m \ - deprecated/studentize.m \ - deprecated/sylvester_matrix.m + deprecated/saving_history.m FCN_FILES += $(deprecated_FCN_FILES) diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/polyderiv.m --- a/scripts/deprecated/polyderiv.m Sun Dec 15 19:31:18 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -## 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 -## . - -## -*- texinfo -*- -## @deftypefn {Function File} {} polyderiv (@var{p}) -## @deftypefnx {Function File} {[@var{k}] =} polyderiv (@var{a}, @var{b}) -## @deftypefnx {Function File} {[@var{q}, @var{d}] =} polyderiv (@var{b}, @var{a}) -## Return the coefficients of the derivative of the polynomial whose -## coefficients are given by the vector @var{p}. If a pair of polynomials -## is given, return the derivative of the product @math{@var{a}*@var{b}}. -## If two inputs and two outputs are given, return the derivative of the -## polynomial quotient @math{@var{b}/@var{a}}. The quotient numerator is -## in @var{q} and the denominator in @var{d}. -## @seealso{poly, polyint, polyreduce, roots, conv, deconv, residue, -## filter, polygcd, polyval, polyvalm} -## @end deftypefn - -## Author: Tony Richardson -## Created: June 1994 -## Adapted-By: jwe - -function [q, d] = polyderiv (p, a) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "polyderiv is obsolete and will be removed from a future version of Octave; please use polyder instead"); - endif - - if (nargin == 1 || nargin == 2) - if (! isvector (p)) - error ("polyderiv: argument must be a vector"); - endif - if (nargin == 2) - if (! isvector (a)) - error ("polyderiv: argument must be a vector"); - endif - if (nargout == 1) - ## derivative of p*a returns a single polynomial - q = polyderiv (conv (p, a)); - else - ## derivative of p/a returns numerator and denominator - d = conv (a, a); - if (numel (p) == 1) - q = -p * polyderiv (a); - elseif (numel (a) == 1) - q = a * polyderiv (p); - else - q = conv (polyderiv (p), a) - conv (p, polyderiv (a)); - q = polyreduce (q); - endif - - ## remove common factors from numerator and denominator - x = polygcd (q, d); - if (length(x) != 1) - q = deconv (q, x); - d = deconv (d, x); - endif - - ## move all the gain into the numerator - q = q/d(1); - d = d/d(1); - endif - else - lp = numel (p); - if (lp == 1) - q = 0; - return; - elseif (lp == 0) - q = []; - return; - endif - - ## Force P to be a row vector. - p = p(:).'; - - q = p(1:(lp-1)) .* [(lp-1):-1:1]; - endif - else - print_usage (); - endif - -endfunction - - -%!assert(all (all (polyderiv ([1, 2, 3]) == [2, 2]))); - -%!assert(polyderiv (13) == 0); - -%!error polyderiv ([]); - -%!error polyderiv ([1, 2; 3, 4]); - diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/saving_history.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/shell_cmd.m --- a/scripts/deprecated/shell_cmd.m Sun Dec 15 19:31:18 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -## Copyright (C) 2012-2013 Rik Wehbring -## -## 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 -## . - -## "-*- texinfo -*- -## @deftypefn {Built-in Function} {} shell_cmd (@var{string}) -## @deftypefnx {Built-in Function} {} shell_cmd (@var{string}, @var{return_output}) -## @deftypefnx {Built-in Function} {} shell_cmd (@var{string}, @var{return_output}, @var{type}) -## @deftypefnx {Built-in Function} {[@var{status}, @var{output}] =} shell_cmd (@dots{}) -## @deftypefnx {Built-in Function} {[@var{status}, @var{output}] =} shell_cmd (@var{string}, @var{return_output}, @var{type}) -## Execute a shell command specified by @var{string}. -## If the optional argument @var{type} is @qcode{"async"}, the process -## is started in the background and the process id of the child process -## is returned immediately. Otherwise, the process is started and -## Octave waits until it exits. If the @var{type} argument is omitted, it -## defaults to a value of @qcode{"sync"}. -## -## If the optional argument @var{return_output} is true and the subprocess -## is started synchronously, or if @var{shell_cmd} is called with one input -## argument and one or more output arguments, then the output from the command -## is returned. Otherwise, if the subprocess is executed synchronously, its -## output is sent to the standard output. -## -## The @code{shell_cmd} function can return two values. The first is the -## exit status of the command and the second is any output from the -## command that was written to the standard output stream. For example, -## -## @example -## [status, output] = shell_cmd ("echo foo; exit 2"); -## @end example -## -## @noindent -## will set the variable @code{output} to the string @samp{foo}, and the -## variable @code{status} to the integer @samp{2}. -## -## For commands run asynchronously, @var{status} is the process id of the -## command shell that is started to run the command. -## @seealso{system, unix, dos} -## @end deftypefn - -## Deprecated in version 3.6 - -function [status, output] = shell_cmd (varargin) - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "shell_cmd is obsolete and will be removed from a future version of Octave; please use system instead"); - endif - - [status, output] = system (varargin{:}); - -endfunction - diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/studentize.m --- a/scripts/deprecated/studentize.m Sun Dec 15 19:31:18 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -## Copyright (C) 1995-2013 Kurt Hornik -## -## 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 -## . - -## -*- texinfo -*- -## @deftypefn {Function File} {} studentize (@var{x}) -## @deftypefnx {Function File} {} studentize (@var{x}, @var{dim}) -## If @var{x} is a vector, subtract its mean and divide by its standard -## deviation. -## -## If @var{x} is a matrix, do the above along the first non-singleton -## dimension. -## If the optional argument @var{dim} is given, operate along this dimension. -## @seealso{center} -## @end deftypefn - -## Author: KH -## Description: Subtract mean and divide by standard deviation - -function t = studentize (x, dim) - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "studentize is obsolete and will be removed from a future version of Octave; please use zscore instead"); - endif - - if (nargin != 1 && nargin != 2) - print_usage (); - endif - - if (! isnumeric(x)) - error ("studentize: X must be a numeric vector or matrix"); - endif - - if (isinteger (x)) - x = double (x); - endif - - nd = ndims (x); - sz = size (x); - if (nargin != 2) - ## Find the first non-singleton dimension. - dim = find (sz > 1, 1); - if (isempty (dim)) - dim = 1; - endif - else - if (!(isscalar (dim) && dim == fix (dim)) - || !(1 <= dim && dim <= nd)) - error ("studentize: DIM must be an integer and a valid dimension"); - endif - endif - - c = sz(dim); - if (c == 0) - t = x; - else - idx = ones (1, nd); - idx(dim) = c; - t = x - repmat (mean (x, dim), idx); - t = t ./ repmat (max (cat (dim, std(t, [], dim), ! any (t, dim)), [], dim), idx); - endif - -endfunction - - -%!assert(studentize ([1,2,3]), [-1,0,1]) -%!assert(studentize (int8 ([1,2,3])), [-1,0,1]) -#%!assert(studentize (ones (3,2,0,2)), zeros (3,2,0,2)) -%!assert(studentize ([2,0,-2;0,2,0;-2,-2,2]), [1,0,-1;0,1,0;-1,-1,1]) - -%% Test input validation -%!error studentize () -%!error studentize (1, 2, 3) -%!error studentize ([true true]) -%!error studentize (1, ones(2,2)) -%!error studentize (1, 1.5) -%!error studentize (1, 0) -%!error studentize (1, 3) - diff -r a99bbbcf743c -r 7721e78b1337 scripts/deprecated/sylvester_matrix.m --- a/scripts/deprecated/sylvester_matrix.m Sun Dec 15 19:31:18 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -## 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 -## . - -## -*- texinfo -*- -## @deftypefn {Function File} {} sylvester_matrix (@var{k}) -## Return the Sylvester matrix of order -## @tex -## $n = 2^k$. -## @end tex -## @ifnottex -## n = 2^@var{k}. -## @end ifnottex -## -## @seealso{toeplitz, hankel} -## @end deftypefn - -## Author: jwe - -function retval = sylvester_matrix (k) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "sylvester_matrix is obsolete and will be removed from a future version of Octave; please use hadamard(2^k) instead"); - endif - - if (nargin != 1) - print_usage (); - endif - - if (isscalar (k)) - if (k < 1) - retval = 1; - else - tmp = sylvester_matrix (k-1); - retval = [tmp, tmp; tmp, -tmp]; - endif - else - error ("sylvester_matrix: expecting scalar argument"); - endif - -endfunction - - -%!assert((sylvester_matrix (1) == [1, 1; 1, -1] -%! && (sylvester_matrix (2) -%! == [1, 1, 1, 1; 1, -1, 1, -1; 1, 1, -1, -1; 1, -1, -1, 1]))); - -%!error sylvester_matrix ([1, 2; 3, 4]); - -%!error sylvester_matrix (); - -%!error sylvester_matrix (1, 2); - diff -r a99bbbcf743c -r 7721e78b1337 scripts/general/isa.m --- a/scripts/general/isa.m Sun Dec 15 19:31:18 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -## 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 -## . - -## -*- texinfo -*- -## @deftypefn {Function File} {} isa (@var{obj}, @var{classname}) -## Return true if @var{obj} is an object from the class @var{classname}. -## -## @var{classname} may also be one of the following class categories: -## -## @table @asis -## @item @qcode{"float"} -## Floating point value comprising classes @qcode{"double"} and -## @qcode{"single"}. -## -## @item @qcode{"integer"} -## Integer value comprising classes (u)int8, (u)int16, (u)int32, (u)int64. -## -## @item @qcode{"numeric"} -## Numeric value comprising either a floating point or integer value. -## @end table -## @seealso{class, typeinfo} -## @end deftypefn - -## Author: Paul Kienzle -## Adapted-by: jwe - -function retval = isa (obj, classname) - - if (nargin != 2) - print_usage (); - endif - - if (strcmp (classname, "float")) - retval = isfloat (obj); - elseif (strcmp (classname, "integer")) - retval = isinteger (obj); - elseif (strcmp (classname, "numeric")) - retval = isnumeric (obj); - else - class_of_obj = class (obj); - retval = strcmp (class_of_obj, classname); - if (! retval && isobject (obj)) - retval = __isa_parent__ (obj, classname); - endif - endif - -endfunction - - -%!assert (isa ("char", "float"), false) -%!assert (isa (logical (1), "float"), false) -%!assert (isa (double (13), "float"), true) -%!assert (isa (single (13), "float"), true) -%!assert (isa (int8 (13), "float"), false) -%!assert (isa (int16 (13), "float"), false) -%!assert (isa (int32 (13), "float"), false) -%!assert (isa (int64 (13), "float"), false) -%!assert (isa (uint8 (13), "float"), false) -%!assert (isa (uint16 (13), "float"), false) -%!assert (isa (uint32 (13), "float"), false) -%!assert (isa (uint64 (13), "float"), false) -%!assert (isa ("char", "numeric"), false) -%!assert (isa (logical (1), "numeric"), false) -%!assert (isa (double (13), "numeric"), true) -%!assert (isa (single (13), "numeric"), true) -%!assert (isa (int8 (13), "numeric"), true) -%!assert (isa (int16 (13), "numeric"), true) -%!assert (isa (int32 (13), "numeric"), true) -%!assert (isa (int64 (13), "numeric"), true) -%!assert (isa (uint8 (13), "numeric"), true) -%!assert (isa (uint16 (13), "numeric"), true) -%!assert (isa (uint32 (13), "numeric"), true) -%!assert (isa (uint64 (13), "numeric"), true) -%!assert (isa (uint8 (13), "integer"), true) -%!assert (isa (double (13), "integer"), false) -%!assert (isa (single (13), "integer"), false) - -%!assert (isa (double (13), "double")) -%!assert (isa (single (13), "single")) -%!assert (isa (int8 (13), "int8")) -%!assert (isa (int16 (13), "int16")) -%!assert (isa (int32 (13), "int32")) -%!assert (isa (int64 (13), "int64")) -%!assert (isa (uint8 (13), "uint8")) -%!assert (isa (uint16 (13), "uint16")) -%!assert (isa (uint32 (13), "uint32")) -%!assert (isa (uint64 (13), "uint64")) -%!assert (isa ("string", "char")) -%!assert (isa (true, "logical")) -%!assert (isa (false, "logical")) -%!assert (isa ({1, 2}, "cell")) -%!test -%! a.b = 1; -%! assert (isa (a, "struct")); - diff -r a99bbbcf743c -r 7721e78b1337 scripts/general/module.mk --- a/scripts/general/module.mk Sun Dec 15 19:31:18 2013 -0800 +++ b/scripts/general/module.mk Sun Dec 15 19:42:24 2013 -0800 @@ -40,7 +40,6 @@ general/interp3.m \ general/interpn.m \ general/interpft.m \ - general/isa.m \ general/iscolumn.m \ general/isdir.m \ general/isequal.m \ @@ -82,6 +81,7 @@ general/subsindex.m \ general/triplequad.m \ general/trapz.m \ + general/validateattributes.m \ $(general_PRIVATE_FCN_FILES) FCN_FILES += $(general_FCN_FILES) diff -r a99bbbcf743c -r 7721e78b1337 scripts/general/validateattributes.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/general/validateattributes.m Sun Dec 15 19:42:24 2013 -0800 @@ -0,0 +1,432 @@ +## Copyright (C) 2013 Carnë Draug +## +## 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 +## . + +## -*- texinfo -*- +## @deftypefn {Function File} {} validateattributes (@var{A}, @var{classes}, @var{attributes}) +## @deftypefnx {Function File} {} validateattributes (@var{A}, @var{classes}, @var{attributes}, @var{arg_idx}) +## @deftypefnx {Function File} {} validateattributes (@var{A}, @var{classes}, @var{attributes}, @var{func_name}) +## @deftypefnx {Function File} {} validateattributes (@var{A}, @var{classes}, @var{attributes}, @var{func_name}, @var{arg_name}) +## @deftypefnx {Function File} {} validateattributes (@var{A}, @var{classes}, @var{attributes}, @var{func_name}, @var{arg_name}, @var{arg_idx}) +## Check validity of input argument. +## +## Confirms that the argument @var{A} is valid by belonging to one of +## @var{classes}, and holding all of the @var{attributes}. If it does not, +## an error is thrown, with a message formatted accordingly. The error +## message can be made further complete by the function name @var{fun_name}, +## the argument name @var{arg_name}, and its position in the input +## @var{arg_idx}. +## +## @var{classes} must be a cell array of strings (an empty cell array is +## allowed) with the name of classes (remember that a class name is case +## sensitive). In addition to the class name, the following categories +## names are also valid: +## +## @table @asis +## @item @qcode{"float"} +## Floating point value comprising classes @qcode{"double"} and +## @qcode{"single"}. +## +## @item @qcode{"integer"} +## Integer value comprising classes (u)int8, (u)int16, (u)int32, (u)int64. +## +## @item @qcode{"numeric"} +## Numeric value comprising either a floating point or integer value. +## +## @end table +## +## @var{attributes} must be a cell array with names of checks for @var{A}. +## Some of them require an additional value to be supplied right after the +## name (see details for each below). +## +## @table @asis +## @item @qcode{"<="} +## All values are less than or equal to the following value in @var{attributes}. +## +## @item @qcode{"<"} +## All values are less than the following value in @var{attributes}. +## +## @item @qcode{">="} +## All values are greater than or equal to the following value in +## @var{attributes}. +## +## @item @qcode{">"} +## All values are greater than the following value in @var{attributes}. +## +## @item @qcode{"2d"} +## A 2-dimensional matrix. Note that vectors and empty matrices have +## 2 dimensions, one of them being of length 1, or both length 0. +## +## @item @qcode{"3d"} +## Has no more than 3 dimensions. A 2-dimensional matrix is a 3-D matrix +## whose 3rd dimension is of length 1. +## +## @item @qcode{"binary"} +## All values are either 1 or 0. +## +## @item @qcode{"column"} +## Values are arranged in a single column. +## +## @item @qcode{"decreasing"} +## No value is @var{NaN}, and each is less than the preceding one. +## +## @item @qcode{"even"} +## All values are even numbers. +## +## @item @qcode{"finite"} +## All values are finite. +## +## @item @qcode{"increasing"} +## No value is @var{NaN}, and each is greater than the preceding one. +## +## @item @qcode{"integer"} +## All values are integer. This is different than using @code{isinteger} +## which only checks its an integer type. This checks that each value in +## @var{A} is an integer value, i.e., it has no decimal part. +## +## @item @qcode{"ncols"} +## Has exactly as many columns as the next value in @var{attributes}. +## +## @item @qcode{"ndims"} +## Has exactly as many dimensions as the next value in @var{attributes}. +## +## @item @qcode{"nondecreasing"} +## No value is @var{NaN}, and each is greater than or equal to the preceding +## one. +## +## @item @qcode{"nonempty"} +## It is not empty. +## +## @item @qcode{"nonincreasing"} +## No value is @var{NaN}, and each is less than or equal to the preceding one. +## +## @item @qcode{"nonnan"} +## No value is a @code{NaN}. +## +## @item @qcode{"non-negative"} +## All values are non negative. +## +## @item @qcode{"nonsparse"} +## It is not a sparse matrix. +## +## @item @qcode{"nonzero"} +## No value is zero. +## +## @item @qcode{"nrows"} +## Has exactly as many rows as the next value in @var{attributes}. +## +## @item @qcode{"numel"} +## Has exactly as many elements as the next value in @var{attributes}. +## +## @item @qcode{"odd"} +## All values are odd numbers. +## +## @item @qcode{"positive"} +## All values are positive. +## +## @item @qcode{"real"} +## It is a non-complex matrix. +## +## @item @qcode{"row"} +## Values are arranged in a single row. +## +## @item @qcode{"scalar"} +## It is a scalar. +## +## @item @qcode{"size",} +## Its size has length equal to the values of the next in @var{attributes}. +## The next value must is an array with the length for each dimension. To +## ignore the check for a certain dimension, the value of @code{NaN} can be +## used. +## +## @item @qcode{"square"} +## Is a square matrix. +## +## @item @qcode{"vector"} +## Values are arranged in a single vector (column or vector). +## +## @end table +## +## @seealso{nargin, varargin, isa, validatestring} +## @end deftypefn + +function validateattributes (A, cls, attr, varargin) + if (nargin < 3 || nargin > 6) + print_usage (); + elseif (! iscellstr (cls)) + error ("validateattributes: CLASSES must be a cell array of strings"); + elseif (! iscell (attr)) + error ("validateattributes: ATTRIBUTES must be a cell array"); + endif + + ## Built start of error message from the extra optional arguments + func_name = ""; + var_name = "input"; + if (nargin > 3) + fourth = varargin{1}; + if (ischar (fourth)) + func_name = [fourth ": "]; + elseif (nargin == 4 && valid_arg_idx (fourth)) + var_name = sprintf ("input %d", fourth); + else + error ("validateattributes: 4th input argument must be ARG_IDX or FUNC_NAME"); + endif + + if (nargin > 4) + var_name = varargin{2}; + if (! ischar (var_name)) + error ("validateattributes: VAR_NAME must be a string"); + endif + + if (nargin > 5) + arg_idx = varargin{3}; + if (! valid_arg_idx (arg_idx)) + error ("validateattributes: ARG_IDX must be a positive integer"); + endif + var_name = sprintf ("%s (argument #%i)", var_name, arg_idx); + endif + endif + endif + err_ini = [func_name var_name]; + + check_cl = isa (A, cls); + if (! isempty (check_cl) && ! any (check_cl)) + ## Allowing for an empty list of classes is Matlab incompatible but + ## that should count as a just a Matlab bug, not an incompatibility. + + ## Replace the category names with the classes that belong to it. + integer = { "int8" "int16" "int32" "int64" ... + "uint8" "uint16" "uint32" "uint64"}; + float = {"single" "double"}; + numeric = {integer{:} float{:}}; + cls = replace_cl_group (cls, "integer", integer); + cls = replace_cl_group (cls, "float", float ); + cls = replace_cl_group (cls, "numeric", numeric); + cls = unique (cls); + + classes = sprintf (" %s", cls{:}); + error ("%s must be of class:\n\n %s\n\nbut was of class %s", + err_ini, classes, class (A)); + endif + + ## We use a while loop because some attributes require the following value + ## in the cell array. Also, we can't just get the boolean value for the + ## test and check at the end the error message since some of the tests + ## require some more complex error message. + + ## It may look like that we don't perform enough input check in this + ## function (e.g., we don't check if there's a value after the size + ## attribute). The reasoning is that this will be a function mostly used + ## by developers with fairly static input so any problem would be caught + ## immediately during that functino development, it's no dependent on the + ## final user input. In addition, it can be called so many times at the + ## start of every function, we want it to run specially fast. + idx = 1; + problem = false; # becomes true when one of the tests fails + while (idx <= numel (attr)) + ## TODO: once we use this in Octave core, it might be worthy to find + ## which attributes are checked more often, and place them in that + ## order inside the switch block. + switch (tolower (attr{idx++})) + case "2d", problem = ndims (A) != 2; + case "3d", problem = ndims (A) > 3; + case "column", problem = ! iscolumn (A); + case "row", problem = ! isrow (A); + case "scalar", problem = ! isscalar (A); + case "vector", problem = ! isvector (A); + case "square", problem = ! issquare (A); + case "nonempty", problem = isempty (A); + case "nonsparse", problem = issparse (A); + case "binary", problem = ! islogical (A) && ... + any ((A(:) != 1) & (A(:) != 0)); + case "even", problem = any (rem (A(:), 2) != 0); + case "odd", problem = any (mod (A(:), 2) != 1); + case "integer", problem = ! isinteger (A) && ... + any (ceil (A(:)) != A(:)); + case "real", problem = ! isreal (A); + case "finite", problem = ! isinteger (A) && ... + ! all (isfinite (A(:))); + case "nonnan", problem = ! isinteger (A) && ... + any (isnan (A(:))); + case "nonnegative", problem = any (A(:) < 0); + case "nonzero", problem = any (A(:) == 0); + case "positive", problem = any (A(:) <= 0); + case "decreasing", problem = (any (isnan (A(:))) || + any (diff (A(:)) >= 0)); + case "increasing", problem = (any (isnan (A(:))) || + any (diff (A(:)) <= 0)); + case "nondecreasing", problem = (any (isnan (A(:))) || + any (diff (A(:)) < 0)); + case "nonincreasing", problem = (any (isnan (A(:))) || + any (diff (A(:)) > 0)); + case "size", + A_size = size (A); + w_size = attr{idx++}; + A_size(isnan (w_size)) = NaN; + if (! isequaln (A_size, w_size)) + A_size_str = sprintf ("%dx", size (A))(1:end-1); + w_size_str = sprintf ("%ix", w_size)(1:end-1); + w_size_str = strrep (w_size_str, "NaN", "N"); + error ("%s must be of size %s but was %s", err_ini, w_size_str, A_size_str); + endif + case "numel", + if (numel (A) != attr{idx++}) + error ("%s must have %d elements", err_ini, attr{idx-1}); + endif + case "ncols", + if (columns (A) != attr{idx++}) + error ("%s must have %d columns", err_ini, attr{idx-1}); + endif + case "nrows", + if (rows (A) != attr{idx++}) + error ("%s must have %d rows", err_ini, attr{idx-1}); + endif + case "ndims", + ## Note that a [4 5 1] matrix is not considered to have ndims == 3 + ## but is ok for "3d". This is not a bug. + if (ndims (A) != attr{idx++}) + error ("%s must have %d dimensions", err_ini, attr{idx-1}); + endif + case ">" + if (! all (A(:) > attr{idx++})) + error ("%s must be greater than %f", err_ini, attr{idx-1}); + endif + case ">=" + if (! all (A(:) >= attr{idx++})) + error ("%s must be greater than or equal to %f", err_ini, attr{idx-1}); + endif + case "<" + if (! all (A(:) < attr{idx++})) + error ("%s must be less than %f", err_ini, attr{idx-1}); + endif + case "<=" + if (! all (A(:) <= attr{idx++})) + error ("%s must be less than or equal to %f", err_ini, attr{idx-1}); + endif + otherwise + error ("validateattributes: unknown ATTRIBUTE %s", attr{idx-1}); + endswitch + if (problem) + error ("%s must be %s", err_ini, attr{idx-1}); + endif + endwhile +endfunction + +function retval = valid_arg_idx (arg) + retval = isnumeric (arg) && isscalar (arg) && arg > 0 && ceil (arg) == arg; +endfunction + +function cls = replace_cl_group (cls, name, group) + num_pos = strcmpi (cls, name); + if (any (num_pos)) + cls(num_pos) = []; + cls(end+1:end+numel(group)) = group; + endif +endfunction + +%!error validateattributes (rand (5), {"uint8"}, {}) +%!error validateattributes (uint8 (rand (5)), {"float"}, {}) +%!error <2d> validateattributes (rand (5, 5, 5), {}, {"2d"}) +%!error <3d> validateattributes (rand (5, 5, 5, 7), {}, {"3d"}) +%!error validateattributes (rand (5, 5), {}, {"column"}) +%!error validateattributes (rand (1, 5), {}, {"column"}) +%!error validateattributes (rand (5, 5), {}, {"row"}) +%!error validateattributes (rand (5, 1), {}, {"row"}) +%!error validateattributes (rand (1, 5), {}, {"scalar"}) +%!error validateattributes (rand (5), {}, {"vector"}) +%!error validateattributes (rand (5, 6), {}, {"square"}) +%!error validateattributes ([], {}, {"nonempty"}) +%!error validateattributes (sparse(rand(5)), {}, {"nonsparse"}) +%!error validateattributes ("text", {}, {"binary"}) +%!error validateattributes ([0 1 0 3 0], {}, {"binary"}) +%!error validateattributes ([2 3 6 8], {}, {"even"}) +%!error validateattributes ([2 NaN], {}, {"even"}) +%!error validateattributes ([3 4 7 5], {}, {"odd"}) +%!error validateattributes ([5 NaN], {}, {"odd"}) +%!error validateattributes ([5 5.2 5.7], {}, {"integer"}) +%!error validateattributes ([5i 8 9], {}, {"real"}) +%!error validateattributes ([5i Inf 8], {}, {"finite"}) +%!error validateattributes ([NaN Inf 8], {}, {"nonnan"}) +%!error validateattributes ([7 8 -9], {}, {"nonnegative"}) +%!error validateattributes ([7 8 0], {}, {"nonzero"}) +%!error validateattributes ([7 0 8], {}, {"positive"}) +%!error validateattributes ([7 8 4 3 -5], {}, {"decreasing"}) +%!error validateattributes ([7 NaN 4 3 -5], {}, {"decreasing"}) +%!error validateattributes ([7 8 4 9 20], {}, {"increasing"}) +%!error validateattributes ([7 8 NaN 9 20], {}, {"increasing"}) +%!error validateattributes ([7 8 4 9 20], {}, {"nonincreasing"}) +%!error validateattributes ([7 8 NaN 9 20], {}, {"nonincreasing"}) +%!error validateattributes ([7 8 4 3 -5], {}, {"nondecreasing"}) +%!error validateattributes ([7 NaN 4 3 -5], {}, {"nondecreasing"}) +%!error validateattributes (ones (5, 3, 6), {}, {"size", [5 4 7]}) +%!error validateattributes (ones (5, 3, 6), {}, {"size", [5 NaN 7]}) +%!error validateattributes (ones (5, 3, 6), {}, {"size", [5 3 6 2]}) +%!error validateattributes (ones (6, 3), {}, {"numel", 12}) +%!error validateattributes (ones (6, 2), {}, {"ncols", 3}) +%!error validateattributes (ones (6, 2), {}, {"nrows", 3}) +%!error validateattributes (ones (6, 2, 6, 3), {}, {"ndims", 3}) +%!error validateattributes ([6 7 8 5], {}, {">", 5}) +%!error validateattributes ([6 7 8 5], {}, {">=", 6}) +%!error validateattributes ([6 7 8 5], {}, {"<", 8}) +%!error validateattributes ([6 7 8 5], {}, {"<=", 7}) + +%!test +%! validateattributes (rand (5), {"numeric"}, {}) +%! validateattributes (rand (5), {"float"}, {}) +%! validateattributes (rand (5), {"double"}, {}) +%! validateattributes ("text", {"char"}, {}) +%! validateattributes (rand (5), {}, {"2d"}) +%! validateattributes (rand (5), {}, {"3d"}) +%! validateattributes (rand (5, 5, 5), {}, {"3d"}) +%! validateattributes (rand (5, 1), {}, {"column"}) +%! validateattributes (rand (1, 5), {}, {"row"}) +%! validateattributes ("a", {}, {"scalar"}) +%! validateattributes (5, {}, {"scalar"}) +%! validateattributes (rand (1, 5), {}, {"vector"}) +%! validateattributes (rand (5, 1), {}, {"vector"}) +%! validateattributes (rand (5), {}, {"square"}) +%! validateattributes (rand (5), {}, {"nonempty"}) +%! validateattributes (rand (5), {}, {"nonsparse"}) +%! validateattributes ([0 1 0 1 0], {}, {"binary"}) +%! validateattributes (rand (5) > 0.5, {}, {"binary"}) +%! validateattributes ([8 4 0 6], {}, {"even"}) +%! validateattributes ([-1 3 5], {}, {"odd"}) +%! validateattributes ([8 4 0 6], {}, {"real"}) +%! validateattributes ([8 4i 0 6], {}, {"finite"}) +%! validateattributes (uint8 ([8 4]), {}, {"finite"}) +%! validateattributes ([8 Inf], {}, {"nonnan"}) +%! validateattributes ([0 7 4], {}, {"nonnegative"}) +%! validateattributes ([-8 7 4], {}, {"nonzero"}) +%! validateattributes ([8 7 4], {}, {"positive"}) +%! validateattributes ([8 7 4 -5], {}, {"decreasing"}) +%! validateattributes ([-8 -7 4 5], {}, {"increasing"}) +%! validateattributes ([8 4 4 -5], {}, {"nonincreasing"}) +%! validateattributes ([-8 -8 4 5], {}, {"nondecreasing"}) +%! validateattributes (rand (4, 6, 7, 2), {}, {"size", [4 6 7 2]}) +%! validateattributes (rand (4, 6, 7, 2), {}, {"size", [4 NaN 7 2]}) +%! validateattributes (rand (4, 6, 7, 2), {}, {"size", [4 6 NaN 2 NaN]}) +%! validateattributes (rand (6, 2), {}, {"numel", 12}) +%! validateattributes (rand (6, 2), {}, {"ncols", 2}) +%! validateattributes (rand (6, 2), {}, {"nrows", 6}) +%! validateattributes (rand (6, 2, 4, 5), {}, {"ndims", 4}) +%! validateattributes ([4 5 6 7], {}, {">", 3}) +%! validateattributes ([4 5 6 7], {}, {">=", 4}) +%! validateattributes ([4 5 6 7], {}, {"<", 8}) +%! validateattributes ([4 5 6 7], {}, {"<=", 7}) + +%!test +%! validateattributes ([0 1 0 1], {"double", "uint8"}, {"binary", "size", [NaN 4], "nonnan"}) diff -r a99bbbcf743c -r 7721e78b1337 scripts/help/__unimplemented__.m --- a/scripts/help/__unimplemented__.m Sun Dec 15 19:31:18 2013 -0800 +++ b/scripts/help/__unimplemented__.m Sun Dec 15 19:42:24 2013 -0800 @@ -822,7 +822,6 @@ "unloadlibrary", "unmesh", "userpath", - "validateattributes", "verctrl", "verLessThan", "viewmtx", diff -r a99bbbcf743c -r 7721e78b1337 scripts/help/help.m diff -r a99bbbcf743c -r 7721e78b1337 scripts/miscellaneous/edit.m --- a/scripts/miscellaneous/edit.m Sun Dec 15 19:31:18 2013 -0800 +++ b/scripts/miscellaneous/edit.m Sun Dec 15 19:42:24 2013 -0800 @@ -284,7 +284,7 @@ endif ## If the file includes a path, it may be an overloaded function. - if (! index (file, "@") && index (file, filesep)) + if (! index (file, "@") && strchr (file, '/\')) ## No "@" at the beginning of the file, add to the list. numfiles = numel (filelist); for n = 1:numfiles diff -r a99bbbcf743c -r 7721e78b1337 scripts/miscellaneous/ls.m --- a/scripts/miscellaneous/ls.m Sun Dec 15 19:31:18 2013 -0800 +++ b/scripts/miscellaneous/ls.m Sun Dec 15 19:42:24 2013 -0800 @@ -63,6 +63,10 @@ if (ispc () && ! isunix ()) ## shell (cmd.exe) on MinGW uses '^' as escape character args = regexprep (args, '([^\w.*? -])', '^$1'); + ## Strip UNIX directory character which looks like an option to dir cmd. + if (args{end}(end) == '/') + args{end}(end) = ""; + endif else args = regexprep (args, '([^\w.*? -])', '\\$1'); endif diff -r a99bbbcf743c -r 7721e78b1337 scripts/miscellaneous/what.m --- a/scripts/miscellaneous/what.m Sun Dec 15 19:31:18 2013 -0800 +++ b/scripts/miscellaneous/what.m Sun Dec 15 19:42:24 2013 -0800 @@ -30,17 +30,19 @@ if (nargin == 0) d = pwd (); - elseif (isempty (strfind (d, filesep ()))) - ## Find the appropriate directory on the path. - p = strtrim (ostrsplit (path (), pathsep ())); - d = p{find (cellfun (@(x) ! isempty (strfind (x, d)), p))(end)}; else - [status, msg, msgid] = fileattrib (d); - if (status != 1) - error ("what: could not find the file or path %s", d); - else - d = msg.Name; + dtmp = canonicalize_file_name (d); + if (isempty (dtmp)) + ## Search for directory name in path + if (d(end) == '/' || d(end) == '\') + d(end) = []; + endif + dtmp = find_dir_in_path (d); + if (isempty (dtmp)) + error ("what: could not find the directory %s", d); + endif endif + d = dtmp; endif files = dir (d); @@ -60,7 +62,7 @@ continue; else ## Ignore mdl and p files - [dummy, f, e] = fileparts (n); + [~, f, e] = fileparts (n); if (strcmp (e, ".m")) w.m{end+1} = n; elseif (strcmp (e, ".oct")) diff -r a99bbbcf743c -r 7721e78b1337 scripts/plot/draw/fill.m --- a/scripts/plot/draw/fill.m Sun Dec 15 19:31:18 2013 -0800 +++ b/scripts/plot/draw/fill.m Sun Dec 15 19:42:24 2013 -0800 @@ -93,16 +93,16 @@ for i = 1 : length (iargs) cdata = varargin{iargs(i) + 2}; - - ## Matlab uses flat/interp shading based on orientation of cdata. - if (isnumeric (cdata) && isrow (cdata)) - popt = ["facecolor", "flat", opts]; - else - popt = opts; + ## For Matlab compatibility, replicate cdata to match size of data + if (iscolumn (cdata)) + sz = size (varargin{iargs(i)}); + if (all (sz > 1)) + cdata = repmat (cdata, [1, sz(2)]); + endif endif [htmp, fail] = __patch__ (hax, varargin{iargs(i)+(0:1)}, cdata, - popt{:}); + opts{:}); if (fail) print_usage (); endif @@ -145,7 +145,7 @@ endif elseif (isnumeric (arg)) ## Assume any numeric argument is correctly formatted cdata. - ## Let patch worry about the multple different input formats + ## Let patch worry about the multple different input formats. retval = true; endif endfunction diff -r a99bbbcf743c -r 7721e78b1337 scripts/testfun/rundemos.m --- a/scripts/testfun/rundemos.m Sun Dec 15 19:31:18 2013 -0800 +++ b/scripts/testfun/rundemos.m Sun Dec 15 19:42:24 2013 -0800 @@ -36,20 +36,17 @@ dirs = ostrsplit (path (), pathsep ()); do_class_dirs = true; elseif (nargin == 1) - if (is_absolute_filename (directory)) - dirs = {directory}; - elseif (is_rooted_relative_filename (directory)) - dirs = {canonicalize_file_name(directory)}; - else - if (directory(end) == filesep ()) - directory = directory(1:end-1); + dirs = {canonicalize_file_name(directory)}; + if (isempty (dirs{1})) + ## Search for directory name in path + if (directory(end) == '/' || directory(end) == '\') + directory(end) = []; endif fullname = find_dir_in_path (directory); - if (! isempty (fullname)) - dirs = {fullname}; - else + if (isempty (fullname)) error ("rundemos: DIRECTORY argument must be a valid pathname"); endif + dirs = {fullname}; endif do_class_dirs = false; else diff -r a99bbbcf743c -r 7721e78b1337 scripts/testfun/runtests.m --- a/scripts/testfun/runtests.m Sun Dec 15 19:31:18 2013 -0800 +++ b/scripts/testfun/runtests.m Sun Dec 15 19:42:24 2013 -0800 @@ -36,20 +36,17 @@ dirs = ostrsplit (path (), pathsep ()); do_class_dirs = true; elseif (nargin == 1) - if (is_absolute_filename (directory)) - dirs = {directory}; - elseif (is_rooted_relative_filename (directory)) - dirs = {canonicalize_file_name(directory)}; - else - if (directory(end) == filesep ()) - directory = directory(1:end-1); + dirs = {canonicalize_file_name(directory)}; + if (isempty (dirs{1})) + ## Search for directory name in path + if (directory(end) == '/' || directory(end) == '\') + directory(end) = []; endif fullname = find_dir_in_path (directory); - if (! isempty (fullname)) - dirs = {fullname}; - else + if (isempty (fullname)) error ("runtests: DIRECTORY argument must be a valid pathname"); endif + dirs = {fullname}; endif do_class_dirs = false; else diff -r a99bbbcf743c -r 7721e78b1337 src/main.in.cc --- a/src/main.in.cc Sun Dec 15 19:31:18 2013 -0800 +++ b/src/main.in.cc Sun Dec 15 19:42:24 2013 -0800 @@ -585,12 +585,18 @@ { int retval = 0; - bool start_gui = false; - bool gui_libs = false; + bool start_gui = true; + bool gui_libs = true; std::string octave_bindir = get_octave_bindir (); - std::string file = octave_bindir + dir_sep_char + "octave-cli"; + std::string file = octave_bindir + dir_sep_char; + +#if defined (HAVE_OCTAVE_GUI) + file += "octave-gui"; +#else + file += "octave-cli"; +#endif char **new_argv = new char * [argc + 1]; @@ -605,19 +611,7 @@ for (int i = 1; i < argc; i++) { - if (! strcmp (argv[i], "--force-gui")) - { - start_gui = true; - gui_libs = true; - file = octave_bindir + dir_sep_char; - #if defined (HAVE_OCTAVE_GUI) - file += "octave-gui"; - #else - file += "octave-cli"; - #endif - new_argv[k++] = argv[i]; - } - else if (! strcmp (argv[i], "--no-gui-libs")) + if (! strcmp (argv[i], "--no-gui-libs")) { // Run the version of Octave that is not linked with any GUI // libraries. It may not be possible to do plotting or any @@ -625,7 +619,9 @@ // require less memory. Don't pass the --no-gui-libs option // on as that option is not recognized by Octave. - // This is the default for 3.8 release. + start_gui = false; + gui_libs = false; + file = octave_bindir + dir_sep_char + "octave-cli"; } else if (! strcmp (argv[i], "--no-gui")) { @@ -635,10 +631,11 @@ // if the --no-gui option is given, we may be asked to do some // plotting or ui* calls. - // This option calls the cli executable for the 3.8 release. + start_gui = false; + new_argv[k++] = argv[i]; } - else if (! strcmp (argv[i], "--silent") || ! strcmp (argv[i], "-q") - || ! strcmp (argv[i], "--quiet")) + else if (! strcmp (argv[i], "--silent") || ! strcmp (argv[i], "--quiet") + || ! strcmp (argv[i], "-q")) { warn_display = false; new_argv[k++] = argv[i];