Categorize - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


ListTools

  

Categorize

  

categorize the elements of a list according to a given routine

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Categorize(f, L, opts, ...)

Parameters

f

-

a reflexive procedure of two arguments

L

-

list

opts

-

(optional) options to procedure f

Description

• 

The Categorize( 'f', 'L', 'opts' ) function categorizes the list L into lists  such that f(Mi[1], j, opts) returns true for each element j in the ith list Mi. The procedure f must return a value of type truefalse, and it must be reflexive: f(x, x, opts) must return true for each x in L.

• 

If f defines an equivalence relation, then the result is a partition of L into equivalence classes.

• 

If f can be written in the form (x,y) -> g(x) = g(y), then the call ListTools[Classify](g, L, opts) is more efficient, and equivalent except in the form of the output (Classify returns a table of sets).

Examples

(1)

(2)

(3)

(4)

(5)

See Also

list

ListTools

ListTools[Classify]

seq

type/list

type/truefalse

verify/expand

 


Download Help Document