Skip to content

Add sparse set domains#515

Merged
alexzucca90 merged 2 commits intodwavesystems:constraint-programmingfrom
alexzucca90:dev/cp_sparse_set
Apr 22, 2026
Merged

Add sparse set domains#515
alexzucca90 merged 2 commits intodwavesystems:constraint-programmingfrom
alexzucca90:dev/cp_sparse_set

Conversation

@alexzucca90
Copy link
Copy Markdown
Collaborator

No description provided.

@alexzucca90 alexzucca90 added the enhancement New feature or request label Apr 21, 2026
@arcondello
Copy link
Copy Markdown
Member

arcondello commented Apr 21, 2026

Seems like we'll want a separate container-like sparse_set class that gets used by this class in the long run? Doesn't need to be now but want to understand the vision. Or, more concretely, should we merge this and then should I work on a container version?

class SparseSetArray : public DomainArray {
public:
SparseSetArray(StateManager* sm, ssize_t min_size, ssize_t max_size, ssize_t lb, ssize_t ub);
// SparseSetArray(StateManager* sm, ssize_t size, ssize_t lb, ssize_t ub);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lots of commented out functions, here and elsewhere.


private:
std::vector<ssize_t> n_;
std::vector<ssize_t> ofs_;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is quite terse. Could we make these clearer or add a comment explaining what they are?

Copy link
Copy Markdown
Member

@arcondello arcondello left a comment

Choose a reason for hiding this comment

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

Probably needs an overall documentation pass, but I think this is fine to merge into the development branch

@alexzucca90 alexzucca90 merged commit 409c266 into dwavesystems:constraint-programming Apr 22, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants