(b, i) = vectorMax (A, first, last);
b is the largest element of vector A between indices first and last.
i contains the index of b in vector A.
First and last are optional. If first is omitted, then first = 1. If last is omitted, then last equals the size of A.
(b, i) =
vectorMax({1.3, 1.2, 7.4, 3.6, 20.9, 0, -6.7, -100, 5, 0.1});
returns
b = 20.9;
i = 5;
(b, i) = vectorMax({1.3, 1.2, 7.4, 3.6, 20.9, 0, -6.7, -100, 5, 0.1}, 6, 9);
returns
b = 5;
i = 9;
function vectorMax input Real A[:]; input Integer first = 1; input Integer last = size(A, 1); output Real b; output Integer i; end vectorMax;