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

Fix: clplatea small dimension issue #355

Closed
danphenderson opened this issue Dec 18, 2024 · 3 comments · Fixed by #360
Closed

Fix: clplatea small dimension issue #355

danphenderson opened this issue Dec 18, 2024 · 3 comments · Fixed by #360
Labels

Comments

@danphenderson
Copy link
Contributor

danphenderson commented Dec 18, 2024

Currently, prob = ADNLPProblems.clplatea(n=N) fails for all $N < 9$ as a result of this sum in it's definition:

           sum(
             sum(
               1 // 2 * (x[i + (j - 1) * p] - x[i - 1 + (j - 1) * p])^2 +
               hp2 * (x[i + (j - 1) * p] - x[i - 1 + (j - 1) * p])^4 for j = 2:p
             ) for i = 3:p
           )

Where $p$ is defined to be $p = floor(Int, sqrt(n))$. So, $N$ must be greater than $8$ for sum( .... for i=3:p) to be over a non-empty collection.

Suggested fixes:

  • Update the warning statement and properly adjust the number of variables to be 9 or greater.
  • Or, depending on the province and if it makes sense, we may modify the above sum as sum((... for i = 3:p); init=0.0); but then an issue would arise for $N < 4$ if similar action isn't taken to modify the two other sums in clplatea's definition.
@danphenderson
Copy link
Contributor Author

Similar issues arise for clplateb and clplatec.

@tmigot
Copy link
Member

tmigot commented Dec 18, 2024

Hi @danphenderson ! Thanks for the issue.
We fixed a couple similar recently, so I am not surprised. Since, you already analyzed the problem could you open a PR to fix this issue?

@tmigot
Copy link
Member

tmigot commented Dec 18, 2024

Sorry, I didn't read the whole message^^
The solution adjust the number of variables to be 9 or greater is good I think since it's really a corner case and using "small" dimension should mainly be for testing and debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants