.Modelica.Math.BooleanVectors.allTrue

Information

Syntax

allTrue(b);

Description

Returns true if all elements of the Boolean input vector b are true. Otherwise the function returns false. If b is an empty vector, i.e., size(b,1)=0, the function returns false.

Example

  Boolean b1[3] = {true, true, true};
  Boolean b2[3] = {false, true, false};
  Boolean r1, r2;
algorithm
  r1 = allTrue(b1);  // r1 = true
  r2 = allTrue(b2);  // r2 = false

See also

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

Interface

function allTrue
  extends Modelica.Icons.Function;
  input Boolean b[:] "Boolean vector";
  output Boolean result "= true, if all elements of b are true";
end allTrue;

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