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

Re: Implementing RFC 272

Thread Previous
From:
Karl Glazebrook
Date:
September 24, 2000 07:45
Subject:
Re: Implementing RFC 272
Message ID:
39CE1379.F3A4611B@pha.jhu.edu

It was also described in one of the PDL RFCs ages ago.

The general data structure was described which basically
allows a:b:c slices, transposes (read arbitrary dimension
swapping) etc with no copy overhead.

In PDL

$a = zeroes(5000,4000,3000);

$b = $a->slice('2:5000:2,3:3000,0:3000:10')->xchg(2,1);

incurs no copy penalty in $b. In particular changeing $b
changes $a, it is a 'virtual slice'

Karl

c.soeller@auckland.ac.nz wrote:
> 
> Buddha Buck wrote:
> 
> > When I heard about transpose() (as well as reshape(), etc), I was
> > concerned about the time it would take to execute these complex
> > operations.  To wit, naively, I believed that a lot of data shuffling
> > would be necessary.
> 
> If I understand your message correctly this is exactly what PDL, NumPY,
> etc do right now and is also described in one of my messages I sent
> yesterday (Re: RFC 272 (v1) Arrays: transpose()) about implementing
> aliasing ;)
> 
>   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