Takes an input \(N \times p\) matrix of polynomial expansions and outputs a list of length \(K+1\), isolating the rows of the input corresponding to assigned partition.
knot_expand_list(partition_codes, partition_bounds, nr, mat, K)
List of length \(K+1\), each element containing the submatrix for that partition
Numeric vector; values determining partition assignment for each row
Numeric vector; ordered knot locations defining partition boundaries
Integer; number of rows in input matrix
Numeric matrix; data to be partitioned
Integer; number of interior knots (resulting in \(K+1\) partitions)