Skip to content

Conversation

@andrsd
Copy link
Collaborator

@andrsd andrsd commented Jan 14, 2026

Refs #90

@andrsd andrsd requested review from ragusa and wdhawkins January 14, 2026 13:58
@andrsd andrsd self-assigned this Jan 14, 2026
@andrsd andrsd added the maintenance Code maintenance task label Jan 14, 2026
Copy link
Contributor

@ragusa ragusa left a comment

Choose a reason for hiding this comment

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

silly question: size_t is machine-dependent but often unsigned int 64 bit, right? why use such a large integer capacity when we know the groups will also be less than what can be encoded using unsigned int?

@andrsd
Copy link
Collaborator Author

andrsd commented Jan 14, 2026

The only reason for std::size_t is that LBSProblem stores groups like this:

  std::vector<LBSGroup> groups_;

which I admit is somewhat silly. It kinda says that groups might be stored in random order, but I don't think the code is capable of handling that. If you always want to iterate over groups from 0..G, I can remove the container and use a smaller integer type.

@ragusa
Copy link
Contributor

ragusa commented Jan 15, 2026

The only reason for std::size_t is that LBSProblem stores groups like this:

  std::vector<LBSGroup> groups_;

which I admit is somewhat silly. It kinda says that groups might be stored in random order, but I don't think the code is capable of handling that. If you always want to iterate over groups from 0..G, I can remove the container and use a smaller integer type.

Pinging @wdarylhawkins to get his opinion, since both you and I think size_t is silly.

In forward mode, we go 0..G. In adjoint mode, we may go G..0.

@wdhawkins
Copy link
Collaborator

The only reason for std::size_t is that LBSProblem stores groups like this:

  std::vector<LBSGroup> groups_;

which I admit is somewhat silly. It kinda says that groups might be stored in random order, but I don't think the code is capable of handling that. If you always want to iterate over groups from 0..G, I can remove the container and use a smaller integer type.

Pinging @wdarylhawkins to get his opinion, since both you and I think size_t is silly.

In forward mode, we go 0..G. In adjoint mode, we may go G..0.

I also agree that using size_t is silly. I'd much prefer it be an unsigned int.

@andrsd andrsd force-pushed the issue/90-num-groups branch from a715a7b to 2d72fd7 Compare January 20, 2026 21:06
@andrsd andrsd changed the title Number of groups is std::size_t Number of groups is unsigned int Jan 20, 2026
@andrsd andrsd force-pushed the issue/90-num-groups branch from 2d72fd7 to efcab35 Compare January 20, 2026 21:09
@ragusa ragusa self-requested a review January 21, 2026 03:58
@andrsd andrsd force-pushed the issue/90-num-groups branch from efcab35 to 6619de3 Compare January 21, 2026 15:51
@ragusa ragusa self-requested a review January 21, 2026 16:14
@andrsd andrsd force-pushed the issue/90-num-groups branch 5 times, most recently from c433cd0 to ff8b1b1 Compare January 26, 2026 17:10
- Group ID is now `unsigned int`.
- Groups IDs are not stored in a container inside `LBSProblem`, we only
  store the number of groups
Groupset remembers the first and the last group number.
@andrsd andrsd force-pushed the issue/90-num-groups branch from ff8b1b1 to b9617d7 Compare January 26, 2026 17:25
@andrsd andrsd requested a review from ragusa January 26, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Code maintenance task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants