[
https://issues.apache.org/jira/browse/MATH-879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479013#comment-13479013
]
Gilles commented on MATH-879:
-----------------------------
The code is:
{code}
if (lambda <= 0) {
lambda = 4 + (int) (3 * Math.log(dimension));
}
{code}
This implies that the default is dependent on the number of optimized
parameters. Hence, I would suggest that "lambda" be specified at the call to
"optimize", as kind of "OptimizationData" (with a more suggestive name, such as
"PopulationSize"), with no default (the value currently used in the code could
appear as a _suggestion_ in the documentation).
And passing this parameter through the constructor will be deprecated.
What do you think?
> "CMAESOptimizer" silently changes invalid input
> -----------------------------------------------
>
> Key: MATH-879
> URL: https://issues.apache.org/jira/browse/MATH-879
> Project: Commons Math
> Issue Type: Bug
> Affects Versions: 3.0
> Reporter: Gilles
> Assignee: Gilles
> Priority: Trivial
> Fix For: 3.1
>
>
> The "lambda" input parameter must be strictly positive. But when it's not the
> case, an undocumented default is used (cf. line 526).
> When a precondition is not satisfied, the code must throw an exception.
> Instead of the code unknowingly changing the input, it is rather the
> documentation that should suggest a good default.
> This change would allow to make "lambda" a constant (final) field.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira