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

Using valarray instead of vector for Array type. #17

Open
kalwalt opened this issue Oct 20, 2022 · 2 comments
Open

Using valarray instead of vector for Array type. #17

kalwalt opened this issue Oct 20, 2022 · 2 comments
Labels
C/C++ code enhancement New feature or request

Comments

@kalwalt
Copy link
Owner

kalwalt commented Oct 20, 2022

At the moment i declared all the members inside data_t class as vector's because they are Array's

template <typename T> using Array = std::vector<T>;

But maybe we could try to use valarray instead of vector STL container, it has some advantages, for example it includes math functions (abs sin, cos..) and slicing yhe array that could be very useful. I will make some test, and will report here.

@kalwalt kalwalt added enhancement New feature or request C/C++ code labels Oct 20, 2022
@kalwalt
Copy link
Owner Author

kalwalt commented Oct 20, 2022

Converting the code to valarray, has some drawbacks, it lacks of vector functions like empty(), data(), assign(). Because the code now it use these functions, i need to understand if it possible to convert the code without these functions.

@kalwalt
Copy link
Owner Author

kalwalt commented Oct 20, 2022

But we could implement a different matrix_t class based on valarray and then make a comparison with some tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C/C++ code enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant