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

Support complex types? #1

Closed
ethanhs opened this issue Mar 16, 2019 · 1 comment
Closed

Support complex types? #1

ethanhs opened this issue Mar 16, 2019 · 1 comment

Comments

@ethanhs
Copy link

ethanhs commented Mar 16, 2019

I have a requirement for using cma-es with Complex<f64> arrays. How hard do you think it would be to add support for this?

@pengowen123
Copy link
Owner

Adding built-in support would complicate the API, so I would prefer such functionality to instead be constructed on top of the library.

Complex numbers are essentially two independent numbers, so you could simply double the number of dimensions and manually construct Complex<f64> out of adjacent elements in the parameter array. If this is a common enough use case, a helper function could be added to do this for you.

@ethanhs ethanhs closed this as completed Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants