Internal function that calculates the inverted cumsum

CumSumInv(ntsegm, nmaxclust, z)

Arguments

ntsegm

An integer.

nmaxclust

An integer.

z

An integer matrix.