-
Notifications
You must be signed in to change notification settings - Fork 229
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
Differential evolution #1062
Differential evolution #1062
Conversation
71c3dfc
to
a4652f9
Compare
@jzmaddock , @mborland : The only thing I'd like to change about this is the fact it can only take one argument type. I've resigned myself to the fact that each argument must be a container, but I would like to be able to query with (say)
This seems . . . somewhat doable. |
a4652f9
to
3394976
Compare
3394976
to
6292285
Compare
I'm not sure I know enough about the problem domain to comment in detail (except that we do need this!), but I worry somewhat about the interface to I wonder, is it reasonable to suppose that Second question: does this need to be an object? Which is to say, does it get reused and/or cache values? Or should it be a free function? I appreciate there are a lot of parameters though! On the docs front, it would be useful to have at least one usage example in the docs, rather than just pointing to the test cases. |
Yeah it's horrible. I think I'll do the Julia thing and just store all the params in a struct (this was also a suggestion in the codereview), and then I'll just make it a free function.
Is it impossible? I wonder if we could say Nonetheless, your suggestion to just provide two arrays does indeed solve the ugliness problem and is a clear win over what currently exists. Final question: Would it make sense to create a |
What about both a free function that takes a structure that unpacks into one that just takes the params list like the scipy signature? |
@mborland : Yeah that's probably the right approach . . . |
Some good suggestions in the review there... it's possible to take the parameter structure a step further, and create a function with named arguments: https://pdimov.github.io/blog/2020/09/07/named-parameters-in-c20/ The drawback is that the parameters have to appear in the correct order, but defaulted ones can be omitted.
Yes definitely doable I think, requires a traits class with a template-type template parameter to extract the contained type:
|
c8527a8
to
171abb3
Compare
@mborland , @jzmaddock : Example added, class changed to free function + parameter struct, C++20 named parameters can be used by user (though it works with C++17), docs written. The only thing I'd really like to see is real-time observation of the progress in an example, but I think that's out of reach without a GUI dependency. BTW anyone know why only Windows+gcc-8 hates the Func template syntax?
|
59f9c02
to
c3ca8e6
Compare
c3ca8e6
to
b6e03b1
Compare
@mborland, @jzmaddock : Ain't gonna lie, I'm sick of this now! Feel free to add comments if you see anything else that needs addressing and I'll get to it in another PR. |
No description provided.