Kotlin / Kotlin/multik

How to sort rows in a `D2Array` by value in the last (or nth) column

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
api feature ndarray
Dominant language
Kotlin
Stars
734
Forks
51
Avg merge
9h 52m
Merged PRs (30d)
6

Description

I noticed a `D2Array` is just a single array containing all elements, instead of a nested array of arrays.

So how can the "rows" be sorted by the values of the last (or nth) column.

The equivalent in plain Kotlin would be:

```kotlin
val foo = Array(10) { DoubleArray(10) { nextDouble() } }

foo.sortBy { it.last() }
```

Contributor guide

Open the contributing guide

Research direction

The issue names no source file or test. Start by locating D2Array's flat storage and any existing row-access or sorting APIs, then determine how sorting by the last or nth column should be exposed. Done means the requested row-ordering behavior is implemented or documented with coverage for the relevant cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.