What functions does pagefun support?

In Matlab help, you said there are many functions that pagefun supports.
But I check it and found not so many functions are supported by pagefun.
What was worse, sum is not supported by pagefun!!!
PAGEFUN does not support the specified function 'sum'.
When do you make pagefun support the elementary functions, like sum, size.... I am so looking forward to...

5 comentarios

Stephen23
Stephen23 el 14 de Ag. de 2017
The pagefun documentation has a list of supported functions.
Jan
Jan el 14 de Ag. de 2017
When do you make pagefun support the elementary functions, like
sum, size...
This is the public forum, not the official support of MathWorks. So "we" cannot modify the pagefun code.
sungho Kang
sungho Kang el 14 de Ag. de 2017
Thank you for your answers... I forgot this site is not official... :(
Stephen23
Stephen23 el 14 de Ag. de 2017
@sungho Kang: what MATLAB version are you using?
sungho Kang
sungho Kang el 15 de Ag. de 2017
I am using Mat 16a.

Iniciar sesión para comentar.

Respuestas (2)

Matt J
Matt J el 14 de Ag. de 2017
Editada: Matt J el 14 de Ag. de 2017

0 votos

If you want the page-wise sum of a gpuArray, you don't need pagefun. Examples:
>> X=gpuArray.rand(100,100,200);
>> Y1=sum(X,1);
>> Y2=sum(X,2);
>> Yall=sum(reshape(X,1,[],200),2);
>> whos X Y1 Y2 Yall
Name Size Bytes Class Attributes
X 100x100x200 4 gpuArray
Y1 1x100x200 4 gpuArray
Y2 100x1x200 4 gpuArray
Yall 1x1x200 4 gpuArray
That said, I agree that it would be nice if TMW advanced the functionality of pagefun(), e.g., to include things like interp2.

2 comentarios

Joss Knight
Joss Knight el 14 de Ag. de 2017
Editada: Joss Knight el 14 de Ag. de 2017
Batch interp2 is just interp3. You just need to provide an appropriate query.
The main missing pagefun functions are other batch BLAS and LAPACK operations like non-square mldivide, and svd. Also, some people ask us to relax the restrictions that all the matrices be the same size.
Matt J
Matt J el 15 de Ag. de 2017
The problem with posing batch interp2 as an interp3 operation
Vq = interp3(X,Y,Z,V,Xq,Yq,Zq)
is that the query data take up a lot of space. In scenarios where Xq, Yq are the same for every page, you have to do a lot of replication. Even when Xq and Yq are not the same for every page, the Zq data will comprise a whole volume of replicated data just to indicate the page number.

Iniciar sesión para comentar.

Joss Knight
Joss Knight el 14 de Ag. de 2017
Editada: Joss Knight el 14 de Ag. de 2017

0 votos

sum already supports batch operations, and with accumarray you can sum arbitrary data partitions.
pagefun supports all the matrix functions listed by the help, and every element-wise gpuArray function. Given how many element-wise operations there are ( plus, times, sqrt, log, sin, acos etc etc etc), isn't it fair to say that's 'many'? Or is it a little disingenuous?!

3 comentarios

Matt J
Matt J el 14 de Ag. de 2017
But why would one wish to use pagefun for element-wise operations? Isn't
A=pagefun(@times,B,C);
just the same as doing
A=B.*C;
directly?
Joss Knight
Joss Knight el 15 de Ag. de 2017
That's why I'm suggesting it's a little disingenuous!
It wasn't the same, until they added automatic dimension expansion to the basic binary operators.
sungho Kang
sungho Kang el 15 de Ag. de 2017
Editada: Stephen23 el 15 de Ag. de 2017
Ok.
The reason that I asked the question is that I wanted to use ismember with pagefun, like
pagefun(@ismember, A, B)
because I have very many small matrices(or vectors) to check that each of them is subset of each other matrices(or vectors).
But I got error message with the command, so I looked into how I can do that with pagefun and elementary functions like sum, size, transpose etc.
And I got that the elementary functions of sum, size is not supported by pagefun.
The original problem is that I want to check each row of A is subset of each row of B.
ismember(A(i, :), B(j, :))
To do this very fast, I need to pagefun with ismember. But it's not possible, so I asked the question.

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Preguntada:

el 14 de Ag. de 2017

Comentada:

el 15 de Ag. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!