MCPcopy Create free account
hub / github.com/cogentcore/core / SortLevels

Method SortLevels

tensor/table/splits.go:164–177  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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
164func (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

Callers

nothing calls this directly

Calls 1

SortMethod · 0.95

Tested by

no test coverage detected