Skip to content

feat: Add combinatoric indices utilitiy#5344

Open
junggjo9 wants to merge 9 commits intoacts-project:mainfrom
junggjo9:CombIndices
Open

feat: Add combinatoric indices utilitiy#5344
junggjo9 wants to merge 9 commits intoacts-project:mainfrom
junggjo9:CombIndices

Conversation

@junggjo9
Copy link
Copy Markdown
Contributor

@junggjo9 junggjo9 commented Apr 14, 2026

Add utility class to loop over all possibility to draw K elements from a set of N numbers
--- END COMMIT MESSAGE ---

Tagging: @andiwand, @dimitra97

@github-actions github-actions bot added this to the next milestone Apr 14, 2026
@github-actions github-actions bot added the Component - Core Affects the Core module label Apr 14, 2026
@junggjo9 junggjo9 marked this pull request as ready for review April 14, 2026 11:34
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

📊: Physics performance monitoring for f97d6a6

Full contents

physmon summary

Copy link
Copy Markdown
Contributor

@andiwand andiwand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main concern is that we introduce new non-tracking utility with very targeted use but in the public versioned namespace while clients should not depend on it.

To understand this better:

  • What is the use case for this?
  • Does boost provide something we can use? Potentially Boost.Hana if we want to push this further into compile time
  • STL has std::next_permutation which could be used for something like this

Generally I believe we deal with ordered subsets in a couple of places but I didn't come across generating them yet. If we need this for future code in ACTS I would propose moving this into detail

@junggjo9
Copy link
Copy Markdown
Contributor Author

I've not yet seen anything in boost which could provide this functionality, We'll need this to collapse the loop structure in the NSW segment finder from 4-> 1 loops.

@junggjo9
Copy link
Copy Markdown
Contributor Author

Permutation isn't neither what we want to do because the number elements themselves may change

