Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integer handling for feasible sets #83

Merged
merged 8 commits into from
Oct 9, 2024

Conversation

Ovascos
Copy link
Contributor

@Ovascos Ovascos commented Oct 7, 2024

This PR adds support for query the number of integers in a feasible set.

int lp_feasibility_set_is_point_int(const lp_feasibility_set_t* set) {
long cnt = 0;
for (size_t i = 0; i < set->size; ++i) {
long tmp = lp_interval_count_int(set->intervals + i);
Copy link
Member

Choose a reason for hiding this comment

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

wondering if we can check this without counting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Counting is more or less for free, as it is "just" one subtraction per interval.

src/polynomial/feasibility_set.c Show resolved Hide resolved
src/polynomial/feasibility_set.c Show resolved Hide resolved
Copy link
Member

@ahmed-irfan ahmed-irfan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks

@ahmed-irfan ahmed-irfan merged commit a79b13b into SRI-CSL:master Oct 9, 2024
8 checks passed
@Ovascos Ovascos deleted the feasible-set-int branch October 10, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants