Mercurial > hg > octave-nkf
changeset 18069:76006571e45a
maint: Periodic merge of stable to default.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 03 Dec 2013 16:06:46 -0800 |
parents | 23f680301f65 (diff) 1c4fd938bdef (current diff) |
children | ff05d5b70411 |
files | configure.ac src/main.in.cc |
diffstat | 45 files changed, 2225 insertions(+), 3247 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS +++ b/NEWS @@ -1,373 +1,14 @@ -Summary of important user-visible changes for version 3.8: +Summary of important user-visible changes for version 4.2: --------------------------------------------------------- - ** 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'. + ** Other new functions added in 4.2: - ** 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 + *none* ** 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): + The following functions were deprecated in Octave 3.8 and have been + removed from Octave 4.2. default_save_options java_new gen_doc_cache java_set @@ -379,1143 +20,52 @@ 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): + The following functions have been deprecated in Octave 4.2 and will + be removed from Octave 4.6 (or whatever version is the second major + release after 4.2): + + *none* + + + The following keywords were deprecated in Octave 3.8 and have been + removed from Octave 4.2 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): + The following configuration variables were deprecated in Octave 3.8 + and have been removed from Octave 4.2 CC_VERSION (now GCC_VERSION) CXX_VERSION (now GXX_VERSION) - The internal class <Octave_map> 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 <octave_map> (struct array) - or <octave_scalar_map> for a single structure. + The internal class <Octave_map> was deprecated in Octave 3.8 and has + been removed from Octave 4.2. Replacement classes are + <octave_map> (struct array) or <octave_scalar_map> for a single structure. -Summary of important user-visible changes for version 3.6: +Summary of important user-visible changes for version 4.0: --------------------------------------------------------- - ** 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) + ** Other new functions added in 4.0.0: - ** 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 + 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. + *none* - ** 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.
--- a/build-aux/common.mk +++ b/build-aux/common.mk @@ -105,8 +105,6 @@ # C compiler flags. CC = @CC@ -## FIXME: CC_VERSION is deprecated and should be removed in version 3.12 -CC_VERSION = @CC_VERSION@ GCC_VERSION = @GCC_VERSION@ CPICFLAG = @CPICFLAG@ XTRA_CFLAGS = @XTRA_CFLAGS@ @@ -129,8 +127,6 @@ # C++ compiler flags. CXX = @CXX@ -## FIXME: CXX_VERSION is deprecated and should be removed in version 3.12 -CXX_VERSION = @CXX_VERSION@ GXX_VERSION = @GXX_VERSION@ CXXCPP = @CXXCPP@ CXXPICFLAG = @CXXPICFLAG@ @@ -516,7 +512,6 @@ -e "s|%OCTAVE_CONF_CANONICAL_HOST_TYPE%|\"${canonical_host_type}\"|" \ -e "s|%OCTAVE_CONF_CARBON_LIBS%|\"${CARBON_LIBS}\"|" \ -e "s|%OCTAVE_CONF_CC%|\"${CC}\"|" \ - -e "s|%OCTAVE_CONF_CC_VERSION%|\"${CC_VERSION}\"|" \ -e "s|%OCTAVE_CONF_CCOLAMD_CPPFLAGS%|\"${CCOLAMD_CPPFLAGS}\"|" \ -e "s|%OCTAVE_CONF_CCOLAMD_LDFLAGS%|\"${CCOLAMD_LDFLAGS}\"|" \ -e "s|%OCTAVE_CONF_CCOLAMD_LIBS%|\"${CCOLAMD_LIBS}\"|" \
--- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ ### <http://www.gnu.org/licenses/>. AC_PREREQ([2.62]) -AC_INIT([GNU Octave], [3.7.7+], [http://octave.org/bugs.html], [octave]) +AC_INIT([GNU Octave], [4.1.0+], [http://octave.org/bugs.html], [octave]) dnl PACKAGE_VERSION is set by the AC_INIT VERSION arg OCTAVE_VERSION="$PACKAGE_VERSION" @@ -305,10 +305,6 @@ fi AC_SUBST(GXX_VERSION) -## FIXME: CXX_VERSION is deprecated and should be removed in Octave version 3.12 -CXX_VERSION=$gxx_version -AC_SUBST(CXX_VERSION) - ### Determine which C compiler to use (we expect to find gcc). AC_PROG_CC @@ -355,10 +351,6 @@ fi AC_SUBST(GCC_VERSION) -## FIXME: CC_VERSION is deprecated and should be removed in Octave version 3.12 -CC_VERSION=$GCC_VERSION -AC_SUBST(CC_VERSION) - ### Also check g++ version number, it might be different from the ## gcc version number. @@ -2153,7 +2145,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])
--- a/doc/interpreter/func.txi +++ b/doc/interpreter/func.txi @@ -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.
--- a/etc/NEWS.3 +++ b/etc/NEWS.3 @@ -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 <Octave_map> 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 <octave_map> (struct array) + or <octave_scalar_map> 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.
new file mode 100644 --- /dev/null +++ b/etc/RELEASE.PROCESS @@ -0,0 +1,84 @@ +<!-----------------------------------------------------------------------------> +<! This file contains a list of steps to accomplish before producing a release. + The format of the file is wiki markup and can be directly used as a page + on wiki.octave.org. +<!-----------------------------------------------------------------------------> +==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]]
--- a/libinterp/corefcn/toplev.cc +++ b/libinterp/corefcn/toplev.cc @@ -1251,8 +1251,6 @@ { false, "CAMD_LIBS", OCTAVE_CONF_CAMD_LIBS }, { false, "CARBON_LIBS", OCTAVE_CONF_CARBON_LIBS }, { false, "CC", OCTAVE_CONF_CC }, - // FIXME: CC_VERSION is deprecated. Remove in version 3.12 - { false, "CC_VERSION", OCTAVE_CONF_CC_VERSION }, { false, "CCOLAMD_CPPFLAGS", OCTAVE_CONF_CCOLAMD_CPPFLAGS }, { false, "CCOLAMD_LDFLAGS", OCTAVE_CONF_CCOLAMD_LDFLAGS }, { false, "CCOLAMD_LIBS", OCTAVE_CONF_CCOLAMD_LIBS }, @@ -1275,8 +1273,6 @@ { false, "CXXCPP", OCTAVE_CONF_CXXCPP }, { false, "CXXFLAGS", OCTAVE_CONF_CXXFLAGS }, { false, "CXXPICFLAG", OCTAVE_CONF_CXXPICFLAG }, - // FIXME: CXX_VERSION is deprecated. Remove in version 3.12 - { false, "CXX_VERSION", OCTAVE_CONF_CXX_VERSION }, { false, "DEFAULT_PAGER", OCTAVE_DEFAULT_PAGER }, { false, "DEFS", OCTAVE_CONF_DEFS }, { false, "DL_LD", OCTAVE_CONF_DL_LD },
--- a/libinterp/octave-value/ov-class.cc +++ b/libinterp/octave-value/ov-class.cc @@ -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<std::string> 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\
--- a/liboctave/system/file-ops.cc +++ b/liboctave/system/file-ops.cc @@ -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);
deleted file mode 100644 --- a/scripts/deprecated/__error_text__.m +++ /dev/null @@ -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 -## <http://www.gnu.org/licenses/>. - -## -*- 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 -
deleted file mode 100644 --- a/scripts/deprecated/cor.m +++ /dev/null @@ -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 -## <http://www.gnu.org/licenses/>. - -## -*- 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); -
deleted file mode 100644 --- a/scripts/deprecated/corrcoef.m +++ /dev/null @@ -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 -## <http://www.gnu.org/licenses/>. - -## -*- 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 <hornik@wu-wien.ac.at> -## 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)); -
deleted file mode 100644 --- a/scripts/deprecated/cut.m +++ /dev/null @@ -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 -## <http://www.gnu.org/licenses/>. - -## -*- 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 <Kurt.Hornik@wu-wien.ac.at> -## 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 -
deleted file mode 100644 --- a/scripts/deprecated/default_save_options.m +++ /dev/null @@ -1,42 +0,0 @@ -## Copyright (C) 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 -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Built-in Function} {@var{val} =} default_save_options () -## @deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val}) -## @deftypefnx {Built-in Function} {} default_save_options (@var{new_val}, "local") -## This function has been deprecated. Use @code{@file{save_default_options}} -## instead. -## @seealso{save_default_options} -## @end deftypefn - -## Deprecated in 3.8 - -function retval = default_save_options (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "default_save_options is obsolete and will be removed from a future version of Octave, please use save_default_options instead"); - endif - - retval = save_default_options (varargin{:}); - -endfunction -
deleted file mode 100644 --- a/scripts/deprecated/error_text.m +++ /dev/null @@ -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 -## <http://www.gnu.org/licenses/>. - -## -*- 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 -
deleted file mode 100644 --- a/scripts/deprecated/gen_doc_cache.m +++ /dev/null @@ -1,39 +0,0 @@ -## Copyright (C) 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 -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {} gen_doc_cache (@var{out_file}, @var{directory}) -## This function has been deprecated. Use @code{doc_cache_create} instead. -## @seealso{doc_cache_create} -## @end deftypefn - -## Deprecated in 3.8 - -function gen_doc_cache (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "gen_doc_cache is obsolete and will be removed from a future version of Octave, please use doc_cache_create instead"); - endif - - doc_cache_create (varargin{:}); - -endfunction -
deleted file mode 100644 --- a/scripts/deprecated/interp1q.m +++ /dev/null @@ -1,81 +0,0 @@ -## Copyright (C) 2008-2013 David Bateman -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {@var{yi} =} interp1q (@var{x}, @var{y}, @var{xi}) -## One-dimensional linear interpolation without error checking. -## Interpolates @var{y}, defined at the points @var{x}, at the points -## @var{xi}. The sample points @var{x} must be a strictly monotonically -## increasing column vector. If @var{y} is a matrix or an N-dimensional -## array, the interpolation is performed on each column of @var{y}. If -## @var{y} is a vector, it must be a column vector of the same length as -## @var{x}. -## -## Values of @var{xi} beyond the endpoints of the interpolation result -## in NA being returned. -## -## Note that the error checking is only a significant portion of the -## execution time of this @code{interp1} if the size of the input arguments -## is relatively small. Therefore, the benefit of using @code{interp1q} -## is relatively small. -## @seealso{interp1} -## @end deftypefn - -function yi = interp1q (x, y, xi) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "interp1q is obsolete and will be removed from a future version of Octave; use interp1 instead"); - endif - - x = x(:); - nx = rows (x); - szy = size (y); - y = y(:,:); - [ny, nc] = size (y); - szx = size (xi); - xi = xi (:); - dy = diff (y); - dx = diff (x); - idx = lookup (x, xi, "lr"); - s = (xi - x (idx)) ./ dx (idx); - yi = bsxfun (@times, s, dy(idx,:)) + y(idx,:); - range = xi < x(1) | !(xi <= x(nx)); - yi(range,:) = NA; - if (length (szx) == 2 && any (szx == 1)) - yi = reshape (yi, [max(szx), szy(2:end)]); - else - yi = reshape (yi, [szx, szy(2:end)]); - endif -endfunction - - -%!shared xp, yp, xi, yi -%! xp = [0:2:10].'; yp = sin (2*pi*xp/5); -%! xi = [-1; 0; 2.2; 4; 6.6; 10; 11]; -%! yi = interp1 (xp,yp,xi); -%!assert (interp1q (xp,yp, [min(xp)-1; max(xp)+1]), [NA; NA]); -%!assert (interp1q (xp,yp,xp), yp, 100*eps); -%!assert (isempty (interp1q (xp,yp,[]))); -%!assert (interp1q (xp,yp,xi), yi); -%!assert (interp1q (xp,[yp,yp],xi), [yi, yi]); -%!assert (interp1q (xp,yp,[xi,xi]), [yi, yi]); -%!assert (interp1q (xp,[yp,yp],[xi,xi]), cat (3, [yi, yi], [yi, yi])); -
deleted file mode 100644 --- a/scripts/deprecated/isequalwithequalnans.m +++ /dev/null @@ -1,50 +0,0 @@ -## Copyright (C) 2005-2013 William Poetra Yoga Hadisoeseno -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {} isequalwithequalnans (@var{x1}, @var{x2}, @dots{}) -## This function has been deprecated. Use @code{@file{isequaln}} instead. -## @seealso{isequaln} -## @end deftypefn - -## Deprecated in 3.8 - -function retval = isequalwithequalnans (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "isequalwithequalnans is obsolete and will be removed from a future version of Octave, please use isequaln instead"); - endif - - retval = isequaln (varargin{:}); - -endfunction - - -## test for equality -%!assert (isequalwithequalnans ({1,2,NaN,4},{1,2,NaN,4}), true) -%!assert (isequalwithequalnans ([1,2,NaN,4],[1,2,NaN,4]), true) -## test for inequality -%!assert (isequalwithequalnans ([1,2,NaN,4],[1,NaN,3,4]), false) -%!assert (isequalwithequalnans ([1,2,NaN,4],[1,2,3,4]), false) -## test for equality (struct) -%!assert (isequalwithequalnans (struct ('a',NaN,'b',2),struct ('a',NaN,'b',2),struct ('a',NaN,'b',2)), true) -%!assert (isequalwithequalnans (1,2,1), false) -
deleted file mode 100644 --- a/scripts/deprecated/java_convert_matrix.m +++ /dev/null @@ -1,48 +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 -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Built-in Function} {@var{val} =} java_convert_matrix () -## @deftypefnx {Built-in Function} {@var{old_val} =} java_convert_matrix (@var{new_val}) -## @deftypefnx {Built-in Function} {} java_convert_matrix (@var{new_val}, "local") -## Query or set the internal variable that controls whether Java arrays are -## automatically converted to Octave matrices. The default value is false. -## -## When called from inside a function with the @qcode{"local"} option, the -## variable is changed locally for the function and any subroutines it calls. -## The original variable value is restored when exiting the function. -## @seealso{java_matrix_autoconversion, java_unsigned_conversion, java_debug} -## @end deftypefn - -function old_val = java_convert_matrix (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "java_convert_matrix is obsolete and will be removed from a future version of Octave; use java_matrix_autoconversion instead"); - endif - - if (nargin > 2) - print_usage (); - endif - - old_val = java_matrix_autoconversion (varargin{:}); - -endfunction -
deleted file mode 100644 --- a/scripts/deprecated/java_debug.m +++ /dev/null @@ -1,49 +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 -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Built-in Function} {@var{val} =} java_debug () -## @deftypefnx {Built-in Function} {@var{old_val} =} java_debug (@var{new_val}) -## @deftypefnx {Built-in Function} {} java_debug (@var{new_val}, "local") -## Query or set the internal variable that determines whether extra debugging -## information regarding the initialization of the JVM and any Java exceptions -## is printed. -## -## When called from inside a function with the @qcode{"local"} option, the -## variable is changed locally for the function and any subroutines it calls. -## The original variable value is restored when exiting the function. -## @seealso{debug_java, java_convert_matrix, java_unsigned_conversion} -## @end deftypefn - -function old_val = java_debug (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "java_debug is obsolete and will be removed from a future version of Octave; use debug_java instead"); - endif - - if (nargin > 2) - print_usage (); - endif - - old_val = debug_java (varargin{:}); - -endfunction -
deleted file mode 100644 --- a/scripts/deprecated/java_get.m +++ /dev/null @@ -1,63 +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 -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Loadable Function} {@var{val} =} java_get (@var{obj}, @var{name}) -## Get the value of the field @var{name} of the Java object @var{obj}. For -## static fields, @var{obj} can be a string representing the fully qualified -## name of the corresponding class. -## -## When @var{obj} is a regular Java object, structure-like indexing can be -## used as a shortcut syntax. For instance, the two following statements are -## equivalent -## -## @example -## @group -## java_get (x, "field1") -## x.field1 -## @end group -## @end example -## -## @seealso{java_set, javaMethod, javaObject} -## @end deftypefn - -function retval = java_get (obj, name) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "java_get is obsolete and will be removed from a future version of Octave; use structure-like indexing instead"); - endif - - if (nargin != 2) - print_usage (); - endif - - if (isjava (obj)) - retval = obj.(name); - elseif (ischar (obj)) - ## FIXME: Need a solution for getting static fields of class - ## which does not depend on __java_get__ which will be removed. - retval = __java_get__ (obj, name); - else - error ("java_get: OBJ must be a Java object"); - endif - -endfunction -
deleted file mode 100644 --- a/scripts/deprecated/java_invoke.m +++ /dev/null @@ -1,57 +0,0 @@ -## Copyright (C) 2007, 2013 Michael Goffioul -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}) -## @deftypefnx {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}, @var{arg1}, @dots{}) -## Invoke the method @var{methodname} on the Java object @var{obj} with the -## arguments @var{arg1}, @dots{} For static methods, @var{obj} can be a -## string representing the fully qualified name of the corresponding class. -## The function returns the result of the method invocation. -## -## When @var{obj} is a regular Java object, structure-like indexing can be -## used as a shortcut syntax. For instance, the two following statements are -## equivalent -## -## @example -## @group -## ret = java_invoke (x, "method1", 1.0, "a string") -## ret = x.method1 (1.0, "a string") -## @end group -## @end example -## -## @seealso{javaMethod, javaObject} -## @end deftypefn - -function retval = java_invoke (obj, methodname, varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "java_invoke is obsolete and will be removed from a future version of Octave, please use javaMethod instead"); - endif - - if (nargin < 2) - print_usage (); - endif - - retval = javaMethod (methodname, obj, varargin{:}); - -endfunction -
deleted file mode 100644 --- a/scripts/deprecated/java_set.m +++ /dev/null @@ -1,63 +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 -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Loadable Function} {@var{obj} =} java_set (@var{obj}, @var{name}, @var{val}) -## Set the value of the field @var{name} of the Java object @var{obj} to -## @var{val}. For static fields, @var{obj} can be a string representing the -## fully qualified named of the corresponding Java class. -## -## When @var{obj} is a regular Java object, structure-like indexing can be -## used as a shortcut syntax. For instance, the two following statements are -## equivalent -## -## @example -## @group -## java_set (x, "field1", val) -## x.field1 = val -## @end group -## @end example -## -## @seealso{java_get, javaMethod, javaObject} -## @end deftypefn - -function retval = java_set (obj, name, val) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "java_set is obsolete and will be removed from a future version of Octave; use structure-like indexing instead"); - endif - - if (nargin != 3) - print_usage (); - endif - - if (isjava (obj)) - obj.(name) = val; - elseif (ischar (obj)) - ## FIXME: Need a solution for getting static fields of class - ## which does not depend on __java_set__ which will be removed. - retval = __java_set__ (obj, name, val); - else - error ("java_set: OBJ must be a Java object"); - endif - -endfunction -
deleted file mode 100644 --- a/scripts/deprecated/java_unsigned_conversion.m +++ /dev/null @@ -1,50 +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 -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Built-in Function} {@var{val} =} java_unsigned_conversion () -## @deftypefnx {Built-in Function} {@var{old_val} =} java_unsigned_conversion (@var{new_val}) -## @deftypefnx {Built-in Function} {} java_unsigned_conversion (@var{new_val}, "local") -## Query or set the internal variable that controls how integer classes are -## converted when Java matrix autoconversion is enabled. When enabled, Java -## arrays of class Byte or Integer are converted to matrices of class uint8 or -## uint32 respectively. -## -## When called from inside a function with the @qcode{"local"} option, the -## variable is changed locally for the function and any subroutines it calls. -## The original variable value is restored when exiting the function. -## @seealso{java_unsigned_autoconversion, java_convert_matrix, debug_java} -## @end deftypefn - -function old_val = java_unsigned_conversion (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "java_unsigned_conversion is obsolete and will be removed from a future version of Octave; use java_unsigned_autoconversion instead"); - endif - - if (nargin > 2) - print_usage (); - endif - - old_val = java_unsigned_autoconversion (varargin{:}); - -endfunction -
deleted file mode 100644 --- a/scripts/deprecated/javafields.m +++ /dev/null @@ -1,54 +0,0 @@ -## Copyright (C) 2007, 2013 Michael Goffioul -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {} javafields (@var{javaobj}) -## @deftypefnx {Function File} {} javafields ("@var{classname}") -## @deftypefnx {Function File} {@var{fld_names} =} javafields (@dots{}) -## Return the fields of a Java object or Java class in the form of a cell -## array of strings. If no output is requested, print the result -## to the standard output. -## @seealso{fieldnames, methods, javaObject} -## @end deftypefn - -function fld_names = javafields (javaobj) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "javafields is obsolete and will be removed from a future version of Octave, please use fieldnames instead"); - endif - - if (nargin != 1) - print_usage (); - endif - - c_methods = javaMethod ("getFields", "org.octave.ClassHelper", javaobj); - method_list = ostrsplit (c_methods, ';'); - - if (nargout == 0) - if (! isempty (method_list)) - disp (method_list); - endif - else - fld_names = cellstr (method_list); - endif - -endfunction -
deleted file mode 100644 --- a/scripts/deprecated/javamethods.m +++ /dev/null @@ -1,54 +0,0 @@ -## Copyright (C) 2007, 2013 Michael Goffioul -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {} javamethods (@var{javaobj}) -## @deftypefnx {Function File} {} javamethods ("@var{classname}") -## @deftypefnx {Function File} {@var{mtd_names} =} javamethods (@dots{}) -## Return the methods of a Java object or Java class in the form of a cell -## array of strings. If no output is requested, print the result to the -## standard output. -## @seealso{methods, fieldnames, javaMethod, javaObject} -## @end deftypefn - -function mtd_names = javamethods (classname) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "javamethods is obsolete and will be removed from a future version of Octave, please use methods instead"); - endif - - if (nargin != 1) - print_usage (); - endif - - cls_methods = javaMethod ("getMethods", "org.octave.ClassHelper", classname); - method_list = ostrsplit (cls_methods, ';'); - - if (nargout == 0) - if (! isempty (method_list)) - disp (method_list); - endif - else - mtd_names = cellstr (method_list); - endif - -endfunction -
--- a/scripts/deprecated/module.mk +++ b/scripts/deprecated/module.mk @@ -1,32 +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 \ - deprecated/isstr.m \ - deprecated/java_convert_matrix.m \ - deprecated/java_debug.m \ - deprecated/java_get.m \ - deprecated/java_invoke.m \ - deprecated/java_new.m \ - deprecated/java_unsigned_conversion.m \ - 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/isstr.m FCN_FILES += $(deprecated_FCN_FILES)
deleted file mode 100644 --- a/scripts/deprecated/polyderiv.m +++ /dev/null @@ -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 -## <http://www.gnu.org/licenses/>. - -## -*- 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 <arichard@stark.cc.oh.us> -## 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]); -
deleted file mode 100644 --- a/scripts/deprecated/re_read_readline_init_file.m +++ /dev/null @@ -1,40 +0,0 @@ -## Copyright (C) 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 -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Built-in Function} {} re_read_readline_init_file (@var{file}) -## This function has been deprecated. Use -## @code{@file{readline_re_read_init_file}} instead. -## @seealso{readline_read_init_file} -## @end deftypefn - -## Deprecated in 3.8 - -function re_read_readline_init_file (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "re_read_readline_init_file is obsolete and will be removed from a future version of Octave, please use readline_re_read_init_file instead"); - endif - - readline_re_read_init_file (varargin{:}); - -endfunction -
deleted file mode 100644 --- a/scripts/deprecated/read_readline_init_file.m +++ /dev/null @@ -1,40 +0,0 @@ -## Copyright (C) 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 -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Built-in Function} {} read_readline_init_file (@var{file}) -## This function has been deprecated. Use -## @code{@file{readline_read_init_file}} instead. -## @seealso{readline_read_init_file} -## @end deftypefn - -## Deprecated in 3.8 - -function read_readline_init_file (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "read_readline_init_file is obsolete and will be removed from a future version of Octave, please use readline_read_init_file instead"); - endif - - readline_read_init_file (varargin{:}); - -endfunction -
deleted file mode 100644 --- a/scripts/deprecated/saving_history.m +++ /dev/null @@ -1,41 +0,0 @@ -## Copyright (C) 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 -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Built-in Function} {@var{val} =} saving_history () -## @deftypefnx {Built-in Function} {@var{old_val} =} saving_history (@var{new_val}) -## @deftypefnx {Built-in Function} {} saving_history (@var{new_val}, "local") -## This function has been deprecated. Use @code{@file{history_save}} instead. -## @seealso{history_save} -## @end deftypefn - -## Deprecated in 3.8 - -function retval = saving_history (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "saving_history is obsolete and will be removed from a future version of Octave, please use history_save instead"); - endif - - retval = save_default_options (varargin{:}); - -endfunction -
deleted file mode 100644 --- a/scripts/deprecated/shell_cmd.m +++ /dev/null @@ -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 -## <http://www.gnu.org/licenses/>. - -## "-*- 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 -
deleted file mode 100644 --- a/scripts/deprecated/studentize.m +++ /dev/null @@ -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 -## <http://www.gnu.org/licenses/>. - -## -*- 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 <Kurt.Hornik@wu-wien.ac.at> -## 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) -
deleted file mode 100644 --- a/scripts/deprecated/sylvester_matrix.m +++ /dev/null @@ -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 -## <http://www.gnu.org/licenses/>. - -## -*- 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); -
deleted file mode 100644 --- a/scripts/general/isa.m +++ /dev/null @@ -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 -## <http://www.gnu.org/licenses/>. - -## -*- 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 <pkienzle@users.sf.net> -## 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")); -
--- a/scripts/general/module.mk +++ b/scripts/general/module.mk @@ -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)
new file mode 100644 --- /dev/null +++ b/scripts/general/validateattributes.m @@ -0,0 +1,430 @@ +## 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 +## <http://www.gnu.org/licenses/>. + +## -*- 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 @qcode +## @item "float" +## Floating point value comprising classes @qcode{"double"} and +## @qcode{"single"}. +## +## @item "integer" +## Integer value comprising classes (u)int8, (u)int16, (u)int32, (u)int64. +## +## @item "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 @qcode +## @item "<=" +## All values are less than or equal to the following value in @var{attributes}. +## +## @item "<" +## All values are less than the following value in @var{attributes}. +## +## @item ">=" +## All values are greater than or equal to the following value in @var{attributes}. +## +## @item ">" +## All values are greater than the following value in @var{attributes}. +## +## @item "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 "3d" +## Has no more than 3 dimensions. A 2 dimensional matrix is a 3D matrix +## whose 3rd dimension is of length 1. +## +## @item "binary" +## All values are either 1 or 0. +## +## @item "column" +## Values are arranged in a single column. +## +## @item "decreasing" +## No value is @var{NaN}, and each is less than the preceding one. +## +## @item "even" +## All values are even numbers. +## +## @item "finite" +## All values are finite. +## +## @item "increasing" +## No value is @var{NaN}, and each is greater than the preceding one. +## +## @item "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 "ncols" +## Has exactly as many columns as the next value in @var{attributes}. +## +## @item "ndims" +## Has exactly as many dimensions as the next value in @var{attributes}. +## +## @item "nondecreasing" +## No value is @var{NaN}, and each is greater than or equal to the preceding one. +## +## @item "nonempty" +## It is not empty. +## +## @item "nonincreasing" +## No value is @var{NaN}, and each is less than or equal to the preceding one. +## +## @item "nonnan" +## No value is a @code{NaN}. +## +## @item "nonnegative" +## All values are non negative. +## +## @item "nonsparse" +## It is not a sparse matrix. +## +## @item "nonzero" +## No value is zero. +## +## @item "nrows" +## Has exactly as many rows as the next value in @var{attributes}. +## +## @item "numel" +## Has exactly as many elements as the next value in @var{attributes}. +## +## @item "odd" +## All values are odd numbers. +## +## @item "positive" +## All values are positive. +## +## @item "real" +## It is a non-complex matrix. +## +## @item "row" +## Values are arranged in a single row. +## +## @item "scalar" +## It is a scalar. +## +## @item "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 "square" +## Is a square matrix. +## +## @item "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 <double> validateattributes (rand (5), {"uint8"}, {}) +%!error <single> validateattributes (uint8 (rand (5)), {"float"}, {}) +%!error <2d> validateattributes (rand (5, 5, 5), {}, {"2d"}) +%!error <3d> validateattributes (rand (5, 5, 5, 7), {}, {"3d"}) +%!error <column> validateattributes (rand (5, 5), {}, {"column"}) +%!error <column> validateattributes (rand (1, 5), {}, {"column"}) +%!error <row> validateattributes (rand (5, 5), {}, {"row"}) +%!error <row> validateattributes (rand (5, 1), {}, {"row"}) +%!error <scalar> validateattributes (rand (1, 5), {}, {"scalar"}) +%!error <vector> validateattributes (rand (5), {}, {"vector"}) +%!error <square> validateattributes (rand (5, 6), {}, {"square"}) +%!error <nonempty> validateattributes ([], {}, {"nonempty"}) +%!error <nonsparse> validateattributes (sparse(rand(5)), {}, {"nonsparse"}) +%!error <binary> validateattributes ("text", {}, {"binary"}) +%!error <binary> validateattributes ([0 1 0 3 0], {}, {"binary"}) +%!error <even> validateattributes ([2 3 6 8], {}, {"even"}) +%!error <even> validateattributes ([2 NaN], {}, {"even"}) +%!error <odd> validateattributes ([3 4 7 5], {}, {"odd"}) +%!error <odd> validateattributes ([5 NaN], {}, {"odd"}) +%!error <integer> validateattributes ([5 5.2 5.7], {}, {"integer"}) +%!error <real> validateattributes ([5i 8 9], {}, {"real"}) +%!error <finite> validateattributes ([5i Inf 8], {}, {"finite"}) +%!error <nonnan> validateattributes ([NaN Inf 8], {}, {"nonnan"}) +%!error <nonnegative> validateattributes ([7 8 -9], {}, {"nonnegative"}) +%!error <nonzero> validateattributes ([7 8 0], {}, {"nonzero"}) +%!error <positive> validateattributes ([7 0 8], {}, {"positive"}) +%!error <decreasing> validateattributes ([7 8 4 3 -5], {}, {"decreasing"}) +%!error <decreasing> validateattributes ([7 NaN 4 3 -5], {}, {"decreasing"}) +%!error <increasing> validateattributes ([7 8 4 9 20], {}, {"increasing"}) +%!error <increasing> validateattributes ([7 8 NaN 9 20], {}, {"increasing"}) +%!error <nonincreasing> validateattributes ([7 8 4 9 20], {}, {"nonincreasing"}) +%!error <nonincreasing> validateattributes ([7 8 NaN 9 20], {}, {"nonincreasing"}) +%!error <nondecreasing> validateattributes ([7 8 4 3 -5], {}, {"nondecreasing"}) +%!error <nondecreasing> validateattributes ([7 NaN 4 3 -5], {}, {"nondecreasing"}) +%!error <size> validateattributes (ones (5, 3, 6), {}, {"size", [5 4 7]}) +%!error <size> validateattributes (ones (5, 3, 6), {}, {"size", [5 NaN 7]}) +%!error <size> validateattributes (ones (5, 3, 6), {}, {"size", [5 3 6 2]}) +%!error <elements> validateattributes (ones (6, 3), {}, {"numel", 12}) +%!error <columns> validateattributes (ones (6, 2), {}, {"ncols", 3}) +%!error <rows> validateattributes (ones (6, 2), {}, {"nrows", 3}) +%!error <dimensions> validateattributes (ones (6, 2, 6, 3), {}, {"ndims", 3}) +%!error <greater than> validateattributes ([6 7 8 5], {}, {">", 5}) +%!error <greater than> validateattributes ([6 7 8 5], {}, {">=", 6}) +%!error <less than> validateattributes ([6 7 8 5], {}, {"<", 8}) +%!error <less than> 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"})
--- a/scripts/help/__unimplemented__.m +++ b/scripts/help/__unimplemented__.m @@ -822,7 +822,6 @@ "unloadlibrary", "unmesh", "userpath", - "validateattributes", "verctrl", "verLessThan", "viewmtx",
--- a/scripts/miscellaneous/edit.m +++ b/scripts/miscellaneous/edit.m @@ -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
--- a/scripts/miscellaneous/ls.m +++ b/scripts/miscellaneous/ls.m @@ -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
--- a/scripts/miscellaneous/what.m +++ b/scripts/miscellaneous/what.m @@ -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"))
--- a/scripts/plot/draw/fill.m +++ b/scripts/plot/draw/fill.m @@ -94,15 +94,8 @@ 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; - endif - [htmp, fail] = __patch__ (hax, varargin{iargs(i)+(0:1)}, cdata, - popt{:}); + opts{:}); if (fail) print_usage (); endif @@ -145,7 +138,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
--- a/scripts/testfun/rundemos.m +++ b/scripts/testfun/rundemos.m @@ -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
--- a/scripts/testfun/runtests.m +++ b/scripts/testfun/runtests.m @@ -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 @@ -127,7 +124,7 @@ if (fid >= 0) str = fread (fid, "*char").'; fclose (fid); - retval = ! isempty (regexp (str, '^%!(?:test|assert|error|warning)', + retval = ! isempty (regexp (str, '^%!(?:test|xtest|assert|error|warning)', 'lineanchors', 'once')); else error ("runtests: fopen failed: %s", f);
--- a/src/main.in.cc +++ b/src/main.in.cc @@ -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];