On 16 Jun., 07:03, "Alf P. Steinbach" <al...@start.nowrote:
* Chris Forone:
But much of the reason that I'm not familiar with it is that valarray is
essentially an unfinished class.
One that isn't used in practice, the Most Useless part of the standard library.
Who knows what the author had in mind?
Valarrays have been designed with linear algebra and numeric
computation in mind.
The internal memory layout is a one dimensional array (quick
operations on all elements and on two equally sized valarrays).
The slice_arrays allow elegant access e.g. to row/column vectors in
matrices, or for example the diagonal vector.
Tensor math also comes to mind as an area where valarrays can be
efficient as containers.
If you have to deal with big matrices, you learn to like the class.
Its not a very frequent task for most developers, though.
best,
Michael.