Macaulay2 » Documentation
Packages » Macaulay2Doc :: selectPairs
next | previous | forward | backward | up | index | toc

selectPairs -- select a part of a hash table by pairs

Synopsis

Description

i1 : x = hashTable{(1, 2), (2, 4), (3, 6), (4, 8), (5, 10)}

o1 = HashTable{1 => 2 }
               2 => 4
               3 => 6
               4 => 8
               5 => 10

o1 : HashTable
i2 : selectPairs(x, (k,v) -> odd(k + v))

o2 = HashTable{1 => 2 }
               3 => 6
               5 => 10

o2 : HashTable
i3 : selectPairs(2, x, (k, v) -> odd(k + v))

o3 = HashTable{1 => 2}
               3 => 6

o3 : HashTable

See also

Ways to use selectPairs:

For the programmer

The object selectPairs is a compiled function.