arrays and views

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

arrays and views

Neal Becker
I hope you'll excuse a naive question.  There are a number of c++ array-type
libraries.  For example, boost::ublas.  It seems to me that the distinction
between an array vs. an array slice leads to significant complexity in the
design.

I think the design could be much simpler.  There are only 2 objects: storage,
and views of storage.  As long as storage is managed, e.g.: reference
counted, there is no need to make a distinction between various types of
views.

A view then specifies any number of dimensions, slicing, basing, and holds a
(e.g.) shared_pointer to storage.

Any thoughts?
_______________________________________________
glas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/glas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: arrays and views

Toon Knapen
I do not think using shared-ptr's are a good idea and second I do not
think using shared-ptr's will solve any problem.

I think we currently can see the matrix as (embedding or being) the
storage and matrix-slices or any other matrix-view as being a view on
this storage. I personally do not see how using shared-ptr's would
simplify design?

Second, using shared-ptr's on small matrices might induce a performance
penalty. And thus IMHO to be avoided for the same reason we are not
using polymorphism inside the matrix libraries.

toon



Neal Becker wrote:

> I hope you'll excuse a naive question.  There are a number of c++ array-type
> libraries.  For example, boost::ublas.  It seems to me that the distinction
> between an array vs. an array slice leads to significant complexity in the
> design.
>
> I think the design could be much simpler.  There are only 2 objects: storage,
> and views of storage.  As long as storage is managed, e.g.: reference
> counted, there is no need to make a distinction between various types of
> views.
>
> A view then specifies any number of dimensions, slicing, basing, and holds a
> (e.g.) shared_pointer to storage.
>
> Any thoughts?
> _______________________________________________
> glas mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/glas

_______________________________________________
glas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/glas
Loading...