Mercurial > hg > octave-jordi
changeset 19397:9e5b64b3c1fe
Fix up documentation for new disable_[range,diagonal_matrix,permutation_matrix] fcns.
* NEWS: Announce new functions disable_range, disable_diagonal_matrix,
disable_permutation_matrix.
* diagperm.txi: Add example showing space savings from using
disable_diagonal_matrix.
* ov.cc(Fdisable_range): Correct docstring which had cut-and-paste error
documenting disable_permutation_matrix instead. Add seealso links to
other disable_xxx functions.
* ov.cc(Fdisable_diagonal_matrix, Fdisable_permutation_matrix): Add seealso
links to other disable_xxx functions.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 13 Dec 2014 18:41:03 -0800 |
parents | 50d4fd16fb3a |
children | 9035a36736af |
files | NEWS doc/interpreter/diagperm.txi libinterp/octave-value/ov.cc |
diffstat | 3 files changed, 36 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS +++ b/NEWS @@ -17,6 +17,19 @@ inputParser + ** Optional stricter Matlab compatibility for ranges, diagonal matrices, + and permutation matrices. + + Octave has internal optimizations which use space-efficient storage + for the three data types above. Three new functions have been added + which control whether the optimizations are used (default), or whether + the data types are stored as full matrices. + + disable_range disable_diagonal_matrix disable_permutation_matrix + + All three optimizations are disabled if Octave is started with the + --braindead command line option. + ** Interpolation function changes for Matlab compatibility The interpolation method 'cubic' is now equivalent to 'pchip'
--- a/doc/interpreter/diagperm.txi +++ b/doc/interpreter/diagperm.txi @@ -59,13 +59,26 @@ Octave provides special treatment of real and complex rectangular diagonal matrices, as well as permutation matrices. They are stored as special objects, using efficient storage and algorithms, facilitating writing both readable and -efficient matrix algebra expressions in the Octave language. The -special treatment may be disabled by using the functions -@dfn{disable_permutation_matrix} and @dfn{disable_diagonal_matrix} +efficient matrix algebra expressions in the Octave language. The special +treatment may be disabled by using the functions @dfn{disable_diagonal_matrix} +and @dfn{disable_permutation_matrix}. + +@DOCSTRING(disable_diagonal_matrix) @DOCSTRING(disable_permutation_matrix) -@DOCSTRING(disable_diagonal_matrix) +The space savings are significant as demonstrated by the following code. + +@example +@group +x = diag (rand (10, 1)); +xf = full (x); +sizeof (x) +@result{} 80 +sizeof (xf) +@result{} 800 +@end group +@end example @menu * Creating Diagonal Matrices::
--- a/libinterp/octave-value/ov.cc +++ b/libinterp/octave-value/ov.cc @@ -3194,6 +3194,7 @@ When called from inside a function with the @qcode{\"local\"} option, the\n\ variable is changed locally for the function and any subroutines it calls.\n\ The original variable value is restored when exiting the function.\n\ +@seealso{disable_range, disable_diagonal_matrix}\n\ @end deftypefn") { return SET_INTERNAL_VARIABLE (disable_permutation_matrix); @@ -3222,6 +3223,7 @@ When called from inside a function with the @qcode{\"local\"} option, the\n\ variable is changed locally for the function and any subroutines it calls.\n\ The original variable value is restored when exiting the function.\n\ +@seealso{disable_range, disable_permutation_matrix}\n\ @end deftypefn") { return SET_INTERNAL_VARIABLE (disable_diagonal_matrix); @@ -3256,14 +3258,14 @@ @deftypefn {Built-in Function} {@var{val} =} disable_range ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} disable_range (@var{new_val})\n\ @deftypefnx {Built-in Function} {} disable_range (@var{new_val}, \"local\")\n\ -Query or set the internal variable that controls whether permutation\n\ -matrices are stored in a special space-efficient format. The default\n\ -value is true. If this option is disabled Octave will store permutation\n\ -matrices as full matrices.\n\ +Query or set the internal variable that controls whether ranges are stored\n\ +in a special space-efficient format. The default value is true. If this\n\ +option is disabled Octave will store ranges as full matrices.\n\ \n\ When called from inside a function with the @qcode{\"local\"} option, the\n\ variable is changed locally for the function and any subroutines it calls.\n\ The original variable value is restored when exiting the function.\n\ +@seealso{disable_diagonal_matrix, disable_permutation_matrix}\n\ @end deftypefn") { return SET_INTERNAL_VARIABLE (disable_range);