Skip to content

Fix: clplatea small dimension issue #355

@danphenderson

Description

@danphenderson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions