Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-03-29 00:23:07


Thanks for your reply.

I've studied things in more detail and I feel a lot better about things now.

I think I was just frustrated with the difficulty understanding the
documentation.

So I'll just make couple of observations.

a) Basically I think this package is ideal for the problem that I am
attempting
apply it to. This made it worthwhile to spend a larger time than I might
have otherwise to figure out how it works.

User Documentation and Tutorial

Short Example - basically OK execept that the typedefs add an extra layer
of conceptual redirection which makes less obvious than it should be.

MultiArray Components
OK - but just mentions views without pointing to any explaination of them.

Array View and Subarray Type Generators - Reading through the tutorial
and coming upon this is totally mystifying.

Creating Views
Describes how they are created with out explaining that they are. I looked
in vain for a class description of views - either formal or informal.

The rest of tutorial is OK

Reference Documentation

Library Synopsis

mentions boost/multi_array.hpp - it would have been nice if there had been a
link
to the source code header.

Now I see this:

namespace boost {
  namespace multi_array_types {
    typedef *implementation-defined* index;

An I have no idea what *implementation-defined* is. I could be defined
by the compiler, standard libary implementation or it could be set by
my own array instantiation. (This might be be related to a warning I
get regarding unsigned int vs size_t when I use the library) Anyway
its not at all clear to me.

MultiArray Concept - OK this is pretty clear

BUT - its not clear what the concept is to be used for. There aren't
any other templates which this concept is used to describe a template
parameter. On seeing this, along with what I expect views to be, I
expected to see something like

A(T & t)

in "valid expressions" where T is a type modeling MultArray concept.
Instead each class modeling this concept has its own list of constructors.
So the whole idea of defining a concept seemed sort of like a detour. I
suppose
this is really a question about the library itself. The library seems to
be built on recurrsive ideas - arrays of arrays of higher order,
MultiArray classes constructed from other onese, etc. But this doesn't
seem to be reflected in the library or the documentation.

Models

Views are mentioned - but its not initially clear what the relationship is
between views, sub arrays and mult_array

I tracked down the concept checking classes. They are not mentioned
in the documentation - which I could be OK since its not clear how a
user would find these useful. Its not obvious that a user would want
to make his own model of a MultiArray so it might not seem
necessary - more on that below.

After struggling through this, the code, and a number of small
compilation experiments, I concluded that the library does seem to
implement what I originally thought it should implement - and it seems
a nice job and complete. So I'm pleased with that I've found - I just
don't think it should be so hard.

So that's my observations on the multi_array documentation and a
little bit on the design. I feel better now.

Now there are two things I would like to do with this library. My
perusal of the documentation was motivated by the desire to
implement them.

a) I really need a "join" operator which looks like:

template<unsigned int I, class M, class N>
array_view<??> join<I>(M & m, N &n);

where M and N are classes modeling the MultiArray concept. This
function would do the following:

i) verify the that the projections of m and n along dimension I have
the same shape and fail if they do not.
ii) return a view which is the "sticking together" along dimension I
of m and n. This is the inverse process of slicing. Should this not
exist at this time, I well attempt to implement it.

b) I can live without the following - but it would be very cool from my
application. The ability to define different extents for subarrays with
different indices.

Array a1[2];
Array a2[4];
Array a3[2] = {a1, a2};

I suspect that such a think is beyond what the library can be made
to do - and its not even clear that it make sense - but its not a big
issue for me.

Robert Ramey

Ronald Garcia wrote:
> Hi Robert,
>
> You should be able to create a new instance of a multi_array from a
> subarray or view reference. Could you show me some specific code
> that you're having trouble with?
>
> Cheers,
> ron
>
> On Mar 24, 2006, at 5:18 PM, Robert Ramey wrote:
>
>> The multi_array library seems to a good fit for a situation which I'm
>> currently dealing with.
>>
>> I'm having a lot of problems understanding how to use it though.
>>
>> I can't really understand the distinction between the differing
>> types of
>> views, subviews etc.
>>
>> I would sort of expect that a new instance of a multi_array could
>> be created
>> by passing
>> a reference to anything that fullills he requirements of a
>> multi_array.
>> That seems not
>> to be the case.
>>
>> If you could pont me to any additional information on this library,
>> I would
>> be interested.
>>
>> Robert Ramey
>>
>>
>>
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net