.CRML.ETL.Utilities.vectorMax

Returns the largest element of a vector

Information

Syntax

(b, i) = vectorMax (A, first, last);

Description

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.

Examples

(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;

Interface

function vectorMax
  input Real A[:];
  input Integer first = 1;
  input Integer last = size(A, 1);
  output Real b;
  output Integer i;
end vectorMax;

Generated at 2026-04-01T18:18:38Z by OpenModelicaOpenModelica 1.26.3 using GenerateDoc.mos