One of the reasons that permutedims! is not documented yet, is because it 
was initially not exported, I believe. The non-allocating version of the 
simpler case of transposing a matrix, i.e. transpose! and ctranspose! are 
also still not exported, and thus, undocumented. Given the current tendency 
to export also the mutating methods, there was a pull request to export 
(c)transpose! as well, but it got stalled by having to decide on the best 
way to deal with the fact that one should use a completely different memory 
buffer for the destination (which is also the case for permutedims!)

https://github.com/JuliaLang/julia/pull/7814

I will try to add clear (hopefully) documentation for these methods and get 
this pull request merged next week.

Jutho



Op woensdag 17 september 2014 20:43:41 UTC+2 schreef Tim Holy:
>
> To add to Doug's point, permutedims! is non-allocating, but it's not 
> in-place. 
> After all, you can't stash a 3-by-5 matrix in a 5-by-3 matrix. The syntax 
> is 
>     permutedims!(output, input, perm) 
> where output already has the right size. 
>
> Since permutedims! is undocumented, DumpsterDoofus, would you add it to 
> https://github.com/JuliaLang/julia/blob/master/doc/stdlib/base.rst? 
> (just click on the little pencil icon) 
>
> --Tim 
>
>
> On Wednesday, September 17, 2014 11:03:24 AM DumpsterDoofus wrote: 
> > I am having trouble with `permute!`, the in-place version of 
> `permutedims`. 
> > I tried the following: 
> > 
> > A = rand(Float32, 20, 30, 40, 2); 
> > 
> > permute!(A, [1;2;3;4]) 
> > 
> > which produced the following: 
> > 
> > ERROR: BoundsError() 
> >  in permute!! at combinatorics.jl:196 
> >  in permute! at combinatorics.jl:212 
> > 
> > Strangely, executing the the in-place version, 
> > 
> > permutedims(A, [1;2;3;4]) 
> > 
> > works fine, giving the correct result. 
> > 
> > What is going on here? 
>
>

Reply via email to