Utilities
OMFrontend.ListUtil and OMFrontend.ArrayUtil hold the list and array functions the frontend is written with. They were the packages ListUtil.jl and ArrayUtil.jl until OMFrontend 2.1.0 and keep their names and functions.
ListUtil
OMFrontend.ListUtil — Module
The list functions of OMFrontend (OpenModelica's List package, the part the frontend uses).
Every function that builds a list takes the element type TO of the result as its last argument and builds Cons{TO} cells; the result is a TypedList{TO} (nil or a Cons{TO}). A fold takes the type of its accumulator (TO for fold, TA for the argument of mapFold). The caller passes the element type it declares (List{Subscript} → Subscript), so the result is stored without a conversion (convert copies a list of another element type cell by cell) and every local in the loops has a concrete or small union type.
A list argument may have cells of any element type: it is read, and copied only where a result needs Cons{TO} cells and the input has others.
Small functions that take an element as an argument (isMemberOnTrue, consOnTrue, ...) are @inline: a call with an argument of abstract type (Expression, Subscript) is a run-time dispatch unless it is inlined.
Failures (fail()) are kept where OpenModelica's functions fail: callers inside @matchcontinue rely on them.
OMFrontend.ListUtil.TypedList — Type
TypedList{T}A list built by ListUtil: nil or a Cons{T}. A List{T} field or variable holds it without a conversion.
OMFrontend.ListUtil._copyOnto — Method
_copyOnto(::Type{TO}, lst, acc) -> TypedList{TO}The elements of lst, in order, in front of acc; lst itself is shared when acc is empty.
OMFrontend.ListUtil._fromVector — Method
_fromVector(::Type{TO}, v) -> TypedList{TO}The elements of v, in order, as a list.
OMFrontend.ListUtil._norm — Method
_norm(lst) -> Union{Nil{Any}, Cons{T}}A rest of a list (a tail field, of type Union{Nil, Cons{T}}) with its empty list as nil.
OMFrontend.ListUtil._reverseOnto — Method
_reverseOnto(::Type{TO}, lst, acc) -> TypedList{TO}The elements of lst in reverse order in front of acc, in Cons{TO} cells.
OMFrontend.ListUtil._reverseTyped — Method
_reverseTyped(::Type{TO}, acc) -> TypedList{TO}The accumulator acc, built reversed, in order. An accumulator of zero or one element is returned as it is.
OMFrontend.ListUtil._typed — Method
_typed(::Type{TO}, lst) -> TypedList{TO}lst as a TypedList{TO}: itself when it is empty or has Cons{TO} cells, else a copy.
OMFrontend.ListUtil._unionAdd — Method
_unionAdd(acc, inList, inCompFunc, TO) -> TypedList{TO}The elements of inList not yet in acc (inCompFunc) pushed onto acc. The membership loop is written out: a call with an element of abstract type and a union argument is a run-time dispatch.
OMFrontend.ListUtil._vector — Method
_vector(::Type{TO}, lst) -> Vector{TO}The elements of lst in a vector.
OMFrontend.ListUtil.all — Method
True if inFunc holds for every element.
OMFrontend.ListUtil.append_reverse — Method
append_reverse(inList1, inList2, TO) -> TypedList{TO}The elements of inList1 in reverse order in front of inList2.
OMFrontend.ListUtil.applyAndFold — Method
applyAndFold(inList, inFoldFunc, inApplyFunc, inFoldArg, TO) -> TOinFoldFunc(inApplyFunc(e), acc) over the elements, from inFoldArg.
OMFrontend.ListUtil.consOnTrue — Method
consOnTrue(inCondition, inElement, inList, TO) -> TypedList{TO}inElement in front of inList if inCondition holds, else inList.
OMFrontend.ListUtil.deleteMemberOnTrue — Method
deleteMemberOnTrue(inValue, inList, inCompareFunc, TO) -> (TypedList{TO}, Option{TO})inList without the first element for which inCompareFunc(inValue, e) holds, and SOME of that element; (inList, NONE()) if there is none. Example: deleteMemberOnTrue(2, {1, 2, 3, 2}, intEq, Int) => ({1, 3, 2}, SOME(2)).
OMFrontend.ListUtil.exist — Method
True if inFindFunc holds for an element.
OMFrontend.ListUtil.exist1 — Method
True if inFindFunc(e, inExtraArg) holds for an element.
OMFrontend.ListUtil.fill — Method
fill(inElement, inCount, TO) -> TypedList{TO}A list of inCount copies of inElement. Example: fill(2, 3, Int) => {2, 2, 2}.
OMFrontend.ListUtil.filterOnTrue — Method
filterOnTrue(inList, inFilterFunc, TO) -> TypedList{TO}The elements for which inFilterFunc holds, in order. Example: filterOnTrue({1, 2, 3, 4}, iseven, Int) => {2, 4}.
OMFrontend.ListUtil.find — Method
The first element for which inFunc holds; fails if there is none.
OMFrontend.ListUtil.find1 — Method
The first element for which inFunc(e, arg1) holds; fails if there is none.
OMFrontend.ListUtil.findOption — Method
SOME of the first element for which pred_func holds, NONE() if there is none.
OMFrontend.ListUtil.firstN — Method
firstN(inList, inN, TO) -> TypedList{TO}The first inN elements; fails if there are fewer.
OMFrontend.ListUtil.flatten — Method
flatten(inList, TO) -> TypedList{TO}The lists of inList joined. Example: flatten({{1, 2}, {3, 4, 5}, {6}, {}}, Int) => {1, 2, 3, 4, 5, 6}.
OMFrontend.ListUtil.flattenReverse — Method
flattenReverse(inList, TO) -> TypedList{TO}The lists of inList joined, the last first, each one in its own order (OpenModelica's List.flattenReverse).
OMFrontend.ListUtil.fold — Method
fold(inList, inFoldFunc, inStartValue, TO) -> TOinFoldFunc(e, acc) over the elements, from inStartValue. Example: fold({1, 2, 3}, intAdd, 2, Int) => 8.
OMFrontend.ListUtil.fold1 — Method
fold1(inList, inFoldFunc, inExtraArg, inStartValue, TO) -> TOinFoldFunc(e, inExtraArg, acc) over the elements, from inStartValue.
OMFrontend.ListUtil.foldList1 — Method
foldList1(inList, inFoldFunc, inExtraArg1, inStartValue, TO) -> TOfold1 over the elements of each list of inList.
OMFrontend.ListUtil.foldr — Method
foldr(inList, inFoldFunc, inStartValue, TO) -> TOAs fold, with the arguments of inFoldFunc swapped: inFoldFunc(acc, e).
OMFrontend.ListUtil.getMemberOnTrue — Method
The first element for which inCompFunc(inValue, e) holds; fails if there is none.
OMFrontend.ListUtil.hasOneElement — Method
True if the list has exactly one element.
OMFrontend.ListUtil.isEqualOnTrue — Method
isEqualOnTrue(inList1, inList2, inCompFunc) -> BoolTrue if the lists have the same length and inCompFunc holds for each pair of elements.
OMFrontend.ListUtil.isMemberOnTrue — Method
True if inCompFunc(inValue, e) holds for an element.
OMFrontend.ListUtil.last — Method
The last element of a list; fails if the list is empty.
OMFrontend.ListUtil.lastN — Method
lastN(inList, inN) -> ListThe last inN elements (shared with inList); fails if there are fewer.
OMFrontend.ListUtil.map — Method
map(inList, inFunc, TO) -> TypedList{TO}inFunc applied to each element.
OMFrontend.ListUtil.map1 — Method
map1(inList, inMapFunc, inArg1, TO) -> TypedList{TO}inMapFunc(e, inArg1) for each element.
OMFrontend.ListUtil.map1Fold — Method
map1Fold(inList, inFunc, inConstArg, inArg, TO, TA) -> (TypedList{TO}, TA)(e1, arg) = inFunc(e, inConstArg, arg) for each element; the list of the e1 and the last arg.
OMFrontend.ListUtil.map1_0 — Method
map1_0(inList, inFunc, inArg1)inFunc(e, inArg1) for each element, for its side effects.
OMFrontend.ListUtil.map1_2 — Method
map1_2(inList, inFunc, inArg1, TO1, TO2) -> (TypedList{TO1}, TypedList{TO2})The two results of inFunc(e, inArg1) for each element, as two lists.
OMFrontend.ListUtil.map2 — Method
map2(inList, inFunc, inArg1, inArg2, TO) -> TypedList{TO}inFunc(e, inArg1, inArg2) for each element.
OMFrontend.ListUtil.map2FoldCheckReferenceEq — Method
map2FoldCheckReferenceEq(inList, inFunc, inConstArg, inConstArg2, inArg, TO, TA) -> (TypedList{TO}, TA)(e1, arg) = inFunc(e, inConstArg, inConstArg2, arg) for each element. The list is inList itself, without allocating, when every e1 is the element it came from (referenceEq) and inList has Cons{TO} cells; otherwise a new list.
OMFrontend.ListUtil.map2List — Method
map2List(inListList, inFunc, inArg1, inArg2, TO) -> TypedList{List{TO}}inFunc(e, inArg1, inArg2) for each element of each list.
OMFrontend.ListUtil.map2Option — Method
map2Option(inList, inFunc, inArg1, inArg2, TO) -> TypedList{TO}inFunc(e, inArg1, inArg2) for each SOME(e); NONE() elements are left out.
OMFrontend.ListUtil.map3 — Method
map3(inList, inFunc, inArg1, inArg2, inArg3, TO) -> TypedList{TO}inFunc(e, inArg1, inArg2, inArg3) for each element.
OMFrontend.ListUtil.mapAllValueBool — Method
mapAllValueBool(inList, inMapFunc, inValue) -> BoolTrue if inMapFunc(e) equals inValue (valueEq) for every element and no call fails.
OMFrontend.ListUtil.mapFlat — Method
mapFlat(inList, inMapFunc, TO) -> TypedList{TO}The lists inMapFunc(e) joined, the last first (OpenModelica's List.mapFlat: the reverse of listAppend(inMapFunc(e_n), ... listAppend(inMapFunc(e_1), {}))).
OMFrontend.ListUtil.mapFold — Method
mapFold(inList, inFunc, inArg, TO, TA) -> (TypedList{TO}, TA)(e1, arg) = inFunc(e, arg) for each element; the list of the e1 and the last arg.
OMFrontend.ListUtil.mapFoldSO — Method
mapFoldSO(inList, inFunc, inArg, TO) -> TypedList{TO}inFunc(e, inArg) for each element (mapFold where the argument is not updated).
OMFrontend.ListUtil.mapList — Method
mapList(inListList, inFunc, TO) -> TypedList{List{TO}}inFunc applied to each element of each list. Example: mapList({{1, 2}, {3}}, intString, String) => {{"1", "2"}, {"3"}}.
OMFrontend.ListUtil.mapMap — Method
mapMap(inList, inMapFunc1, inMapFunc2, TO) -> TypedList{TO}inMapFunc2(inMapFunc1(e)) for each element.
OMFrontend.ListUtil.partition — Method
partition(inList, inPartitionLength, TO) -> TypedList{List{TO}}inList in parts of inPartitionLength elements, the last one shorter if needed. Example: partition({1, 2, 3, 4, 5}, 2, Int) => {{1, 2}, {3, 4}, {5}}.
OMFrontend.ListUtil.positionOnTrue — Method
The one-based position of the first element for which inPredFunc holds, -1 if there is none.
OMFrontend.ListUtil.reduce — Method
reduce(inList, inReduceFunc, TO) -> TOinReduceFunc over the elements, left to right; fails for the empty list. Example: reduce({1, 2, 3}, intAdd, Int) => 6.
OMFrontend.ListUtil.replaceOnTrue — Method
replaceOnTrue(inReplacement, inList, inFunc, TO) -> (TypedList{TO}, Bool)inList with the first element for which inFunc holds replaced by inReplacement, and whether one was. Example: replaceOnTrue(4, {1, 2, 3}, isTwo, Int) => ({1, 4, 3}, true).
OMFrontend.ListUtil.rest — Method
All elements but the first; fails if the list is empty.
OMFrontend.ListUtil.set — Method
set(inList, inN, inElement, TO) -> TypedList{TO}inList with the element at the one-based position inN replaced. Example: set({2,1,4,2}, 2, 3, Int) => {2,3,4,2}.
OMFrontend.ListUtil.sort — Method
sort(inList, inCompFunc, TO) -> TypedList{TO}inList sorted (stable); inCompFunc(a, b) is true when a comes after b. Example: sort({2, 1, 3}, intGt, Int) => {1, 2, 3}.
OMFrontend.ListUtil.sortedUnique — Method
sortedUnique(inList, inCompFunc, TO) -> TypedList{TO}The elements of a sorted list without repeats; inCompFunc tells whether two neighbors are equal.
OMFrontend.ListUtil.split — Method
split(inList, inPosition, TO) -> (TypedList{TO}, List)The first inPosition elements and the rest (shared). Example: split({1, 2, 5, 7}, 2, Int) => ({1, 2}, {5, 7}).
OMFrontend.ListUtil.splitLast — Method
splitLast(inList, TO) -> (TO, TypedList{TO})The last element and the elements before it; fails if the list is empty. Example: splitLast({3, 5, 7}, Int) => (7, {3, 5}).
OMFrontend.ListUtil.splitOnTrue — Method
splitOnTrue(inList, inFunc, TO) -> (TypedList{TO}, TypedList{TO})The elements for which inFunc holds and the others, each in the order of inList.
OMFrontend.ListUtil.splitr — Method
splitr(inList, inPosition, TO) -> (TypedList{TO}, List)As split, the first list reversed. Example: splitr({1, 2, 5, 7}, 2, Int) => ({2, 1}, {5, 7}).
OMFrontend.ListUtil.stripFirst — Method
All elements but the first (shared); the empty list for the empty list.
OMFrontend.ListUtil.stripN — Method
stripN(inList, inN) -> ListinList without its first inN elements (shared); fails if there are fewer or inN is negative.
OMFrontend.ListUtil.threadMapAllValue — Method
threadMapAllValue(inList1, inList2, inMapFunc, inValue)Fails unless the lists have the same length and inMapFunc(e1, e2) equals inValue (valueEq) for every pair.
OMFrontend.ListUtil.threadTuple — Method
threadTuple(inList1, inList2, TO) -> TypedList{TO}The pairs of elements at the same position, up to the end of the shorter list; TO is the pair type. Example: threadTuple({1, 2}, {true, false}, Tuple{Int, Bool}) => {(1, true), (2, false)}.
OMFrontend.ListUtil.toString — Method
toString(inList, inPrintFunc, inListNameStr, inBeginStr, inDelimitStr, inEndStr, inPrintEmpty) -> StringinListNameStr, inBeginStr, the elements printed with inPrintFunc separated by inDelimitStr, and inEndStr. An empty list gives inListNameStr * inBeginStr * inEndStr, or only inListNameStr if inPrintEmpty is false. Example: toString({1, 2, 3}, intString, "nums", "{", ";", "}", true) => "nums{1;2;3}".
OMFrontend.ListUtil.trim — Method
trim(lst, pred_func) -> Listlst without the elements at its head for which pred_func holds (shared). Example: trim({2, 4, 3, 6}, iseven) => {3, 6}.
OMFrontend.ListUtil.union — Method
union(inList1, inList2, TO) -> TypedList{TO}The elements of both lists without duplicates (isequal). Example: union({0, 1}, {2, 1}, Int) => {0, 1, 2}. An empty list and a list give that list as it is.
OMFrontend.ListUtil.unionEltOnTrue — Method
unionEltOnTrue(inElement, inList, inCompFunc, TO) -> TypedList{TO}inElement in front of inList unless an element of inList equals it (inCompFunc).
OMFrontend.ListUtil.unionOnTrue — Method
unionOnTrue(inList1, inList2, inCompFunc, TO) -> TypedList{TO}The elements of both lists without duplicates (inCompFunc), in order of first occurrence. Example: unionOnTrue({1, 2}, {2, 3}, intEq, Int) => {1, 2, 3}.
OMFrontend.ListUtil.uniqueOnTrue — Method
uniqueOnTrue(inList, inCompFunc, TO) -> TypedList{TO}The elements of inList without duplicates (inCompFunc), the first occurrence kept.
ArrayUtil
OMFrontend.ArrayUtil.all — Method
Returns true if the given predicate function returns true for all elements in the given Vector.
OMFrontend.ArrayUtil.any — Method
Returns true if the given predicate function returns true for any element in the given Vector.
OMFrontend.ArrayUtil.appendList! — Method
Returns the input array with the list elements added to the end of the given array. @author:johti17
OMFrontend.ArrayUtil.appendList — Method
Returns a new array with the list elements added to the end of the given array.
OMFrontend.ArrayUtil.appendToElement — Method
Appends a list to a list element of an array.
OMFrontend.ArrayUtil.arrayListsEmpty — Method
output true if all lists in the array are empty
OMFrontend.ArrayUtil.compare — Method
compare(arr1, arr2, comp_func) -> IntCompare two arrays element-wise using comp_func(e1, e2) which must return an integer (-1, 0, or 1). Returns the result of the first non-zero comparison, or compares array lengths if all corresponding elements are equal.
OMFrontend.ArrayUtil.consToElement — Method
Concatenates an element to a list element of an array. The array may be typed Vector{List} (untyped element lists); do not constrain the element to the list type.
OMFrontend.ArrayUtil.copy — Method
Copies all values from inArraySrc to inArrayDest. Fails if inArraySrc is larger than inArrayDest.
NOTE: There's also a builtin arrayCopy operator that should be used if the purpose is only to duplicate an array.
OMFrontend.ArrayUtil.copyN — Method
Copies the first inN values from inArraySrc to inArrayDest. Fails if inN is larger than either inArraySrc or inArrayDest.
OMFrontend.ArrayUtil.copyRange — Method
Copies a range of elements from one array to another.
OMFrontend.ArrayUtil.createIntRange — Method
Creates an array<Integer> of size inLen with the values set to the range of 1:inLen.
OMFrontend.ArrayUtil.exist — Method
Returns true if a certain element exists in the given array as indicated by the given predicate function.
OMFrontend.ArrayUtil.expand — Method
Increases the number of elements of an array with inN. Each new element is assigned the value inFill.
OMFrontend.ArrayUtil.expandOnDemand — Method
Resizes an array with the given factor if the array is smaller than the requested size.
OMFrontend.ArrayUtil.expandToSize — Method
Expands an array to the given size, or does nothing if the array is already large enough.
OMFrontend.ArrayUtil.fill — Method
Fills an array with inElement inCount times.
OMFrontend.ArrayUtil.fold — Method
Takes an array, a function, and a start value of type TO. The function is applied to each array element, and the start value is passed to the function and updated: inFunction(e, acc)::TO.
OMFrontend.ArrayUtil.fold1 — Method
Takes an array, a function, and a start value. The function is applied to each array element, and the start value is passed to the function and updated.
OMFrontend.ArrayUtil.fold2 — Method
Takes an array, a function, a constant parameter, and a start value. The function is applied to each array element, and the start value is passed to the function and updated.
OMFrontend.ArrayUtil.fold3 — Method
Takes an array, a function, a constant parameter, and a start value. The function is applied to each array element, and the start value is passed to the function and updated.
OMFrontend.ArrayUtil.fold4 — Method
Takes an array, a function, four constant parameters, and a start value. The function is applied to each array element, and the start value is passed to the function and updated.
OMFrontend.ArrayUtil.fold5 — Method
Takes an array, a function, four constant parameters, and a start value. The function is applied to each array element, and the start value is passed to the function and updated.
OMFrontend.ArrayUtil.fold6 — Method
Takes an array, a function, four constant parameters, and a start value. The function is applied to each array element, and the start value is passed to the function and updated.
OMFrontend.ArrayUtil.foldIndex — Method
Takes an array, a function, and a start value. The function is applied to each array element, and the start value is passed to the function and updated, additional the index of the passed element is also passed to the function.
OMFrontend.ArrayUtil.generate — Method
generate(n, gen_func) -> VectorGenerate a vector of n elements by calling gen_func(i) for i in 1:n.
OMFrontend.ArrayUtil.getIndexFirst — Method
Like arrayGet, but with the index first so it can used with List.map.
OMFrontend.ArrayUtil.getMemberOnTrue — Method
Takes a value and returns the first element for which the comparison function returns true, along with that elements position in the array.
OMFrontend.ArrayUtil.getRange — Method
Gets the elements between inStart and inEnd.
OMFrontend.ArrayUtil.isEqual — Method
Checks if two arrays are equal.
OMFrontend.ArrayUtil.isEqualOnTrue — Method
isEqualOnTrue(arr1, arr2, eq_func) -> BoolReturn true if arr1 and arr2 have the same length and eq_func(arr1[i], arr2[i]) returns true for all corresponding pairs.
OMFrontend.ArrayUtil.map — Method
Takes an array and a function over the elements of the array, which is applied to each element. The updated elements will form a new array, leaving the original array unchanged.
OMFrontend.ArrayUtil.map0 — Method
Applies a non-returning function to all elements in an array.
OMFrontend.ArrayUtil.map1 — Method
Takes an array, an extra arguments, and a function over the elements of the array, which is applied to each element. The updated elements will form a new array, leaving the original array unchanged.
OMFrontend.ArrayUtil.map1Fold — Method
map1FoldTakes a Vector, an extra argument, an extra constant argument, and a function. The function will be applied to each element in the list, and the extra argument will be passed to the function and updated.
OMFrontend.ArrayUtil.mapBoolAnd — Method
mapBoolAnd(arr, pred_func) -> BoolApply pred_func to each element of arr; return true only if all applications return true (logical AND over mapped results).
OMFrontend.ArrayUtil.mapFold — Method
Takes a vector, an extra argument and a function. The function will be applied to each element in the list, and the extra argument will be passed to the function and updated.
OMFrontend.ArrayUtil.mapFoldSO — Method
`$mapFoldSO$ Same as map fold. Applies the function to the map, however, it does not return the extra argument.
OMFrontend.ArrayUtil.mapIndices! — Method
Applies a function to only the elements given by the sorted list of indices. inline variant of mapIndices
OMFrontend.ArrayUtil.mapIndices — Method
Applies a function to only the elements given by the sorted list of indices.
OMFrontend.ArrayUtil.mapList — Method
As map, but takes a list in and creates an array from the result.
OMFrontend.ArrayUtil.mapNoCopy — Method
Takes an array and a function over the elements of the array, which is applied for each element. Since it will update the array values the returned array must have the same type, and thus the applied function must also return the same type.
OMFrontend.ArrayUtil.mapNoCopy_1 — Method
Same as arrayMapNoCopy, but with an additional arguments that's updated for each call.
OMFrontend.ArrayUtil.partition — Method
function partition(inList::Vector{T}, inPartitionLength::Int) where {T} Partitions a vector of elements into sublists of length n. Example:
julia> partition([1, 2, 3, 4, 5], 2) => [[1, 2], [3, 4], [5]]OMFrontend.ArrayUtil.position — Method
Returns the index of the given element in the array, or 0 if it wasn't found.
OMFrontend.ArrayUtil.reduce — Method
Takes a list and a function operating on two elements of the array. The function performs a reduction of the array to a single value using the function. Example: reduce([1, 2, 3], intAdd) => 6
OMFrontend.ArrayUtil.removeOnTrue — Method
Goes through an Array and removes all elements which are equal to the given value, using the given comparison function. @author:johti17
OMFrontend.ArrayUtil.replaceAtWithFill — Method
Takes
- an element,
- a position (1..n)
- an array and
- a fill value
The function replaces the value at the given position in the array, if the given position is out of range, the fill value is used to padd the array up to that element position and then insert the value at the position.
Example: replaceAtWithFill('A', 5, {'a', 'b', 'c'}, 'dummy') => {'a', 'b', 'c', 'dummy', 'A'}
OMFrontend.ArrayUtil.reverse — Method
reverses the elements in an array
OMFrontend.ArrayUtil.select — Method
Takes an array and a list of indices, and returns a new array with the indexed elements. Will fail if any index is out of bounds.
OMFrontend.ArrayUtil.setRange — Method
Sets the elements in positions inStart to inEnd to inValue.
OMFrontend.ArrayUtil.split — Method
Takes a list and a position, and splits the list at the position given. Example:
julia> split([1, 2, 5, 7], 2) => ([1, 2], [5, 7])OMFrontend.ArrayUtil.threadMap — Method
threadMap(arr1, arr2, map_func) -> VectorApply map_func(arr1[i], arr2[i]) for each index, returning a new vector of the results. Both input arrays must have the same length.
OMFrontend.ArrayUtil.toString — Method
Converts an array of type T into string representation.
OMFrontend.ArrayUtil.transpose — Method
transpose(arr::Vector{Vector{T}}) -> Vector{Vector{T}}Transpose a vector of vectors (matrix in row-major form). Returns a new vector of vectors where rows become columns and vice versa.
Example: transpose([[1,2,3], [4,5,6]]) returns [[1,4], [2,5], [3,6]].
OMFrontend.ArrayUtil.transposeArray — Method
Transposes a vector of vectors Example:
julia:> transposeArray([[1, 2, 3], [4, 5, 6]])
3-element Vector{Vector{Int64}}:
[1, 4]
[2, 5]
[3, 6]OMFrontend.ArrayUtil.updateIndexFirst — Method
Like arrayUpdate, but with the index first so it can be used with List.map.
OMFrontend.ArrayUtil.updatewithArrayIndexFirst — Method
Replaces the element with the given index in the second array with the value of the corresponding element in the first array.