SortLevels sorts the splits according to the current index level ordering of values i.e., first index level is outer sort dimension, then within that is the next, etc
()
| 162 | // SortLevels sorts the splits according to the current index level ordering of values |
| 163 | // i.e., first index level is outer sort dimension, then within that is the next, etc |
| 164 | func (spl *Splits) SortLevels() { |
| 165 | spl.Sort(func(sl *Splits, i, j int) bool { |
| 166 | vli := sl.Values[i] |
| 167 | vlj := sl.Values[j] |
| 168 | for k := range vli { |
| 169 | if vli[k] < vlj[k] { |
| 170 | return true |
| 171 | } else if vli[k] > vlj[k] { |
| 172 | return false |
| 173 | } // fallthrough |
| 174 | } |
| 175 | return false |
| 176 | }) |
| 177 | } |
| 178 | |
| 179 | // SortOrder sorts the splits according to the given ordering of index levels |
| 180 | // which can be a subset as well |