A first prototype for the space of sequences

Former-commit-id: 07dc6ef044b5b6a6fb45dc2acb01dffe71a96195
This commit is contained in:
2023-08-27 14:58:55 +02:00
parent cbd42d5b30
commit 9bf006af93
17 changed files with 969 additions and 117 deletions

View File

@ -65,6 +65,10 @@ func (r Ranker[_]) Len() int { return len(r.r) }
func (r Ranker[T]) Less(i, j int) bool { return r.x.Less(r.r[i], r.r[j]) }
func (r Ranker[_]) Swap(i, j int) { r.r[i], r.r[j] = r.r[j], r.r[i] }
// Order sorts the given data using the provided sort.Interface and returns the sorted indices.
//
// data: The data to be sorted.
// Returns: A slice of integers representing the sorted indices.
func Order[T sort.Interface](data T) []int {
ldata := data.Len()
if ldata == 0 {