Close
Close window
Remove - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

CodeTools[Profiling]

Remove

remove procedures from a table of profiling data

Calling Sequence

Remove(selector, tab)

Parameters

selector

-

boolean valued procedure

tab

-

table of profiling data

Description

The Remove(selector, tab) command is similar to the remove function. The boolean valued function selector is called on each element in tab. A copy of tab is returned with the elements for which selector returns true removed.

The selector parameter is a procedure that accepts two arguments. The first argument is the encoded name (see EncodeName ) of the procedure and the second argument is the rtable containing the profiling data.

Examples

>

withCodeToolsProfiling:

>

selector := proc(n,t)
# check the total number of function calls
if (t[1][1] > 5) then
return true;
else
return false;
end if;
end proc;

selectorprocn&comma;tif5<t&lsqb;1&rsqb;&lsqb;1&rsqb;thenreturntrueelsereturnfalseend ifend proc

(1)
>

a := proc( )
return 1;
end proc;

aprocreturn1end proc

(2)
>

b := proc( )
local i;
for i from 1 to 10 do
a();
end do;
end proc;

bproclocali&semi;forito10doaend doend proc

(3)
>

tBuildprocs=a&comma;b&comma;commands=b

ttable_Inert_ASSIGNEDNAMEb&comma;PROC=1001001000&comma;_Inert_ASSIGNEDNAMEa&comma;PROC=10101010

(4)
>

PrintProfilest

a
a := proc()
|Calls Seconds Words|
PROC | 10 0.001 0|
1 | 10 0.001 0| return 1
end proc

b
b := proc()
local i;
|Calls Seconds Words|
PROC | 1 0.000 0|
1 | 1 0.000 0| for i to 10 do
2 | 10 0.000 0| a()
end do
end proc

>

sRemoveselector&comma;t

stable_Inert_ASSIGNEDNAMEb&comma;PROC=1001001000

(5)
>

PrintProfiless

b
b := proc()
local i;
|Calls Seconds Words|
PROC | 1 0.000 0|
1 | 1 0.000 0| for i to 10 do
2 | 10 0.000 0| a()
end do
end proc


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /