.Modelica.Math.BooleanVectors.enumerate

Information

Syntax

enumerate(b);

Description

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

Example

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

See also

allTrue, 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 entries (increasing order; 0 for false entries)";
end enumerate;

Generated at 2020-06-05T07:38:22Z by OpenModelica 1.16.0~dev-420-gc007a39