Boost logo

Boost :

From: Ralf W. Grosse-Kunstleve (rwgk_at_[hidden])
Date: 2003-02-03 18:46:15


--- David Abrahams <dave_at_[hidden]> wrote:
> jhr.walter_at_[hidden] (Joerg Walter) writes:
>
> > I needed something with exactly boost::shared_array's interface to add
> > reference counting to ublas. With shared_array I'm able to run the CLAPACK
> > test suite on ublas containers.
>
> I think Ralf Grosse-Kunstleve did something similar in scitbx
> (http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cctbx/scitbx/array_family/)

The type implemented in shared_plain.h (in the directory above) is a reference
counted array type. The code is derived from the std::vector implementation in
STLport (see copyright statement). Naming is according to Boost conventions.

I did not use boost::shared_array to implement the shared_plain<T> type because
one of our requirements is that one reference count can be used to manage
multiple types. This is required in the context of in-place fast Fourier
transforms. I.e. an array that starts out as shared_plain<std::complex<double>
> ends up as shared<double> after the Fourier transformation or vice versa. Of
course, constructing an array with type T and destructing it while thinking of
it as containing element types U could potentially lead to disasters. To
provide a certain degree of protection type casts are therefore only allowed
for element types with trivial destructors. This is managed through type traits
that can be specialized by the user.

The source code comes with a comprehensive set of regression tests. It is also
extensively tested as part of our application and has not changed significantly
for about 10 months now. I.e. I consider it "stable." I am planning to write
documentation "real soon." The license is also compatible with Boost, I
believe.

Ralf

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk