|
Calling Sequence
|
|
Seq( f, i = m..n )
Seq( f, i = m..n, step )
Seq( f, i = 1..n, step )
Seq( f, i = x )
Seq( f, i in x )
Seq( i = m..n, step )
Seq[ tasksize = s ]( ... )
|
|
Parameters
|
|
f
|
-
|
(expression) any expression
|
i
|
-
|
(name)
|
m,n
|
-
|
(numeric) values to range over
|
x
|
-
|
(expression)
|
step
|
-
|
(numeric) (optional)
|
s
|
-
|
(optional, posint) maximum task size
|
|
|
|
|
Description
|
|
•
|
The Seq command is a parallel implementation of the seq command. For a complete description of the calling sequences of Seq see the seq help page.
|
•
|
Seq is implemented using the Task programming model.
|
•
|
Seq attempts to determine how to divide the input into separate tasks to spread the work across all available cores. However in some situations Seq may not choose the optimal size. In particular a small number of long running tasks may not be spread evenly over all threads. In this case, you can specify the maximum task size using the tasksize option. Seq will divide the input into tasks that compute at most tasksize elements within a single task.
|
|
|
Examples
|
|
>
|
|
| (4) |
| (5) |
| (6) |
>
|
|
| (7) |
>
|
[Seq( i, i=0..-infinity )];
C := proc( f, x )
local i;
[Seq( coeff( f, x, i ), i=0..degree(f,x) )];
end proc;
|
| (10) |
| (11) |
|
|
|