-
Notifications
You must be signed in to change notification settings - Fork 138
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
use square when possible and stronger filtering 2 #1055
Conversation
practical interest to be confirmed by experiments
Sonatype Lift is retiringSonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console. |
|
|
||
private boolean hasHoles(IntVar var) { | ||
return (var.getUB() - var.getLB() + 1) > var.getDomainSize(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ArthurGodet you suggest to remove it because the following code is expected to create holes everywhere?
// check perfect squares once and for all
int ub = vars[0].getUB();
vrms.clear();
vrms.setOffset(vars[0].getLB());
for (int value = vars[0].getLB(); value <= ub; value = vars[0].nextValue(value)) {
if (!MathUtils.isPerfectSquare(value)) {
vrms.add(value);
}
}
impact = vars[0].removeValues(vrms, this);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, indeed. As long as vars[0] has an enumerated domain and its bounds are different, it will necessarily contains holes because of this code.
@ArthurGodet can you please confirm I correctly reapplied your suggestions in the last commit ? |
Yes, everything seems good to me now ! |
No description provided.