.Modelica.Math.BooleanVectors.enumerate

Enumerates the true elements in a Boolean vector (0 for false elements)

Information

Syntax

enumerate(b);

Description

This function returns an integer vector that consecutively numbers the true elements in a Boolean vector b. The false elements are indicated by 0.

Example

enumerate({false, true, false, true}) returns {0,1,0,2}.

See also

allTrue, andTrue, anyTrue, countTrue, firstTrueIndex, index, and oneTrue.

Interface

function enumerate
  extends Modelica.Icons.Function;
  input Boolean b[:] "Boolean vector";
  output Integer enumerated[size(b, 1)] "Indices of the true elements in b (increasing order; 0 for false elements)";
end enumerate;

Generated at 2025-03-11T19:24:33Z by OpenModelicaOpenModelica 1.24.5 using GenerateDoc.mos