get_compositions Function

public pure function get_compositions(k, n) result(res)

Get the ordered compositions of n into k summands.

Get all possible solutions for the k dimensional hypersurface. by taking into account the order. is different from . The German wikipedia has a nice article https://de.wikipedia.org/wiki/Partitionsfunktion#Geordnete_Zahlcompositionen

The compositions are returned in lexicographically decreasing order.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: k
integer, intent(in) :: n

Return Value integer, allocatable, (:,:)


Contents