Mercurial > octave
comparison scripts/deprecated/sparse_auto_mutate.m @ 31445:0924234dd747 stable
sparse_auto_mutate.m: Update documentation for deprecated function.
* NEWS.8.md: Remove unneeded newline.
* sparse_auto_mutate.m: Document that this function has no effect
whatsoever.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 15 Nov 2022 18:37:58 -0800 |
parents | 568bddf0215e |
children | 597f3ee61a48 |
comparison
equal
deleted
inserted
replaced
31444:2569c40924e7 | 31445:0924234dd747 |
---|---|
27 ## @deftypefn {} {@var{val} =} sparse_auto_mutate () | 27 ## @deftypefn {} {@var{val} =} sparse_auto_mutate () |
28 ## @deftypefnx {} {@var{old_val} =} sparse_auto_mutate (@var{new_val}) | 28 ## @deftypefnx {} {@var{old_val} =} sparse_auto_mutate (@var{new_val}) |
29 ## @deftypefnx {} {@var{old_val} =} sparse_auto_mutate (@var{new_val}, "local") | 29 ## @deftypefnx {} {@var{old_val} =} sparse_auto_mutate (@var{new_val}, "local") |
30 ## | 30 ## |
31 ## @code{sparse_auto_mutate} is deprecated and will be removed in Octave | 31 ## @code{sparse_auto_mutate} is deprecated and will be removed in Octave |
32 ## version 9. Use @code{optimize_diagonal_matrix} instead. | 32 ## version 10. |
33 ## | 33 ## |
34 ## Query or set whether storing diagonal matrices in a special space-efficient | 34 ## The @code{sparse_auto_mutate} function no longer has any effect on Octave's |
35 ## format is disabled. | 35 ## behavior. Previously, after calling @code{sparse_auto_mutate (true)}, |
36 ## | 36 ## Octave would automatically convert sparse matrices to full when a sparse |
37 ## The default value is false. If this option is set to true, Octave will | 37 ## matrix required more memory than simply using full matrix storage. This |
38 ## store ranges as full matrices. | 38 ## setting was false by default for compatibility with @sc{matlab}. Now you |
39 ## | 39 ## must manually convert to full storage when desired (use @code{full}). |
40 ## When called from inside a function with the @qcode{"local"} option, the | 40 ## @seealso{full} |
41 ## setting is changed locally for the function and any subroutines it calls. | |
42 ## The original setting is restored when exiting the function. | |
43 ## @seealso{sparse_auto_mutate, disable_permutation_matrix} | |
44 ## @end deftypefn | 41 ## @end deftypefn |
45 | 42 |
46 ## FIXME: DEPRECATED: Remove in version 10. | 43 ## FIXME: DEPRECATED: Remove in version 10. |
47 | 44 |
48 function retval = sparse_auto_mutate (val, opt) | 45 function retval = sparse_auto_mutate (val, opt) |
53 warning ("Octave:deprecated-function", | 50 warning ("Octave:deprecated-function", |
54 "sparse_auto_mutate is obsolete, has no effect, and will be removed from a future version of Octave\n"); | 51 "sparse_auto_mutate is obsolete, has no effect, and will be removed from a future version of Octave\n"); |
55 endif | 52 endif |
56 | 53 |
57 if (nargin == 0 || nargout > 0) | 54 if (nargin == 0 || nargout > 0) |
58 ## Always false now. | 55 retval = false; # Always false now. |
59 retval = false; | |
60 return; | 56 return; |
61 endif | 57 endif |
62 | 58 |
63 if (nargin == 2) | 59 if (nargin == 2) |
64 if (! (ischar (opt) && strcmp (opt, "local"))) | 60 if (! (ischar (opt) && strcmp (opt, "local"))) |
65 error ('sparse_auto_mutate: second argument must be "local"'); | 61 error ('sparse_auto_mutate: second argument must be "local"'); |
66 endif | 62 endif |
67 nargin = 1; | 63 nargin = 1; |
68 endif | 64 endif |
69 | 65 |
70 ## Don't bother warning that "local" is invalid outside of a | 66 ## Don't bother warning that "local" is invalid outside of a function. |
71 ## function. | |
72 | |
73 if (nargin > 1) | 67 if (nargin > 1) |
74 print_usage (); | 68 print_usage (); |
75 endif | 69 endif |
76 | 70 |
77 if (! islogical (val)) | 71 if (! islogical (val)) |