Boost logo

Boost :

From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2024-09-16 14:17:45


śr., 26 kwi 2023 o 23:38 Alfredo Correa via Boost <boost_at_[hidden]>
napisał(a):

> Hi all,
>
> My name is Alfredo.
> I would like to propose this library called Multi for inclusion in Boost.
> Multi is a container and views library for (dynamic) multidimensional
> arrays.
>
> The library is available here,
> https://gitlab.com/correaa/boost-multi.
>
> The Boost prefix is purely aspirational at this point, of course.
> As I understand the process, the important step at this point is to
> find someone(s) to endorse the library and later a review manager.
> If you want to be an endorser, please let me know.
>
> If anyone has feedback or tips to prepare it for a review, please let me
> know as well.
> I will be at the Aspen CPPNOW conference if someone wants to discuss it in
> person.
> I am in the C++ Slack channel #boost for discussions as well.
>
> Here is a link to try it quickly online https://godbolt.org/z/KerbxW6WK.
>

Hi Alfredo,
Thank you for sharing your library. This has been more than a year now, and
I am sorry for the delayed response. Thank you for reminding us of it in
the slack channel. From this, I gather that the game is still afoot.

Recently, it was pointed out in this Mailing List, that it is unfair with
respect to the authors to give critical feedback without having studied the
proposal, yet I am about to do exactly this. I have only read the
introductory part of the docs, as well as the "Comparison with other array
libraries" appendix, and my feedback is solely based on that. But you can
consider me a good representative of a potential user of the library, who
is impatient, and can offer only 5-10 minutes to decide if they want to
invest more time in studying the library. This is in the spirit of Roert
Ramey's advice:
https://www.youtube.com/watch?v=ACeNgqBKL7E&ab_channel=CppCon

I personally never needed to manipulate big multidimensional arrays, so I
cannot immediately appreciate the usefulness of the library. I need a good
introductory part. When I read the high-level description, I immediately
think, "it is the same as std::mdspan". The docs say that it is different
from the std::mdspan, but then I think, "no, it is the same as std::mdspan".

>From the comparison table, I gather that Multi offers both the container
and the views (sort of references), and that std::mdspan is only a view. Am
I right? The docs say that Multi provides value semantics, but I guess it
is not a fair statement. I guess (and correct me if I got this wrong) that
the container is value-semantic, but the views are not. That is the nature
of the views, that you want them *not* to have value semantics. A fair
comparison, should compare Multi's views to std::mdspan. Now, the Standard
library has also a proposal in flight to add a container for
multi-dimensional arrays: std::mdarray:
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1684r2.html
Could you also include it in your comparison? And I would expect that
std::mdspan and std::mdarray are treated as one in this case.

I read that Multi's types have an STL-compatible interface (range). But
this is far from obvious what it means in the context of multi-dimensional
arrays. The range/iterator interface was tailored for one-dimensional data
structures. There is no obvious generalization to multiple dimensions. I
wouldn't even expect a multi-dimensional array to give me an STL interface
(whatever that means). Maybe, you mean that the library offers a view where
you can see the entire multidimensional array as a long string of values?
This would make sense, but if it is the case, I expect the introduction to
say exactly this.

In the case of std::mdspan, it has been said that it has been tailored to
efficiently represent both huge datasets as well as tiny 4x4 matrices. I am
not sure if this is the case, but I request that the docs for Multi say
what use case they have been designed and optimized for. Does the library
only represent dense matrices, or can it also represent sparse data?

The term "stride-based". It is not clear to me what it means.

I cannot see from the introduction if this library will throw exceptions.

The comparison between Multi and std::mdspan in the row "const-propagation
semantics" is unfair. I guess you are comparing Multi's container with a
view. A view is not expected to propagate constness.

So this is the very initial feedback, I hope it helps.

Regards,
&rzej;


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