develooper Front page | | Postings from August 2000

Re: Upcoming RFC's...

Thread Previous
Christian Soeller
August 31, 2000 14:20
Re: Upcoming RFC's...
Message ID:
Buddha Buck wrote:

> RFC X+2: Retrieving Matrix dimensions
>     Present @#matrix as analogous to $#array
>     Discuss what $#matrix should return, as well as @#array
>     What is @matrix in scaler context?  (undef, anyone?)

Number of elements? For sparse matrices number of non-zero elements?

> A new proposal:
> RFC X+3: Flattening Matrices
>     Present @array = flatten(@matrix), which returns the elements of @matrix
>         as a 1-dimensional (sparse) array.

Good idea (compare also PDL->clump).

>     Discuss the efficiency of this
>     How to undo?

I'd suggest go along the route of PDL smart refs. The flattened array is
linked to the source array. Working on the flattened array updates
(lazily) the original nD source. If it is sparse enough save array of
indices + values internally, allows reconstruction (that might be the
way the sparse original matrix is stored anyway).


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About