TODOS re-order splits to show best case with max.segments < n.data? 2022.1.24 remove random_set_vec test.rev example which failed on M1. 2021.11.3 binseg_normal_cv does model selection via most frequent number of segments with minimum validation error (over several random splits). 2021.11.2 break ties in Segment operator< by size (split larger segments first). binseg_normal gains args is.validation.vec, position.vec in order to support efficient cross-validation. it now returns list with new component subtrain.borders (predicted changepoint positions). get_splits* functions for comparing empirical to best/worst case. 2021.1.6 More comments in binseg_normal.cpp to help potential GSOC students. 2020.10.7 Comment binseg_normal.cpp to explain optimal_cost computation. Use C++ multiset with operator< instead of multimap/vector. Use cumsum C++ vector for constant time mean/cost computation for any split. Store cost of segments before/after split, pass the cost values to maybe_add to avoid having to recompute them. Computation works for only one data point. 2020.9.15 remove unused C++ errors. test coef method. 2020.9.3 Bugfix for negative means, docs. predict/plot methods, copy code from example. 2019.9.20 Initial implementation.