next
|
previous
|
forward
|
backward
|
up
|
top
|
index
|
toc
|
home
Macaulay2
>
The Macaulay2 language
>
lists and sequences
>
select(ZZ,BasicList,Function)
select(ZZ,BasicList,Function) -- select a limited number of elements from a list
Synopsis
Usage:
select(n,v,f)
Function:
select
Inputs:
n
,
an
integer
v
,
a
basic list
f
,
a
function
Outputs:
a
basic list
, a list containing at most
n
elements of the list
v
that yield
true
when the function
f
is applied.
Description
The order of the elements in the result will be the same as in the original list
v
.
i1 : select(4,0..10,even) o1 = (0, 2, 4, 6) o1 : Sequence
See also
select(BasicList,Function)
-- select elements from a list