.Modelica.Math.BooleanVectors.index

Information

Syntax

index(b);

Description

This function returns an integer vector that contains indices to the true entries in a Boolean vector b. The number of entries in the integer vector is the number of true entries in b.

Example

index({false, true, false, true}) returns {2,4}.

See also

allTrue, anyTrue, countTrue, enumerate, firstTrueIndex, and oneTrue.

Interface

function index
  extends Modelica.Icons.Function;
  input Boolean b[:] "Boolean vector";
  output Integer indices[countTrue(b)] "Indices of the true entries";
end index;

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