.TRANSFORM.Math.findPlace

Information

NOTE: Currently only handles montonically increasing, positive array values.

Example:

e = 5.5

v = {1,3,7,9,11}

result = 2 because 5.5 falls between index 2 and 3 of v


Example 2:

e = 3

v = {1,3,7,9,11}

result = 2


Example 3:

e = 12

v = {1,3,7,9,11}

result = 5

Interface

function findPlace
  input Real e "Search for e";
  input Real v[:] "Real vector";
  output Integer result "result=0, if e < v[1], result=size(v,1) if e > v[end]";
end findPlace;

Generated at 2024-11-22T19:25:38Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos