Topic: valarray implementation
Author: Simon<sgwoodjr@gmail.com>
Date: Tue, 3 Jan 2012 13:02:26 -0800 (PST)
Raw View
Hi,
Can someone point me to a version of Vandevoorde's implementation of
the valarray class. I have found a reference with the following link:
ftp://ftp.cs.rpi.edu/pub/vandevod/Valarray/Documents, however it
appears to be broken.
-Simon
--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: Kevin Copps <kc@isc.tamu.edu>
Date: 1996/05/01 Raw View
For those interested in discussion of the ANSI/ISO C++ standard
valarray class for numeric arrays, and those interested simply
in a good numeric vector class,
I have made a partial implementation of valarray available.
(to see the proposed standard documention point your browser to
http://dogbert.lbl.gov/FAQ/C++_WP_HTML/lib-numerics.html)
The present implementation relies heavily on the STL function
classes, and in fact, an extension of the STL function classes are
suggested by it. The source compiles with no warnings on the
highest warning level of Microsoft Visuall C++ 4.1
Find source code and examples for valarray<kc> at
http://yoyodyne.tamu.edu/oop/oopcpp.html
My implementation of valarray is significant because of the
following advantages:
1. small additional member functions make it closely parallel
the STL container classes, making it possible to use the STL
algorithms with valarray.
2. all mathematical scalar and vector operations are implemented
using "expression templates". That is, every application of an
operator on valarray will result in an inline template expansion.
This avoids the creation of temporaries and has been shown to result
in speeds close to hand tuned C code.
3. The additional function classes added to the STL form a
complete set of operations suitable for creating a function pointer
algebra class, or a general expression class, useful for passing
expressions into functions.
The disadvantages I perceive are the following:
1. A tradeoff of speed with large code size; all the inline
template expansions can create larger code sizes than the more
conventional array classes now available in commercial libraries.
2. Even small and medium sized expressions, when instantiated, can
create very long class names. These long names put a strain on
compilers and may confuse debuggers.
--
Kevin Copps
Interdisciplinary Engineering
Texas A&M University
kc@isc.tamu.edu
[ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
[ about comp.lang.c++.moderated. First time posters: do this! ]
---
[ 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 ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]