develooper Front page | perl.perl6.language.data | Postings from August 2000

Re: Upcoming RFC's...

Thread Previous
From:
Christian Soeller
Date:
August 31, 2000 14:20
Subject:
Re: Upcoming RFC's...
Message ID:
39AEBEA6.B2AEDB7A@auckland.ac.nz
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).

  Christian

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About