I recently seen topics here that says the findall function is quite slow and I think so too most likely if I am dealing with large number of elements say hundreds of thousands or more. An example of what I want is as follows: Given an array of arrays say

[ [1] ; [3] ; [4] ; [2] ; [1, 4] ; [1, 3] ; [3, 4]; [2, 4] ; [1, 3, 4] ; [2, 3, 4] ].

Then for each element in the array I get the combinations taken (length - 1) and find its indices. For example, combinations taken 1 for [1, 4] is [1] and [4] which has indices 1 and 3 respectively in the array. Also, combinations taken 2 for [1,3,4] is [1, 3], [1, 4], and [3, 4] which has indices 6, 5, and 7 respectively. Is there an alternative for using findall function especially if you are dealing with 200,000 or more elements in the array? Thank you for any suggestion or answer.

`permutations`

in the `Combinatorics.jl`

package iiuc.

But if you have something of length 200,000 and you take pairs of those, good luck fitting the result in your computer’s memory.

1 Like