|
Boost : |
From: RGProlog_at_[hidden]
Date: 2004-02-11 11:51:41
Wrote garcia_at_[hidden]
>Greetings,
>I am trying to grok what it is you describe, but I am afraid I may be
>missing something. Could you explain in what ways >dynamic_multi_array
>differs from the arrays in the Boost.MultiArray library?
>Thanks
Thank you for your interest.
The dynamic_multi_array arrays differ from the the arrays in the
Boost.MultiArray library in the same way the arrays in the Boost.Dynamic Bitset library
differ from the arrays in the std::bitset library; it is dynamic vs. static.
Thus the rationale behind the Dynamic Multi Array library is similar to the
rationale behind Boost.Dynamic Bitset library. It complimemts the Boost.MultiArray
library.
The way the Dynamic Multi Array library is implemented is different. The
relationship between the components of the Dynamic Myltiarray library, for
example, is different. While the coupling between multi_array and
multi_array_ref the Boost.Dynamic Bitset library is almost the stongest possible, public
inheritance, the relationship between dynamic_multi_array &
dynamic_multi_array_ref is the weakest possible. The dynamic_multi_array_ref points to the data
initialized and managed by the dynamic_multi_array and that's it. (for the
details see documentation once it will become available on the vault.) There is a
clear rationale behind this decision. The dynamic_multi_array component does not
provide the capacity to hone in on its subviews; the dynamic_multi_array and
the dynamic_subarray components do. The dynamic_multi_array is stricly an
extension of std::vector into the multi dimensional enviroment. Thus a user who
needs just that --- a strict extension of std::vector --- and wants to avoid
the performance penalty the subview capacity would incur, he/she can use the
the dynamic_multi_array component of the library alone. For those who want it
all, though, the rest of the components will do the job.
Also, the Dynamic Multi Array library does not define a subview type.
Instead, at a meager price of a few numeric assignment, an existing
dynamic_multi_array_ref object can be parametrized to act as any subview of the same
dimension of the array object it references, and still retain its iterator
interface.
Also, the Dynamic Multi Array library does not define an analog of the
Boost.MultiArray library index_gen facility. In analogy to std::vector whose
objects can be both accessed and generated using a single integral type, the
dynamic_multi_array object can be constructed and accessed using C++ arrays,
boost::arrays, std::vector arrays or any other class that contains a contiguous
block of integral data and has a random access interface.
I did e-mail to you, and will e-mailt to anyone expressing interest in
the Dynamic Multi Array library the library's code untill the day I will be
able to put the code on the wault.
---Roman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk