Macaulay2 / Macaulay2/M2

runLengthEncode prefers sequences to duplicates

Open
#4,393 3 comments 0 reactions 0 assignees View on GitHub

A pull request for this has already been merged.

  • #4532 by @pzinn — merged
Core
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

I'm not sure if I'm expecting something unreasonable, but in this situation:
```m2
i4 : runLengthEncode {1,2,2,2,3,3,3}

o4 = {1..2, 2:2, 3:3}
```
I would expect `{1, 3:2, 3:3}` instead.

For context, this method is used for compactly displaying the twists of sums of line bundles, so knowing that O(2) is repeated 3 times is more significant.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the runLengthEncode entry point and any related tests or examples. Reproduce the provided input, then determine how the function chooses between sequence ranges and duplicate counts; done means the output preserves the expected duplicate count for 2 and remains covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.