A matrix approach to the Gini index decomposition by subgroup and by income source