esa / pagmo2

A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pagmo2/
GNU General Public License v3.0
812 stars 160 forks source link

turn all `std::vector<double>` into `vector_double` #329

Open Sceki opened 5 years ago

Sceki commented 5 years ago

I have noticed (especially in the hypervolume.hpp file, but maybe also elsewhere), that there are still various std::vector<double> instead of vector_double. I guess this is not wanted, and you might want to convert all of them.

bluescarni commented 5 years ago

I think we need to decide what vector_double means exactly first. It was originally meant only as a typing shortcut, but I have been thinking that we could use it to provide a customised vector type (which, for instance, could use a custom allocator to avoid dynamic memory usage in the common case in which vector_double contains only 1 item, that is, the fitness in single-objective unconstrained problems).

Sceki commented 5 years ago

Just out of curiosity, would this use bring some advantages performance-wise? Or is it just to help the developer in coding?

bluescarni commented 5 years ago

Right now changing all the types would be only cosmetics.

If we change vector_double to something else, it would have (hopefully) performance benefits when doing optimisation on single-objective unconstrained problems.