Instead of the current utils/Blitz2FLENS.h Blitz and FLENS could be better integrated by making a GeneralStorageView of a blitz::Array and passing it to GEMatrix as template parameter.
Transposition of blitz::Array only permutes strides, does not touch storage, as we very well know. What is maybe not so clear is that this remains the case after deep copying as well, since also in this case the strides are just copied so that the result does not have obvious ordering. The way to go is to first create an array with the desired ordering and then assign to it from the original array.
A more general solution would be to implement an Array class, which is noncopyable and inherits publicly from blitz::Array. Then in “copy-like” constructors and transposition, one must in each and every case specify whether deep or shallow semantics is meant. In this case, since no real copy constructor is available, one should resort to another way to return these arrays from functions: A straightforward solution is to return the underlying blitz::Array, and reconstruct the Array from this. It should also provide something like a “cloning” member, which allows for dressing up a chunk of memory with the very same Array interface, with the correct storage layout, etc. Clearly, this new Array class obsoletes blitzplusplus::TinyOfArrays.
, of course, as blitz::Array has an immense number of constructors.
The class could leav all work to the underlying blitz::Array storage, but solve this silly problem of size_t, ptrdiff_t, int conversions. The difficulty is the construction, because blitz::Array provides an immense number of constructors, but with the constructor inheritance of C++11 it should be possible.