allCombinations Module Function

pure module function allCombinations(array) result(res)

Convert IntArray(:) vector into a 2D array of shape (size(IntArray),:) containing all possible combination of IntArray(:)%entries. Works only for sizes 1 and 3

Arguments

Type IntentOptional Attributes Name
type(IntArray), intent(in), dimension(:) :: array

Return Value integer(kind=ik), dimension(:,:), allocatable