Structs

  • | Given input vector LENGTHS, and input n_split, | LengthsSplit returns a single output vector. | | It “splits” each length into n_split values which | add up to the original length. | | It will attempt to do equal splits, and if not | possible, it orders larger values first. | | If the n_split is larger than the length, zero | padding will be applied. | | e.g. LENGTHS = [9 4 5] | n_split = 3 | Y = [3 3 3 2 1 1 2 2 1] | | e.g. LENGTHS = [2, 1, 2] | n_split = 3 | Y = [1 1 0 1 0 0 1 1 0]