Mercurial > hg > octave-nkf
annotate scripts/general/profexplore.m @ 20828:a3b9ee5c040a
Replace bsxfun with broadcasting for performance with complex inputs (bug #38628).
cumtrapz.m, quadgk.m, trapz.m, center.m, zscore.m: Replace bsxfun with
broadcasting for performance where inputs might be complex.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 12 Oct 2015 21:28:32 -0700 |
parents | 83792dd9bcc1 |
children |
rev | line source |
---|---|
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
1 ## Copyright (C) 2012-2015 Daniel Kraft |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
2 ## |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
3 ## This file is part of Octave. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
4 ## |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
8 ## your option) any later version. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
9 ## |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
13 ## General Public License for more details. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
14 ## |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
18 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
19 ## -*- texinfo -*- |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17202
diff
changeset
|
20 ## @deftypefn {Function File} {} profexplore () |
17202
9e613baf431e
profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
Philipp Kutin <philipp.kutin@gmail.com>
parents:
14359
diff
changeset
|
21 ## @deftypefnx {Function File} {} profexplore (@var{data}) |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
22 ## Interactively explore hierarchical profiler output. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
23 ## |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
24 ## Assuming @var{data} is the structure with profile data returned by |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17202
diff
changeset
|
25 ## @code{profile (@qcode{"info"})}, this command opens an interactive prompt |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
26 ## that can be used to explore the call-tree. Type @kbd{help} to get a list |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17202
diff
changeset
|
27 ## of possible commands. If @var{data} is omitted, @code{profile ("info")} |
17202
9e613baf431e
profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
Philipp Kutin <philipp.kutin@gmail.com>
parents:
14359
diff
changeset
|
28 ## is called and used in its place. |
13191
c5ddb99ff5de
Put @seealso in profiler functions' docstrings.
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13189
diff
changeset
|
29 ## @seealso{profile, profshow} |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
30 ## @end deftypefn |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
31 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
32 ## Built-in profiler. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
33 ## Author: Daniel Kraft <d@domob.eu> |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
34 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
35 function profexplore (data) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
36 |
17202
9e613baf431e
profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
Philipp Kutin <philipp.kutin@gmail.com>
parents:
14359
diff
changeset
|
37 if (nargin == 0) |
9e613baf431e
profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
Philipp Kutin <philipp.kutin@gmail.com>
parents:
14359
diff
changeset
|
38 data = profile ("info"); |
9e613baf431e
profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
Philipp Kutin <philipp.kutin@gmail.com>
parents:
14359
diff
changeset
|
39 elseif (nargin != 1) |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
40 print_usage (); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
41 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
42 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
43 ## The actual work is done by a recursive worker function, since that |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
44 ## is an easy way to traverse the tree datastructure. Here, we just check |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
45 ## the arguments (already done) and give over to it. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
46 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
47 __profexplore_worker (data.FunctionTable, data.Hierarchical, "Top\n", " "); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
48 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
49 endfunction |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
50 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
51 ## This is the worker function. tree is the current subtree we want to |
14359
7277fe922e99
doc: Use Octave preference for double quote in docstrings in scripts/
Rik <octave@nomad.inbox5.com>
parents:
14222
diff
changeset
|
52 ## display / explore. parents is a string containing the already "rendered" |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
53 ## data for the parents which is displayed on top of the list of current |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
54 ## children. prefix is the prefix to add to each line rendered; this |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
55 ## is just a string of spaces to get indentation right. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
56 ## |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
57 ## Returning 0 indicates that the user requested to totally exit the |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
58 ## explorer, thus also all higher levels should exit immediately. An integer |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
59 ## greater zero indicates to exit that many levels since the user wants to go |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
60 ## up (but not necessarily quit). |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
61 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
62 function rv = __profexplore_worker (fcn_table, tree, parents, prefix) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
63 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
64 ## Sort children by total time. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
65 times = -[ tree.TotalTime ]; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
66 [~, p] = sort (times); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
67 tree = tree(p); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
68 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
69 while (true) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
70 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
71 printf ("\n%s", parents); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
72 strings = cell (length (tree), 1); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
73 for i = 1 : length (tree) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
74 strings{i} = sprintf ("%s: %d calls, %.3f total, %.3f self", ... |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
75 fcn_table(tree(i).Index).FunctionName, ... |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
76 tree(i).NumCalls, ... |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
77 tree(i).TotalTime, tree(i).SelfTime); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
78 printf ("%s%d) %s\n", prefix, i, strings{i}); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
79 endfor |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
80 printf ("\n"); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
81 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
82 cmd = input ("profexplore> ", "s"); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
83 option = fix (str2double (cmd)); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
84 |
17202
9e613baf431e
profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
Philipp Kutin <philipp.kutin@gmail.com>
parents:
14359
diff
changeset
|
85 if (strcmp (cmd, "exit") || strcmp (cmd, "quit")) |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
86 rv = 0; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
87 return; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
88 elseif (strcmp (cmd, "help")) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
89 printf ("\nCommands for profile explorer:\n\n"); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
90 printf ("exit Return to Octave prompt.\n"); |
17202
9e613baf431e
profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
Philipp Kutin <philipp.kutin@gmail.com>
parents:
14359
diff
changeset
|
91 printf ("quit Return to Octave prompt.\n"); |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
92 printf ("help Display this help message.\n"); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
93 printf ("up [N] Go up N levels, where N is an integer. Default is 1.\n"); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
94 printf ("N Go down a level into option N.\n"); |
14222
190952239c2c
Use '!' for not operation in preference to '~'.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
95 elseif (! isnan (option)) |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
96 if (option < 1 || option > length (tree)) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
97 printf ("The chosen option is out of range!\n"); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
98 else |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
99 newParents = sprintf ("%s%s%s\n", parents, prefix, strings{option}); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
100 newPrefix = sprintf ("%s ", prefix); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
101 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
102 rv = __profexplore_worker (fcn_table, tree(option).Children, ... |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
103 newParents, newPrefix); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
104 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
105 if (rv == 0) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
106 return; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
107 elseif (rv > 1) |
20441
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
108 rv -= 1; |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
109 return; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
110 else |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
111 assert (rv == 1); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
112 ## It was requested to return to this level, so just stay. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
113 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
114 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
115 elseif (length (cmd) >= 2 && strcmp (substr (cmd, 1, 2), "up")) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
116 if (length (cmd) == 2) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
117 rv = 1; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
118 return; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
119 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
120 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
121 if (length (cmd) > 3 && cmd(3) == ' ') |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
122 opt = fix (str2double (substr (cmd, 3))); |
14222
190952239c2c
Use '!' for not operation in preference to '~'.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
123 if (! isnan (opt) && opt > 0) |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
124 rv = opt; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
125 return; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
126 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
127 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
128 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
129 printf ("Invalid 'up' command. Type 'help' for further"); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
130 printf (" information.\n"); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
131 else |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
132 printf ("Unrecognized input. Type 'help' to get a list of possible"); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
133 printf (" commands.\n"); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
134 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
135 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
136 endwhile |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
137 endfunction |
17338
1c89599167a6
maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
138 |