219: Iteration: 0-> drawn indices: [0, 1, 2, 3]
219: Iteration: 1-> drawn indices: [0, 1, 2, 4]
219: Iteration: 2-> drawn indices: [0, 1, 2, 5]
219: Iteration: 3-> drawn indices: [0, 1, 2, 6]
219: Iteration: 4-> drawn indices: [0, 1, 2, 7]
219: Iteration: 5-> drawn indices: [0, 1, 2, 8]
219: Iteration: 6-> drawn indices: [0, 1, 2, 9]
219: Iteration: 7-> drawn indices: [0, 1, 2, 10]
219: Iteration: 8-> drawn indices: [0, 1, 2, 11]
219: Iteration: 9-> drawn indices: [0, 1, 2, 12]
219: Iteration: 10-> drawn indices: [0, 1, 2, 13]
219: Iteration: 11-> drawn indices: [0, 1, 2, 14]
219: Iteration: 12-> drawn indices: [0, 1, 3, 4]
219: Iteration: 13-> drawn indices: [0, 1, 3, 5]
219: Iteration: 14-> drawn indices: [0, 1, 3, 6]
219: Iteration: 15-> drawn indices: [0, 1, 3, 7]
219: Iteration: 16-> drawn indices: [0, 1, 3, 8]
219: Iteration: 17-> drawn indices: [0, 1, 3, 9]
219: Iteration: 18-> drawn indices: [0, 1, 3, 10]
219: Iteration: 19-> drawn indices: [0, 1, 3, 11]
219: Iteration: 20-> drawn indices: [0, 1, 3, 12]
219: Iteration: 21-> drawn indices: [0, 1, 3, 13]
219: Iteration: 22-> drawn indices: [0, 1, 3, 14]
219: Iteration: 23-> drawn indices: [0, 1, 4, 5]
219: Iteration: 24-> drawn indices: [0, 1, 4, 6]
219: Iteration: 25-> drawn indices: [0, 1, 4, 7]
219: Iteration: 26-> drawn indices: [0, 1, 4, 8]
219: Iteration: 27-> drawn indices: [0, 1, 4, 9]
219: Iteration: 28-> drawn indices: [0, 1, 4, 10]
219: Iteration: 29-> drawn indices: [0, 1, 4, 11]
219: Iteration: 30-> drawn indices: [0, 1, 4, 12]
219: Iteration: 31-> drawn indices: [0, 1, 4, 13]
219: Iteration: 32-> drawn indices: [0, 1, 4, 14]
219: Iteration: 33-> drawn indices: [0, 1, 5, 6]
219: Iteration: 34-> drawn indices: [0, 1, 5, 7]
219: Iteration: 35-> drawn indices: [0, 1, 5, 8]
219: Iteration: 36-> drawn indices: [0, 1, 5, 9]
219: Iteration: 37-> drawn indices: [0, 1, 5, 10]
219: Iteration: 38-> drawn indices: [0, 1, 5, 11]
219: Iteration: 39-> drawn indices: [0, 1, 5, 12]
219: Iteration: 40-> drawn indices: [0, 1, 5, 13]
219: Iteration: 41-> drawn indices: [0, 1, 5, 14]
219: Iteration: 42-> drawn indices: [0, 1, 6, 7]
219: Iteration: 43-> drawn indices: [0, 1, 6, 8]
219: Iteration: 44-> drawn indices: [0, 1, 6, 9]
219: Iteration: 45-> drawn indices: [0, 1, 6, 10]
219: Iteration: 46-> drawn indices: [0, 1, 6, 11]
219: Iteration: 47-> drawn indices: [0, 1, 6, 12]
219: Iteration: 48-> drawn indices: [0, 1, 6, 13]
219: Iteration: 49-> drawn indices: [0, 1, 6, 14]
219: Iteration: 50-> drawn indices: [0, 1, 7, 8]
219: Iteration: 51-> drawn indices: [0, 1, 7, 9]
219: Iteration: 52-> drawn indices: [0, 1, 7, 10]
219: Iteration: 53-> drawn indices: [0, 1, 7, 11]
219: Iteration: 54-> drawn indices: [0, 1, 7, 12]
219: Iteration: 55-> drawn indices: [0, 1, 7, 13]
219: Iteration: 56-> drawn indices: [0, 1, 7, 14]
219: Iteration: 57-> drawn indices: [0, 1, 8, 9]
219: Iteration: 58-> drawn indices: [0, 1, 8, 10]
219: Iteration: 59-> drawn indices: [0, 1, 8, 11]
219: Iteration: 60-> drawn indices: [0, 1, 8, 12]
219: Iteration: 61-> drawn indices: [0, 1, 8, 13]
219: Iteration: 62-> drawn indices: [0, 1, 8, 14]
219: Iteration: 63-> drawn indices: [0, 1, 9, 10]
219: Iteration: 64-> drawn indices: [0, 1, 9, 11]
219: Iteration: 65-> drawn indices: [0, 1, 9, 12]
219: Iteration: 66-> drawn indices: [0, 1, 9, 13]
219: Iteration: 67-> drawn indices: [0, 1, 9, 14]
219: Iteration: 68-> drawn indices: [0, 1, 10, 11]
219: Iteration: 69-> drawn indices: [0, 1, 10, 12]
219: Iteration: 70-> drawn indices: [0, 1, 10, 13]
219: Iteration: 71-> drawn indices: [0, 1, 10, 14]
219: Iteration: 72-> drawn indices: [0, 1, 11, 12]
219: Iteration: 73-> drawn indices: [0, 1, 11, 13]
219: Iteration: 74-> drawn indices: [0, 1, 11, 14]
219: Iteration: 75-> drawn indices: [0, 1, 12, 13]
219: Iteration: 76-> drawn indices: [0, 1, 12, 14]
219: Iteration: 77-> drawn indices: [0, 1, 13, 14]
219: Iteration: 78-> drawn indices: [0, 2, 3, 4]
219: Iteration: 79-> drawn indices: [0, 2, 3, 5]
219: Iteration: 80-> drawn indices: [0, 2, 3, 6]
219: Iteration: 81-> drawn indices: [0, 2, 3, 7]
219: Iteration: 82-> drawn indices: [0, 2, 3, 8]
219: Iteration: 83-> drawn indices: [0, 2, 3, 9]
219: Iteration: 84-> drawn indices: [0, 2, 3, 10]
219: Iteration: 85-> drawn indices: [0, 2, 3, 11]
219: Iteration: 86-> drawn indices: [0, 2, 3, 12]
219: Iteration: 87-> drawn indices: [0, 2, 3, 13]
219: Iteration: 88-> drawn indices: [0, 2, 3, 14]

@dimitra97
Copy link
Copy Markdown
Contributor

Actually we are not interested in permutations, we would like to generate unique combinations of elements as subsets of a bigger set.
In my opinion, this cleanly generates combinations of k elements out of N, fine but sill I am a bit skeptical about the usage in athena. I am in the process of evaluating this (dont know how fast I can be in case you want to merge it for this or if you want to merge it either way)
I would agree to put this into detail either way though

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component - Core Affects the Core module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants