Functions Min and Max
Functions Min and Max
Min( X, I ) Max( X, I )
These return the smallest (Min) or largest (Max) values along an indicated index.
To find the larger of separate values, use:
Max( [a,b,c] )
This form evaluates a, b, and c, and finds the largest value among them. For example:
Max( [sin(30), tan(30), cos(30)] ) --> 0.8660254
The index parameter is optional, but it is highly recommended that you always specify the index except in the list-usage just mentioned, or in the case where you can guarantee that X will always be one-dimensional (such as when X is itself an index). In most cases, even if your array is 1-D today, it is better to specify the index explicitly so that the expression can correctly array abstract if new dimensions are introduced into your model in the future.
As of 4.0, these functions do not support named parameter syntax.
Functions CondMin and CondMax
CondMin( X : Array[I], cond : Boolean[I] ; I : IndexType ) CondMax( X : Array[I], cond : Boolean[I] ; I : IndexType )
Conditional Min and Max. These return the smallest (CondMin) or largest (CondMax) values along a given index, but only along a subset of values as indicated by the parameter cond.
As of 4.0, these functions do not support named parameter syntax.
Enable comment auto-refresher