partition SciMax Toolbox partpol

SciMax Toolbox >> partition_set

partition_set

Maxima Function

Calling Sequence

partition_set (a, f)

Description

Partitions the set a according to the predicate f.

partition_set returns a list of two sets. The first set comprises the elements of a for which f evaluates to false, and the second comprises any other elements of a. partition_set does not apply is to the return value of f.

partition_set complains if a is not a literal set.

See also .

Examples:

(%i1) partition_set ({2, 7, 1, 8, 2, 8}, evenp);
(%o1)                   [{1, 7}, {2, 8}]
(%i2) partition_set ({x, rat(y), rat(y) + z, 1},
                     lambda ([x], ratp(x)));
(%o2)/R/              [{1, x}, {y, y + z}]
partition SciMax Toolbox partpol