Interest in library for nested containers?
Hello, is there interest in adding a library for nested containers (including a flattening view, a function counting the scalar elements etc.) to Boost? A working version is available at https://github.com/AlbertoMarnetto/multidim . If the concept and the interface are suitable for a submission – in particular if the requirement of a C++11 compiler is acceptable and the small number of functionalities is not a problem – I can proceed to restructure the library to meet Boost's style guidelines. Regards, Alberto Marnetto
What would this offer over Boost.MultiArray?
On Fri, Jan 22, 2016 at 10:49 AM, Alberto Marnetto
Hello,
is there interest in adding a library for nested containers (including a flattening view, a function counting the scalar elements etc.) to Boost? A working version is available at https://github.com/AlbertoMarnetto/multidim . If the concept and the interface are suitable for a submission – in particular if the requirement of a C++11 compiler is acceptable and the small number of functionalities is not a problem – I can proceed to restructure the library to meet Boost's style guidelines.
Regards, Alberto Marnetto
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Vee Kay
What would this offer over Boost.MultiArray?
My library and Boost.Multidim are actually orthogonal: the latter offers a specific family of containers, while the former is a collection of algorithms for generic programming with arbitrary container types. As an example, say one needs a template function which copies a nested container of unknown type T into an appropriate boost::multi_array. Using only STL and Boost this is not easy, as one has to heavily use metaprogramming to obtain the template parameters of the target multi_array (scalar type and dimensionality), and then more convolutions with recursion are needed to actually implement the copy. With multidim the same function can be written in about 10 lines, as the library provides all the requested functionalities: dimensionality() and scalarType() to determine the appropriate multi_array instantiation, bounds() to correctly size it, and flattening views to copy source to destination with a single 'for' loop. Here I have somewhat cheated, since I wrote multidim specifically to solve such kind of problems, but nonetheless I hope to have shown how my code could add functionality to Boost and cooperate nicely with its components. Regards, Alberto Marnetto
participants (2)
-
Alberto Marnetto
-
Vee Kay