Topic: valarrays - who uses them ?


Author: Sigbjoern Revheim <Sigbjorn.Revheim@nsd.uib.no.nospam>
Date: 1999/06/23
Raw View
Philip Brabbin wrote:

> Probably the most mysterious parts of the C++ Standard Library for me
> must be the valarray and its related classes. Is it supposed to be a
> competitor for existing LA libraries, or does it have a different function.

I don't know if this helps you, but here is what I found in a help file about
valarry:

"The C++ language is often used in scientific and engineering work to perform
long and difficult operations on arrays of numbers. While the language itself
provides the flexibility and efficiency needed for these kind of
calculations, the code can become very complex. Naturally, we can use the
object-oriented features of the language to encapsulate this complexity, but
classes designed to simplify numeric programming without sacrificing
performance are notoriously difficult to code correctly. Fortunately, the
Standard C++ Library now provides some relief in the form of the valarray
class template.

This class template provides the necessary efficiency in the form of a
single-dimensional array. Class valarray can be used to perform calculations
directly on arrays in a single dimension, and to represent higher order
arrays with a little more effort. An extended set of subscripting operators
provides the basis for building matrices and other more sophisticated classes
from the relatively simple and lean valarray."


I don't know anything about the LA libs you mentioned but I guess they aren't
generic. The advantage of using valarry must be the ability to use user
defined types.
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: Philip Brabbin <pabrabbin@hotmail.com>
Date: 1999/06/23
Raw View
Probably the most mysterious parts of the C++ Standard Library for me
must be the valarray and its related classes.

It seems that they're meant to be low-level primitives (which can be
agressively optimised by compilers) used for Linear Algebra.  However,
since the Fortran BLAS and LAPACK libraries appear to be already well
established and have highly optimised implementation on many platforms,
I can't quite work out what role the valarray is supposed perform.  Is
it supposed to be a competitor for existing LA libraries, or does it
have a different function.

Any ideas v. welcome.

Thanks,

Phil Brabbin


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]