June 2025
Intermediate to advanced
1093 pages
33h 24m
English
The valarray is not a container like the others. Its focus is less on compatibility with iterators, algorithms, and other containers, and more on the ability to parallelize numerical data processing.
You typically use valarray only with numeric types because it has specialized functions for them. It is also equipped with all conceivable arithmetic operator overloads, allowing you to write entire arithmetic expressions for valarray as if they were numbers, similar to what mathematicians do with (mathematical) vectors and matrices.
So if you've always wished you could simply add two vector<double>s component-wise with + or multiply with *, then valarray is for you:
Read now
Unlock full access