Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2004-07-12 12:10:18


>> these points to some extent and provides some other nice properties
>> such as allowing transposition of arbitrary
>> indices with no need to reorder the underlying storage (that is
>> mat.transpose(0,1) causes all subsequent calls to mat(i,j) to provide
>> the transposed element without moving the elements themselves). I
>> have
>
> I'd be interested in seeing how this was done, especially in comparison
> with Timothy Budd's methods in _An Apl Compiler_. I had an
> implementation of this; however, it was only for dense matrices since
> that's all Budd had in his book.

What I do is maintain a signature of permutations (essentially the
index order : for example, in a 3D C array the signature would be
(0,1,2) while a FORTRAN order array would be (2,1,0). An accessor
class is responsible for converting between the multidimensional index
and a one dimensional offset corresponding to a dense matrix; the
allocator then uses this offset to get the element out of storage - if
the matrix is dense, the allocator just passes the already computed
offset along, while if it is sparse, a map is used to look for the
existence of the specified element.

------------------------------------------------------------------------
---------------------------
Matthias Schabel, Ph.D.
Utah Center for Advanced Imaging Research
729 Arapeen Drive
Salt Lake City, UT 84108
801-587-9413 (work)
801-585-3592 (fax)
801-706-5760 (cell)
801-484-0811 (home)
mschabel at ucair med utah edu


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