Boost logo

Ublas :

Subject: [ublas] Proposal
From: Cem Bassoy (cem.bassoy_at_[hidden])
Date: 2018-03-23 21:43:09

Hi Stefan,

thanks for your interest.
actually I did not want to really change any type system but only follow
the taxonomy of uBLAS.
I took the definitions provided by uBlas docu for matrix and vector
concepts and adjusted those for tensors. See
A multiarray concept has been already developed in
I think the only new concept is the multidimensional iterator. This will be
difficult to develop. But we do not need it for first shot of the library.
It would just be consistent with the current uBlas version. If I am not
wrong even matrix operations provide iterators, see
Not sure if we need that.
So I only wanted things to be consistent, at least for the proposal.

In short, programming-wise I think:
- tensor template class is a must.
- tensor expression templates, entry wise tensor operations and tensor
unfolding are a must.
- iterators are nice to have.
- tensor slices and views are a nice to have.
- in-place tensor contractions are also nice to have.
- efficient in-place tensor contractions are really hard to implement.

We would need to agree on :
what tensor parameter do we want to be compile-time or runtime variable?
do we want the same flexibility as boost::numeric::matrix or

I have already implemented a tensor library without expression templates
(runtime-variable rank, dimensions and even storage format). However almost
all of the tensor operations I have described in the proposal are
implemented. However, the interface needs to be adjusted really as I did
not use expression templates. You can read about the library and concepts

I would like to start to contribute to the boost community and hopefully
try to write a paper about it, similar to the authors of Boost.MultiArray.
I think this might be a good start. Of course in future, I would love to
add a full library which will cost more time.

I hope I could answer some of your questions.