up previous next
Max, Min

a maximum or minimum element of a sequence or list
Syntax

Max(E_1:OBJECT,...,E_n:OBJECT):OBJECT
Min(E_1:OBJECT,...,E_n:OBJECT):OBJECT

Max(L:LIST):OBJECT
Min(L:LIST):OBJECT


Description
In the first form, these functions return a maximum and minimum, respectively, of E_1,...,E_n. In the second form, they return a maximum and minimum, respectively, of the objects in the list L.

Example
  Max([1,2,3]);
3
-------------------------------
  Max(1,2,3);
3
-------------------------------
  Min(1,2,3);
1
-------------------------------
  Use R ::= QQ[x,y,z];
  Max(x^3z, x^2y^2); -- x^2y^2 > x^3z in the default ordering, DegRevLex
x^2y^2
-------------------------------
  Min(x^3z, x^2y^2);
x^3z
-------------------------------
  Use R ::= QQ[x,y,z], DegLex;
  Max(x^3z, x^2y^2); -- x^3z > x^2y^2 in DegLex
x^3z
-------------------------------
  -- ordered by inclusion: a maximal element in the list is returned
  Max(Ideal(x), Ideal(x^2), Ideal(x,y), Ideal(x-2,y-1));
Ideal(x, y)
-------------------------------


See Also