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

The compositions are returned in lexicographically decreasing order.


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

Return Value integer, allocatable, (:,:)