sum_preserving_matrix_partition.Rd
This function takes a matrix as input and partitions each column such that only one entry in each row is non-zero, and the sums of each row are roughly equivalent.
sum_preserving_matrix_partition(X, option = 2, tol = 0.001)
A matrix with segmented rows
The function uses a greedy algorithm to select the entry with the maximum absolute value (or maximum positive value) in each column. The rows are then normalized to ensure that the sums are roughly equivalent.