annotate scripts/miscellaneous/clearAllMemoizedCaches.m @ 31247:3dae836c598c

doc: Expand and edit documentation for memoization (bug #60860)
author Arun Giridhar <arungiridhar@gmail.com>
date Fri, 30 Sep 2022 06:38:59 -0400
parents a887ffb997a7
children a40c0b7aa376
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31245
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
1 ########################################################################
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
2 ##
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
3 ## Copyright (C) 2021 The Octave Project Developers
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
4 ##
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
5 ## See the file COPYRIGHT.md in the top-level directory of this
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
6 ## distribution or <https://octave.org/copyright/>.
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
7 ##
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
8 ## This file is part of Octave.
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
9 ##
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
10 ## Octave is free software: you can redistribute it and/or modify it
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
11 ## under the terms of the GNU General Public License as published by
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
12 ## the Free Software Foundation, either version 3 of the License, or
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
13 ## (at your option) any later version.
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
14 ##
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
15 ## Octave is distributed in the hope that it will be useful, but
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
18 ## GNU General Public License for more details.
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
19 ##
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
20 ## You should have received a copy of the GNU General Public License
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
21 ## along with Octave; see the file COPYING. If not, see
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
22 ## <https://www.gnu.org/licenses/>.
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
23 ##
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
24 ########################################################################
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
25
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
26 ## -*- texinfo -*-
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
27 ## @deftypefn {} {} clearAllMemoizedCaches ()
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
28 ## Clear all memoized caches.
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
29 ##
31247
3dae836c598c doc: Expand and edit documentation for memoization (bug #60860)
Arun Giridhar <arungiridhar@gmail.com>
parents: 31245
diff changeset
30 ## Memoization maintains internal tables of which functions have been called
3dae836c598c doc: Expand and edit documentation for memoization (bug #60860)
Arun Giridhar <arungiridhar@gmail.com>
parents: 31245
diff changeset
31 ## with which inputs. This function clears those tables to free memory,
3dae836c598c doc: Expand and edit documentation for memoization (bug #60860)
Arun Giridhar <arungiridhar@gmail.com>
parents: 31245
diff changeset
32 ## or for a fresh start.
3dae836c598c doc: Expand and edit documentation for memoization (bug #60860)
Arun Giridhar <arungiridhar@gmail.com>
parents: 31245
diff changeset
33 ##
31245
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
34 ## @seealso{memoize}
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
35 ## @end deftypefn
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
36
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
37 function clearAllMemoizedCaches
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
38
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
39 if (nargin || nargout)
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
40 print_usage ();
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
41 endif
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
42
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
43 __memoize__ ();
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
44
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
45 endfunction
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
46
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
47 ## Mark file as being tested. No real test needed for this function.
a887ffb997a7 New function memoize to optimize repetitive function calls (bug #60860).
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
diff changeset
48 %!assert (1)